diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md index 51d1f53d4466..3d2842c8e4db 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.5 (Unreleased) +## 1.0.0-beta.1 (2024-06-13) + +- Azure Resource Manager SecurityInsights client library for Java. This package contains Microsoft Azure SDK for SecurityInsights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md index be7cd5eb6b9e..eb8c692c8531 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md @@ -2,7 +2,7 @@ Azure Resource Manager SecurityInsights client library for Java. -This package contains Microsoft Azure SDK for SecurityInsights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-09. 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 SecurityInsights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2024-04. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-securityinsights - 1.0.0-beta.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,20 +83,25 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[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/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fsecurityinsights%2Fazure-resourcemanager-securityinsights%2FREADME.png) diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md index de287165b2a0..97c24e73c7f1 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,11 @@ - [Get](#automationrules_get) - [List](#automationrules_list) +## BillingStatistics + +- [Get](#billingstatistics_get) +- [List](#billingstatistics_list) + ## BookmarkOperation - [Expand](#bookmarkoperation_expand) @@ -45,6 +54,43 @@ - [Get](#bookmarks_get) - [List](#bookmarks_list) +## BusinessApplicationAgentOperation + +- [Get](#businessapplicationagentoperation_get) + +## BusinessApplicationAgents + +- [CreateOrUpdate](#businessapplicationagents_createorupdate) +- [Delete](#businessapplicationagents_delete) +- [List](#businessapplicationagents_list) + +## ContentPackageOperation + +- [Install](#contentpackageoperation_install) +- [Uninstall](#contentpackageoperation_uninstall) + +## ContentPackages + +- [Get](#contentpackages_get) +- [List](#contentpackages_list) + +## ContentTemplateOperation + +- [Delete](#contenttemplateoperation_delete) +- [Get](#contenttemplateoperation_get) +- [Install](#contenttemplateoperation_install) + +## ContentTemplates + +- [List](#contenttemplates_list) + +## DataConnectorDefinitions + +- [CreateOrUpdate](#dataconnectordefinitions_createorupdate) +- [Delete](#dataconnectordefinitions_delete) +- [Get](#dataconnectordefinitions_get) +- [List](#dataconnectordefinitions_list) + ## DataConnectors - [Connect](#dataconnectors_connect) @@ -58,10 +104,6 @@ - [Post](#dataconnectorscheckrequirementsoperation_post) -## DomainWhois - -- [Get](#domainwhois_get) - ## Entities - [Expand](#entities_expand) @@ -69,6 +111,7 @@ - [GetInsights](#entities_getinsights) - [List](#entities_list) - [Queries](#entities_queries) +- [RunPlaybook](#entities_runplaybook) ## EntitiesGetTimeline @@ -101,6 +144,39 @@ - [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) @@ -115,6 +191,13 @@ - [Get](#incidentrelations_get) - [List](#incidentrelations_list) +## IncidentTasks + +- [CreateOrUpdate](#incidenttasks_createorupdate) +- [Delete](#incidenttasks_delete) +- [Get](#incidenttasks_get) +- [List](#incidenttasks_list) + ## Incidents - [CreateOrUpdate](#incidents_createorupdate) @@ -127,10 +210,6 @@ - [ListEntities](#incidents_listentities) - [RunPlaybook](#incidents_runplaybook) -## IpGeodata - -- [Get](#ipgeodata_get) - ## Metadata - [Create](#metadata_create) @@ -149,6 +228,14 @@ - [List](#operations_list) +## ProductPackageOperation + +- [Get](#productpackageoperation_get) + +## ProductPackages + +- [List](#productpackages_list) + ## ProductSettings - [Delete](#productsettings_delete) @@ -156,6 +243,23 @@ - [List](#productsettings_list) - [Update](#productsettings_update) +## ProductTemplateOperation + +- [Get](#producttemplateoperation_get) + +## ProductTemplates + +- [List](#producttemplates_list) + +## Reevaluate + +- [Recommendation](#reevaluate_recommendation) + +## ResourceProvider + +- [ListGeodataByIp](#resourceprovider_listgeodatabyip) +- [ListWhoisByDomain](#resourceprovider_listwhoisbydomain) + ## SecurityMLAnalyticsSettings - [CreateOrUpdate](#securitymlanalyticssettings_createorupdate) @@ -181,6 +285,21 @@ - [Get](#sourcecontrolsoperation_get) - [List](#sourcecontrolsoperation_list) +## Systems + +- [CreateOrUpdate](#systems_createorupdate) +- [Delete](#systems_delete) +- [Get](#systems_get) +- [List](#systems_list) +- [ListActions](#systems_listactions) +- [ReportActionStatus](#systems_reportactionstatus) +- [UndoAction](#systems_undoaction) + +## ThreatIntelligence + +- [Count](#threatintelligence_count) +- [Query](#threatintelligence_query) + ## ThreatIntelligenceIndicator - [AppendTags](#threatintelligenceindicator_appendtags) @@ -199,6 +318,14 @@ - [List](#threatintelligenceindicatorsoperation_list) +## TriggeredAnalyticsRuleRunOperation + +- [Get](#triggeredanalyticsrulerunoperation_get) + +## Update + +- [Recommendation](#update_recommendation) + ## WatchlistItems - [CreateOrUpdate](#watchlistitems_createorupdate) @@ -212,23 +339,59 @@ - [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 -/** Samples for Actions CreateOrUpdate. */ +/** + * Samples for Actions CreateOrUpdate. + */ public final class ActionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/actions/CreateActionOfAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/actions/CreateActionOfAlertRule.json */ /** * Sample code: Creates or updates an action of alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAnActionOfAlertRule( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .actions() + manager.actions() .define("912bec42-cb66-4c03-ac63-1761b6898c3e") .withExistingAlertRule("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5") .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") @@ -244,28 +407,23 @@ public final class ActionsCreateOrUpdateSamples { ### Actions_Delete ```java -import com.azure.core.util.Context; - -/** Samples for Actions Delete. */ +/** + * Samples for Actions Delete. + */ public final class ActionsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/actions/DeleteActionOfAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/actions/DeleteActionOfAlertRule.json */ /** * Sample code: Delete an action of alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAnActionOfAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .actions() - .deleteWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - "912bec42-cb66-4c03-ac63-1761b6898c3e", - Context.NONE); + public static void + deleteAnActionOfAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.actions() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "912bec42-cb66-4c03-ac63-1761b6898c3e", com.azure.core.util.Context.NONE); } } ``` @@ -273,28 +431,23 @@ public final class ActionsDeleteSamples { ### Actions_Get ```java -import com.azure.core.util.Context; - -/** Samples for Actions Get. */ +/** + * Samples for Actions Get. + */ public final class ActionsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/actions/GetActionOfAlertRuleById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/actions/GetActionOfAlertRuleById.json */ /** * Sample code: Get an action of alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnActionOfAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .actions() - .getWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - "912bec42-cb66-4c03-ac63-1761b6898c3e", - Context.NONE); + public static void + getAnActionOfAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.actions() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "912bec42-cb66-4c03-ac63-1761b6898c3e", com.azure.core.util.Context.NONE); } } ``` @@ -302,45 +455,74 @@ public final class ActionsGetSamples { ### Actions_ListByAlertRule ```java -import com.azure.core.util.Context; - -/** Samples for Actions ListByAlertRule. */ +/** + * Samples for Actions ListByAlertRule. + */ public final class ActionsListByAlertRuleSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/actions/GetAllActionsByAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/actions/GetAllActionsByAlertRule.json */ /** * Sample code: Get all actions of alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllActionsOfAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.actions().listByAlertRule("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + public static void + getAllActionsOfAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.actions() + .listByAlertRule("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } } ``` -### AlertRuleTemplates_Get +### AlertRuleOperation_TriggerRuleRun ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.AnalyticsRuleRunTrigger; +import java.time.OffsetDateTime; + +/** + * Samples for AlertRuleOperation TriggerRuleRun. + */ +public final class AlertRuleOperationTriggerRuleRunSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 -/** Samples for AlertRuleTemplates Get. */ +```java +/** + * Samples for AlertRuleTemplates Get. + */ public final class AlertRuleTemplatesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplateById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplateById.json */ /** * Sample code: Get alert rule template by Id. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAlertRuleTemplateById( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRuleTemplates() - .getWithResponse("myRg", "myWorkspace", "65360bb0-8986-4ade-a89d-af3cf44d28aa", Context.NONE); + public static void + getAlertRuleTemplateById(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRuleTemplates() + .getWithResponse("myRg", "myWorkspace", "65360bb0-8986-4ade-a89d-af3cf44d28aa", + com.azure.core.util.Context.NONE); } } ``` @@ -348,21 +530,21 @@ public final class AlertRuleTemplatesGetSamples { ### AlertRuleTemplates_List ```java -import com.azure.core.util.Context; - -/** Samples for AlertRuleTemplates List. */ +/** + * Samples for AlertRuleTemplates List. + */ public final class AlertRuleTemplatesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json */ /** * Sample code: Get all alert rule templates. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllAlertRuleTemplates( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.alertRuleTemplates().list("myRg", "myWorkspace", Context.NONE); + public static void + getAllAlertRuleTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRuleTemplates().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` @@ -370,9 +552,10 @@ public final class AlertRuleTemplatesListSamples { ### AlertRules_CreateOrUpdate ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.AlertDetail; import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.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; @@ -392,279 +575,176 @@ import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncide 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; import java.util.HashMap; import java.util.Map; -/** Samples for AlertRules CreateOrUpdate. */ +/** + * Samples for AlertRules CreateOrUpdate. + */ public final class AlertRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/CreateFusionAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/CreateFusionAlertRule.json */ /** * Sample code: Creates or updates a Fusion alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAFusionAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "myFirstFusionRule", - new FusionAlertRule() - .withEtag("3d00c3ca-0000-0100-0000-5d42d5010000") + public static void + createsOrUpdatesAFusionAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRules() + .createOrUpdateWithResponse("myRg", "myWorkspace", "myFirstFusionRule", + new FusionAlertRule().withEtag("3d00c3ca-0000-0100-0000-5d42d5010000") .withAlertRuleTemplateName("f71aba3d-28fb-450b-b192-4e76a83015c8") .withEnabled(true) - .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()))))), - Context.NONE); - } - - /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json + .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/preview/2024-04-01-preview/examples/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json */ /** * Sample code: Creates or updates a MicrosoftSecurityIncidentCreation rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAMicrosoftSecurityIncidentCreationRule( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "microsoftSecurityIncidentCreationRuleExample", - new MicrosoftSecurityIncidentCreationAlertRule() - .withEtag("\"260097e0-0000-0d00-0000-5d6fa88f0000\"") + manager.alertRules() + .createOrUpdateWithResponse("myRg", "myWorkspace", "microsoftSecurityIncidentCreationRuleExample", + new MicrosoftSecurityIncidentCreationAlertRule().withEtag("\"260097e0-0000-0d00-0000-5d6fa88f0000\"") .withDisplayName("testing displayname") .withEnabled(true) .withProductFilter(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/CreateScheduledAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/CreateScheduledAlertRule.json */ /** * Sample code: Creates or updates a Scheduled alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAScheduledAlertRule( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new ScheduledAlertRule() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + manager.alertRules() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new ScheduledAlertRule().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") .withDescription("An example for a scheduled rule") .withDisplayName("My scheduled rule") .withEnabled(true) @@ -672,19 +752,14 @@ public final class AlertRulesCreateOrUpdateSamples { .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) - .withLookbackDuration(Duration.parse("PT5H")) - .withMatchingMethod(MatchingMethod.SELECTED) - .withGroupByEntities(Arrays.asList(EntityMappingType.HOST)) - .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) - .withGroupByCustomDetails( - Arrays.asList("OperatingSystemType", "OperatingSystemName")))) + .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(true) + .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) + .withReopenClosedIncident(false) + .withLookbackDuration(Duration.parse("PT5H")) + .withMatchingMethod(MatchingMethod.SELECTED) + .withGroupByEntities(Arrays.asList(EntityMappingType.HOST)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) + .withGroupByCustomDetails(Arrays.asList("OperatingSystemType", "OperatingSystemName")))) .withQuery("Heartbeat") .withQueryFrequency(Duration.parse("PT1H")) .withQueryPeriod(Duration.parse("P2DT1H30M")) @@ -694,277 +769,170 @@ public final class AlertRulesCreateOrUpdateSamples { .withEventGroupingSettings( new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.ALERT_PER_RESULT)) .withCustomDetails(mapOf("OperatingSystemName", "OSName", "OperatingSystemType", "OSType")) - .withEntityMappings( - Arrays - .asList( - new EntityMapping() - .withEntityType(EntityMappingType.HOST) - .withFieldMappings( - Arrays - .asList( - new FieldMapping() - .withIdentifier("FullName") - .withColumnName("Computer"))), - new EntityMapping() - .withEntityType(EntityMappingType.IP) - .withFieldMappings( - Arrays - .asList( - new FieldMapping() - .withIdentifier("Address") - .withColumnName("ComputerIP"))))) - .withAlertDetailsOverride( - new AlertDetailsOverride() - .withAlertDisplayNameFormat("Alert from {{Computer}}") - .withAlertDescriptionFormat("Suspicious activity was made by {{ComputerIP}}")), - Context.NONE); - } - - /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/CreateFusionAlertRuleWithFusionScenarioExclusion.json + .withEntityMappings(Arrays.asList( + new EntityMapping().withEntityType(EntityMappingType.HOST) + .withFieldMappings(Arrays + .asList(new FieldMapping().withIdentifier("FullName").withColumnName("Computer"))), + new EntityMapping().withEntityType(EntityMappingType.IP) + .withFieldMappings(Arrays + .asList(new FieldMapping().withIdentifier("Address").withColumnName("ComputerIP"))))) + .withAlertDetailsOverride(new AlertDetailsOverride() + .withAlertDisplayNameFormat("Alert from {{Computer}}") + .withAlertDescriptionFormat("Suspicious activity was made by {{ComputerIP}}") + .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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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") + 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()))))), - Context.NONE); - } - - /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/CreateNrtAlertRule.json + .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/preview/2024-04-01-preview/examples/alertRules/CreateNrtAlertRule.json */ /** * Sample code: Creates or updates a Nrt alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesANrtAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new NrtAlertRule() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + 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") + "ProtectionStatus | extend HostCustomEntity = Computer | extend IPCustomEntity = ComputerIP_Hidden") .withTactics(Arrays.asList(AttackTactic.PERSISTENCE, AttackTactic.LATERAL_MOVEMENT)) .withTechniques(Arrays.asList("T1037", "T1021")) .withDisplayName("Rule2") @@ -972,22 +940,18 @@ public final class AlertRulesCreateOrUpdateSamples { .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)))) + .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)), - Context.NONE); + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1004,22 +968,22 @@ public final class AlertRulesCreateOrUpdateSamples { ### AlertRules_Delete ```java -import com.azure.core.util.Context; - -/** Samples for AlertRules Delete. */ +/** + * Samples for AlertRules Delete. + */ public final class AlertRulesDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/DeleteAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/DeleteAlertRule.json */ /** * Sample code: Delete an alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void deleteAnAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.alertRules() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } } ``` @@ -1027,64 +991,65 @@ public final class AlertRulesDeleteSamples { ### AlertRules_Get ```java -import com.azure.core.util.Context; - -/** Samples for AlertRules Get. */ +/** + * Samples for AlertRules Get. + */ public final class AlertRulesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetScheduledAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetScheduledAlertRule.json */ /** * Sample code: Get a Scheduled alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAScheduledAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + public static void + getAScheduledAlertRule(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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetNrtAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetNrtAlertRule.json */ /** * Sample code: Get an Nrt alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAnNrtAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.alertRules() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetFusionAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetFusionAlertRule.json */ /** * Sample code: Get a Fusion alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAFusionAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.alertRules().getWithResponse("myRg", "myWorkspace", "myFirstFusionRule", Context.NONE); + manager.alertRules() + .getWithResponse("myRg", "myWorkspace", "myFirstFusionRule", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json */ /** * Sample code: Get a MicrosoftSecurityIncidentCreation rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAMicrosoftSecurityIncidentCreationRule( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .getWithResponse("myRg", "myWorkspace", "microsoftSecurityIncidentCreationRuleExample", Context.NONE); + manager.alertRules() + .getWithResponse("myRg", "myWorkspace", "microsoftSecurityIncidentCreationRuleExample", + com.azure.core.util.Context.NONE); } } ``` @@ -1092,20 +1057,20 @@ public final class AlertRulesGetSamples { ### AlertRules_List ```java -import com.azure.core.util.Context; - -/** Samples for AlertRules List. */ +/** + * Samples for AlertRules List. + */ public final class AlertRulesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetAllAlertRules.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetAllAlertRules.json */ /** * Sample code: Get all alert rules. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllAlertRules(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.alertRules().list("myRg", "myWorkspace", Context.NONE); + manager.alertRules().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` @@ -1117,20 +1082,21 @@ import com.azure.resourcemanager.securityinsights.models.AutomationRuleAction; import com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic; import java.util.List; -/** Samples for AutomationRules CreateOrUpdate. */ +/** + * Samples for AutomationRules CreateOrUpdate. + */ public final class AutomationRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/automationRules/AutomationRules_CreateOrUpdate.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/automationRules/AutomationRules_CreateOrUpdate.json */ /** * Sample code: AutomationRules_CreateOrUpdate. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void automationRulesCreateOrUpdate( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .automationRules() + public static void + automationRulesCreateOrUpdate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.automationRules() .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") .withExistingWorkspace("myRg", "myWorkspace") .withDisplayName((String) null) @@ -1145,23 +1111,23 @@ public final class AutomationRulesCreateOrUpdateSamples { ### AutomationRules_Delete ```java -import com.azure.core.util.Context; - -/** Samples for AutomationRules Delete. */ +/** + * Samples for AutomationRules Delete. + */ public final class AutomationRulesDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/automationRules/AutomationRules_Delete.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/automationRules/AutomationRules_Delete.json */ /** * Sample code: AutomationRules_Delete. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void automationRulesDelete( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .automationRules() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + public static void + automationRulesDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.automationRules() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } } ``` @@ -1169,22 +1135,22 @@ public final class AutomationRulesDeleteSamples { ### AutomationRules_Get ```java -import com.azure.core.util.Context; - -/** Samples for AutomationRules Get. */ +/** + * Samples for AutomationRules Get. + */ public final class AutomationRulesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/automationRules/AutomationRules_Get.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/automationRules/AutomationRules_Get.json */ /** * Sample code: AutomationRules_Get. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void automationRulesGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .automationRules() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.automationRules() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } } ``` @@ -1192,20 +1158,65 @@ public final class AutomationRulesGetSamples { ### AutomationRules_List ```java -import com.azure.core.util.Context; - -/** Samples for AutomationRules List. */ +/** + * Samples for AutomationRules List. + */ public final class AutomationRulesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/automationRules/AutomationRules_List.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/automationRules/AutomationRules_List.json */ /** * Sample code: AutomationRules_List. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void automationRulesList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.automationRules().list("myRg", "myWorkspace", Context.NONE); + manager.automationRules().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### BillingStatistics_Get + +```java +/** + * Samples for BillingStatistics Get. + */ +public final class BillingStatisticsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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); + } +} +``` + +### BillingStatistics_List + +```java +/** + * Samples for BillingStatistics List. + */ +public final class BillingStatisticsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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); } } ``` @@ -1213,33 +1224,29 @@ public final class AutomationRulesListSamples { ### BookmarkOperation_Expand ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; import java.time.OffsetDateTime; import java.util.UUID; -/** Samples for BookmarkOperation Expand. */ +/** + * Samples for BookmarkOperation Expand. + */ public final class BookmarkOperationExpandSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/expand/PostExpandBookmark.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/expand/PostExpandBookmark.json */ /** * Sample code: Expand an bookmark. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void expandAnBookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkOperations() - .expandWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new BookmarkExpandParameters() - .withEndTime(OffsetDateTime.parse("2020-01-24T17:21:00.000Z")) + manager.bookmarkOperations() + .expandWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new BookmarkExpandParameters().withEndTime(OffsetDateTime.parse("2020-01-24T17:21:00.000Z")) .withExpansionId(UUID.fromString("27f76e63-c41b-480f-bb18-12ad2e011d49")) .withStartTime(OffsetDateTime.parse("2019-12-25T17:21:00.000Z")), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1247,20 +1254,21 @@ public final class BookmarkOperationExpandSamples { ### BookmarkRelations_CreateOrUpdate ```java -/** Samples for BookmarkRelations CreateOrUpdate. */ +/** + * Samples for BookmarkRelations CreateOrUpdate. + */ public final class BookmarkRelationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/relations/CreateBookmarkRelation.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/CreateBookmarkRelation.json */ /** * Sample code: Creates or updates a bookmark relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesABookmarkRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkRelations() + 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( @@ -1273,28 +1281,23 @@ public final class BookmarkRelationsCreateOrUpdateSamples { ### BookmarkRelations_Delete ```java -import com.azure.core.util.Context; - -/** Samples for BookmarkRelations Delete. */ +/** + * Samples for BookmarkRelations Delete. + */ public final class BookmarkRelationsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/relations/DeleteBookmarkRelation.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/DeleteBookmarkRelation.json */ /** * Sample code: Delete the bookmark relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteTheBookmarkRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkRelations() - .deleteWithResponse( - "myRg", - "myWorkspace", - "2216d0e1-91e3-4902-89fd-d2df8c535096", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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); } } ``` @@ -1302,28 +1305,23 @@ public final class BookmarkRelationsDeleteSamples { ### BookmarkRelations_Get ```java -import com.azure.core.util.Context; - -/** Samples for BookmarkRelations Get. */ +/** + * Samples for BookmarkRelations Get. + */ public final class BookmarkRelationsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/relations/GetBookmarkRelationByName.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/GetBookmarkRelationByName.json */ /** * Sample code: Get a bookmark relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getABookmarkRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkRelations() - .getWithResponse( - "myRg", - "myWorkspace", - "2216d0e1-91e3-4902-89fd-d2df8c535096", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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); } } ``` @@ -1331,23 +1329,23 @@ public final class BookmarkRelationsGetSamples { ### BookmarkRelations_List ```java -import com.azure.core.util.Context; - -/** Samples for BookmarkRelations List. */ +/** + * Samples for BookmarkRelations List. + */ public final class BookmarkRelationsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.json */ /** * Sample code: Get all bookmark relations. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllBookmarkRelations( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkRelations() - .list("myRg", "myWorkspace", "2216d0e1-91e3-4902-89fd-d2df8c535096", null, null, null, null, Context.NONE); + 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); } } ``` @@ -1363,20 +1361,21 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -/** Samples for Bookmarks CreateOrUpdate. */ +/** + * Samples for Bookmarks CreateOrUpdate. + */ public final class BookmarksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/CreateBookmark.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/CreateBookmark.json */ /** * Sample code: Creates or updates a bookmark. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesABookmark( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarks() + 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\"") @@ -1389,17 +1388,9 @@ public final class BookmarksCreateOrUpdateSamples { .withQueryResult("Security Event query result") .withUpdated(OffsetDateTime.parse("2021-09-01T13:15:30Z")) .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) - .withEntityMappings( - Arrays - .asList( - new BookmarkEntityMappings() - .withEntityType("Account") - .withFieldMappings( - Arrays - .asList( - new EntityFieldMapping() - .withIdentifier("Fullname") - .withValue("johndoe@microsoft.com"))))) + .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(); @@ -1410,22 +1401,22 @@ public final class BookmarksCreateOrUpdateSamples { ### Bookmarks_Delete ```java -import com.azure.core.util.Context; - -/** Samples for Bookmarks Delete. */ +/** + * Samples for Bookmarks Delete. + */ public final class BookmarksDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/DeleteBookmark.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/DeleteBookmark.json */ /** * Sample code: Delete a bookmark. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void deleteABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarks() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.bookmarks() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } } ``` @@ -1433,22 +1424,22 @@ public final class BookmarksDeleteSamples { ### Bookmarks_Get ```java -import com.azure.core.util.Context; - -/** Samples for Bookmarks Get. */ +/** + * Samples for Bookmarks Get. + */ public final class BookmarksGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/GetBookmarkById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/GetBookmarkById.json */ /** * Sample code: Get a bookmark. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarks() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.bookmarks() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } } ``` @@ -1456,4122 +1447,5815 @@ public final class BookmarksGetSamples { ### Bookmarks_List ```java -import com.azure.core.util.Context; - -/** Samples for Bookmarks List. */ +/** + * Samples for Bookmarks List. + */ public final class BookmarksListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/GetBookmarks.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/GetBookmarks.json */ /** * Sample code: Get all bookmarks. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllBookmarks(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.bookmarks().list("myRg", "myWorkspace", Context.NONE); + manager.bookmarks().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` -### DataConnectors_Connect +### BusinessApplicationAgentOperation_Get ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.securityinsights.models.ConnectAuthKind; -import com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for DataConnectors Connect. */ -public final class DataConnectorsConnectSamples { - /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/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("fakeKeyPlaceholder") - .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))), - Context.NONE); - } - +/** + * Samples for BusinessApplicationAgentOperation Get. + */ +public final class BusinessApplicationAgentOperationGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/ConnectAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgent_Get.json */ /** - * Sample code: Connect an APIPolling data connector. - * + * Sample code: BusinessApplicationAgent_Get. + * * @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("fakeKeyPlaceholder") - .withRequestConfigUserInputValues( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"displayText\":\"Organization" - + " Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"somePlaceHolderValue\",\"requestObjectKey\":\"apiEndpoint\"}", - Object.class, - SerializerEncoding.JSON))), - Context.NONE); + public static void + businessApplicationAgentGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.businessApplicationAgentOperations() + .getWithResponse("myRg", "myWorkspace", "3d69632b-0b60-4af3-8720-77f01a25d34a", + com.azure.core.util.Context.NONE); } } ``` -### DataConnectors_CreateOrUpdate +### BusinessApplicationAgents_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.securityinsights.models.Availability; -import com.azure.resourcemanager.securityinsights.models.AvailabilityStatus; -import com.azure.resourcemanager.securityinsights.models.CodelessApiPollingDataConnector; -import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingAuthProperties; -import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingConfigProperties; -import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingPagingProperties; -import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingRequestProperties; -import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingResponseProperties; -import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties; -import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem; -import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesDataTypesItem; -import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesGraphQueriesItem; -import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesInstructionStepsItem; -import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesSampleQueriesItem; -import com.azure.resourcemanager.securityinsights.models.CodelessUiDataConnector; -import com.azure.resourcemanager.securityinsights.models.ConnectivityType; -import com.azure.resourcemanager.securityinsights.models.DataTypeState; -import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnector; -import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes; -import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities; -import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; -import com.azure.resourcemanager.securityinsights.models.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.ProviderName; -import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; -import com.azure.resourcemanager.securityinsights.models.SettingType; -import com.azure.resourcemanager.securityinsights.models.TIDataConnector; -import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypes; -import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypesIndicators; -import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnector; -import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypes; -import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypesTaxiiClient; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.models.AgentConfiguration; -/** Samples for DataConnectors CreateOrUpdate. */ -public final class DataConnectorsCreateOrUpdateSamples { +/** + * Samples for BusinessApplicationAgents CreateOrUpdate. + */ +public final class BusinessApplicationAgentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateOfficeDataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgents_CreateOrUpdate.json */ /** - * Sample code: Creates or updates an Office365 data connector. - * + * Sample code: BusinessApplicationAgents_CreateOrUpdate. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAnOffice365DataConnector( + public static void businessApplicationAgentsCreateOrUpdate( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new OfficeDataConnector() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") - .withDataTypes( - new OfficeDataConnectorDataTypes() - .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.ENABLED)) - .withSharePoint( - new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED)) - .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED))) - .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), - Context.NONE); + manager.businessApplicationAgents() + .define("3d69632b-0b60-4af3-8720-77f01a25d34a") + .withExistingWorkspace("myRg", "myWorkspace") + .withConfiguration((AgentConfiguration) null) + .withDisplayName((String) null) + .create(); } +} +``` + +### BusinessApplicationAgents_Delete +```java +/** + * Samples for BusinessApplicationAgents Delete. + */ +public final class BusinessApplicationAgentsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateOfficePowerBIDataConnector.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgents_Delete.json */ /** - * Sample code: Creates or updates an Office PowerBI data connector. - * + * Sample code: BusinessApplicationAgents_Delete. + * * @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"), - Context.NONE); + public static void + businessApplicationAgentsDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.businessApplicationAgents() + .deleteWithResponse("myRg", "myWorkspace", "3d69632b-0b60-4af3-8720-77f01a25d34a", + com.azure.core.util.Context.NONE); } +} +``` +### BusinessApplicationAgents_List + +```java +/** + * Samples for BusinessApplicationAgents List. + */ +public final class BusinessApplicationAgentsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateThreatIntelligenceTaxiiDataConnector.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgents_List.json */ /** - * Sample code: Creates or updates a Threat Intelligence Taxii data connector. - * + * Sample code: BusinessApplicationAgents_List. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAThreatIntelligenceTaxiiDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new TiTaxiiDataConnector() - .withEtag("d12423f6-a60b-4ca5-88c0-feb1a182d0f0") - .withWorkspaceId("dd124572-4962-4495-9bd2-9dade12314b4") - .withFriendlyName("testTaxii") - .withTaxiiServer("https://limo.anomali.com/api/v1/taxii2/feeds") - .withCollectionId("135") - .withUsername("--") - .withPassword("--") - .withTaxiiLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) - .withPollingFrequency(PollingFrequency.ONCE_ADAY) - .withDataTypes( - new TiTaxiiDataConnectorDataTypes() - .withTaxiiClient( - new TiTaxiiDataConnectorDataTypesTaxiiClient().withState(DataTypeState.ENABLED))) - .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), - Context.NONE); + public static void + businessApplicationAgentsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.businessApplicationAgents().list("myRg", "myWorkspace", null, null, 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/preview/2022-09-01-preview/examples/dataConnectors/CreateThreatIntelligenceDataConnector.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentPackages/InstallPackage.json */ /** - * Sample code: Creates or updates an Threat Intelligence Platform data connector. - * + * Sample code: Install a package to the workspace. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAnThreatIntelligencePlatformDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new TIDataConnector() - .withTipLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) - .withDataTypes( - new TIDataConnectorDataTypes() - .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))) - .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), - Context.NONE); + 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(); } +} +``` +### ContentPackageOperation_Uninstall + +```java +/** + * Samples for ContentPackageOperation Uninstall. + */ +public final class ContentPackageOperationUninstallSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateDynamics365DataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentPackages/UninstallPackage.json */ /** - * Sample code: Creates or updates a Dynamics365 data connector. - * + * Sample code: Uninstall a package from the workspace. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesADynamics365DataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "c2541efb-c9a6-47fe-9501-87d1017d1512", - new Dynamics365DataConnector() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") - .withDataTypes( - new Dynamics365DataConnectorDataTypes() - .withDynamics365CdsActivities( - new Dynamics365DataConnectorDataTypesDynamics365CdsActivities() - .withState(DataTypeState.ENABLED))) - .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), - Context.NONE); + 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); } +} +``` + +### ContentPackages_Get +```java +/** + * Samples for ContentPackages Get. + */ +public final class ContentPackagesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateGenericUI.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentPackages/GetPackageById.json */ /** - * Sample code: Creates or updates a GenericUI data connector. - * + * Sample code: Get installed packages by id. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAGenericUIDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "316ec55e-7138-4d63-ab18-90c8a60fd1c8", - new CodelessUiDataConnector() - .withConnectorUiConfig( - new CodelessUiConnectorConfigProperties() - .withTitle("Qualys Vulnerability Management (CCP DEMO)") - .withPublisher("Qualys") - .withDescriptionMarkdown( - "The [Qualys Vulnerability Management" - + " (VM)](https://www.qualys.com/apps/vulnerability-management/) data connector" - + " provides the capability to ingest vulnerability host detection data into Azure" - + " Sentinel through the Qualys API. The connector provides visibility into host" - + " detection data from vulerability scans. This connector provides Azure Sentinel" - + " the capability to view dashboards, create custom alerts, and improve" - + " investigation ") - .withGraphQueriesTableName("QualysHostDetection_CL") - .withGraphQueries( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesGraphQueriesItem() - .withMetricName("Total data received") - .withLegend("{{graphQueriesTableName}}") - .withBaseQuery("{{graphQueriesTableName}}"))) - .withSampleQueries( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesSampleQueriesItem() - .withDescription("Top 10 Vulerabilities detected") - .withQuery( - "{{graphQueriesTableName}}\n" - + " | mv-expand todynamic(Detections_s)\n" - + " | extend Vulnerability = tostring(Detections_s.Results)\n" - + " | summarize count() by Vulnerability\n" - + " | top 10 by count_"))) - .withDataTypes( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesDataTypesItem() - .withName("{{graphQueriesTableName}}") - .withLastDataReceivedQuery( - "{{graphQueriesTableName}}\n" - + " | summarize Time = max(TimeGenerated)\n" - + " | where isnotempty(Time)"))) - .withConnectivityCriteria( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() - .withType(ConnectivityType.IS_CONNECTED_QUERY) - .withValue( - Arrays - .asList( - "{{graphQueriesTableName}}\n" - + " | summarize LastLogReceived =" - + " max(TimeGenerated)\n" - + " | project IsConnected = LastLogReceived >" - + " ago(30d)")))) - .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) - .withPermissions( - new Permissions() - .withResourceProvider( - Arrays - .asList( - new PermissionsResourceProviderItem() - .withProvider( - ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) - .withPermissionsDisplayText( - "read and write permissions on the workspace are required.") - .withProviderDisplayName("Workspace") - .withScope(PermissionProviderScope.WORKSPACE) - .withRequiredPermissions( - new RequiredPermissions() - .withWrite(true) - .withRead(true) - .withDelete(true)), - new PermissionsResourceProviderItem() - .withProvider( - ProviderName - .MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS) - .withPermissionsDisplayText( - "read permissions to shared keys for the workspace are" - + " required. [See the documentation to learn more about" - + " workspace" - + " keys](https://docs.microsoft.com/azure/azure-monitor/platform/agent-windows#obtain-workspace-id-and-key).") - .withProviderDisplayName("Keys") - .withScope(PermissionProviderScope.WORKSPACE) - .withRequiredPermissions( - new RequiredPermissions().withAction(true)))) - .withCustoms( - Arrays - .asList( - new PermissionsCustomsItem() - .withName("Microsoft.Web/sites permissions") - .withDescription( - "Read and write permissions to Azure Functions to create a" - + " Function App is required. [See the documentation to" - + " learn more about Azure" - + " Functions](https://docs.microsoft.com/azure/azure-functions/)."), - new PermissionsCustomsItem() - .withName("Qualys API Key") - .withDescription( - "A Qualys VM API username and password is required. [See the" - + " documentation to learn more about Qualys VM" - + " API](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf).")))) - .withInstructionSteps( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - ">**NOTE:** This connector uses Azure Functions to connect to Qualys VM" - + " to pull its logs into Azure Sentinel. This might result in" - + " additional data ingestion costs. Check the [Azure Functions" - + " pricing" - + " page](https://azure.microsoft.com/pricing/details/functions/)" - + " for details."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - ">**(Optional Step)** Securely store workspace and API authorization" - + " key(s) or token(s) in Azure Key Vault. Azure Key Vault provides" - + " a secure mechanism to store and retrieve key values. [Follow" - + " these" - + " instructions](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" - + " to use Azure Key Vault with an Azure Function App."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**STEP 1 - Configuration steps for the Qualys VM API**\n\n" - + "1. Log into the Qualys Vulnerability Management console with an" - + " administrator account, select the **Users** tab and the" - + " **Users** subtab. \n" - + "2. Click on the **New** drop-down menu and select **Users..**\n" - + "3. Create a username and password for the API account. \n" - + "4. In the **User Roles** tab, ensure the account role is set to" - + " **Manager** and access is allowed to **GUI** and **API**\n" - + "4. Log out of the administrator account and log into the console" - + " with the new API credentials for validation, then log out of" - + " the API account. \n" - + "5. Log back into the console using an administrator account and" - + " modify the API accounts User Roles, removing access to **GUI**." - + " \n" - + "6. Save all changes."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**STEP 2 - Choose ONE from the following two deployment options to" - + " deploy the connector and the associated Azure Function**\n\n" - + ">**IMPORTANT:** Before deploying the Qualys VM connector, have" - + " the Workspace ID and Workspace Primary Key (can be copied from" - + " the following), as well as the Qualys VM API Authorization" - + " Key(s), readily available.") - .withInstructions( - Arrays - .asList( - new InstructionStepsInstructionsItem() - .withParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"fillWith\":[\"WorkspaceId\"],\"label\":\"Workspace" - + " ID\"}", - Object.class, - SerializerEncoding.JSON)) - .withType(SettingType.COPYABLE_LABEL), - new InstructionStepsInstructionsItem() - .withParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"fillWith\":[\"PrimaryKey\"],\"label\":\"Primary" - + " Key\"}", - Object.class, - SerializerEncoding.JSON)) - .withType(SettingType.COPYABLE_LABEL))), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("Option 1 - Azure Resource Manager (ARM) Template") - .withDescription( - "Use this method for automated deployment of the Qualys VM connector" - + " using an ARM Tempate.\n\n" - + "1. Click the **Deploy to Azure** button below. \n\n" - + "\t[![Deploy To" - + " Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/sentinelqualysvmazuredeploy)\n" - + "2. Select the preferred **Subscription**, **Resource Group** and" - + " **Location**. \n" - + "3. Enter the **Workspace ID**, **Workspace Key**, **API" - + " Username**, **API Password** , update the **URI**, and any" - + " additional URI **Filter Parameters** (each filter should be" - + " separated by an \"&\" symbol, no spaces.) \n" - + "> - Enter the URI that corresponds to your region. The complete" - + " list of API Server URLs can be [found" - + " here](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf#G4.735348)" - + " -- There is no need to add a time suffix to the URI, the" - + " Function App will dynamically append the Time Value to the URI" - + " in the proper format. \n" - + " - The default **Time Interval** is set to pull the last five" - + " (5) minutes of data. If the time interval needs to be modified," - + " it is recommended to change the Function App Timer Trigger" - + " accordingly (in the function.json file, post deployment) to" - + " prevent overlapping data ingestion. \n" - + "> - Note: If using Azure Key Vault secrets for any of the values" - + " above, use the`@Microsoft.KeyVault(SecretUri={Security" - + " Identifier})`schema in place of the string values. Refer to" - + " [Key Vault references" - + " documentation](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" - + " for further details. \n" - + "4. Mark the checkbox labeled **I agree to the terms and" - + " conditions stated above**. \n" - + "5. Click **Purchase** to deploy."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("Option 2 - Manual Deployment of Azure Functions") - .withDescription( - "Use the following step-by-step instructions to deploy the Quayls VM" - + " connector manually with Azure Functions."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**1. Create a Function App**\n\n" - + "1. From the Azure Portal, navigate to [Function" - + " App](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp)," - + " and select **+ Add**.\n" - + "2. In the **Basics** tab, ensure Runtime stack is set to" - + " **Powershell Core**. \n" - + "3. In the **Hosting** tab, ensure the **Consumption" - + " (Serverless)** plan type is selected.\n" - + "4. Make other preferrable configuration changes, if needed, then" - + " click **Create**."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**2. Import Function App Code**\n\n" - + "1. In the newly created Function App, select **Functions** on" - + " the left pane and click **+ New Function**.\n" - + "2. Select **Timer Trigger**.\n" - + "3. Enter a unique Function **Name** and leave the default cron" - + " schedule of every 5 minutes, then click **Create**.\n" - + "5. Click on **Code + Test** on the left pane. \n" - + "6. Copy the [Function App" - + " Code](https://aka.ms/sentinelqualysvmazurefunctioncode) and" - + " paste into the Function App `run.ps1` editor.\n" - + "7. Click **Save**."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**3. Configure the Function App**\n\n" - + "1. In the Function App, select the Function App Name and select" - + " **Configuration**.\n" - + "2. In the **Application settings** tab, select **+ New" - + " application setting**.\n" - + "3. Add each of the following seven (7) application settings" - + " individually, with their respective string values" - + " (case-sensitive): \n" - + "\t\tapiUsername\n" - + "\t\tapiPassword\n" - + "\t\tworkspaceID\n" - + "\t\tworkspaceKey\n" - + "\t\turi\n" - + "\t\tfilterParameters\n" - + "\t\ttimeInterval\n" - + "> - Enter the URI that corresponds to your region. The complete" - + " list of API Server URLs can be [found" - + " here](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf#G4.735348)." - + " The `uri` value must follow the following schema: `https:///api/2.0/fo/asset/host/vm/detection/?action=list&vm_processed_after=`" - + " -- There is no need to add a time suffix to the URI, the" - + " Function App will dynamically append the Time Value to the URI" - + " in the proper format.\n" - + "> - Add any additional filter parameters, for the" - + " `filterParameters` variable, that need to be appended to the" - + " URI. Each parameter should be seperated by an \"&\" symbol and" - + " should not include any spaces.\n" - + "> - Set the `timeInterval` (in minutes) to the value of `5` to" - + " correspond to the Timer Trigger of every `5` minutes. If the" - + " time interval needs to be modified, it is recommended to change" - + " the Function App Timer Trigger accordingly to prevent" - + " overlapping data ingestion.\n" - + "> - Note: If using Azure Key Vault, use" - + " the`@Microsoft.KeyVault(SecretUri={Security Identifier})`schema" - + " in place of the string values. Refer to [Key Vault references" - + " documentation](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" - + " for further details.\n" - + "4. Once all application settings have been entered, click" - + " **Save**."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**4. Configure the host.json**.\n\n" - + "Due to the potentially large amount of Qualys host detection" - + " data being ingested, it can cause the execution time to surpass" - + " the default Function App timeout of five (5) minutes. Increase" - + " the default timeout duration to the maximum of ten (10)" - + " minutes, under the Consumption Plan, to allow more time for the" - + " Function App to execute.\n\n" - + "1. In the Function App, select the Function App Name and select" - + " the **App Service Editor** blade.\n" - + "2. Click **Go** to open the editor, then select the" - + " **host.json** file under the **wwwroot** directory.\n" - + "3. Add the line `\"functionTimeout\": \"00:10:00\",` above the" - + " `managedDependancy` line \n" - + "4. Ensure **SAVED** appears on the top right corner of the" - + " editor, then exit the editor.\n\n" - + "> NOTE: If a longer timeout duration is required, consider" - + " upgrading to an [App Service" - + " Plan](https://docs.microsoft.com/azure/azure-functions/functions-scale#timeout)")))), - Context.NONE); - } - - /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateOffice365ProjectDataConnetor.json + 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); + } +} +``` + +### ContentPackages_List + +```java +/** + * Samples for ContentPackages List. + */ +public final class ContentPackagesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentPackages/GetPackages.json */ /** - * Sample code: Creates or updates an Office365 Project data connector. - * + * Sample code: Get all available packages. + * * @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"), - Context.NONE); + 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); } +} +``` +### ContentTemplateOperation_Delete + +```java +/** + * Samples for ContentTemplateOperation Delete. + */ +public final class ContentTemplateOperationDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentTemplates/DeleteTemplate.json */ /** - * Sample code: Creates or updates a APIPolling data connector. - * + * Sample code: Delete metadata. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAAPIPollingDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "316ec55e-7138-4d63-ab18-90c8a60fd1c8", - new CodelessApiPollingDataConnector() - .withConnectorUiConfig( - new CodelessUiConnectorConfigProperties() - .withTitle("GitHub Enterprise Audit Log") - .withPublisher("GitHub") - .withDescriptionMarkdown( - "The GitHub audit log connector provides the capability to ingest GitHub logs into" - + " Azure Sentinel. By connecting GitHub audit logs into Azure Sentinel, you can" - + " view this data in workbooks, use it to create custom alerts, and improve your" - + " investigation process.") - .withGraphQueriesTableName("GitHubAuditLogPolling_CL") - .withGraphQueries( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesGraphQueriesItem() - .withMetricName("Total events received") - .withLegend("GitHub audit log events") - .withBaseQuery("{{graphQueriesTableName}}"))) - .withSampleQueries( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesSampleQueriesItem() - .withDescription("All logs") - .withQuery("{{graphQueriesTableName}}\n | take 10 "))) - .withDataTypes( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesDataTypesItem() - .withName("{{graphQueriesTableName}}") - .withLastDataReceivedQuery( - "{{graphQueriesTableName}}\n" - + " | summarize Time = max(TimeGenerated)\n" - + " | where isnotempty(Time)"))) - .withConnectivityCriteria( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() - .withType(ConnectivityType.fromString("SentinelKindsV2")) - .withValue(Arrays.asList()))) - .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) - .withPermissions( - new Permissions() - .withResourceProvider( - Arrays - .asList( - new PermissionsResourceProviderItem() - .withProvider( - ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) - .withPermissionsDisplayText( - "read and write permissions are required.") - .withProviderDisplayName("Workspace") - .withScope(PermissionProviderScope.WORKSPACE) - .withRequiredPermissions( - new RequiredPermissions() - .withWrite(true) - .withRead(true) - .withDelete(true)))) - .withCustoms( - Arrays - .asList( - new PermissionsCustomsItem() - .withName("GitHub API personal token Key") - .withDescription( - "You need access to GitHub personal token, the key should have" - + " 'admin:org' scope")))) - .withInstructionSteps( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("Connect GitHub Enterprise Audit Log to Azure Sentinel") - .withDescription( - "Enable GitHub audit Logs. \n" - + " Follow" - + " [this](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)" - + " to create or find your personal key") - .withInstructions( - Arrays - .asList( - new InstructionStepsInstructionsItem() - .withParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"enable\":\"true\",\"userRequestPlaceHoldersInput\":[{\"displayText\":\"Organization" - + " Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"\",\"requestObjectKey\":\"apiEndpoint\"}]}", - Object.class, - SerializerEncoding.JSON)) - .withType(SettingType.fromString("APIKey"))))))) - .withPollingConfig( - new CodelessConnectorPollingConfigProperties() - .withAuth( - new CodelessConnectorPollingAuthProperties() - .withAuthType("APIKey") - .withApiKeyName("Authorization") - .withApiKeyIdentifier("token")) - .withRequest( - new CodelessConnectorPollingRequestProperties() - .withApiEndpoint("https://api.github.com/organizations/{{placeHolder1}}/audit-log") - .withRateLimitQps(50) - .withQueryWindowInMin(15) - .withHttpMethod("Get") - .withQueryTimeFormat("yyyy-MM-ddTHH:mm:ssZ") - .withRetryCount(2) - .withTimeoutInSeconds(60) - .withHeaders( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"Accept\":\"application/json\",\"User-Agent\":\"Scuba\"}", - Object.class, - SerializerEncoding.JSON)) - .withQueryParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"phrase\":\"created:{_QueryWindowStartTime}..{_QueryWindowEndTime}\"}", - Object.class, - SerializerEncoding.JSON))) - .withPaging( - new CodelessConnectorPollingPagingProperties() - .withPagingType("LinkHeader") - .withPageSizeParaName("per_page")) - .withResponse( - new CodelessConnectorPollingResponseProperties() - .withEventsJsonPaths(Arrays.asList("$")))), - Context.NONE); + public static void deleteMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplateOperations() + .deleteWithResponse("myRg", "myWorkspace", "8365ebfe-a381-45b7-ad08-7d818070e11f", + com.azure.core.util.Context.NONE); } } ``` -### DataConnectors_Delete +### ContentTemplateOperation_Get ```java -import com.azure.core.util.Context; - -/** Samples for DataConnectors Delete. */ -public final class DataConnectorsDeleteSamples { +/** + * Samples for ContentTemplateOperation Get. + */ +public final class ContentTemplateOperationGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DeleteOffice365ProjectDataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentTemplates/GetTemplateById.json */ /** - * Sample code: Delete an Office365 Project data connector. - * + * Sample code: Get a template. + * * @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", Context.NONE); + public static void getATemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplateOperations() + .getWithResponse("myRg", "myWorkspace", "8365ebfe-a381-45b7-ad08-7d818070e11f", + com.azure.core.util.Context.NONE); } +} +``` + +### ContentTemplateOperation_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 ContentTemplateOperation Install. + */ +public final class ContentTemplateOperationInstallSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DeleteGenericUI.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentTemplates/InstallTemplate.json */ /** - * Sample code: Delete a GenericUI data connector. - * + * Sample code: Get a template. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAGenericUIDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + public static void getATemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) + throws IOException { + manager.contentTemplateOperations() + .define("str.azure-sentinel-solution-str") + .withExistingWorkspace("myRg", "myWorkspace") + .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)) + .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") + .create(); } +} +``` + +### ContentTemplates_List +```java +/** + * Samples for ContentTemplates List. + */ +public final class ContentTemplatesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DeleteOfficeDataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentTemplates/GetTemplates.json */ /** - * Sample code: Delete an Office365 data connector. - * + * Sample code: Get all installed templates. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAnOffice365DataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + public static void + getAllInstalledTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplates() + .list("myRg", "myWorkspace", null, null, null, null, null, null, null, null, + com.azure.core.util.Context.NONE); } +} +``` + +### 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.CustomizableConnectorDefinition; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig; +import com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails; +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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DeleteOfficePowerBIDataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectorDefinitions/CreateCustomizableDataConnectorDefinition.json */ /** - * Sample code: Delete an Office PowerBI data connector. - * + * Sample code: Create data connector definition. + * * @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", Context.NONE); + 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); } +} +``` +### DataConnectorDefinitions_Delete + +```java +/** + * Samples for DataConnectorDefinitions Delete. + */ +public final class DataConnectorDefinitionsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DeleteAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectorDefinitions/DeleteDataConnectorDefinitionById.json */ /** - * Sample code: Delete a APIPolling data connector. - * + * Sample code: Delete data connector definition. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAAPIPollingDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + 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); } } ``` -### DataConnectors_Disconnect +### DataConnectorDefinitions_Get ```java -import com.azure.core.util.Context; - -/** Samples for DataConnectors Disconnect. */ -public final class DataConnectorsDisconnectSamples { +/** + * Samples for DataConnectorDefinitions Get. + */ +public final class DataConnectorDefinitionsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DisconnectAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectorDefinitions/GetCustomizableDataConnectoeDefinitionById.json */ /** - * Sample code: Disconnect an APIPolling data connector. - * + * Sample code: Get customize data connector definition. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void disconnectAnAPIPollingDataConnector( + public static void getCustomizeDataConnectorDefinition( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .disconnectWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + manager.dataConnectorDefinitions() + .getWithResponse("myRg", "myWorkspace", "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12", + com.azure.core.util.Context.NONE); } } ``` -### DataConnectors_Get +### DataConnectorDefinitions_List ```java -import com.azure.core.util.Context; - -/** Samples for DataConnectors Get. */ -public final class DataConnectorsGetSamples { +/** + * Samples for DataConnectorDefinitions List. + */ +public final class DataConnectorDefinitionsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetOffice365ProjectDataConnetorById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectorDefinitions/GetDataConnectorDefinitions.json */ /** - * Sample code: Get an Office365 Project data connector. - * + * Sample code: Get all data connector definitions. + * * @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", Context.NONE); + public static void + getAllDataConnectorDefinitions(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorDefinitions().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } +} +``` + +### DataConnectors_Connect + +```java +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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetGenericUI.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/ConnectAPIPollingV2Logs.json */ /** - * Sample code: Get a GenericUI data connector. - * + * Sample code: Connect an APIPolling V2 logs data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAGenericUIDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + 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); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetOffice365AdvancedThreatProtectionById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/ConnectAPIPolling.json */ /** - * Sample code: Get an Office ATP data connector. - * + * Sample code: Connect an APIPolling 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", Context.NONE); + 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); } +} +``` +### 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.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.DcrConfiguration; +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.MicrosoftPurviewInformationProtectionConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionDataConnector; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnector; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed; +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 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.ProviderName; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import com.azure.resourcemanager.securityinsights.models.TIDataConnector; +import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypesIndicators; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnector; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypesTaxiiClient; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for DataConnectors CreateOrUpdate. + */ +public final class DataConnectorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetIoTById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateMicrosoftPurviewInformationProtectionDataConnetor.json */ /** - * Sample code: Get a IoT data connector. - * + * Sample code: Creates or updates an MicrosoftPurviewInformationProtection data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAIoTDataConnector( + public static void createsOrUpdatesAnMicrosoftPurviewInformationProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "d2e5dc7a-f3a2-429d-954b-939fa8c2932e", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftCloudAppSecurityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateOfficeDataConnetor.json */ /** - * Sample code: Get a MCAS data connector. - * + * Sample code: Creates or updates an Office365 data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMCASDataConnector( + public static void createsOrUpdatesAnOffice365DataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "b96d014d-b5c2-4a01-9aba-a8058f629d42", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetThreatIntelligenceTaxiiById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateMicrosoftThreatProtectionDataConnetor.json */ /** - * Sample code: Get a TI Taxii data connector. - * + * Sample code: Creates or updates a MicrosoftThreatProtection data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getATITaxiiDataConnector( + public static void createsOrUpdatesAMicrosoftThreatProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c39bb458-02a7-4b3f-b0c8-71a1d2692652", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftThreatIntelligenceById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateOfficePowerBIDataConnector.json */ /** - * Sample code: Get a MicrosoftThreatIntelligence data connector. - * + * Sample code: Creates or updates an Office PowerBI data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMicrosoftThreatIntelligenceDataConnector( + public static void createsOrUpdatesAnOfficePowerBIDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetAzureSecurityCenterById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateThreatIntelligenceTaxiiDataConnector.json */ /** - * Sample code: Get a ASC data connector. - * + * Sample code: Creates or updates a Threat Intelligence Taxii data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAASCDataConnector( + public static void createsOrUpdatesAThreatIntelligenceTaxiiDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetThreatIntelligenceById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateThreatIntelligenceDataConnector.json */ /** - * Sample code: Get a TI data connector. - * + * Sample code: Creates or updates an Threat Intelligence Platform data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getATIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetAmazonWebServicesCloudTrailById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateDynamics365DataConnetor.json */ /** - * Sample code: Get an AwsCloudTrail data connector. - * + * Sample code: Creates or updates a Dynamics365 data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAwsCloudTrailDataConnector( + public static void createsOrUpdatesADynamics365DataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateGenericUI.json */ /** - * Sample code: Get a MDATP data connector. - * + * 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateOffice365ProjectDataConnetor.json + */ + /** + * Sample code: Creates or updates an Office365 Project data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMDATPDataConnector( + public static void createsOrUpdatesAnOffice365ProjectDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "06b3ccb8-1384-4bcc-aec7-852f6d57161b", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftThreatProtectionById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateGoogleCloudPlatform.json */ /** - * Sample code: Get a MicrosoftThreatProtection data connector. - * + * Sample code: Creates or updates a GCP data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMicrosoftThreatProtectionDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetAzureActiveDirectoryById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateMicrosoftThreatIntelligenceDataConnector.json */ /** - * Sample code: Get an AAD data connector. - * + * Sample code: Creates or updates a Microsoft Threat Intelligence data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAADDataConnector( + public static void createsOrUpdatesAMicrosoftThreatIntelligenceDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d", Context.NONE); + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", + new MstiDataConnector() + .withDataTypes(new MstiDataConnectorDataTypes().withMicrosoftEmergingThreatFeed( + new MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed().withState(DataTypeState.ENABLED) + .withLookbackPeriod("1970-01-01T00:00:00.000Z"))) + .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetAzureAdvancedThreatProtectionById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateAPIPolling.json */ /** - * Sample code: Get an AATP data connector. - * + * Sample code: Creates or updates a APIPolling data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAATPDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "07e42cb3-e658-4e90-801c-efa0f29d3d44", Context.NONE); + 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); } +} +``` +### DataConnectors_Delete + +```java +/** + * Samples for DataConnectors Delete. + */ +public final class DataConnectorsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteOffice365ProjectDataConnetor.json */ /** - * Sample code: Get a APIPolling data connector. - * + * Sample code: Delete an Office365 Project data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAAPIPollingDataConnector( + public static void deleteAnOffice365ProjectDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + 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/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftInsiderRiskManagementById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteMicrosoftPurviewInformationProtectionDataConnetor.json */ /** - * Sample code: Get an Office IRM data connector. - * + * Sample code: Delete an MicrosoftPurviewInformationProtection data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnOfficeIRMDataConnector( + public static void deleteAnMicrosoftPurviewInformationProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "3d3e955e-33eb-401d-89a7-251c81ddd660", Context.NONE); + 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/preview/2022-09-01-preview/examples/dataConnectors/GetDynamics365DataConnectorById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteGoogleCloudPlatform.json */ /** - * Sample code: Get a Dynamics365 data connector. - * + * Sample code: Delete a GCP data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getADynamics365DataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c2541efb-c9a6-47fe-9501-87d1017d1512", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetOfficeDataConnetorById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteGenericUI.json */ /** - * Sample code: Get an Office365 data connector. - * + * Sample code: Delete a GenericUI data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnOffice365DataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetAmazonWebServicesS3ById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteOfficeDataConnetor.json */ /** - * Sample code: Get an Aws S3 data connector. - * + * Sample code: Delete an Office365 data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAwsS3DataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "afef3743-0c88-469c-84ff-ca2e87dc1e48", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetOfficePowerBIDataConnetorById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteOfficePowerBIDataConnetor.json */ /** - * Sample code: Get an Office365 PowerBI data connector. - * + * 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteAPIPolling.json + */ + /** + * Sample code: Delete a APIPolling data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAAPIPollingDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteMicrosoftThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Delete an MicrosoftThreatIntelligence data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnOffice365PowerBIDataConnector( + public static void deleteAnMicrosoftThreatIntelligenceDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", + com.azure.core.util.Context.NONE); } } ``` -### DataConnectors_List +### DataConnectors_Disconnect ```java -import com.azure.core.util.Context; - -/** Samples for DataConnectors List. */ -public final class DataConnectorsListSamples { +/** + * Samples for DataConnectors Disconnect. + */ +public final class DataConnectorsDisconnectSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetDataConnectors.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DisconnectAPIPolling.json */ /** - * Sample code: Get all data connectors. - * + * Sample code: Disconnect an APIPolling data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllDataConnectors( + public static void disconnectAnAPIPollingDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.dataConnectors().list("myRg", "myWorkspace", Context.NONE); + manager.dataConnectors() + .disconnectWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + com.azure.core.util.Context.NONE); } } ``` -### DataConnectorsCheckRequirementsOperation_Post +### DataConnectors_Get ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.AadCheckRequirements; -import com.azure.resourcemanager.securityinsights.models.AscCheckRequirements; -import com.azure.resourcemanager.securityinsights.models.Dynamics365CheckRequirements; -import com.azure.resourcemanager.securityinsights.models.IoTCheckRequirements; -import com.azure.resourcemanager.securityinsights.models.McasCheckRequirements; -import com.azure.resourcemanager.securityinsights.models.MstiCheckRequirements; -import com.azure.resourcemanager.securityinsights.models.MtpCheckRequirements; -import com.azure.resourcemanager.securityinsights.models.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.TICheckRequirements; -import com.azure.resourcemanager.securityinsights.models.TiTaxiiCheckRequirements; - -/** Samples for DataConnectorsCheckRequirementsOperation Post. */ -public final class DataConnectorsCheckRequirementsOperationPostSamples { +/** + * Samples for DataConnectors Get. + */ +public final class DataConnectorsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsOfficeATP.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAzureActiveDirectoryById.json */ /** - * Sample code: Check requirements for OfficeATP. - * + * Sample code: Get an AADIP (Azure Active Directory Identity Protection) data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForOfficeATP( + public static void getAnAADIPAzureActiveDirectoryIdentityProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new OfficeAtpCheckRequirements(), Context.NONE); + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsOffice365Project.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetOffice365ProjectDataConnetorById.json */ /** - * Sample code: Check requirements for Office365Project. - * + * Sample code: Get an Office365 Project data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForOffice365Project( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new Office365ProjectCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectory.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetGenericUI.json */ /** - * Sample code: Check requirements for AAD. - * + * Sample code: Get a GenericUI data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForAAD( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftCloudAppSecurity.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetOffice365AdvancedThreatProtectionById.json */ /** - * Sample code: Check requirements for Mcas. - * + * Sample code: Get an Office ATP data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForMcas( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new McasCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsIoT.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetIoTById.json */ /** - * Sample code: Check requirements for IoT. - * + * Sample code: Get a IoT data connector. + * * @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"), - Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsMdatp.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftCloudAppSecurityById.json */ /** - * Sample code: Check requirements for Mdatp. - * + * Sample code: Get a MCAS data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForMdatp( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new McasCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetThreatIntelligenceTaxiiById.json */ /** - * Sample code: Check requirements for AAD - no authorization. - * + * Sample code: Get a TI Taxii data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForAADNoAuthorization( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsAzureSecurityCenter.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftThreatIntelligenceById.json */ /** - * Sample code: Check requirements for ASC. - * + * Sample code: Get a MicrosoftThreatIntelligence data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForASC( + public static void getAMicrosoftThreatIntelligenceDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse( - "myRg", - "myWorkspace", - new AscCheckRequirements().withSubscriptionId("c0688291-89d7-4bed-87a2-a7b1bff43f4c"), - Context.NONE); + 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/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatProtection.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAzureSecurityCenterById.json */ /** - * Sample code: Check requirements for MicrosoftThreatProtection. - * + * Sample code: Get a ASC data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForMicrosoftThreatProtection( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new MtpCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligenceTaxii.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetThreatIntelligenceById.json */ /** - * Sample code: Check requirements for TI Taxii. - * + * Sample code: Get a TI data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForTITaxii( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new TiTaxiiCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsOfficeIRM.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAmazonWebServicesCloudTrailById.json */ /** - * Sample code: Check requirements for OfficeIRM. - * + * Sample code: Get an AwsCloudTrail data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForOfficeIRM( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new OfficeIrmCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json */ /** - * Sample code: Check requirements for MicrosoftThreatIntelligence. - * + * Sample code: Get a MDATP data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForMicrosoftThreatIntelligence( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new MstiCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsOfficePowerBI.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftThreatProtectionById.json */ /** - * Sample code: Check requirements for OfficePowerBI. - * + * Sample code: Get a MicrosoftThreatProtection data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForOfficePowerBI( + public static void getAMicrosoftThreatProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new OfficePowerBICheckRequirements(), Context.NONE); + 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/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsDynamics365.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftPurviewInformationProtectionDataConnetorById.json */ /** - * Sample code: Check requirements for Dynamics365. - * + * Sample code: Get a MicrosoftPurviewInformationProtection data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForDynamics365( + public static void getAMicrosoftPurviewInformationProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new Dynamics365CheckRequirements(), Context.NONE); + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoLicense.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAzureAdvancedThreatProtectionById.json */ /** - * Sample code: Check requirements for AAD - no license. - * + * Sample code: Get an AATP data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForAADNoLicense( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAPIPolling.json */ /** - * Sample code: Check requirements for TI. - * + * Sample code: Get a APIPolling data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForTI( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new TICheckRequirements(), Context.NONE); + 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); } -} -``` -### DomainWhois_Get - -```java -import com.azure.core.util.Context; - -/** Samples for DomainWhois Get. */ -public final class DomainWhoisGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/enrichment/GetWhoisByDomainName.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftInsiderRiskManagementById.json */ /** - * Sample code: Get whois information for a single domain name. - * + * Sample code: Get an Office IRM data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getWhoisInformationForASingleDomainName( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.domainWhois().getWithResponse("myRg", "microsoft.com", Context.NONE); + 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); } -} -``` - -### Entities_Expand - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; -import java.time.OffsetDateTime; -import java.util.UUID; -/** Samples for Entities Expand. */ -public final class EntitiesExpandSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/expand/PostExpandEntity.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetDynamics365DataConnectorById.json */ /** - * Sample code: Expand an entity. - * + * Sample code: Get a Dynamics365 data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void expandAnEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entities() - .expandWithResponse( - "myRg", - "myWorkspace", - "e1d3d618-e11f-478b-98e3-bb381539a8e1", - new EntityExpandParameters() - .withEndTime(OffsetDateTime.parse("2019-05-26T00:00:00.000Z")) - .withExpansionId(UUID.fromString("a77992f3-25e9-4d01-99a4-5ff606cc410a")) - .withStartTime(OffsetDateTime.parse("2019-04-25T00:00:00.000Z")), - Context.NONE); + 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); } -} -``` - -### Entities_Get - -```java -import com.azure.core.util.Context; -/** Samples for Entities Get. */ -public final class EntitiesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetSubmissionMailEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetOfficeDataConnetorById.json */ /** - * Sample code: Get a submissionMail entity. - * + * Sample code: Get an Office365 data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getASubmissionMailEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetDnsEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetGoogleCloudPlatformById.json */ /** - * Sample code: Get a dns entity. - * + * Sample code: Get a GCP data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getADnsEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "f4e74920-f2c0-4412-a45f-66d94fdf01f8", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetFileHashEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAmazonWebServicesS3ById.json */ /** - * Sample code: Get a file hash entity. - * + * Sample code: Get an Aws S3 data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAFileHashEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "ea359fa6-c1e5-f878-e105-6344f3e399a1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetIoTDeviceEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetRestApiPollerById.json */ /** - * Sample code: Get an IoT device entity. - * + * Sample code: Get a RestApiPoller data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnIoTDeviceEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetRegistryKeyEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetOfficePowerBIDataConnetorById.json */ /** - * Sample code: Get a registry key entity. - * + * Sample code: Get an Office365 PowerBI data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getARegistryKeyEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetMailboxEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetDataConnectors.json */ /** - * Sample code: Get a mailbox entity. - * + * Sample code: Get all data connectors. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMailboxEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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.MicrosoftPurviewInformationProtectionCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MstiCheckRequirements; +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.TICheckRequirements; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiCheckRequirements; +/** + * Samples for DataConnectorsCheckRequirementsOperation Post. + */ +public final class DataConnectorsCheckRequirementsOperationPostSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetMalwareEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsOfficeATP.json */ /** - * Sample code: Get a malware entity. - * + * Sample code: Check requirements for OfficeATP. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMalwareEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetSecurityAlertEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsOffice365Project.json */ /** - * Sample code: Get a security alert entity. - * + * Sample code: Check requirements for Office365Project. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getASecurityAlertEntity( + public static void checkRequirementsForOffice365Project( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "4aa486e0-6f85-41af-99ea-7acdce7be6c8", Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new Office365ProjectCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetIpEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json */ /** - * Sample code: Get an ip entity. - * + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection) - no authorization. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnIpEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetAccountEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftCloudAppSecurity.json */ /** - * Sample code: Get an account entity. - * + * Sample code: Check requirements for Mcas. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAccountEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetCloudApplicationEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsIoT.json */ /** - * Sample code: Get a cloud application entity. - * + * Sample code: Check requirements for IoT. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getACloudApplicationEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetFileEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMdatp.json */ /** - * Sample code: Get a file entity. - * + * Sample code: Check requirements for Mdatp. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAFileEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetRegistryValueEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsAzureSecurityCenter.json */ /** - * Sample code: Get a registry value entity. - * + * Sample code: Check requirements for ASC. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getARegistryValueEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "dc44bd11-b348-4d76-ad29-37bf7aa41356", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetUrlEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftPurviewInformationProtection.json */ /** - * Sample code: Get a url entity. - * + * Sample code: Check requirements for MicrosoftPurviewInformationProtection. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAUrlEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetMailClusterEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatProtection.json */ /** - * Sample code: Get a mailCluster entity. - * + * Sample code: Check requirements for MicrosoftThreatProtection. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMailClusterEntity( + public static void checkRequirementsForMicrosoftThreatProtection( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new MtpCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetSecurityGroupEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligenceTaxii.json */ /** - * Sample code: Get a security group entity. - * + * Sample code: Check requirements for TI Taxii. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getASecurityGroupEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetMailMessageEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsOfficeIRM.json */ /** - * Sample code: Get a mailMessage entity. - * + * Sample code: Check requirements for OfficeIRM. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMailMessageEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetAzureResourceEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatIntelligence.json */ /** - * Sample code: Get an azure resource entity. - * + * Sample code: Check requirements for MicrosoftThreatIntelligence. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAzureResourceEntity( + public static void checkRequirementsForMicrosoftThreatIntelligence( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new MstiCheckRequirements().withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetHostEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectory.json */ /** - * Sample code: Get a host entity. - * + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection). + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAHostEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetProcessEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsOfficePowerBI.json */ /** - * Sample code: Get a process entity. - * + * Sample code: Check requirements for OfficePowerBI. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAProcessEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "7264685c-038c-42c6-948c-38e14ef1fb98", Context.NONE); + 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); } -} -``` - -### Entities_GetInsights - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -/** Samples for Entities GetInsights. */ -public final class EntitiesGetInsightsSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/insights/PostGetInsights.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsDynamics365.json */ /** - * Sample code: Entity Insight. - * + * Sample code: Check requirements for Dynamics365. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void entityInsight(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entities() - .getInsightsWithResponse( - "myRg", - "myWorkspace", - "e1d3d618-e11f-478b-98e3-bb381539a8e1", - new EntityGetInsightsParameters() - .withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) - .withEndTime(OffsetDateTime.parse("2021-10-01T00:00:00.000Z")) - .withAddDefaultExtendedTimeRange(false) - .withInsightQueryIds(Arrays.asList(UUID.fromString("cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4"))), - Context.NONE); + 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); } -} -``` - -### Entities_List -```java -import com.azure.core.util.Context; - -/** Samples for Entities List. */ -public final class EntitiesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetEntities.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoLicense.json */ /** - * Sample code: Get all entities. - * + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection) - no license. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllEntities(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().list("myRg", "myWorkspace", Context.NONE); + 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); } -} -``` - -### Entities_Queries - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; -/** Samples for Entities Queries. */ -public final class EntitiesQueriesSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetQueries.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligence.json */ /** - * Sample code: Get Entity Query. - * + * Sample code: Check requirements for TI. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entities() - .queriesWithResponse( - "myRg", - "myWorkspace", - "e1d3d618-e11f-478b-98e3-bb381539a8e1", - EntityItemQueryKind.INSIGHT, - Context.NONE); + 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); } } ``` -### EntitiesGetTimeline_List +### Entities_Expand ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; import java.time.OffsetDateTime; +import java.util.UUID; -/** Samples for EntitiesGetTimeline List. */ -public final class EntitiesGetTimelineListSamples { +/** + * Samples for Entities Expand. + */ +public final class EntitiesExpandSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/timeline/PostTimelineEntity.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/expand/PostExpandEntity.json */ /** - * Sample code: Entity timeline. - * + * Sample code: Expand an entity. + * * @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")) + public static void expandAnEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .expandWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityExpandParameters().withEndTime(OffsetDateTime.parse("2019-05-26T00:00:00.000Z")) + .withExpansionId(UUID.fromString("a77992f3-25e9-4d01-99a4-5ff606cc410a")) + .withStartTime(OffsetDateTime.parse("2019-04-25T00:00:00.000Z")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_Get + +```java +/** + * Samples for Entities Get. + */ +public final class EntitiesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetSubmissionMailEntityById.json + */ + /** + * Sample code: Get a submissionMail entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getASubmissionMailEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetDnsEntityById.json + */ + /** + * Sample code: Get a dns entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getADnsEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "f4e74920-f2c0-4412-a45f-66d94fdf01f8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetFileHashEntityById.json + */ + /** + * Sample code: Get a file hash entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFileHashEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "ea359fa6-c1e5-f878-e105-6344f3e399a1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetIoTDeviceEntityById.json + */ + /** + * Sample code: Get an IoT device entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnIoTDeviceEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetRegistryKeyEntityById.json + */ + /** + * Sample code: Get a registry key entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getARegistryKeyEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetMailboxEntityById.json + */ + /** + * Sample code: Get a mailbox entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMailboxEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetMalwareEntityById.json + */ + /** + * Sample code: Get a malware entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMalwareEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetSecurityAlertEntityById.json + */ + /** + * Sample code: Get a security alert entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getASecurityAlertEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "4aa486e0-6f85-41af-99ea-7acdce7be6c8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetIpEntityById.json + */ + /** + * Sample code: Get an ip entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnIpEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetAccountEntityById.json + */ + /** + * Sample code: Get an account entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAccountEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetCloudApplicationEntityById.json + */ + /** + * Sample code: Get a cloud application entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getACloudApplicationEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetFileEntityById.json + */ + /** + * Sample code: Get a file entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFileEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetRegistryValueEntityById.json + */ + /** + * Sample code: Get a registry value entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getARegistryValueEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "dc44bd11-b348-4d76-ad29-37bf7aa41356", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetUrlEntityById.json + */ + /** + * Sample code: Get a url entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAUrlEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetMailClusterEntityById.json + */ + /** + * Sample code: Get a mailCluster entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAMailClusterEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetSecurityGroupEntityById.json + */ + /** + * Sample code: Get a security group entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getASecurityGroupEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetMailMessageEntityById.json + */ + /** + * Sample code: Get a mailMessage entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAMailMessageEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetAzureResourceEntityById.json + */ + /** + * Sample code: Get an azure resource entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnAzureResourceEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetHostEntityById.json + */ + /** + * Sample code: Get a host entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAHostEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetProcessEntityById.json + */ + /** + * Sample code: Get a process entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAProcessEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getWithResponse("myRg", "myWorkspace", "7264685c-038c-42c6-948c-38e14ef1fb98", + com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_GetInsights + +```java +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +/** + * Samples for Entities GetInsights. + */ +public final class EntitiesGetInsightsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/insights/PostGetInsights.json + */ + /** + * Sample code: Entity Insight. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void entityInsight(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .getInsightsWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityGetInsightsParameters().withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) + .withEndTime(OffsetDateTime.parse("2021-10-01T00:00:00.000Z")) + .withAddDefaultExtendedTimeRange(false) + .withInsightQueryIds(Arrays.asList(UUID.fromString("cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_List + +```java +/** + * Samples for Entities List. + */ +public final class EntitiesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetEntities.json + */ + /** + * Sample code: Get all entities. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllEntities(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities().list("myRg", "myWorkspace", 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetQueries.json + */ + /** + * Sample code: Get Entity Query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .queriesWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + EntityItemQueryKind.INSIGHT, com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_RunPlaybook + +```java + +/** + * Samples for Entities RunPlaybook. + */ +public final class EntitiesRunPlaybookSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/timeline/PostTimelineEntity.json + */ + /** + * Sample code: Entity timeline. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void entityTimeline(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entitiesGetTimelines() + .listWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityTimelineParameters().withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) + .withEndTime(OffsetDateTime.parse("2021-10-01T00:00:00.000Z")) .withNumberOfBucket(4), - Context.NONE); + com.azure.core.util.Context.NONE); + } +} +``` + +### EntitiesRelations_List + +```java +/** + * Samples for EntitiesRelations List. + */ +public final class EntitiesRelationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/relations/GetAllEntityRelations.json + */ + /** + * Sample code: Get all relations of an entity. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllRelationsOfAnEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entitiesRelations() + .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/CreateEntityQueryActivity.json + */ + /** + * Sample code: Creates or updates an Activity entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnActivityEntityQuery( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueries() + .createOrUpdateWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + new ActivityCustomEntityQuery().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withTitle("An account was deleted on this host") + .withContent("On '{{Computer}}' the account '{{TargetAccount}}' was deleted by '{{AddedBy}}'") + .withDescription("Account deleted on host") + .withQueryDefinitions(new ActivityEntityQueriesPropertiesQueryDefinitions().withQuery( + "let GetAccountActions = (v_Host_Name:string, v_Host_NTDomain:string, v_Host_DnsDomain:string, v_Host_AzureID:string, v_Host_OMSAgentID:string){\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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/DeleteEntityQuery.json + */ + /** + * Sample code: Delete an entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueries() + .deleteWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + com.azure.core.util.Context.NONE); + } +} +``` + +### EntityQueries_Get + +```java +/** + * Samples for EntityQueries Get. + */ +public final class EntityQueriesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/GetActivityEntityQueryById.json + */ + /** + * Sample code: Get an Activity entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnActivityEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueries() + .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/GetExpansionEntityQueryById.json + */ + /** + * Sample code: Get an Expansion entity query. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnExpansionEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueries() + .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + com.azure.core.util.Context.NONE); + } +} +``` + +### EntityQueries_List + +```java +import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind; + +/** + * Samples for EntityQueries List. + */ +public final class EntityQueriesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/GetEntityQueries.json + */ + /** + * Sample code: Get all entity queries. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllEntityQueries(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueries() + .list("myRg", "myWorkspace", EntityQueriesKind.EXPANSION, com.azure.core.util.Context.NONE); + } +} +``` + +### EntityQueryTemplates_Get + +```java +/** + * Samples for EntityQueryTemplates Get. + */ +public final class EntityQueryTemplatesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueryTemplates/GetActivityEntityQueryTemplateById.json + */ + /** + * Sample code: Get an Activity entity query template. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnActivityEntityQueryTemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueryTemplates() + .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + com.azure.core.util.Context.NONE); + } +} +``` + +### EntityQueryTemplates_List + +```java +import com.azure.resourcemanager.securityinsights.models.Constant124; + +/** + * Samples for EntityQueryTemplates List. + */ +public final class EntityQueryTemplatesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.json + */ + /** + * Sample code: Get all entity query templates. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllEntityQueryTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueryTemplates() + .list("myRg", "myWorkspace", Constant124.ACTIVITY, com.azure.core.util.Context.NONE); + } +} +``` + +### EntityRelations_GetRelation + +```java +/** + * Samples for EntityRelations GetRelation. + */ +public final class EntityRelationsGetRelationSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/relations/GetEntityRelationByName.json + */ + /** + * Sample code: Get an entity relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnEntityRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityRelations() + .getRelationWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 +import java.util.UUID; + +/** + * Samples for Get SingleRecommendation. + */ +public final class GetSingleRecommendationSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", + UUID.fromString("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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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().listWithResponse("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### GetTriggeredAnalyticsRuleRuns_List + +```java +/** + * Samples for GetTriggeredAnalyticsRuleRuns List. + */ +public final class GetTriggeredAnalyticsRuleRunsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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; +import java.util.UUID; + +/** + * Samples for Hunts CreateOrUpdate. + */ +public final class HuntsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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(UUID.fromString("873b5263-5d34-4149-b356-ad341b01e123"))) + .create(); + } +} +``` + +### Hunts_Delete + +```java +/** + * Samples for Hunts Delete. + */ +public final class HuntsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/relations/CreateIncidentRelation.json + */ + /** + * Sample code: Creates or updates an incident relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesAnIncidentRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentRelations() + .createOrUpdateWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + new RelationInner().withRelatedResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"), + com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentRelations_Delete + +```java +/** + * Samples for IncidentRelations Delete. + */ +public final class IncidentRelationsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/relations/DeleteIncidentRelation.json + */ + /** + * Sample code: Delete the incident relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteTheIncidentRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentRelations() + .deleteWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentRelations_Get + +```java +/** + * Samples for IncidentRelations Get. + */ +public final class IncidentRelationsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/relations/GetIncidentRelationByName.json + */ + /** + * Sample code: Get an incident relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnIncidentRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentRelations() + .getWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentRelations_List + +```java +/** + * Samples for IncidentRelations List. + */ +public final class IncidentRelationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/relations/GetAllIncidentRelations.json + */ + /** + * Sample code: Get all incident relations. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllIncidentRelations(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentRelations() + .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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; +import java.util.UUID; + +/** + * Samples for Incidents CreateOrUpdate. + */ +public final class IncidentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) + .withFirstActivityTimeUtc(OffsetDateTime.parse("2019-01-01T13:00:30Z")) + .withLastActivityTimeUtc(OffsetDateTime.parse("2019-01-01T13:05:30Z")) + .create(); + } +} +``` + +### Incidents_CreateTeam + +```java +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; + +/** + * Samples for Incidents CreateTeam. + */ +public final class IncidentsCreateTeamSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/IncidentTeam/Incidents_CreateTeam.json + */ + /** + * Sample code: Incidents_CreateTeam. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentsCreateTeam(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .createTeamWithResponse("myRg", "myWorkspace", "69a30280-6a4c-4aa7-9af0-5d63f335d600", + new TeamInformationInner(), com.azure.core.util.Context.NONE); + } +} +``` + +### Incidents_Delete + +```java +/** + * Samples for Incidents Delete. + */ +public final class IncidentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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); } } ``` -### EntitiesRelations_List +### Incidents_ListAlerts ```java -import com.azure.core.util.Context; +/** + * Samples for Incidents ListAlerts. + */ +public final class IncidentsListAlertsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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); + } +} +``` -/** Samples for EntitiesRelations List. */ -public final class EntitiesRelationsListSamples { +### Incidents_ListBookmarks + +```java +/** + * Samples for Incidents ListBookmarks. + */ +public final class IncidentsListBookmarksSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/relations/GetAllEntityRelations.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/IncidentBookmarks/Incidents_ListBookmarks.json */ /** - * Sample code: Get all relations of an entity. - * + * Sample code: Incidents_ListBookmarks. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllRelationsOfAnEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entitiesRelations() - .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, Context.NONE); + 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); } } ``` -### EntityQueries_CreateOrUpdate +### Incidents_ListEntities ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.ActivityCustomEntityQuery; -import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueriesPropertiesQueryDefinitions; -import com.azure.resourcemanager.securityinsights.models.EntityType; +/** + * Samples for Incidents ListEntities. + */ +public final class IncidentsListEntitiesSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.time.LocalDate; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -/** Samples for EntityQueries CreateOrUpdate. */ -public final class EntityQueriesCreateOrUpdateSamples { +/** + * Samples for Metadata Create. + */ +public final class MetadataCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/CreateEntityQueryActivity.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/PutMetadata.json */ /** - * Sample code: Creates or updates an Activity entity query. - * + * Sample code: Create/update full metadata. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAnActivityEntityQuery( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueries() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "07da3cc8-c8ad-4710-a44e-334cdcb7882b", - new ActivityCustomEntityQuery() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") - .withTitle("An account was deleted on this host") - .withContent("On '{{Computer}}' the account '{{TargetAccount}}' was deleted by '{{AddedBy}}'") - .withDescription("Account deleted on host") - .withQueryDefinitions( - new ActivityEntityQueriesPropertiesQueryDefinitions() - .withQuery( - "let GetAccountActions = (v_Host_Name:string, v_Host_NTDomain:string," - + " v_Host_DnsDomain:string, v_Host_AzureID:string, v_Host_OMSAgentID:string){\n" - + "SecurityEvent\n" - + "| where EventID in (4725, 4726, 4767, 4720, 4722, 4723, 4724)\n" - + "// parsing for Host to handle variety of conventions coming from data\n" - + "| extend Host_HostName = case(\n" - + "Computer has '@', tostring(split(Computer, '@')[0]),\n" - + "Computer has '\\\\', tostring(split(Computer, '\\\\')[1]),\n" - + "Computer has '.', tostring(split(Computer, '.')[0]),\n" - + "Computer\n" - + ")\n" - + "| extend Host_NTDomain = case(\n" - + "Computer has '\\\\', tostring(split(Computer, '\\\\')[0]), \n" - + "Computer has '.', tostring(split(Computer, '.')[-2]), \n" - + "Computer\n" - + ")\n" - + "| extend Host_DnsDomain = case(\n" - + "Computer has '\\\\', tostring(split(Computer, '\\\\')[0]), \n" - + "Computer has '.', strcat_array(array_slice(split(Computer,'.'),-2,-1),'.'), \n" - + "Computer\n" - + ")\n" - + "| where (Host_HostName =~ v_Host_Name and Host_NTDomain =~ v_Host_NTDomain) \n" - + "or (Host_HostName =~ v_Host_Name and Host_DnsDomain =~ v_Host_DnsDomain) \n" - + "or v_Host_AzureID =~ _ResourceId \n" - + "or v_Host_OMSAgentID == SourceComputerId\n" - + "| project TimeGenerated, EventID, Activity, Computer, TargetAccount," - + " TargetUserName, TargetDomainName, TargetSid, SubjectUserName, SubjectUserSid," - + " _ResourceId, SourceComputerId\n" - + "| extend AddedBy = SubjectUserName\n" - + "// Future support for Activities\n" - + "| extend timestamp = TimeGenerated, HostCustomEntity = Computer," - + " AccountCustomEntity = TargetAccount\n" - + "};\n" - + "GetAccountActions('{{Host_HostName}}', '{{Host_NTDomain}}'," - + " '{{Host_DnsDomain}}', '{{Host_AzureID}}', '{{Host_OMSAgentID}}')\n" - + " \n" - + "| where EventID == 4726 ")) - .withInputEntityType(EntityType.HOST) - .withRequiredInputFieldsSets( - Arrays - .asList( - Arrays.asList("Host_HostName", "Host_NTDomain"), - Arrays.asList("Host_HostName", "Host_DnsDomain"), - Arrays.asList("Host_AzureID"), - Arrays.asList("Host_OMSAgentID"))) - .withEntitiesFilter(mapOf("Host_OsFamily", Arrays.asList("Windows"))) - .withEnabled(true), - Context.NONE); + 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(Operator.fromString("AND")) + .withCriteria(Arrays.asList( + new MetadataDependencies().withOperator(Operator.fromString("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(); } - @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; + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/PutMetadataMinimal.json + */ + /** + * Sample code: Create/update minimal metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createUpdateMinimalMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas() + .define("metadataName") + .withExistingWorkspace("myRg", "myWorkspace") + .withContentId("c00ee137-7475-47c8-9cce-ec6f0f1bedd0") + .withParentId( + "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName") + .withKind("AnalyticsRule") + .create(); } } ``` -### EntityQueries_Delete +### Metadata_Delete ```java -import com.azure.core.util.Context; - -/** Samples for EntityQueries Delete. */ -public final class EntityQueriesDeleteSamples { +/** + * Samples for Metadata Delete. + */ +public final class MetadataDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/DeleteEntityQuery.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/DeleteMetadata.json */ /** - * Sample code: Delete an entity query. - * + * Sample code: Delete metadata. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAnEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueries() - .deleteWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + public static void deleteMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().deleteWithResponse("myRg", "myWorkspace", "metadataName", com.azure.core.util.Context.NONE); } } ``` -### EntityQueries_Get +### Metadata_Get ```java -import com.azure.core.util.Context; +/** + * Samples for Metadata Get. + */ +public final class MetadataGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/GetMetadata.json + */ + /** + * Sample code: Get single metadata by name. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getSingleMetadataByName(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas().getWithResponse("myRg", "myWorkspace", "metadataName", com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for EntityQueries Get. */ -public final class EntityQueriesGetSamples { +### Metadata_List + +```java +/** + * Samples for Metadata List. + */ +public final class MetadataListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/GetActivityEntityQueryById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/GetAllMetadata.json */ /** - * Sample code: Get an Activity entity query. - * + * Sample code: Get all metadata. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnActivityEntityQuery( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueries() - .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/GetExpansionEntityQueryById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/GetAllMetadataOData.json */ /** - * Sample code: Get an Expansion entity query. - * + * Sample code: Get all metadata with OData filter/orderby/skip/top. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnExpansionEntityQuery( + public static void getAllMetadataWithODataFilterOrderbySkipTop( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueries() - .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### EntityQueries_List +### Metadata_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataModel; -/** Samples for EntityQueries List. */ -public final class EntityQueriesListSamples { +/** + * Samples for Metadata Update. + */ +public final class MetadataUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/GetEntityQueries.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/PatchMetadata.json */ /** - * Sample code: Get all entity queries. - * + * Sample code: Update metadata. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllEntityQueries(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entityQueries().list("myRg", "myWorkspace", EntityQueriesKind.EXPANSION, Context.NONE); + 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(); } } ``` -### EntityQueryTemplates_Get +### OfficeConsents_Delete ```java -import com.azure.core.util.Context; +/** + * Samples for OfficeConsents Delete. + */ +public final class OfficeConsentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/officeConsents/DeleteOfficeConsents.json + */ + /** + * Sample code: Delete an office consent. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAnOfficeConsent(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.officeConsents() + .deleteWithResponse("myRg", "myWorkspace", "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", + com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for EntityQueryTemplates Get. */ -public final class EntityQueryTemplatesGetSamples { +### OfficeConsents_Get + +```java +/** + * Samples for OfficeConsents Get. + */ +public final class OfficeConsentsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueryTemplates/GetActivityEntityQueryTemplateById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/officeConsents/GetOfficeConsentsById.json */ /** - * Sample code: Get an Activity entity query template. - * + * Sample code: Get an office consent. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnActivityEntityQueryTemplate( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueryTemplates() - .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + 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); } } ``` -### EntityQueryTemplates_List +### OfficeConsents_List ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.Constant88; +/** + * Samples for OfficeConsents List. + */ +public final class OfficeConsentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/officeConsents/GetOfficeConsents.json + */ + /** + * Sample code: Get all office consents. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllOfficeConsents(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.officeConsents().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for EntityQueryTemplates List. */ -public final class EntityQueryTemplatesListSamples { +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/operations/ListOperations.json */ /** - * Sample code: Get all entity query templates. - * + * Sample code: Get all operations. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllEntityQueryTemplates( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entityQueryTemplates().list("myRg", "myWorkspace", Constant88.ACTIVITY, Context.NONE); + public static void getAllOperations(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### EntityRelations_GetRelation +### ProductPackageOperation_Get ```java -import com.azure.core.util.Context; +/** + * Samples for ProductPackageOperation Get. + */ +public final class ProductPackageOperationGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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.productPackageOperations() + .getWithResponse("myRg", "myWorkspace", "str.azure-sentinel-solution-str", + com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for EntityRelations GetRelation. */ -public final class EntityRelationsGetRelationSamples { +### ProductPackages_List + +```java +/** + * Samples for ProductPackages List. + */ +public final class ProductPackagesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/relations/GetEntityRelationByName.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentPackages/GetProductPackages.json */ /** - * Sample code: Get an entity relation. - * + * Sample code: Get all available packages. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnEntityRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityRelations() - .getRelationWithResponse( - "myRg", - "myWorkspace", - "afbd324f-6c48-459c-8710-8d1e1cd03812", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + public static void + getAllAvailablePackages(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productPackages().list("myRg", "myWorkspace", null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### FileImports_Create +### ProductSettings_Delete ```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 ProductSettings Delete. + */ +public final class ProductSettingsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/settings/DeleteEyesOnSetting.json + */ + /** + * Sample code: Delete EyesOn settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteEyesOnSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productSettings().deleteWithResponse("myRg", "myWorkspace", "EyesOn", com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for FileImports Create. */ -public final class FileImportsCreateSamples { +### ProductSettings_Get + +```java +/** + * Samples for ProductSettings Get. + */ +public final class ProductSettingsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/fileImports/CreateFileImport.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/settings/GetEyesOnSetting.json */ /** - * Sample code: Create a file import. - * + * Sample code: Get EyesOn settings. + * * @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(); + public static void getEyesOnSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productSettings().getWithResponse("myRg", "myWorkspace", "EyesOn", com.azure.core.util.Context.NONE); } } ``` -### FileImports_Delete +### ProductSettings_List ```java -import com.azure.core.util.Context; - -/** Samples for FileImports Delete. */ -public final class FileImportsDeleteSamples { +/** + * Samples for ProductSettings List. + */ +public final class ProductSettingsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/fileImports/DeleteFileImport.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/settings/GetAllSettings.json */ /** - * Sample code: Delete a file import. - * + * Sample code: Get all settings. + * * @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", Context.NONE); + public static void getAllSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productSettings().listWithResponse("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` -### FileImports_Get +### ProductSettings_Update ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EyesOn; -/** Samples for FileImports Get. */ -public final class FileImportsGetSamples { +/** + * Samples for ProductSettings Update. + */ +public final class ProductSettingsUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/fileImports/GetFileImportById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/settings/UpdateEyesOnSetting.json */ /** - * Sample code: Get a file import. - * + * Sample code: Update EyesOn settings. + * * @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", Context.NONE); + 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); } } ``` -### FileImports_List +### ProductTemplateOperation_Get ```java -import com.azure.core.util.Context; - -/** Samples for FileImports List. */ -public final class FileImportsListSamples { +/** + * Samples for ProductTemplateOperation Get. + */ +public final class ProductTemplateOperationGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/fileImports/GetFileImports.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentTemplates/GetProductTemplateById.json */ /** - * Sample code: Get all file imports. - * + * Sample code: Get a template. + * * @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, Context.NONE); + public static void getATemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productTemplateOperations() + .getWithResponse("myRg", "myWorkspace", "8365ebfe-a381-45b7-ad08-7d818070e11f", + com.azure.core.util.Context.NONE); } } ``` -### IncidentComments_CreateOrUpdate +### ProductTemplates_List ```java -/** Samples for IncidentComments CreateOrUpdate. */ -public final class IncidentCommentsCreateOrUpdateSamples { +/** + * Samples for ProductTemplates List. + */ +public final class ProductTemplatesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/comments/CreateIncidentComment.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentTemplates/GetProductTemplates.json */ /** - * Sample code: Creates or updates an incident comment. - * + * Sample code: Get all installed templates. + * * @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 + getAllInstalledTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productTemplates() + .list("myRg", "myWorkspace", null, null, null, null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### IncidentComments_Delete +### Reevaluate_Recommendation ```java -import com.azure.core.util.Context; +import java.util.UUID; -/** Samples for IncidentComments Delete. */ -public final class IncidentCommentsDeleteSamples { +/** + * Samples for Reevaluate Recommendation. + */ +public final class ReevaluateRecommendationSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/comments/DeleteIncidentComment.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/recommendations/ReevaluateRecommendation.json */ /** - * Sample code: Delete the incident comment. - * + * Sample code: Reevaluate a recommendation. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteTheIncidentComment( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentComments() - .deleteWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + public static void + reevaluateARecommendation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.reevaluates() + .recommendationWithResponse("myRg", "myWorkspace", UUID.fromString("6d4b54eb-8684-4aa3-a156-3aa37b8014bc"), + com.azure.core.util.Context.NONE); } } ``` -### IncidentComments_Get +### ResourceProvider_ListGeodataByIp ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpAddressBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; -/** Samples for IncidentComments Get. */ -public final class IncidentCommentsGetSamples { +/** + * Samples for ResourceProvider ListGeodataByIp. + */ +public final class ResourceProviderListGeodataByIpSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/comments/GetIncidentCommentById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/enrichment/GetGeodataWithWorkspaceByIp.json */ /** - * Sample code: Get an incident comment. - * + * Sample code: Get geodata for a single IP address. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnIncidentComment( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentComments() - .getWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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); } } ``` -### IncidentComments_List +### ResourceProvider_ListWhoisByDomain ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; -/** Samples for IncidentComments List. */ -public final class IncidentCommentsListSamples { +/** + * Samples for ResourceProvider ListWhoisByDomain. + */ +public final class ResourceProviderListWhoisByDomainSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/comments/GetAllIncidentComments.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/enrichment/GetWhoisWithWorkspaceByDomainName.json */ /** - * Sample code: Get all incident comments. - * + * Sample code: Get whois information for a single domain name. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllIncidentComments( + public static void getWhoisInformationForASingleDomainName( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentComments() - .list("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", null, null, null, null, Context.NONE); + manager.resourceProviders() + .listWhoisByDomainWithResponse("myRg", "myWorkspace", EnrichmentType.MAIN, + new EnrichmentDomainBody().withDomain("microsoft.com"), com.azure.core.util.Context.NONE); } } ``` -### IncidentRelations_CreateOrUpdate +### SecurityMLAnalyticsSettings_CreateOrUpdate ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +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; -/** Samples for IncidentRelations CreateOrUpdate. */ -public final class IncidentRelationsCreateOrUpdateSamples { +/** + * Samples for SecurityMLAnalyticsSettings CreateOrUpdate. + */ +public final class SecurityMLAnalyticsSettingsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/relations/CreateIncidentRelation.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/securityMLAnalyticsSettings/CreateAnomalySecurityMLAnalyticsSetting.json */ /** - * Sample code: Creates or updates an incident relation. - * + * Sample code: Creates or updates a Anomaly Security ML Analytics Settings. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAnIncidentRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentRelations() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "afbd324f-6c48-459c-8710-8d1e1cd03812", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - new RelationInner() - .withRelatedResourceId( - "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"), - Context.NONE); + 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); } } ``` -### IncidentRelations_Delete +### SecurityMLAnalyticsSettings_Delete ```java -import com.azure.core.util.Context; - -/** Samples for IncidentRelations Delete. */ -public final class IncidentRelationsDeleteSamples { +/** + * Samples for SecurityMLAnalyticsSettings Delete. + */ +public final class SecurityMLAnalyticsSettingsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/relations/DeleteIncidentRelation.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json */ /** - * Sample code: Delete the incident relation. - * + * Sample code: Delete a Security ML Analytics Settings. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteTheIncidentRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentRelations() - .deleteWithResponse( - "myRg", - "myWorkspace", - "afbd324f-6c48-459c-8710-8d1e1cd03812", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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); } } ``` -### IncidentRelations_Get +### SecurityMLAnalyticsSettings_Get ```java -import com.azure.core.util.Context; - -/** Samples for IncidentRelations Get. */ -public final class IncidentRelationsGetSamples { +/** + * Samples for SecurityMLAnalyticsSettings Get. + */ +public final class SecurityMLAnalyticsSettingsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/relations/GetIncidentRelationByName.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json */ /** - * Sample code: Get an incident relation. - * + * Sample code: Get a Anomaly Security ML Analytics Settings. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnIncidentRelation( + public static void getAAnomalySecurityMLAnalyticsSettings( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentRelations() - .getWithResponse( - "myRg", - "myWorkspace", - "afbd324f-6c48-459c-8710-8d1e1cd03812", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + manager.securityMLAnalyticsSettings() + .getWithResponse("myRg", "myWorkspace", "myFirstAnomalySettings", com.azure.core.util.Context.NONE); } } ``` -### IncidentRelations_List +### SecurityMLAnalyticsSettings_List ```java -import com.azure.core.util.Context; - -/** Samples for IncidentRelations List. */ -public final class IncidentRelationsListSamples { +/** + * Samples for SecurityMLAnalyticsSettings List. + */ +public final class SecurityMLAnalyticsSettingsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/relations/GetAllIncidentRelations.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json */ /** - * Sample code: Get all incident relations. - * + * Sample code: Get all Security ML Analytics Settings. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllIncidentRelations( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentRelations() - .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, Context.NONE); + public static void + getAllSecurityMLAnalyticsSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.securityMLAnalyticsSettings().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` -### Incidents_CreateOrUpdate +### SentinelOnboardingStates_Create ```java -import com.azure.resourcemanager.securityinsights.models.IncidentClassification; -import com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason; -import com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo; -import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; -import com.azure.resourcemanager.securityinsights.models.IncidentStatus; -import java.time.OffsetDateTime; -import java.util.UUID; - -/** Samples for Incidents CreateOrUpdate. */ -public final class IncidentsCreateOrUpdateSamples { +/** + * Samples for SentinelOnboardingStates Create. + */ +public final class SentinelOnboardingStatesCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/CreateIncident.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/onboardingStates/CreateSentinelOnboardingState.json */ /** - * Sample code: Creates or updates an incident. - * + * Sample code: Create Sentinel onboarding state. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAnIncident( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidents() - .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + public static void + createSentinelOnboardingState(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates() + .define("default") .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") + .withCustomerManagedKey(false) .create(); } } ``` -### Incidents_CreateTeam +### SentinelOnboardingStates_Delete ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.TeamProperties; - -/** Samples for Incidents CreateTeam. */ -public final class IncidentsCreateTeamSamples { +/** + * Samples for SentinelOnboardingStates Delete. + */ +public final class SentinelOnboardingStatesDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/CreateTeam.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/onboardingStates/DeleteSentinelOnboardingState.json */ /** - * Sample code: Creates incident teams group. - * + * Sample code: Delete Sentinel onboarding state. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsIncidentTeamsGroup( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidents() - .createTeamWithResponse( - "ambawolvese5resourcegroup", - "AmbaE5WestCentralUS", - "69a30280-6a4c-4aa7-9af0-5d63f335d600", - new TeamProperties().withTeamName("Team name").withTeamDescription("Team description"), - Context.NONE); + public static void + deleteSentinelOnboardingState(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates() + .deleteWithResponse("myRg", "myWorkspace", "default", com.azure.core.util.Context.NONE); } } ``` -### Incidents_Delete +### SentinelOnboardingStates_Get ```java -import com.azure.core.util.Context; - -/** Samples for Incidents Delete. */ -public final class IncidentsDeleteSamples { +/** + * Samples for SentinelOnboardingStates Get. + */ +public final class SentinelOnboardingStatesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/DeleteIncident.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/onboardingStates/GetSentinelOnboardingState.json */ /** - * Sample code: Delete an incident. - * + * Sample code: Get Sentinel onboarding state. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAnIncident(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidents() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + public static void + getSentinelOnboardingState(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates() + .getWithResponse("myRg", "myWorkspace", "default", com.azure.core.util.Context.NONE); } } ``` -### Incidents_Get +### SentinelOnboardingStates_List ```java -import com.azure.core.util.Context; - -/** Samples for Incidents Get. */ -public final class IncidentsGetSamples { +/** + * Samples for SentinelOnboardingStates List. + */ +public final class SentinelOnboardingStatesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/GetIncidentById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/onboardingStates/GetAllSentinelOnboardingStates.json */ /** - * Sample code: Get an incident. - * + * Sample code: Get all Sentinel onboarding states. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnIncident(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidents() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + public static void + getAllSentinelOnboardingStates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates().listWithResponse("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` -### Incidents_List +### SourceControl_ListRepositories ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; -/** Samples for Incidents List. */ -public final class IncidentsListSamples { +/** + * Samples for SourceControl ListRepositories. + */ +public final class SourceControlListRepositoriesSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/GetIncidents.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/repositories/GetRepositories.json */ /** - * Sample code: Get all incidents. - * + * Sample code: Get repository list. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllIncidents(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.incidents().list("myRg", "myWorkspace", null, "properties/createdTimeUtc desc", 1, null, Context.NONE); + public static void getRepositoryList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControls() + .listRepositories("myRg", "myWorkspace", + new RepositoryAccessProperties().withKind(RepositoryAccessKind.OAUTH) + .withCode("fakeTokenPlaceholder") + .withState("state") + .withClientId("54b3c2c0-1f48-4a1c-af9f-6399c3240b73"), + com.azure.core.util.Context.NONE); } } ``` -### Incidents_ListAlerts +### SourceControlsOperation_Create ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.RepositoryAccess; +import com.azure.resourcemanager.securityinsights.models.ContentType; +import com.azure.resourcemanager.securityinsights.models.Repository; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import java.util.Arrays; -/** Samples for Incidents ListAlerts. */ -public final class IncidentsListAlertsSamples { +/** + * Samples for SourceControlsOperation Create. + */ +public final class SourceControlsOperationCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/GetAllIncidentAlerts.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/sourcecontrols/CreateSourceControl.json */ /** - * Sample code: Get all incident alerts. - * + * Sample code: Creates or updates a source control. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllIncidentAlerts( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidents() - .listAlertsWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + public static void + createsOrUpdatesASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControlsOperations() + .define("789e0c1f-4a3d-43ad-809c-e713b677b04a") + .withExistingWorkspace("myRg", "myWorkspace") + .withDisplayName("My Source Control") + .withRepoType(RepoType.GITHUB) + .withContentTypes(Arrays.asList(ContentType.fromString("AnalyticRules"), ContentType.WORKBOOK)) + .withRepository(new Repository().withUrl("https://github.com/user/repo") + .withBranch("master") + .withDisplayUrl("https://github.com/user/repo")) + .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(); } } ``` -### Incidents_ListBookmarks +### SourceControlsOperation_Delete ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; -/** Samples for Incidents ListBookmarks. */ -public final class IncidentsListBookmarksSamples { +/** + * Samples for SourceControlsOperation Delete. + */ +public final class SourceControlsOperationDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/GetAllIncidentBookmarks.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/sourcecontrols/DeleteSourceControl.json */ /** - * Sample code: Get all incident bookmarks. - * + * Sample code: Delete a source control. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllIncidentBookmarks( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidents() - .listBookmarksWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + public static void + deleteASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControlsOperations() + .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); } } ``` -### Incidents_ListEntities +### SourceControlsOperation_Get ```java -import com.azure.core.util.Context; - -/** Samples for Incidents ListEntities. */ -public final class IncidentsListEntitiesSamples { +/** + * Samples for SourceControlsOperation Get. + */ +public final class SourceControlsOperationGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/entities/GetAllIncidentEntities.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/sourcecontrols/GetSourceControlById.json */ /** - * Sample code: Gets all incident related entities. - * + * Sample code: Get a source control. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getsAllIncidentRelatedEntities( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidents() - .listEntitiesWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + public static void getASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControlsOperations() + .getWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", + com.azure.core.util.Context.NONE); } } ``` -### Incidents_RunPlaybook +### SourceControlsOperation_List ```java -import com.azure.core.util.Context; - -/** Samples for Incidents RunPlaybook. */ -public final class IncidentsRunPlaybookSamples { +/** + * Samples for SourceControlsOperation List. + */ +public final class SourceControlsOperationListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/manualTrigger/Incidents_RunPlaybook.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/sourcecontrols/GetSourceControls.json */ /** - * Sample code: Incidents_RunPlaybook. - * + * Sample code: Get all source controls. + * * @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, Context.NONE); + public static void + getAllSourceControls(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControlsOperations().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` -### IpGeodata_Get +### Systems_CreateOrUpdate ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.IngestionType; +import com.azure.resourcemanager.securityinsights.models.Log; +import com.azure.resourcemanager.securityinsights.models.LogStatusType; +import com.azure.resourcemanager.securityinsights.models.LogType; +import com.azure.resourcemanager.securityinsights.models.RfcConnector; +import com.azure.resourcemanager.securityinsights.models.SapAuthenticationType; +import com.azure.resourcemanager.securityinsights.models.SapSystemsConfiguration; +import com.azure.resourcemanager.securityinsights.models.SystemStatusType; +import java.util.Arrays; + +/** + * Samples for Systems CreateOrUpdate. + */ +public final class SystemsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_CreateOrUpdate.json + */ + /** + * Sample code: Systems_CreateOrUpdate. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + systemsCreateOrUpdate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .define("3d69632b-0b60-4af3-8720-77f01a25d34a") + .withExistingBusinessApplicationAgent("myRg", "myWorkspace", "3123432b-0b60-4af3-8720-77f01a25d34a") + .withConfiguration(new SapSystemsConfiguration().withAzureResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") + .withConnector(new RfcConnector().withAbapServerHost("1.1.1.1") + .withSystemNumber("001") + .withSystemId("A4H") + .withClient("001") + .withAuthenticationType(SapAuthenticationType.USERNAME_PASSWORD)) + .withLogs(Arrays.asList( + new Log().withType(LogType.ABAP_AUDIT_LOG) + .withIngestionType(IngestionType.INCREMENTAL) + .withStatus(LogStatusType.ENABLED) + .withScheduleInterval(60) + .withBulkSize(100) + .withFilters(Arrays.asList("filter1", "filter2")), + new Log().withType(LogType.USR01) + .withIngestionType(IngestionType.INCREMENTAL) + .withStatus(LogStatusType.ENABLED) + .withScheduleInterval(60) + .withBulkSize(100) + .withFilters(Arrays.asList("filter1", "filter2"))))) + .withDisplayName("A4H_System") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withStatus(SystemStatusType.RUNNING) + .create(); + } +} +``` + +### Systems_Delete -/** Samples for IpGeodata Get. */ -public final class IpGeodataGetSamples { +```java +/** + * Samples for Systems Delete. + */ +public final class SystemsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/enrichment/GetGeodataByIp.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_Delete.json */ /** - * Sample code: Get geodata for a single IP address. - * + * Sample code: Systems_Delete. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getGeodataForASingleIPAddress( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.ipGeodatas().getWithResponse("myRg", "1.2.3.4", Context.NONE); + public static void systemsDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .deleteWithResponse("myRg", "myWorkspace", "3123432b-0b60-4af3-8720-77f01a25d34a", + "3d69632b-0b60-4af3-8720-77f01a25d34a", com.azure.core.util.Context.NONE); } } ``` -### Metadata_Create +### Systems_Get ```java -import com.azure.resourcemanager.securityinsights.models.Kind; -import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; -import com.azure.resourcemanager.securityinsights.models.MetadataCategories; -import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; -import com.azure.resourcemanager.securityinsights.models.MetadataSource; -import com.azure.resourcemanager.securityinsights.models.MetadataSupport; -import com.azure.resourcemanager.securityinsights.models.Operator; -import com.azure.resourcemanager.securityinsights.models.SourceKind; -import com.azure.resourcemanager.securityinsights.models.SupportTier; -import java.time.LocalDate; -import java.util.Arrays; +/** + * Samples for Systems Get. + */ +public final class SystemsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_Get.json + */ + /** + * Sample code: Systems_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void systemsGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .getWithResponse("myRg", "myWorkspace", "3123432b-0b60-4af3-8720-77f01a25d34a", + "3d69632b-0b60-4af3-8720-77f01a25d34a", com.azure.core.util.Context.NONE); + } +} +``` -/** Samples for Metadata Create. */ -public final class MetadataCreateSamples { +### Systems_List + +```java +/** + * Samples for Systems List. + */ +public final class SystemsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/PutMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_List.json */ /** - * Sample code: Create/update full metadata. - * + * Sample code: Systems_List. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createUpdateFullMetadata( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .metadatas() - .define("metadataName") - .withExistingWorkspace("myRg", "myWorkspace") - .withContentId("c00ee137-7475-47c8-9cce-ec6f0f1bedd0") - .withParentId( - "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName") - .withVersion("1.0.0.0") - .withKind(Kind.ANALYTICS_RULE) - .withSource( - new MetadataSource() - .withKind(SourceKind.SOLUTION) - .withName("Contoso Solution 1.0") - .withSourceId("b688a130-76f4-4a07-bf57-762222a3cadf")) - .withAuthor(new MetadataAuthor().withName("User Name").withEmail("email@microsoft.com")) - .withSupport( - new MetadataSupport() - .withTier(SupportTier.PARTNER) - .withName("Microsoft") - .withEmail("support@microsoft.com") - .withLink("https://support.microsoft.com/")) - .withDependencies( - new MetadataDependencies() - .withOperator(Operator.AND) - .withCriteria( - Arrays - .asList( - new MetadataDependencies() - .withOperator(Operator.OR) - .withCriteria( - Arrays - .asList( - new MetadataDependencies() - .withContentId("045d06d0-ee72-4794-aba4-cf5646e4c756") - .withKind(Kind.DATA_CONNECTOR) - .withName("Microsoft Defender for Endpoint"), - new MetadataDependencies() - .withContentId("dbfcb2cc-d782-40ef-8d94-fe7af58a6f2d") - .withKind(Kind.DATA_CONNECTOR), - new MetadataDependencies() - .withContentId("de4dca9b-eb37-47d6-a56f-b8b06b261593") - .withKind(Kind.DATA_CONNECTOR) - .withVersion("2.0"))), - new MetadataDependencies() - .withContentId("31ee11cc-9989-4de8-b176-5e0ef5c4dbab") - .withKind(Kind.PLAYBOOK) - .withVersion("1.0"), - new MetadataDependencies() - .withContentId("21ba424a-9438-4444-953a-7059539a7a1b") - .withKind(Kind.PARSER)))) - .withCategories( - new MetadataCategories() - .withDomains(Arrays.asList("Application", "Security – Insider Threat")) - .withVerticals(Arrays.asList("Healthcare"))) - .withProviders(Arrays.asList("Amazon", "Microsoft")) - .withFirstPublishDate(LocalDate.parse("2021-05-18")) - .withLastPublishDate(LocalDate.parse("2021-05-18")) - .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(); + public static void systemsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .list("myRg", "myWorkspace", "3123432b-0b60-4af3-8720-77f01a25d34a", null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### Systems_ListActions + +```java +/** + * Samples for Systems ListActions. + */ +public final class SystemsListActionsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/actions/ListActions.json + */ + /** + * Sample code: ListActions. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void listActions(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .listActions("myRg", "myWorkspace", "247b377a-7137-4b3c-bf15-df1d3260ef1b", + "3d69632b-0b60-4af3-8720-77f01a25d34a", null, null, com.azure.core.util.Context.NONE); } +} +``` +### Systems_ReportActionStatus + +```java +/** + * Samples for Systems ReportActionStatus. + */ +public final class SystemsReportActionStatusSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/PutMetadataMinimal.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/actions/ReportActionStatus.json */ /** - * Sample code: Create/update minimal metadata. - * + * Sample code: ReportActionStatus. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createUpdateMinimalMetadata( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .metadatas() - .define("metadataName") - .withExistingWorkspace("myRg", "myWorkspace") - .withContentId("c00ee137-7475-47c8-9cce-ec6f0f1bedd0") - .withParentId( - "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName") - .withKind(Kind.ANALYTICS_RULE) - .create(); + public static void reportActionStatus(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .reportActionStatusWithResponse("myRg", "myWorkspace", "247b377a-7137-4b3c-bf15-df1d3260ef1b", + "3d69632b-0b60-4af3-8720-77f01a25d34a", null, com.azure.core.util.Context.NONE); } } ``` -### Metadata_Delete +### Systems_UndoAction ```java -import com.azure.core.util.Context; - -/** Samples for Metadata Delete. */ -public final class MetadataDeleteSamples { +/** + * Samples for Systems UndoAction. + */ +public final class SystemsUndoActionSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/DeleteMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/actions/UndoAction.json */ /** - * Sample code: Delete metadata. - * + * Sample code: UndoAction. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.metadatas().deleteWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE); + public static void undoAction(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .undoActionWithResponse("myRg", "myWorkspace", "247b377a-7137-4b3c-bf15-df1d3260ef1b", + "3d69632b-0b60-4af3-8720-77f01a25d34a", null, com.azure.core.util.Context.NONE); } } ``` -### Metadata_Get +### ThreatIntelligence_Count ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.TiType; -/** Samples for Metadata Get. */ -public final class MetadataGetSamples { +/** + * Samples for ThreatIntelligence Count. + */ +public final class ThreatIntelligenceCountSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/GetMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/PostThreatIntelligenceCount.json */ /** - * Sample code: Get single metadata by name. - * + * Sample code: Get TI object count. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getSingleMetadataByName( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.metadatas().getWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE); + public static void getTIObjectCount(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligences() + .countWithResponse("myRg", "myWorkspace", TiType.MAIN, new Query(), com.azure.core.util.Context.NONE); } } ``` -### Metadata_List +### ThreatIntelligence_Query ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.QueryAutoGenerated; +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 Metadata List. */ -public final class MetadataListSamples { +/** + * Samples for ThreatIntelligence Query. + */ +public final class ThreatIntelligenceQuerySamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/GetAllMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/PostThreatIntelligenceQuery.json */ /** - * Sample code: Get all metadata. - * + * Sample code: Get TI objects. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + public static void getTIObjects(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligences() + .query("myRg", "myWorkspace", TiType.MAIN, + new QueryAutoGenerated() + .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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/GetAllMetadataOData.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/AppendTagsThreatIntelligence.json */ /** - * Sample code: Get all metadata with OData filter/orderby/skip/top. - * + * Sample code: Append tags to a threat intelligence indicator. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllMetadataWithODataFilterOrderbySkipTop( + public static void appendTagsToAThreatIntelligenceIndicator( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + manager.threatIntelligenceIndicators() + .appendTagsWithResponse("myRg", "myWorkspace", "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", + new ThreatIntelligenceAppendTags().withThreatIntelligenceTags(Arrays.asList("tag1", "tag2")), + com.azure.core.util.Context.NONE); } } ``` -### Metadata_Update +### ThreatIntelligenceIndicator_Create ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; -import com.azure.resourcemanager.securityinsights.models.MetadataModel; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import java.util.Arrays; -/** Samples for Metadata Update. */ -public final class MetadataUpdateSamples { +/** + * Samples for ThreatIntelligenceIndicator Create. + */ +public final class ThreatIntelligenceIndicatorCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/PatchMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/UpdateThreatIntelligence.json */ /** - * Sample code: Update metadata. - * + * Sample code: Update a threat Intelligence indicator. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void updateMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - MetadataModel resource = - manager.metadatas().getWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE).getValue(); - resource - .update() - .withAuthor(new MetadataAuthor().withName("User Name").withEmail("email@microsoft.com")) - .apply(); + 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); } } ``` -### OfficeConsents_Delete +### ThreatIntelligenceIndicator_CreateIndicator ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import java.util.Arrays; -/** Samples for OfficeConsents Delete. */ -public final class OfficeConsentsDeleteSamples { +/** + * Samples for ThreatIntelligenceIndicator CreateIndicator. + */ +public final class ThreatIntelligenceIndicatorCreateIndicatorSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/officeConsents/DeleteOfficeConsents.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/CreateThreatIntelligence.json */ /** - * Sample code: Delete an office consent. - * + * Sample code: Create a new Threat Intelligence. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAnOfficeConsent( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .officeConsents() - .deleteWithResponse("myRg", "myWorkspace", "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", Context.NONE); + 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); } } ``` -### OfficeConsents_Get +### ThreatIntelligenceIndicator_Delete ```java -import com.azure.core.util.Context; - -/** Samples for OfficeConsents Get. */ -public final class OfficeConsentsGetSamples { +/** + * Samples for ThreatIntelligenceIndicator Delete. + */ +public final class ThreatIntelligenceIndicatorDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/officeConsents/GetOfficeConsentsById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/DeleteThreatIntelligence.json */ /** - * Sample code: Get an office consent. - * + * Sample code: Delete a threat intelligence indicator. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnOfficeConsent(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .officeConsents() - .getWithResponse("myRg", "myWorkspace", "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", Context.NONE); + 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); } } ``` -### OfficeConsents_List +### ThreatIntelligenceIndicator_Get ```java -import com.azure.core.util.Context; - -/** Samples for OfficeConsents List. */ -public final class OfficeConsentsListSamples { +/** + * Samples for ThreatIntelligenceIndicator Get. + */ +public final class ThreatIntelligenceIndicatorGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/officeConsents/GetOfficeConsents.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json */ /** - * Sample code: Get all office consents. - * + * Sample code: View a threat intelligence indicator by name. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllOfficeConsents( + public static void viewAThreatIntelligenceIndicatorByName( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.officeConsents().list("myRg", "myWorkspace", Context.NONE); + manager.threatIntelligenceIndicators() + .getWithResponse("myRg", "myWorkspace", "e16ef847-962e-d7b6-9c8b-a33e4bd30e47", + com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### ThreatIntelligenceIndicator_QueryIndicators ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingOrder; +import java.util.Arrays; -/** Samples for Operations List. */ -public final class OperationsListSamples { +/** + * Samples for ThreatIntelligenceIndicator QueryIndicators. + */ +public final class ThreatIntelligenceIndicatorQueryIndicatorsSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/operations/ListOperations.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/QueryThreatIntelligence.json */ /** - * Sample code: Get all operations. - * + * Sample code: Query threat intelligence indicators as per filtering criteria. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllOperations(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.operations().list(Context.NONE); + 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); } } ``` -### ProductSettings_Delete +### ThreatIntelligenceIndicator_ReplaceTags ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import java.util.Arrays; -/** Samples for ProductSettings Delete. */ -public final class ProductSettingsDeleteSamples { +/** + * Samples for ThreatIntelligenceIndicator ReplaceTags. + */ +public final class ThreatIntelligenceIndicatorReplaceTagsSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/settings/DeleteEyesOnSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/ReplaceTagsThreatIntelligence.json */ /** - * Sample code: Delete EyesOn settings. - * + * Sample code: Replace tags to a Threat Intelligence. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteEyesOnSettings( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.productSettings().deleteWithResponse("myRg", "myWorkspace", "EyesOn", Context.NONE); + 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); } } ``` -### ProductSettings_Get +### ThreatIntelligenceIndicatorMetrics_List ```java -import com.azure.core.util.Context; - -/** Samples for ProductSettings Get. */ -public final class ProductSettingsGetSamples { +/** + * Samples for ThreatIntelligenceIndicatorMetrics List. + */ +public final class ThreatIntelligenceIndicatorMetricsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/settings/GetEyesOnSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/CollectThreatIntelligenceMetrics.json */ /** - * Sample code: Get EyesOn settings. - * + * Sample code: Get threat intelligence indicators metrics. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getEyesOnSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.productSettings().getWithResponse("myRg", "myWorkspace", "EyesOn", Context.NONE); + public static void getThreatIntelligenceIndicatorsMetrics( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligenceIndicatorMetrics() + .listWithResponse("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` -### ProductSettings_List +### ThreatIntelligenceIndicatorsOperation_List ```java -import com.azure.core.util.Context; - -/** Samples for ProductSettings List. */ -public final class ProductSettingsListSamples { +/** + * Samples for ThreatIntelligenceIndicatorsOperation List. + */ +public final class ThreatIntelligenceIndicatorsOperationListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/settings/GetAllSettings.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/GetThreatIntelligence.json */ /** - * Sample code: Get all settings. - * + * Sample code: Get all threat intelligence indicators. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.productSettings().listWithResponse("myRg", "myWorkspace", 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); } } ``` -### ProductSettings_Update +### TriggeredAnalyticsRuleRunOperation_Get ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.EyesOn; - -/** Samples for ProductSettings Update. */ -public final class ProductSettingsUpdateSamples { +/** + * Samples for TriggeredAnalyticsRuleRunOperation Get. + */ +public final class TriggeredAnalyticsRuleRunOperationGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/settings/UpdateEyesOnSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/triggeredAnalyticsRuleRuns/triggeredAnalyticsRuleRun_Get.json */ /** - * Sample code: Update EyesOn settings. - * + * Sample code: triggeredAnalyticsRuleRun_Get. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void updateEyesOnSettings( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .productSettings() - .updateWithResponse( - "myRg", - "myWorkspace", - "EyesOn", - new EyesOn().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\""), - Context.NONE); + 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); } } ``` -### SecurityMLAnalyticsSettings_CreateOrUpdate +### Update_Recommendation ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.securityinsights.models.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 com.azure.resourcemanager.securityinsights.models.RecommendationPatch; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatchProperties; +import com.azure.resourcemanager.securityinsights.models.State; import java.util.UUID; -/** Samples for SecurityMLAnalyticsSettings CreateOrUpdate. */ -public final class SecurityMLAnalyticsSettingsCreateOrUpdateSamples { +/** + * Samples for Update Recommendation. + */ +public final class UpdateRecommendationSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/securityMLAnalyticsSettings/CreateAnomalySecurityMLAnalyticsSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/recommendations/PatchRecommendation.json */ /** - * Sample code: Creates or updates a Anomaly Security ML Analytics Settings. - * + * Sample code: Creates a recommendation. + * * @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")), - Context.NONE); + public static void + createsARecommendation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.updates() + .recommendationWithResponse("myRg", "myWorkspace", UUID.fromString("6d4b54eb-8684-4aa3-a156-3aa37b8014bc"), + new RecommendationPatch().withProperties(new RecommendationPatchProperties().withState(State.ACTIVE)), + com.azure.core.util.Context.NONE); } } ``` -### SecurityMLAnalyticsSettings_Delete +### WatchlistItems_CreateOrUpdate ```java -import com.azure.core.util.Context; +import java.util.HashMap; +import java.util.Map; -/** Samples for SecurityMLAnalyticsSettings Delete. */ -public final class SecurityMLAnalyticsSettingsDeleteSamples { +/** + * Samples for WatchlistItems CreateOrUpdate. + */ +public final class WatchlistItemsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/CreateWatchlistItem.json */ /** - * Sample code: Delete a Security ML Analytics Settings. - * + * Sample code: Creates or updates a watchlist item. + * * @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", Context.NONE); + public static void + createsOrUpdatesAWatchlistItem(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems() + .define("82ba292c-dc97-4dfc-969d-d4dd9e666842") + .withExistingWatchlist("myRg", "myWorkspace", "highValueAsset") + .withEtag("0300bf09-0000-0000-0000-5c37296e0000") + .withItemsKeyValue( + mapOf("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")) + .create(); + } + + // 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; } } ``` -### SecurityMLAnalyticsSettings_Get +### WatchlistItems_Delete ```java -import com.azure.core.util.Context; - -/** Samples for SecurityMLAnalyticsSettings Get. */ -public final class SecurityMLAnalyticsSettingsGetSamples { +/** + * Samples for WatchlistItems Delete. + */ +public final class WatchlistItemsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/DeleteWatchlistItem.json */ /** - * Sample code: Get a Anomaly Security ML Analytics Settings. - * + * Sample code: Delete a watchlist Item. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAAnomalySecurityMLAnalyticsSettings( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .securityMLAnalyticsSettings() - .getWithResponse("myRg", "myWorkspace", "myFirstAnomalySettings", Context.NONE); + public static void + deleteAWatchlistItem(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems() + .deleteWithResponse("myRg", "myWorkspace", "highValueAsset", "4008512e-1d30-48b2-9ee2-d3612ed9d3ea", + com.azure.core.util.Context.NONE); } } ``` -### SecurityMLAnalyticsSettings_List +### WatchlistItems_Get ```java -import com.azure.core.util.Context; - -/** Samples for SecurityMLAnalyticsSettings List. */ -public final class SecurityMLAnalyticsSettingsListSamples { +/** + * Samples for WatchlistItems Get. + */ +public final class WatchlistItemsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/GetWatchlistItemById.json */ /** - * Sample code: Get all Security ML Analytics Settings. - * + * Sample code: Get a watchlist item. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllSecurityMLAnalyticsSettings( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.securityMLAnalyticsSettings().list("myRg", "myWorkspace", Context.NONE); + 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); } } ``` -### SentinelOnboardingStates_Create +### WatchlistItems_List ```java -/** Samples for SentinelOnboardingStates Create. */ -public final class SentinelOnboardingStatesCreateSamples { +/** + * Samples for WatchlistItems List. + */ +public final class WatchlistItemsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/onboardingStates/CreateSentinelOnboardingState.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/GetWatchlistItems.json */ /** - * Sample code: Create Sentinel onboarding state. - * + * Sample code: Get all watchlist Items. + * * @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 + getAllWatchlistItems(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems().list("myRg", "myWorkspace", "highValueAsset", null, com.azure.core.util.Context.NONE); } } ``` -### SentinelOnboardingStates_Delete +### Watchlists_CreateOrUpdate ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.SourceType; -/** Samples for SentinelOnboardingStates Delete. */ -public final class SentinelOnboardingStatesDeleteSamples { +/** + * Samples for Watchlists CreateOrUpdate. + */ +public final class WatchlistsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/onboardingStates/DeleteSentinelOnboardingState.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json */ /** - * Sample code: Delete Sentinel onboarding state. - * + * Sample code: Creates or updates a watchlist and bulk creates watchlist items. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteSentinelOnboardingState( + public static void createsOrUpdatesAWatchlistAndBulkCreatesWatchlistItems( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sentinelOnboardingStates().deleteWithResponse("myRg", "myWorkspace", "default", Context.NONE); + 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_FILE) + .withDescription("Watchlist from CSV content") + .withNumberOfLinesToSkip(1) + .withRawContent("This line will be skipped\nheader1,header2\nvalue1,value2") + .withItemsSearchKey("header1") + .withContentType("text/csv") + .create(); } -} -``` -### SentinelOnboardingStates_Get - -```java -import com.azure.core.util.Context; - -/** Samples for SentinelOnboardingStates Get. */ -public final class SentinelOnboardingStatesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/onboardingStates/GetSentinelOnboardingState.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/CreateWatchlist.json */ /** - * Sample code: Get Sentinel onboarding state. - * + * Sample code: Creates or updates a watchlist. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getSentinelOnboardingState( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sentinelOnboardingStates().getWithResponse("myRg", "myWorkspace", "default", Context.NONE); + public static void + createsOrUpdatesAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists() + .define("highValueAsset") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDisplayName("High Value Assets Watchlist") + .withProvider("Microsoft") + .withSource("watchlist.csv") + .withSourceType(SourceType.LOCAL_FILE) + .withDescription("Watchlist from CSV content") + .withItemsSearchKey("header1") + .create(); } } ``` -### SentinelOnboardingStates_List +### Watchlists_Delete ```java -import com.azure.core.util.Context; - -/** Samples for SentinelOnboardingStates List. */ -public final class SentinelOnboardingStatesListSamples { +/** + * Samples for Watchlists Delete. + */ +public final class WatchlistsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/onboardingStates/GetAllSentinelOnboardingStates.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/DeleteWatchlist.json */ /** - * Sample code: Get all Sentinel onboarding states. - * + * Sample code: Delete a watchlist. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllSentinelOnboardingStates( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sentinelOnboardingStates().listWithResponse("myRg", "myWorkspace", Context.NONE); + public static void deleteAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists() + .deleteWithResponse("myRg", "myWorkspace", "highValueAsset", com.azure.core.util.Context.NONE); } } ``` -### SourceControl_ListRepositories +### Watchlists_Get ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.RepoType; - -/** Samples for SourceControl ListRepositories. */ -public final class SourceControlListRepositoriesSamples { +/** + * Samples for Watchlists Get. + */ +public final class WatchlistsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/repositories/GetRepositories.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/GetWatchlistByAlias.json */ /** - * Sample code: Get repository list. - * + * Sample code: Get a watchlist. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getRepositoryList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sourceControls().listRepositories("myRg", "myWorkspace", RepoType.GITHUB, Context.NONE); + public static void getAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().getWithResponse("myRg", "myWorkspace", "highValueAsset", com.azure.core.util.Context.NONE); } } ``` -### SourceControlsOperation_Create +### Watchlists_List ```java -import com.azure.resourcemanager.securityinsights.models.ContentPathMap; -import com.azure.resourcemanager.securityinsights.models.ContentType; -import com.azure.resourcemanager.securityinsights.models.RepoType; -import com.azure.resourcemanager.securityinsights.models.Repository; -import java.util.Arrays; - -/** Samples for SourceControlsOperation Create. */ -public final class SourceControlsOperationCreateSamples { +/** + * Samples for Watchlists List. + */ +public final class WatchlistsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/sourcecontrols/CreateSourceControl.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/GetWatchlists.json */ /** - * Sample code: Creates a source control. - * + * Sample code: Get all watchlists. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsASourceControl( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .sourceControlsOperations() - .define("789e0c1f-4a3d-43ad-809c-e713b677b04a") - .withExistingWorkspace("myRg", "myWorkspace") - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") - .withDisplayName("My Source Control") - .withDescription("This is a source control") - .withRepoType(RepoType.GITHUB) - .withContentTypes(Arrays.asList(ContentType.fromString("AnalyticRules"), ContentType.WORKBOOK)) - .withRepository( - new Repository() - .withUrl("https://github.com/user/repo") - .withBranch("master") - .withDisplayUrl("https://github.com/user/repo") - .withPathMapping( - Arrays - .asList( - new ContentPathMap() - .withContentType(ContentType.fromString("AnalyticRules")) - .withPath("path/to/rules"), - new ContentPathMap() - .withContentType(ContentType.WORKBOOK) - .withPath("path/to/workbooks")))) - .create(); + public static void getAllWatchlists(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().list("myRg", "myWorkspace", null, com.azure.core.util.Context.NONE); } } ``` -### SourceControlsOperation_Delete +### WorkspaceManagerAssignmentJobs_Create ```java -import com.azure.core.util.Context; - -/** Samples for SourceControlsOperation Delete. */ -public final class SourceControlsOperationDeleteSamples { +/** + * Samples for WorkspaceManagerAssignmentJobs Create. + */ +public final class WorkspaceManagerAssignmentJobsCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/sourcecontrols/DeleteSourceControl.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/CreateJob.json */ /** - * Sample code: Delete a source control. - * + * Sample code: Creates a job for the specified workspace manager assignment. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteASourceControl( + public static void createsAJobForTheSpecifiedWorkspaceManagerAssignment( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .sourceControlsOperations() - .deleteWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", Context.NONE); + manager.workspaceManagerAssignmentJobs() + .createWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", + com.azure.core.util.Context.NONE); } } ``` -### SourceControlsOperation_Get +### WorkspaceManagerAssignmentJobs_Delete ```java -import com.azure.core.util.Context; - -/** Samples for SourceControlsOperation Get. */ -public final class SourceControlsOperationGetSamples { +/** + * Samples for WorkspaceManagerAssignmentJobs Delete. + */ +public final class WorkspaceManagerAssignmentJobsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/sourcecontrols/GetSourceControlById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/DeleteJob.json */ /** - * Sample code: Get a source control. - * + * Sample code: Delete a workspace manager job. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .sourceControlsOperations() - .getWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", Context.NONE); + 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); } } ``` -### SourceControlsOperation_List +### WorkspaceManagerAssignmentJobs_Get ```java -import com.azure.core.util.Context; - -/** Samples for SourceControlsOperation List. */ -public final class SourceControlsOperationListSamples { +/** + * Samples for WorkspaceManagerAssignmentJobs Get. + */ +public final class WorkspaceManagerAssignmentJobsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/sourcecontrols/GetSourceControls.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/GetJob.json */ /** - * Sample code: Get all source controls. - * + * Sample code: Get a workspace manager job. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllSourceControls( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sourceControlsOperations().list("myRg", "myWorkspace", Context.NONE); + 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); } } ``` -### ThreatIntelligenceIndicator_AppendTags +### WorkspaceManagerAssignmentJobs_List ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; -import java.util.Arrays; - -/** Samples for ThreatIntelligenceIndicator AppendTags. */ -public final class ThreatIntelligenceIndicatorAppendTagsSamples { +/** + * Samples for WorkspaceManagerAssignmentJobs List. + */ +public final class WorkspaceManagerAssignmentJobsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/AppendTagsThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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")), - Context.NONE); + 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.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; import java.util.Arrays; -/** Samples for ThreatIntelligenceIndicator Create. */ -public final class ThreatIntelligenceIndicatorCreateSamples { +/** + * Samples for WorkspaceManagerAssignments CreateOrUpdate. + */ +public final class WorkspaceManagerAssignmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/UpdateThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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( + public static void createsOrUpdatesAWorkspaceManagerAssignment( 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(""), - Context.NONE); + 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.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; -import java.util.Arrays; - -/** Samples for ThreatIntelligenceIndicator CreateIndicator. */ -public final class ThreatIntelligenceIndicatorCreateIndicatorSamples { +/** + * Samples for WorkspaceManagerAssignments Delete. + */ +public final class WorkspaceManagerAssignmentsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/CreateThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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("2021-09-15T17:44:00.114052Z") - .withValidUntil("") - .withModified(""), - Context.NONE); + 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); } } ``` -### ThreatIntelligenceIndicator_Delete +### WorkspaceManagerAssignments_Get ```java -import com.azure.core.util.Context; - -/** Samples for ThreatIntelligenceIndicator Delete. */ -public final class ThreatIntelligenceIndicatorDeleteSamples { +/** + * Samples for WorkspaceManagerAssignments Get. + */ +public final class WorkspaceManagerAssignmentsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/DeleteThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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); } } ``` -### ThreatIntelligenceIndicator_Get +### WorkspaceManagerAssignments_List ```java -import com.azure.core.util.Context; - -/** Samples for ThreatIntelligenceIndicator Get. */ -public final class ThreatIntelligenceIndicatorGetSamples { +/** + * Samples for WorkspaceManagerAssignments List. + */ +public final class WorkspaceManagerAssignmentsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + manager.workspaceManagerAssignments() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); } } ``` -### ThreatIntelligenceIndicator_QueryIndicators +### WorkspaceManagerConfigurations_CreateOrUpdate ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteria; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteriaEnum; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.models.Mode; -/** Samples for ThreatIntelligenceIndicator QueryIndicators. */ -public final class ThreatIntelligenceIndicatorQueryIndicatorsSamples { +/** + * Samples for WorkspaceManagerConfigurations CreateOrUpdate. + */ +public final class WorkspaceManagerConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/QueryThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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("2021-04-05T17:44:00.114052Z") - .withMaxValidUntil("2021-04-25T17:44:00.114052Z") - .withSortBy( - Arrays - .asList( - new ThreatIntelligenceSortingCriteria() - .withItemKey("lastUpdatedTimeUtc") - .withSortOrder(ThreatIntelligenceSortingCriteriaEnum.DESCENDING))) - .withSources(Arrays.asList("Azure Sentinel")), - Context.NONE); + manager.workspaceManagerConfigurations() + .define("default") + .withExistingWorkspace("myRg", "myWorkspace") + .withMode(Mode.ENABLED) + .create(); } } ``` -### ThreatIntelligenceIndicator_ReplaceTags +### WorkspaceManagerConfigurations_Delete ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; -import java.util.Arrays; - -/** Samples for ThreatIntelligenceIndicator ReplaceTags. */ -public final class ThreatIntelligenceIndicatorReplaceTagsSamples { +/** + * Samples for WorkspaceManagerConfigurations Delete. + */ +public final class WorkspaceManagerConfigurationsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/ReplaceTagsThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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( + public static void deleteAWorkspaceManagerConfiguration( 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")), - Context.NONE); + manager.workspaceManagerConfigurations() + .deleteWithResponse("myRg", "myWorkspace", "default", com.azure.core.util.Context.NONE); } } ``` -### ThreatIntelligenceIndicatorMetrics_List +### WorkspaceManagerConfigurations_Get ```java -import com.azure.core.util.Context; - -/** Samples for ThreatIntelligenceIndicatorMetrics List. */ -public final class ThreatIntelligenceIndicatorMetricsListSamples { +/** + * Samples for WorkspaceManagerConfigurations Get. + */ +public final class WorkspaceManagerConfigurationsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/CollectThreatIntelligenceMetrics.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", 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 -import com.azure.core.util.Context; - -/** Samples for ThreatIntelligenceIndicatorsOperation List. */ -public final class ThreatIntelligenceIndicatorsOperationListSamples { +/** + * Samples for WorkspaceManagerConfigurations List. + */ +public final class WorkspaceManagerConfigurationsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/GetThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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( + public static void getAllWorkspaceManagerConfigurationsForASentinelWorkspace( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .threatIntelligenceIndicatorsOperations() - .list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + manager.workspaceManagerConfigurations() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); } } ``` -### WatchlistItems_CreateOrUpdate +### WorkspaceManagerGroups_CreateOrUpdate ```java -import java.util.HashMap; -import java.util.Map; +import java.util.Arrays; -/** Samples for WatchlistItems CreateOrUpdate. */ -public final class WatchlistItemsCreateOrUpdateSamples { +/** + * Samples for WorkspaceManagerGroups CreateOrUpdate. + */ +public final class WorkspaceManagerGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/CreateWatchlistItem.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerGroups/CreateOrUpdateWorkspaceManagerGroup.json */ /** - * Sample code: Creates or updates a watchlist item. - * + * Sample code: Creates or updates a workspace manager group. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAWatchlistItem( + public static void createsOrUpdatesAWorkspaceManagerGroup( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .watchlistItems() - .define("82ba292c-dc97-4dfc-969d-d4dd9e666842") - .withExistingWatchlist("myRg", "myWorkspace", "highValueAsset") - .withEtag("0300bf09-0000-0000-0000-5c37296e0000") - .withItemsKeyValue( - mapOf( - "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")) + 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(); } - - @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; - } } ``` -### WatchlistItems_Delete +### WorkspaceManagerGroups_Delete ```java -import com.azure.core.util.Context; - -/** Samples for WatchlistItems Delete. */ -public final class WatchlistItemsDeleteSamples { +/** + * Samples for WorkspaceManagerGroups Delete. + */ +public final class WorkspaceManagerGroupsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/DeleteWatchlistItem.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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); } } ``` -### WatchlistItems_Get +### WorkspaceManagerGroups_Get ```java -import com.azure.core.util.Context; - -/** Samples for WatchlistItems Get. */ -public final class WatchlistItemsGetSamples { +/** + * Samples for WorkspaceManagerGroups Get. + */ +public final class WorkspaceManagerGroupsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/GetWatchlistItemById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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 -import com.azure.core.util.Context; - -/** Samples for WatchlistItems List. */ -public final class WatchlistItemsListSamples { +/** + * Samples for WorkspaceManagerGroups List. + */ +public final class WorkspaceManagerGroupsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/GetWatchlistItems.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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( + public static void getAllWorkspaceManagerGroupsInTheSentinelWorkspaceManager( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlistItems().list("myRg", "myWorkspace", "highValueAsset", null, Context.NONE); + 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.SourceType; - -/** Samples for Watchlists CreateOrUpdate. */ -public final class WatchlistsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json - */ - /** - * Sample code: Creates or updates a watchlist and bulk creates watchlist items. - * - * @param manager Entry point to SecurityInsightsManager. - */ - public static void createsOrUpdatesAWatchlistAndBulkCreatesWatchlistItems( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .watchlists() - .define("highValueAsset") - .withExistingWorkspace("myRg", "myWorkspace") - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") - .withDisplayName("High Value Assets Watchlist") - .withProvider("Microsoft") - .withSource("watchlist.csv") - .withSourceType(SourceType.LOCAL_FILE) - .withDescription("Watchlist from CSV content") - .withNumberOfLinesToSkip(1) - .withRawContent("This line will be skipped\nheader1,header2\nvalue1,value2") - .withItemsSearchKey("header1") - .withContentType("text/csv") - .create(); - } - +/** + * Samples for WorkspaceManagerMembers CreateOrUpdate. + */ +public final class WorkspaceManagerMembersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/CreateWatchlist.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerMembers/CreateOrUpdateWorkspaceManagerMember.json */ /** - * Sample code: Creates or updates a watchlist. - * + * Sample code: Create or Update a workspace manager member. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAWatchlist( + 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("watchlist.csv") - .withSourceType(SourceType.LOCAL_FILE) - .withDescription("Watchlist from CSV content") - .withItemsSearchKey("header1") + .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 -import com.azure.core.util.Context; - -/** Samples for Watchlists Delete. */ -public final class WatchlistsDeleteSamples { +/** + * Samples for WorkspaceManagerMembers Delete. + */ +public final class WorkspaceManagerMembersDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/DeleteWatchlist.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", 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 -import com.azure.core.util.Context; - -/** Samples for Watchlists Get. */ -public final class WatchlistsGetSamples { +/** + * Samples for WorkspaceManagerMembers Get. + */ +public final class WorkspaceManagerMembersGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/GetWatchlistByAlias.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", 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 -import com.azure.core.util.Context; - -/** Samples for Watchlists List. */ -public final class WatchlistsListSamples { +/** + * Samples for WorkspaceManagerMembers List. + */ +public final class WorkspaceManagerMembersListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/GetWatchlists.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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, 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 4c22f3639bf8..307e5653d0f9 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for SecurityInsights Management - This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-09. + This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2024-04. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + 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 6868ca4ea727..437d4eedbe32 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 @@ -11,8 +11,8 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -25,15 +25,23 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.securityinsights.fluent.SecurityInsights; import com.azure.resourcemanager.securityinsights.implementation.ActionsImpl; -import com.azure.resourcemanager.securityinsights.implementation.AlertRuleTemplatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.AlertRuleOperationsImpl; import com.azure.resourcemanager.securityinsights.implementation.AlertRulesImpl; +import com.azure.resourcemanager.securityinsights.implementation.AlertRuleTemplatesImpl; 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.BusinessApplicationAgentOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.BusinessApplicationAgentsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ContentPackageOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ContentPackagesImpl; +import com.azure.resourcemanager.securityinsights.implementation.ContentTemplateOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ContentTemplatesImpl; +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.DomainWhoisImpl; import com.azure.resourcemanager.securityinsights.implementation.EntitiesGetTimelinesImpl; import com.azure.resourcemanager.securityinsights.implementation.EntitiesImpl; import com.azure.resourcemanager.securityinsights.implementation.EntitiesRelationsImpl; @@ -41,34 +49,63 @@ 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.GetsImpl; +import com.azure.resourcemanager.securityinsights.implementation.GetTriggeredAnalyticsRuleRunsImpl; +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.IncidentsImpl; -import com.azure.resourcemanager.securityinsights.implementation.IpGeodatasImpl; +import com.azure.resourcemanager.securityinsights.implementation.IncidentTasksImpl; 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.ProductPackageOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ProductPackagesImpl; import com.azure.resourcemanager.securityinsights.implementation.ProductSettingsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ProductTemplateOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ProductTemplatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.ReevaluatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.securityinsights.implementation.SecurityInsightsBuilder; import com.azure.resourcemanager.securityinsights.implementation.SecurityMLAnalyticsSettingsImpl; import com.azure.resourcemanager.securityinsights.implementation.SentinelOnboardingStatesImpl; import com.azure.resourcemanager.securityinsights.implementation.SourceControlsImpl; import com.azure.resourcemanager.securityinsights.implementation.SourceControlsOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.SystemsImpl; 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.AlertRuleTemplates; +import com.azure.resourcemanager.securityinsights.models.AlertRuleOperations; import com.azure.resourcemanager.securityinsights.models.AlertRules; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplates; 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.BusinessApplicationAgentOperations; +import com.azure.resourcemanager.securityinsights.models.BusinessApplicationAgents; +import com.azure.resourcemanager.securityinsights.models.ContentPackageOperations; +import com.azure.resourcemanager.securityinsights.models.ContentPackages; +import com.azure.resourcemanager.securityinsights.models.ContentTemplateOperations; +import com.azure.resourcemanager.securityinsights.models.ContentTemplates; +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.DomainWhois; import com.azure.resourcemanager.securityinsights.models.Entities; import com.azure.resourcemanager.securityinsights.models.EntitiesGetTimelines; import com.azure.resourcemanager.securityinsights.models.EntitiesRelations; @@ -76,23 +113,44 @@ 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.Gets; +import com.azure.resourcemanager.securityinsights.models.GetTriggeredAnalyticsRuleRuns; +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.Incidents; -import com.azure.resourcemanager.securityinsights.models.IpGeodatas; +import com.azure.resourcemanager.securityinsights.models.IncidentTasks; 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.ProductPackageOperations; +import com.azure.resourcemanager.securityinsights.models.ProductPackages; import com.azure.resourcemanager.securityinsights.models.ProductSettings; +import com.azure.resourcemanager.securityinsights.models.ProductTemplateOperations; +import com.azure.resourcemanager.securityinsights.models.ProductTemplates; +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.SourceControls; import com.azure.resourcemanager.securityinsights.models.SourceControlsOperations; +import com.azure.resourcemanager.securityinsights.models.Systems; 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; @@ -101,8 +159,8 @@ import java.util.stream.Collectors; /** - * Entry point to SecurityInsightsManager. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource - * provider. + * Entry point to SecurityInsightsManager. + * API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. */ public final class SecurityInsightsManager { private AlertRules alertRules; @@ -113,19 +171,41 @@ public final class SecurityInsightsManager { private AutomationRules automationRules; + private Entities entities; + private Incidents incidents; + private BillingStatistics billingStatistics; + private Bookmarks bookmarks; private BookmarkRelations bookmarkRelations; private BookmarkOperations bookmarkOperations; - private IpGeodatas ipGeodatas; + private BusinessApplicationAgents businessApplicationAgents; - private DomainWhois domainWhois; + private BusinessApplicationAgentOperations businessApplicationAgentOperations; - private Entities entities; + private Systems systems; + + private ContentPackages contentPackages; + + private ContentPackageOperations contentPackageOperations; + + private ProductPackages productPackages; + + private ProductPackageOperations productPackageOperations; + + private ProductTemplates productTemplates; + + private ProductTemplateOperations productTemplateOperations; + + private ContentTemplates contentTemplates; + + private ContentTemplateOperations contentTemplateOperations; + + private ResourceProviders resourceProviders; private EntitiesGetTimelines entitiesGetTimelines; @@ -139,16 +219,32 @@ public final class SecurityInsightsManager { private FileImports fileImports; + private Hunts hunts; + + private HuntRelations huntRelations; + + private HuntComments huntComments; + private IncidentComments incidentComments; private IncidentRelations incidentRelations; + private IncidentTasks incidentTasks; + private Metadatas metadatas; private OfficeConsents officeConsents; private SentinelOnboardingStates sentinelOnboardingStates; + private GetRecommendations getRecommendations; + + private Gets gets; + + private Updates updates; + + private Reevaluates reevaluates; + private SecurityMLAnalyticsSettings securityMLAnalyticsSettings; private ProductSettings productSettings; @@ -163,10 +259,30 @@ public final class SecurityInsightsManager { private ThreatIntelligenceIndicatorMetrics threatIntelligenceIndicatorMetrics; + private ThreatIntelligences threatIntelligences; + + private TriggeredAnalyticsRuleRunOperations triggeredAnalyticsRuleRunOperations; + + private GetTriggeredAnalyticsRuleRuns getTriggeredAnalyticsRuleRuns; + + private AlertRuleOperations alertRuleOperations; + private Watchlists watchlists; private WatchlistItems watchlistItems; + private WorkspaceManagerAssignments workspaceManagerAssignments; + + private WorkspaceManagerAssignmentJobs workspaceManagerAssignmentJobs; + + private WorkspaceManagerConfigurations workspaceManagerConfigurations; + + private WorkspaceManagerGroups workspaceManagerGroups; + + private WorkspaceManagerMembers workspaceManagerMembers; + + private DataConnectorDefinitions dataConnectorDefinitions; + private DataConnectors dataConnectors; private DataConnectorsCheckRequirementsOperations dataConnectorsCheckRequirementsOperations; @@ -178,18 +294,16 @@ public final class SecurityInsightsManager { private SecurityInsightsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new SecurityInsightsBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new SecurityInsightsBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** * Creates an instance of SecurityInsights service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the SecurityInsights service API instance. @@ -202,7 +316,7 @@ public static SecurityInsightsManager authenticate(TokenCredential credential, A /** * Creates an instance of SecurityInsights 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. @@ -215,14 +329,16 @@ public static SecurityInsightsManager authenticate(HttpPipeline httpPipeline, Az /** * Gets a Configurable instance that can be used to create SecurityInsightsManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new SecurityInsightsManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -294,8 +410,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -312,8 +428,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -333,15 +449,13 @@ public SecurityInsightsManager authenticate(TokenCredential credential, AzurePro Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") + userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.securityinsights") .append("/") - .append("1.0.0-beta.4"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") + userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ") .append(Configuration.getGlobalConfiguration().get("os.name")) @@ -366,38 +480,28 @@ public SecurityInsightsManager authenticate(TokenCredential credential, AzurePro policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new SecurityInsightsManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of AlertRules. - * + * * @return Resource collection API of AlertRules. */ public AlertRules alertRules() { @@ -409,7 +513,7 @@ public AlertRules alertRules() { /** * Gets the resource collection API of Actions. It manages ActionResponse. - * + * * @return Resource collection API of Actions. */ public Actions actions() { @@ -421,7 +525,7 @@ public Actions actions() { /** * Gets the resource collection API of AlertRuleTemplates. - * + * * @return Resource collection API of AlertRuleTemplates. */ public AlertRuleTemplates alertRuleTemplates() { @@ -433,7 +537,7 @@ public AlertRuleTemplates alertRuleTemplates() { /** * Gets the resource collection API of AutomationRules. It manages AutomationRule. - * + * * @return Resource collection API of AutomationRules. */ public AutomationRules automationRules() { @@ -443,9 +547,21 @@ public AutomationRules automationRules() { return automationRules; } + /** + * 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 Incidents. It manages Incident. - * + * * @return Resource collection API of Incidents. */ public Incidents incidents() { @@ -455,9 +571,21 @@ public Incidents incidents() { return incidents; } + /** + * 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 Bookmarks. It manages Bookmark. - * + * * @return Resource collection API of Bookmarks. */ public Bookmarks bookmarks() { @@ -469,7 +597,7 @@ public Bookmarks bookmarks() { /** * Gets the resource collection API of BookmarkRelations. It manages Relation. - * + * * @return Resource collection API of BookmarkRelations. */ public BookmarkRelations bookmarkRelations() { @@ -481,7 +609,7 @@ public BookmarkRelations bookmarkRelations() { /** * Gets the resource collection API of BookmarkOperations. - * + * * @return Resource collection API of BookmarkOperations. */ public BookmarkOperations bookmarkOperations() { @@ -492,44 +620,158 @@ public BookmarkOperations bookmarkOperations() { } /** - * Gets the resource collection API of IpGeodatas. - * - * @return Resource collection API of IpGeodatas. + * Gets the resource collection API of BusinessApplicationAgents. It manages BusinessApplicationAgentResource. + * + * @return Resource collection API of BusinessApplicationAgents. */ - public IpGeodatas ipGeodatas() { - if (this.ipGeodatas == null) { - this.ipGeodatas = new IpGeodatasImpl(clientObject.getIpGeodatas(), this); + public BusinessApplicationAgents businessApplicationAgents() { + if (this.businessApplicationAgents == null) { + this.businessApplicationAgents + = new BusinessApplicationAgentsImpl(clientObject.getBusinessApplicationAgents(), this); } - return ipGeodatas; + return businessApplicationAgents; } /** - * Gets the resource collection API of DomainWhois. - * - * @return Resource collection API of DomainWhois. + * Gets the resource collection API of BusinessApplicationAgentOperations. + * + * @return Resource collection API of BusinessApplicationAgentOperations. */ - public DomainWhois domainWhois() { - if (this.domainWhois == null) { - this.domainWhois = new DomainWhoisImpl(clientObject.getDomainWhois(), this); + public BusinessApplicationAgentOperations businessApplicationAgentOperations() { + if (this.businessApplicationAgentOperations == null) { + this.businessApplicationAgentOperations = new BusinessApplicationAgentOperationsImpl( + clientObject.getBusinessApplicationAgentOperations(), this); } - return domainWhois; + return businessApplicationAgentOperations; } /** - * Gets the resource collection API of Entities. - * - * @return Resource collection API of Entities. + * Gets the resource collection API of Systems. It manages SystemResource. + * + * @return Resource collection API of Systems. */ - public Entities entities() { - if (this.entities == null) { - this.entities = new EntitiesImpl(clientObject.getEntities(), this); + public Systems systems() { + if (this.systems == null) { + this.systems = new SystemsImpl(clientObject.getSystems(), this); } - return entities; + return systems; + } + + /** + * 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 ProductPackageOperations. + * + * @return Resource collection API of ProductPackageOperations. + */ + public ProductPackageOperations productPackageOperations() { + if (this.productPackageOperations == null) { + this.productPackageOperations + = new ProductPackageOperationsImpl(clientObject.getProductPackageOperations(), this); + } + return productPackageOperations; + } + + /** + * 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 ProductTemplateOperations. + * + * @return Resource collection API of ProductTemplateOperations. + */ + public ProductTemplateOperations productTemplateOperations() { + if (this.productTemplateOperations == null) { + this.productTemplateOperations + = new ProductTemplateOperationsImpl(clientObject.getProductTemplateOperations(), this); + } + return productTemplateOperations; + } + + /** + * Gets the resource collection API of ContentTemplates. + * + * @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 ContentTemplateOperations. It manages TemplateModel. + * + * @return Resource collection API of ContentTemplateOperations. + */ + public ContentTemplateOperations contentTemplateOperations() { + if (this.contentTemplateOperations == null) { + this.contentTemplateOperations + = new ContentTemplateOperationsImpl(clientObject.getContentTemplateOperations(), this); + } + return contentTemplateOperations; + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; } /** * Gets the resource collection API of EntitiesGetTimelines. - * + * * @return Resource collection API of EntitiesGetTimelines. */ public EntitiesGetTimelines entitiesGetTimelines() { @@ -541,7 +783,7 @@ public EntitiesGetTimelines entitiesGetTimelines() { /** * Gets the resource collection API of EntitiesRelations. - * + * * @return Resource collection API of EntitiesRelations. */ public EntitiesRelations entitiesRelations() { @@ -553,7 +795,7 @@ public EntitiesRelations entitiesRelations() { /** * Gets the resource collection API of EntityRelations. - * + * * @return Resource collection API of EntityRelations. */ public EntityRelations entityRelations() { @@ -565,7 +807,7 @@ public EntityRelations entityRelations() { /** * Gets the resource collection API of EntityQueries. - * + * * @return Resource collection API of EntityQueries. */ public EntityQueries entityQueries() { @@ -577,7 +819,7 @@ public EntityQueries entityQueries() { /** * Gets the resource collection API of EntityQueryTemplates. - * + * * @return Resource collection API of EntityQueryTemplates. */ public EntityQueryTemplates entityQueryTemplates() { @@ -589,7 +831,7 @@ public EntityQueryTemplates entityQueryTemplates() { /** * Gets the resource collection API of FileImports. It manages FileImport. - * + * * @return Resource collection API of FileImports. */ public FileImports fileImports() { @@ -599,9 +841,45 @@ public FileImports fileImports() { 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 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 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 IncidentComments. It manages IncidentComment. - * + * * @return Resource collection API of IncidentComments. */ public IncidentComments incidentComments() { @@ -613,7 +891,7 @@ public IncidentComments incidentComments() { /** * Gets the resource collection API of IncidentRelations. - * + * * @return Resource collection API of IncidentRelations. */ public IncidentRelations incidentRelations() { @@ -623,9 +901,21 @@ public IncidentRelations incidentRelations() { return incidentRelations; } + /** + * 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; + } + /** * Gets the resource collection API of Metadatas. It manages MetadataModel. - * + * * @return Resource collection API of Metadatas. */ public Metadatas metadatas() { @@ -637,7 +927,7 @@ public Metadatas metadatas() { /** * Gets the resource collection API of OfficeConsents. - * + * * @return Resource collection API of OfficeConsents. */ public OfficeConsents officeConsents() { @@ -649,33 +939,81 @@ public OfficeConsents officeConsents() { /** * Gets the resource collection API of SentinelOnboardingStates. It manages SentinelOnboardingState. - * + * * @return Resource collection API of SentinelOnboardingStates. */ public SentinelOnboardingStates sentinelOnboardingStates() { if (this.sentinelOnboardingStates == null) { - this.sentinelOnboardingStates = - new SentinelOnboardingStatesImpl(clientObject.getSentinelOnboardingStates(), this); + this.sentinelOnboardingStates + = new SentinelOnboardingStatesImpl(clientObject.getSentinelOnboardingStates(), this); } return sentinelOnboardingStates; } + /** + * 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 Gets. + * + * @return Resource collection API of Gets. + */ + public Gets gets() { + if (this.gets == null) { + this.gets = new GetsImpl(clientObject.getGets(), this); + } + 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 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 SecurityMLAnalyticsSettings. - * + * * @return Resource collection API of SecurityMLAnalyticsSettings. */ public SecurityMLAnalyticsSettings securityMLAnalyticsSettings() { if (this.securityMLAnalyticsSettings == null) { - this.securityMLAnalyticsSettings = - new SecurityMLAnalyticsSettingsImpl(clientObject.getSecurityMLAnalyticsSettings(), this); + this.securityMLAnalyticsSettings + = new SecurityMLAnalyticsSettingsImpl(clientObject.getSecurityMLAnalyticsSettings(), this); } return securityMLAnalyticsSettings; } /** * Gets the resource collection API of ProductSettings. - * + * * @return Resource collection API of ProductSettings. */ public ProductSettings productSettings() { @@ -687,7 +1025,7 @@ public ProductSettings productSettings() { /** * Gets the resource collection API of SourceControls. - * + * * @return Resource collection API of SourceControls. */ public SourceControls sourceControls() { @@ -699,60 +1037,109 @@ public SourceControls sourceControls() { /** * Gets the resource collection API of SourceControlsOperations. It manages SourceControl. - * + * * @return Resource collection API of SourceControlsOperations. */ public SourceControlsOperations sourceControlsOperations() { if (this.sourceControlsOperations == null) { - this.sourceControlsOperations = - new SourceControlsOperationsImpl(clientObject.getSourceControlsOperations(), this); + this.sourceControlsOperations + = new SourceControlsOperationsImpl(clientObject.getSourceControlsOperations(), this); } return sourceControlsOperations; } /** * Gets the resource collection API of ThreatIntelligenceIndicators. - * + * * @return Resource collection API of ThreatIntelligenceIndicators. */ public ThreatIntelligenceIndicators threatIntelligenceIndicators() { if (this.threatIntelligenceIndicators == null) { - this.threatIntelligenceIndicators = - new ThreatIntelligenceIndicatorsImpl(clientObject.getThreatIntelligenceIndicators(), this); + this.threatIntelligenceIndicators + = new ThreatIntelligenceIndicatorsImpl(clientObject.getThreatIntelligenceIndicators(), this); } return threatIntelligenceIndicators; } /** * Gets the resource collection API of ThreatIntelligenceIndicatorsOperations. - * + * * @return Resource collection API of ThreatIntelligenceIndicatorsOperations. */ public ThreatIntelligenceIndicatorsOperations threatIntelligenceIndicatorsOperations() { if (this.threatIntelligenceIndicatorsOperations == null) { - this.threatIntelligenceIndicatorsOperations = - new ThreatIntelligenceIndicatorsOperationsImpl( - clientObject.getThreatIntelligenceIndicatorsOperations(), this); + this.threatIntelligenceIndicatorsOperations = new ThreatIntelligenceIndicatorsOperationsImpl( + clientObject.getThreatIntelligenceIndicatorsOperations(), this); } return threatIntelligenceIndicatorsOperations; } /** * Gets the resource collection API of ThreatIntelligenceIndicatorMetrics. - * + * * @return Resource collection API of ThreatIntelligenceIndicatorMetrics. */ public ThreatIntelligenceIndicatorMetrics threatIntelligenceIndicatorMetrics() { if (this.threatIntelligenceIndicatorMetrics == null) { - this.threatIntelligenceIndicatorMetrics = - new ThreatIntelligenceIndicatorMetricsImpl(clientObject.getThreatIntelligenceIndicatorMetrics(), this); + this.threatIntelligenceIndicatorMetrics = new ThreatIntelligenceIndicatorMetricsImpl( + clientObject.getThreatIntelligenceIndicatorMetrics(), this); } return threatIntelligenceIndicatorMetrics; } + /** + * Gets the resource collection API of ThreatIntelligences. + * + * @return Resource collection API of ThreatIntelligences. + */ + public ThreatIntelligences threatIntelligences() { + if (this.threatIntelligences == null) { + this.threatIntelligences = new ThreatIntelligencesImpl(clientObject.getThreatIntelligences(), this); + } + return threatIntelligences; + } + + /** + * 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 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 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 Watchlists. It manages Watchlist. - * + * * @return Resource collection API of Watchlists. */ public Watchlists watchlists() { @@ -764,7 +1151,7 @@ public Watchlists watchlists() { /** * Gets the resource collection API of WatchlistItems. It manages WatchlistItem. - * + * * @return Resource collection API of WatchlistItems. */ public WatchlistItems watchlistItems() { @@ -774,9 +1161,87 @@ public WatchlistItems watchlistItems() { return watchlistItems; } + /** + * 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 WorkspaceManagerAssignmentJobs. + * + * @return Resource collection API of WorkspaceManagerAssignmentJobs. + */ + public WorkspaceManagerAssignmentJobs workspaceManagerAssignmentJobs() { + if (this.workspaceManagerAssignmentJobs == null) { + this.workspaceManagerAssignmentJobs + = new WorkspaceManagerAssignmentJobsImpl(clientObject.getWorkspaceManagerAssignmentJobs(), this); + } + return workspaceManagerAssignmentJobs; + } + + /** + * 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 DataConnectorDefinitions. + * + * @return Resource collection API of DataConnectorDefinitions. + */ + public DataConnectorDefinitions dataConnectorDefinitions() { + if (this.dataConnectorDefinitions == null) { + this.dataConnectorDefinitions + = new DataConnectorDefinitionsImpl(clientObject.getDataConnectorDefinitions(), this); + } + return dataConnectorDefinitions; + } + /** * Gets the resource collection API of DataConnectors. - * + * * @return Resource collection API of DataConnectors. */ public DataConnectors dataConnectors() { @@ -788,21 +1253,20 @@ public DataConnectors dataConnectors() { /** * 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); + this.dataConnectorsCheckRequirementsOperations = new DataConnectorsCheckRequirementsOperationsImpl( + clientObject.getDataConnectorsCheckRequirementsOperations(), this); } return dataConnectorsCheckRequirementsOperations; } /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -813,8 +1277,10 @@ public Operations operations() { } /** - * @return Wrapped service client SecurityInsights providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets wrapped service client SecurityInsights providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client SecurityInsights. */ public SecurityInsights serviceClient() { return this.clientObject; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ActionsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ActionsClient.java index 1679ca2138ad..8fb1871e672b 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 @@ -12,11 +12,13 @@ import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; import com.azure.resourcemanager.securityinsights.models.ActionRequest; -/** An instance of this class provides access to all the operations defined in ActionsClient. */ +/** + * 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. @@ -30,7 +32,7 @@ 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. @@ -41,109 +43,104 @@ public interface ActionsClient { * @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); + PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId, + Context context); /** * Gets the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return the action of alert rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ActionResponseInner get(String resourceGroupName, String workspaceName, String ruleId, String actionId); + Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, + String actionId, Context context); /** * Gets the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 action of alert rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context); + ActionResponseInner get(String resourceGroupName, String workspaceName, String ruleId, String actionId); /** * Creates or updates the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param action The action. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return action for alert rule. + * @return action for alert rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ActionResponseInner createOrUpdate( - String resourceGroupName, String workspaceName, String ruleId, String actionId, ActionRequest action); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String ruleId, String actionId, ActionRequest action, Context context); /** * Creates or updates the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param action The action. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return action for alert rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String ruleId, - String actionId, - ActionRequest action, - Context context); + ActionResponseInner createOrUpdate(String resourceGroupName, String workspaceName, String ruleId, String actionId, + ActionRequest action); /** * Delete the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, String actionId, + Context context); /** * Delete the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 ruleId, String actionId, Context context); + void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId); } 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..a1a3ad567bc0 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @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 c568ee0f23fe..c4af7cd0e699 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 @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; -/** An instance of this class provides access to all the operations defined in AlertRuleTemplatesClient. */ +/** + * An instance of this class provides access to all the operations defined in AlertRuleTemplatesClient. + */ public interface AlertRuleTemplatesClient { /** * Gets all alert rule templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -28,7 +30,7 @@ public interface AlertRuleTemplatesClient { /** * Gets all alert rule templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -42,31 +44,31 @@ public interface AlertRuleTemplatesClient { /** * Gets the alert rule template. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param alertRuleTemplateId Alert rule template ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule template. + * @return the alert rule template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); + Response getWithResponse(String resourceGroupName, String workspaceName, + String alertRuleTemplateId, Context context); /** * Gets the alert rule template. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param alertRuleTemplateId Alert rule template ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 the alert rule template. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context); + AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); } 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 d40ca296e5fc..20360c45cccd 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 @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; -/** An instance of this class provides access to all the operations defined in AlertRulesClient. */ +/** + * 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. @@ -28,7 +30,7 @@ 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. * @param context The context to associate with this operation. @@ -42,92 +44,92 @@ public interface AlertRulesClient { /** * Gets the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule. + * @return the alert rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AlertRuleInner get(String resourceGroupName, String workspaceName, String ruleId); + Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, + Context context); /** * Gets the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the alert rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String ruleId, Context context); + AlertRuleInner get(String resourceGroupName, String workspaceName, String ruleId); /** * Creates or updates the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return alert rule. + * @return alert rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AlertRuleInner createOrUpdate( - String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String ruleId, + AlertRuleInner alertRule, Context context); /** * Creates or updates the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return alert rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule, Context context); + AlertRuleInner createOrUpdate(String resourceGroupName, String workspaceName, String ruleId, + AlertRuleInner alertRule); /** * Delete the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String ruleId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, Context context); /** * Delete the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 ruleId, Context context); + void delete(String resourceGroupName, String workspaceName, String ruleId); } 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 8bdfc546a32d..ee8b428d8849 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 @@ -11,106 +11,104 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner; -/** An instance of this class provides access to all the operations defined in AutomationRulesClient. */ +/** + * An instance of this class provides access to all the operations defined in AutomationRulesClient. + */ 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 automationRuleId Automation rule ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the automation rule. + * @return the automation rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AutomationRuleInner get(String resourceGroupName, String workspaceName, String automationRuleId); + Response getWithResponse(String resourceGroupName, String workspaceName, + String automationRuleId, Context context); /** * Gets the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the automation rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String automationRuleId, Context context); + AutomationRuleInner get(String resourceGroupName, String workspaceName, String automationRuleId); /** * 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 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. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AutomationRuleInner createOrUpdate(String resourceGroupName, String workspaceName, String automationRuleId); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String automationRuleId, AutomationRuleInner automationRuleToUpsert, Context context); /** * Creates or updates the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. - * @param 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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String automationRuleId, - AutomationRuleInner automationRuleToUpsert, - Context context); + AutomationRuleInner createOrUpdate(String resourceGroupName, String workspaceName, String automationRuleId); /** * Delete the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. + * @return any object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Object delete(String resourceGroupName, String workspaceName, String automationRuleId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, + Context context); /** * Delete the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 any object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String automationRuleId, Context context); + Object delete(String resourceGroupName, String workspaceName, String automationRuleId); /** * Gets all automation rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -123,7 +121,7 @@ Response deleteWithResponse( /** * 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. 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..6cac546c32ee --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; + +/** + * An instance of this class provides access to all the operations defined in BillingStatisticsClient. + */ +public interface BillingStatisticsClient { + /** + * 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); + + /** + * 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); +} 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 index 1d63a4251db1..8b2d374f6bb2 100644 --- 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 @@ -11,42 +11,40 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in BookmarkOperationsClient. + */ public interface BookmarkOperationsClient { /** * Expand an bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return the entity expansion result operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - BookmarkExpandResponseInner expand( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters); + 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 workspace. * @param bookmarkId Bookmark ID. * @param parameters The parameters required to execute an expand operation on the given bookmark. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entity expansion result operation response along with {@link Response}. + * @return the entity expansion result operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response expandWithResponse( - String resourceGroupName, - String workspaceName, - String bookmarkId, - BookmarkExpandParameters parameters, - Context context); + 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 index e644d527b90a..4557bde35a70 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in BookmarkRelationsClient. + */ public interface BookmarkRelationsClient { /** * Gets all bookmark relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -29,7 +31,7 @@ public interface BookmarkRelationsClient { /** * Gets all bookmark relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -37,8 +39,8 @@ public interface BookmarkRelationsClient { * @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. + * 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. @@ -46,116 +48,104 @@ public interface BookmarkRelationsClient { * @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); + PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId, String filter, + String orderby, Integer top, String skipToken, Context context); /** * Gets a bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param relationName Relation Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return a bookmark relation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RelationInner get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return a bookmark relation. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context); + 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 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. + * @return represents a relation between two resources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RelationInner createOrUpdate( - String resourceGroupName, String workspaceName, String bookmarkId, String relationName, RelationInner relation); + 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 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}. + * @return represents a relation between two resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String bookmarkId, - String relationName, - RelationInner relation, - Context context); + 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) - void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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); + void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); } 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 767fec60845b..b572356bc95b 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 @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; -/** An instance of this class provides access to all the operations defined in BookmarksClient. */ +/** + * 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. @@ -28,7 +30,7 @@ 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. * @param context The context to associate with this operation. @@ -42,93 +44,93 @@ public interface BookmarksClient { /** * Gets a bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a bookmark. + * @return a bookmark along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - BookmarkInner get(String resourceGroupName, String workspaceName, String bookmarkId); + Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Context context); /** * Gets a bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a bookmark. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, Context context); + BookmarkInner get(String resourceGroupName, String workspaceName, String bookmarkId); /** * Creates or updates the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param bookmark The bookmark. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a bookmark in Azure Security Insights. + * @return represents a bookmark in Azure Security Insights along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - BookmarkInner createOrUpdate( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, BookmarkInner bookmark, Context context); /** * Creates or updates the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param bookmark The bookmark. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return represents a bookmark in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark, Context context); + BookmarkInner createOrUpdate(String resourceGroupName, String workspaceName, String bookmarkId, + BookmarkInner 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 bookmarkId Bookmark ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String bookmarkId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Context context); /** * Delete the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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, Context context); + void delete(String resourceGroupName, String workspaceName, String bookmarkId); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BusinessApplicationAgentOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BusinessApplicationAgentOperationsClient.java new file mode 100644 index 000000000000..7848115c0857 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BusinessApplicationAgentOperationsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.BusinessApplicationAgentResourceInner; + +/** + * An instance of this class provides access to all the operations defined in BusinessApplicationAgentOperationsClient. + */ +public interface BusinessApplicationAgentOperationsClient { + /** + * Gets Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 business Application Agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, Context context); + + /** + * Gets Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 business Application Agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BusinessApplicationAgentResourceInner get(String resourceGroupName, String workspaceName, String agentResourceName); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BusinessApplicationAgentsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BusinessApplicationAgentsClient.java new file mode 100644 index 000000000000..3304874cf357 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BusinessApplicationAgentsClient.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.BusinessApplicationAgentResourceInner; + +/** + * An instance of this class provides access to all the operations defined in BusinessApplicationAgentsClient. + */ +public interface BusinessApplicationAgentsClient { + /** + * Creates or updates the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param agentToUpsert The Business Application Agent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the configuration of a Business Application Agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String agentResourceName, BusinessApplicationAgentResourceInner agentToUpsert, + Context context); + + /** + * Creates or updates the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 describes the configuration of a Business Application Agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BusinessApplicationAgentResourceInner createOrUpdate(String resourceGroupName, String workspaceName, + String agentResourceName); + + /** + * Delete the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 agentResourceName, + Context context); + + /** + * Delete the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 agentResourceName); + + /** + * Gets all Business Application Agents under the 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 Business Application Agents under the workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all Business Application Agents under the workspace. + * + * @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 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 Business Application Agents under the workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, + String filter, String skipToken, 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..ee18a441f879 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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 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 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 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 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..76591a74767c --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner; + +/** + * An instance of this class provides access to all the operations defined in ContentPackagesClient. + */ +public interface ContentPackagesClient { + /** + * Gets all installed packages. + * + * @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 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 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); + + /** + * 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 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 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); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplateOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplateOperationsClient.java new file mode 100644 index 000000000000..1ae2dacd2d8b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplateOperationsClient.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; + +/** + * An instance of this class provides access to all the operations defined in ContentTemplateOperationsClient. + */ +public interface ContentTemplateOperationsClient { + /** + * Install a template. + * + * @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 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 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); + + /** + * 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 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 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); + + /** + * Delete an installed template. + * + * @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 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 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/ContentTemplatesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesClient.java new file mode 100644 index 000000000000..08b3a964aef5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesClient.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 ContentTemplatesClient. + */ +public interface ContentTemplatesClient { + /** + * 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 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 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..3260ecd1af62 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; + +/** + * An instance of this class provides access to all the operations defined in DataConnectorDefinitionsClient. + */ +public interface DataConnectorDefinitionsClient { + /** + * Gets all data connector definitions. + * + * @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 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 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); + + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the 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 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 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 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 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 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); +} 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 index 146c3f4c1793..14968c0845e2 100644 --- 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 @@ -18,37 +18,32 @@ 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. + * @return requirements state for a data connector type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataConnectorRequirementsStateInner post( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return requirements state for a data connector type. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response postWithResponse( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements, - Context context); + 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 78d1cc36c200..2f2bf170bc80 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 @@ -12,11 +12,13 @@ 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. */ +/** + * 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. @@ -29,7 +31,7 @@ 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. * @param context The context to associate with this operation. @@ -43,162 +45,154 @@ public interface DataConnectorsClient { /** * Gets a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data connector. + * @return a data connector along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataConnectorInner get(String resourceGroupName, String workspaceName, String dataConnectorId); + Response getWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + Context context); /** * Gets a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a data connector. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String dataConnectorId, Context context); + DataConnectorInner get(String resourceGroupName, String workspaceName, String dataConnectorId); /** * Creates or updates the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data connector. + * @return data connector along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataConnectorInner createOrUpdate( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorInner dataConnector, Context context); /** * Creates or updates the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 data connector. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorInner dataConnector, - Context context); + DataConnectorInner createOrUpdate(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorInner dataConnector); /** * Delete the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String dataConnectorId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + Context context); /** * Delete the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 dataConnectorId, Context context); + void delete(String resourceGroupName, String workspaceName, String dataConnectorId); /** * Connects a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param connectBody The data connector. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void connect( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody); + 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 workspace. * @param dataConnectorId Connector ID. * @param connectBody The data connector. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response connectWithResponse( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorConnectBody connectBody, - Context context); + 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 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) - void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId); + 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 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); + 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 index 28404013fdcb..72ce0e50b7a4 100644 --- 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 @@ -16,12 +16,45 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in EntitiesClient. + */ public interface EntitiesClient { + /** + * 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 identifier. + * @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void runPlaybook(String resourceGroupName, String workspaceName, String entityIdentifier); + /** * 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. @@ -34,7 +67,7 @@ public interface EntitiesClient { /** * Gets all entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -48,138 +81,130 @@ 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. + * @return an entity along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EntityInner get(String resourceGroupName, String workspaceName, String entityId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an entity. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String entityId, Context context); + EntityInner get(String resourceGroupName, String workspaceName, String entityId); /** * 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. + * @return the entity expansion result operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EntityExpandResponseInner expand( - String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the entity expansion result operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response expandWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityExpandParameters parameters, - Context context); + 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return insights and Activities for an entity along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - GetQueriesResponseInner queries( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind); + Response queriesWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityItemQueryKind kind, Context context); /** * Get Insights and Activities for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. * @param kind The Kind parameter for queries. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Response}. + * @return insights and Activities for an entity. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response queriesWithResponse( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context); + GetQueriesResponseInner queries(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind); /** * 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. + * @return the Get Insights result operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EntityGetInsightsResponseInner getInsights( - String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the Get Insights result operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getInsightsWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityGetInsightsParameters parameters, - Context context); + 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 index bfa335c3065e..3eca25a3f85e 100644 --- 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 @@ -11,42 +11,40 @@ 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. */ +/** + * 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. + * @return the entity timeline result operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EntityTimelineResponseInner list( - String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the entity timeline result operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityTimelineParameters parameters, - Context context); + 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 index 10130bd876ab..ae701c02c33a 100644 --- 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 @@ -10,11 +10,13 @@ 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. */ +/** + * 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. @@ -28,7 +30,7 @@ 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. @@ -36,8 +38,8 @@ public interface EntitiesRelationsClient { * @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. + * 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. @@ -45,13 +47,6 @@ public interface EntitiesRelationsClient { * @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); + 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 index 68ba3c6be0c3..094a4e7e75e1 100644 --- 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 @@ -13,11 +13,13 @@ import com.azure.resourcemanager.securityinsights.models.CustomEntityQuery; import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind; -/** An instance of this class provides access to all the operations defined in EntityQueriesClient. */ +/** + * An instance of this class provides access to all the operations defined in EntityQueriesClient. + */ public interface EntityQueriesClient { /** * Gets all entity queries. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,7 +32,7 @@ public interface EntityQueriesClient { /** * Gets all entity queries. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity query kind we want to fetch. @@ -41,102 +43,98 @@ public interface EntityQueriesClient { * @return all entity queries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, EntityQueriesKind kind, + Context context); /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an entity query along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EntityQueryInner get(String resourceGroupName, String workspaceName, String entityQueryId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an entity query. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String entityQueryId, Context context); + 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. + * @return specific entity query along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EntityQueryInner createOrUpdate( - String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return specific entity query. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String entityQueryId, - CustomEntityQuery entityQuery, - Context context); + 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) - void delete(String resourceGroupName, String workspaceName, String entityQueryId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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); + void delete(String resourceGroupName, String workspaceName, String entityQueryId); } 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 index 96c60a276dae..ba6c578d00ad 100644 --- 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 @@ -10,13 +10,15 @@ 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.Constant88; +import com.azure.resourcemanager.securityinsights.models.Constant124; -/** An instance of this class provides access to all the operations defined in EntityQueryTemplatesClient. */ +/** + * An instance of this class provides access to all the operations defined in EntityQueryTemplatesClient. + */ public interface EntityQueryTemplatesClient { /** * Gets all entity query templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,7 +31,7 @@ public interface EntityQueryTemplatesClient { /** * Gets all entity query templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity template query kind we want to fetch. @@ -40,36 +42,36 @@ public interface EntityQueryTemplatesClient { * @return all entity query templates as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, Constant88 kind, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, Constant124 kind, + Context context); /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryTemplateId entity query template ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an entity query along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EntityQueryTemplateInner get(String resourceGroupName, String workspaceName, String entityQueryTemplateId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an entity query. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String entityQueryTemplateId, Context context); + EntityQueryTemplateInner get(String resourceGroupName, String workspaceName, String entityQueryTemplateId); } 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 index 9f6c0165269d..146a29937afc 100644 --- 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 @@ -10,37 +10,39 @@ 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. */ +/** + * 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. + * @return an entity relation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RelationInner getRelation(String resourceGroupName, String workspaceName, String entityId, String relationName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an entity relation. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getRelationWithResponse( - String resourceGroupName, String workspaceName, String entityId, String relationName, Context context); + 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 index 91450d050bde..37a2e8384545 100644 --- 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 @@ -13,11 +13,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in FileImportsClient. + */ public interface FileImportsClient { /** * 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. @@ -30,15 +32,15 @@ public interface FileImportsClient { /** * 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. + * 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. @@ -46,85 +48,75 @@ public interface FileImportsClient { * @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); + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, String skipToken, 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return a file import along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - FileImportInner get(String resourceGroupName, String workspaceName, String fileImportId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return a file import. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String fileImportId, Context context); + 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. + * @return represents a file import in Azure Security Insights along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - FileImportInner create( - String resourceGroupName, String workspaceName, String fileImportId, FileImportInner fileImport); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return represents a file import in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String workspaceName, - String fileImportId, - FileImportInner fileImport, - Context context); + 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. @@ -134,12 +126,12 @@ Response createWithResponse( * @return the {@link SyncPoller} for polling of represents a file import in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, FileImportInner> beginDelete( - String resourceGroupName, String workspaceName, String fileImportId); + SyncPoller, FileImportInner> 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. @@ -150,12 +142,12 @@ SyncPoller, FileImportInner> beginDelete( * @return the {@link SyncPoller} for polling of represents a file import in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, FileImportInner> beginDelete( - String resourceGroupName, String workspaceName, String fileImportId, Context context); + SyncPoller, FileImportInner> 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. @@ -169,7 +161,7 @@ SyncPoller, FileImportInner> beginDelete( /** * 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. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IpGeodatasClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetRecommendationsClient.java similarity index 66% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IpGeodatasClient.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetRecommendationsClient.java index 50c85d732cb8..348e1ced4d49 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IpGeodatasClient.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetRecommendationsClient.java @@ -8,34 +8,36 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationListInner; -/** An instance of this class provides access to all the operations defined in IpGeodatasClient. */ -public interface IpGeodatasClient { +/** + * An instance of this class provides access to all the operations defined in GetRecommendationsClient. + */ +public interface GetRecommendationsClient { /** - * Get geodata for a single IP address. - * + * Gets a list of all recommendations. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ipAddress IP address (v4 or v6) to be enriched. + * @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 geodata for a single IP address. + * @return a list of all recommendations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EnrichmentIpGeodataInner get(String resourceGroupName, String ipAddress); + Response listWithResponse(String resourceGroupName, String workspaceName, Context context); /** - * Get geodata for a single IP address. - * + * Gets a list of all recommendations. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ipAddress IP address (v4 or v6) to be enriched. - * @param context The context to associate with this operation. + * @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 geodata for a single IP address along with {@link Response}. + * @return a list of all recommendations. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String ipAddress, Context context); + RecommendationListInner list(String resourceGroupName, String workspaceName); } 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..0c44336ced41 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..f2f9c0b31a21 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetsClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 java.util.UUID; + +/** + * 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, + UUID 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, UUID 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..5f4c778f9188 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner; + +/** + * An instance of this class provides access to all the operations defined in HuntCommentsClient. + */ +public interface HuntCommentsClient { + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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..b369335b6631 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner; + +/** + * An instance of this class provides access to all the operations defined in HuntRelationsClient. + */ +public interface HuntRelationsClient { + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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..332fc849539a --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntInner; + +/** + * An instance of this class provides access to all the operations defined in HuntsClient. + */ +public interface HuntsClient { + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 c8f34adc3578..b007f5c6df9b 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 @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; -/** An instance of this class provides access to all the operations defined in IncidentCommentsClient. */ +/** + * An instance of this class provides access to all the operations defined in IncidentCommentsClient. + */ public interface IncidentCommentsClient { /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -29,7 +31,7 @@ public interface IncidentCommentsClient { /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -37,8 +39,8 @@ public interface IncidentCommentsClient { * @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. + * 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. @@ -46,121 +48,105 @@ public interface IncidentCommentsClient { * @return all incident comments 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); + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + String filter, String orderby, Integer top, String skipToken, Context context); /** * Gets an incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident comment. + * @return an incident comment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - IncidentCommentInner get( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, Context context); /** * Gets an incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident comment along with {@link Response}. + * @return an incident comment. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context); + IncidentCommentInner get(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId); /** * Creates or updates the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. * @param incidentComment The incident comment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an incident comment. + * @return represents an incident comment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - IncidentCommentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String incidentId, - String incidentCommentId, - IncidentCommentInner incidentComment); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String incidentCommentId, IncidentCommentInner incidentComment, Context context); /** * Creates or updates the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. * @param incidentComment The incident comment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 represents an incident comment. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - String incidentCommentId, - IncidentCommentInner incidentComment, - Context context); + IncidentCommentInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, IncidentCommentInner incidentComment); /** * Delete the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, Context context); /** * Delete the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 incidentCommentId, Context context); + void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); } 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 8f2125a0506d..261d6a8f0bad 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 @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; -/** An instance of this class provides access to all the operations defined in IncidentRelationsClient. */ +/** + * An instance of this class provides access to all the operations defined in IncidentRelationsClient. + */ public interface IncidentRelationsClient { /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -29,7 +31,7 @@ public interface IncidentRelationsClient { /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -37,8 +39,8 @@ public interface IncidentRelationsClient { * @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. + * 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. @@ -46,116 +48,104 @@ public interface IncidentRelationsClient { * @return all incident relations 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); + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, String filter, + String orderby, Integer top, String skipToken, Context context); /** * Gets an incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident relation. + * @return an incident relation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RelationInner get(String resourceGroupName, String workspaceName, String incidentId, String relationName); + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, Context context); /** * Gets an incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident relation along with {@link Response}. + * @return an incident relation. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context); + RelationInner 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 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. + * @return represents a relation between two resources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RelationInner createOrUpdate( - String resourceGroupName, String workspaceName, String incidentId, String relationName, RelationInner relation); + 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 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}. + * @return represents a relation between two resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - String relationName, - RelationInner relation, - Context context); + RelationInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, String relationName, + RelationInner relation); /** * Delete the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, Context context); /** * Delete the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 relationName, Context context); + void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName); } 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..69cc0c887325 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner; + +/** + * An instance of this class provides access to all the operations defined in IncidentTasksClient. + */ +public interface IncidentTasksClient { + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident 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 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); + + /** + * Gets an incident task. + * + * @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 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 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 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 the response body 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 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 the response. + */ + @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 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 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); +} 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 12e0bda1f5e8..9fc30449ae1e 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 @@ -15,48 +15,45 @@ import com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner; import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; import com.azure.resourcemanager.securityinsights.models.ManualTriggerRequestBody; -import com.azure.resourcemanager.securityinsights.models.TeamProperties; -/** An instance of this class provides access to all the operations defined in IncidentsClient. */ +/** + * An instance of this class provides access to all the operations defined in IncidentsClient. + */ public interface IncidentsClient { /** * 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 incidentIdentifier parameter. + * @param requestBody The requestBody parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. + * @return any object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier); + 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 incidentIdentifier parameter. - * @param requestBody The requestBody parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response}. + * @return any object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response runPlaybookWithResponse( - String resourceGroupName, - String workspaceName, - String incidentIdentifier, - ManualTriggerRequestBody requestBody, - Context context); + Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier); /** * 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. @@ -69,15 +66,15 @@ Response runPlaybookWithResponse( /** * 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. + * 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. @@ -85,231 +82,221 @@ Response runPlaybookWithResponse( * @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); + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, String skipToken, Context context); /** * Gets an incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an incident along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - IncidentInner get(String resourceGroupName, String workspaceName, String incidentId); + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Context context); /** * Gets an incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 along with {@link Response}. + * @return an incident. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context); + IncidentInner get(String resourceGroupName, String workspaceName, String incidentId); /** * Creates or updates the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incident The incident. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an incident in Azure Security Insights. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - IncidentInner createOrUpdate( - String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, IncidentInner incident, Context context); /** * Creates or updates the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incident The incident. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident, Context context); + IncidentInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + IncidentInner incident); /** * Delete the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String incidentId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Context context); /** * Delete the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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, Context context); + void delete(String resourceGroupName, String workspaceName, String incidentId); /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param teamProperties Team properties. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes team information. + * @return describes team information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TeamInformationInner createTeam( - String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties); + Response createTeamWithResponse(String resourceGroupName, String workspaceName, + String incidentId, TeamInformationInner teamProperties, Context context); /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param teamProperties Team properties. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes team information along with {@link Response}. + * @return describes team information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createTeamWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - TeamProperties teamProperties, - Context context); + TeamInformationInner createTeam(String resourceGroupName, String workspaceName, String incidentId, + TeamInformationInner teamProperties); /** * Gets all incident alerts. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident alerts. + * @return all incident alerts along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - IncidentAlertListInner listAlerts(String resourceGroupName, String workspaceName, String incidentId); + Response listAlertsWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context); /** * Gets all incident alerts. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident alerts along with {@link Response}. + * @return all incident alerts. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listAlertsWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context); + IncidentAlertListInner listAlerts(String resourceGroupName, String workspaceName, String incidentId); /** * Gets all incident bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident bookmarks. + * @return all incident bookmarks along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - IncidentBookmarkListInner listBookmarks(String resourceGroupName, String workspaceName, String incidentId); + Response listBookmarksWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context); /** * Gets all incident bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident bookmarks along with {@link Response}. + * @return all incident bookmarks. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listBookmarksWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context); + IncidentBookmarkListInner listBookmarks(String resourceGroupName, String workspaceName, String incidentId); /** * Gets all incident related entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident related entities. + * @return all incident related entities along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - IncidentEntitiesResponseInner listEntities(String resourceGroupName, String workspaceName, String incidentId); + Response listEntitiesWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context); /** * Gets all incident related entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident related entities along with {@link Response}. + * @return all incident related entities. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listEntitiesWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context); + IncidentEntitiesResponseInner listEntities(String resourceGroupName, String workspaceName, String incidentId); } 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 index a42eaa9112f1..81c75882fbd1 100644 --- 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 @@ -12,11 +12,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in MetadatasClient. + */ public interface MetadatasClient { /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,14 +31,14 @@ public interface MetadatasClient { /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @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. + * 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. @@ -44,145 +46,131 @@ public interface MetadatasClient { * @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); + PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, Integer skip, Context context); /** * Get a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return a Metadata along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - MetadataModelInner get(String resourceGroupName, String workspaceName, String metadataName); + 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 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}. + * @return a Metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String metadataName, Context context); + MetadataModelInner 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 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) - void delete(String resourceGroupName, String workspaceName, String metadataName); + 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 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); + void delete(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 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. + * @return metadata resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - MetadataModelInner create( - String resourceGroupName, String workspaceName, String metadataName, MetadataModelInner metadata); + 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 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}. + * @return metadata resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String workspaceName, - String metadataName, - MetadataModelInner metadata, - Context context); + 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 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. + * @return metadata resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - MetadataModelInner update( - String resourceGroupName, String workspaceName, String metadataName, MetadataPatch metadataPatch); + 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 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}. + * @return metadata resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String workspaceName, - String metadataName, - MetadataPatch metadataPatch, - Context context); + MetadataModelInner update(String resourceGroupName, String workspaceName, String metadataName, + MetadataPatch metadataPatch); } 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 index 09ab2236789b..b229954462c0 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in OfficeConsentsClient. + */ public interface OfficeConsentsClient { /** * Gets all office365 consents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -28,7 +30,7 @@ public interface OfficeConsentsClient { /** * Gets all office365 consents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -42,60 +44,60 @@ 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. + * @return an office365 consent along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - OfficeConsentInner get(String resourceGroupName, String workspaceName, String consentId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an office365 consent. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String consentId, Context context); + 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) - void delete(String resourceGroupName, String workspaceName, String consentId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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); + void delete(String resourceGroupName, String workspaceName, String consentId); } 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 c6ad3c2c8036..fb17e6ed66dd 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 @@ -10,28 +10,30 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available in the SecurityInsights RP as paginated response with {@link - * PagedIterable}. + * @return lists the operations available in the SecurityInsights RP as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available in the SecurityInsights RP as paginated response with {@link - * PagedIterable}. + * @return lists the operations available in the SecurityInsights RP as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackageOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackageOperationsClient.java new file mode 100644 index 000000000000..795cf9997ee8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackageOperationsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; + +/** + * An instance of this class provides access to all the operations defined in ProductPackageOperationsClient. + */ +public interface ProductPackageOperationsClient { + /** + * 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 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 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/ProductPackagesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesClient.java new file mode 100644 index 000000000000..82ea7654dc6c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesClient.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 ProductPackagesClient. + */ +public interface ProductPackagesClient { + /** + * 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 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 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 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, 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 index ddb0f006d6b3..c768653684d5 100644 --- 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 @@ -11,123 +11,125 @@ import com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner; import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; -/** An instance of this class provides access to all the operations defined in ProductSettingsClient. */ +/** + * An instance of this class provides access to all the operations defined in ProductSettingsClient. + */ public interface ProductSettingsClient { /** * List of all the settings. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return list of all the settings along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SettingListInner list(String resourceGroupName, String workspaceName); + Response listWithResponse(String resourceGroupName, String workspaceName, Context context); /** * List of all the settings. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Response}. + * @return list of all the settings. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String workspaceName, Context context); + SettingListInner list(String resourceGroupName, String workspaceName); /** * 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. + * @return a setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SettingsInner get(String resourceGroupName, String workspaceName, String settingsName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return a setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String settingsName, Context context); + SettingsInner get(String resourceGroupName, String workspaceName, String settingsName); /** * Delete setting of the product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String settingsName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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); + void delete(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. + * @return the Setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SettingsInner update(String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the Setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings, Context context); + SettingsInner update(String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DomainWhoisClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplateOperationsClient.java similarity index 62% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DomainWhoisClient.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplateOperationsClient.java index e9ae9d9fcfed..80de367e2ea0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DomainWhoisClient.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplateOperationsClient.java @@ -8,34 +8,39 @@ 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.ProductTemplateModelInner; -/** An instance of this class provides access to all the operations defined in DomainWhoisClient. */ -public interface DomainWhoisClient { +/** + * An instance of this class provides access to all the operations defined in ProductTemplateOperationsClient. + */ +public interface ProductTemplateOperationsClient { /** - * Get whois information for a single domain name. - * + * Gets a template by its identifier. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param domain Domain name to be enriched. + * @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 whois information for a single domain name. + * @return a template by its identifier along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EnrichmentDomainWhoisInner get(String resourceGroupName, String domain); + Response getWithResponse(String resourceGroupName, String workspaceName, + String templateId, Context context); /** - * Get whois information for a single domain name. - * + * Gets a template by its identifier. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param domain Domain name to be enriched. - * @param context The context to associate with this operation. + * @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 whois information for a single domain name along with {@link Response}. + * @return a template by its identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String domain, Context context); + ProductTemplateModelInner get(String resourceGroupName, String workspaceName, String templateId); } 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..d5b2d341178c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesClient.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.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 ProductTemplatesClient. + */ +public interface ProductTemplatesClient { + /** + * 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 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 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..c79e4dae011d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ReevaluatesClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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; +import java.util.UUID; + +/** + * 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, + UUID 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, UUID 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..60b18e783f19 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; +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 index 4d9c0b816c82..c8dab3ada1d9 100644 --- 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 @@ -7,277 +7,482 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for SecurityInsights class. */ +/** + * 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 EntitiesClient object to access its operations. + * + * @return the EntitiesClient object. + */ + EntitiesClient getEntities(); + /** * Gets the IncidentsClient object to access its operations. - * + * * @return the IncidentsClient object. */ IncidentsClient getIncidents(); + /** + * Gets the BillingStatisticsClient object to access its operations. + * + * @return the BillingStatisticsClient object. + */ + BillingStatisticsClient getBillingStatistics(); + /** * Gets the BookmarksClient object to access its operations. - * + * * @return the BookmarksClient object. */ BookmarksClient getBookmarks(); /** * Gets the BookmarkRelationsClient object to access its operations. - * + * * @return the BookmarkRelationsClient object. */ BookmarkRelationsClient getBookmarkRelations(); /** * Gets the BookmarkOperationsClient object to access its operations. - * + * * @return the BookmarkOperationsClient object. */ BookmarkOperationsClient getBookmarkOperations(); /** - * Gets the IpGeodatasClient object to access its operations. - * - * @return the IpGeodatasClient object. + * Gets the BusinessApplicationAgentsClient object to access its operations. + * + * @return the BusinessApplicationAgentsClient object. */ - IpGeodatasClient getIpGeodatas(); + BusinessApplicationAgentsClient getBusinessApplicationAgents(); /** - * Gets the DomainWhoisClient object to access its operations. - * - * @return the DomainWhoisClient object. + * Gets the BusinessApplicationAgentOperationsClient object to access its operations. + * + * @return the BusinessApplicationAgentOperationsClient object. */ - DomainWhoisClient getDomainWhois(); + BusinessApplicationAgentOperationsClient getBusinessApplicationAgentOperations(); /** - * Gets the EntitiesClient object to access its operations. - * - * @return the EntitiesClient object. + * Gets the SystemsClient object to access its operations. + * + * @return the SystemsClient object. */ - EntitiesClient getEntities(); + SystemsClient getSystems(); + + /** + * 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 ProductPackageOperationsClient object to access its operations. + * + * @return the ProductPackageOperationsClient object. + */ + ProductPackageOperationsClient getProductPackageOperations(); + + /** + * Gets the ProductTemplatesClient object to access its operations. + * + * @return the ProductTemplatesClient object. + */ + ProductTemplatesClient getProductTemplates(); + + /** + * Gets the ProductTemplateOperationsClient object to access its operations. + * + * @return the ProductTemplateOperationsClient object. + */ + ProductTemplateOperationsClient getProductTemplateOperations(); + + /** + * Gets the ContentTemplatesClient object to access its operations. + * + * @return the ContentTemplatesClient object. + */ + ContentTemplatesClient getContentTemplates(); + + /** + * Gets the ContentTemplateOperationsClient object to access its operations. + * + * @return the ContentTemplateOperationsClient object. + */ + ContentTemplateOperationsClient getContentTemplateOperations(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); /** * Gets the EntitiesGetTimelinesClient object to access its operations. - * + * * @return the EntitiesGetTimelinesClient object. */ EntitiesGetTimelinesClient getEntitiesGetTimelines(); /** * Gets the EntitiesRelationsClient object to access its operations. - * + * * @return the EntitiesRelationsClient object. */ EntitiesRelationsClient getEntitiesRelations(); /** * Gets the EntityRelationsClient object to access its operations. - * + * * @return the EntityRelationsClient object. */ EntityRelationsClient getEntityRelations(); /** * Gets the 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 HuntRelationsClient object to access its operations. + * + * @return the HuntRelationsClient object. + */ + HuntRelationsClient getHuntRelations(); + + /** + * Gets the HuntCommentsClient object to access its operations. + * + * @return the HuntCommentsClient object. + */ + HuntCommentsClient getHuntComments(); + /** * 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 IncidentTasksClient object to access its operations. + * + * @return the IncidentTasksClient object. + */ + IncidentTasksClient getIncidentTasks(); + /** * Gets the MetadatasClient object to access its operations. - * + * * @return the MetadatasClient object. */ MetadatasClient getMetadatas(); /** * Gets the OfficeConsentsClient object to access its operations. - * + * * @return the OfficeConsentsClient object. */ OfficeConsentsClient getOfficeConsents(); /** * Gets the SentinelOnboardingStatesClient object to access its operations. - * + * * @return the SentinelOnboardingStatesClient object. */ SentinelOnboardingStatesClient getSentinelOnboardingStates(); + /** + * Gets the GetRecommendationsClient object to access its operations. + * + * @return the GetRecommendationsClient object. + */ + GetRecommendationsClient getGetRecommendations(); + + /** + * 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 ReevaluatesClient object to access its operations. + * + * @return the ReevaluatesClient object. + */ + ReevaluatesClient getReevaluates(); + /** * Gets the SecurityMLAnalyticsSettingsClient object to access its operations. - * + * * @return the SecurityMLAnalyticsSettingsClient object. */ SecurityMLAnalyticsSettingsClient getSecurityMLAnalyticsSettings(); /** * Gets the ProductSettingsClient object to access its operations. - * + * * @return the ProductSettingsClient object. */ ProductSettingsClient getProductSettings(); /** * Gets the SourceControlsClient object to access its operations. - * + * * @return the SourceControlsClient object. */ SourceControlsClient getSourceControls(); /** * Gets the SourceControlsOperationsClient object to access its operations. - * + * * @return the SourceControlsOperationsClient object. */ SourceControlsOperationsClient getSourceControlsOperations(); /** * Gets the 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 ThreatIntelligencesClient object to access its operations. + * + * @return the ThreatIntelligencesClient object. + */ + ThreatIntelligencesClient getThreatIntelligences(); + + /** + * Gets the TriggeredAnalyticsRuleRunOperationsClient object to access its operations. + * + * @return the TriggeredAnalyticsRuleRunOperationsClient object. + */ + TriggeredAnalyticsRuleRunOperationsClient getTriggeredAnalyticsRuleRunOperations(); + + /** + * Gets the GetTriggeredAnalyticsRuleRunsClient object to access its operations. + * + * @return the GetTriggeredAnalyticsRuleRunsClient object. + */ + GetTriggeredAnalyticsRuleRunsClient getGetTriggeredAnalyticsRuleRuns(); + + /** + * Gets the AlertRuleOperationsClient object to access its operations. + * + * @return the AlertRuleOperationsClient object. + */ + AlertRuleOperationsClient getAlertRuleOperations(); + /** * 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 WorkspaceManagerAssignmentsClient object to access its operations. + * + * @return the WorkspaceManagerAssignmentsClient object. + */ + WorkspaceManagerAssignmentsClient getWorkspaceManagerAssignments(); + + /** + * Gets the WorkspaceManagerAssignmentJobsClient object to access its operations. + * + * @return the WorkspaceManagerAssignmentJobsClient object. + */ + WorkspaceManagerAssignmentJobsClient getWorkspaceManagerAssignmentJobs(); + + /** + * 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 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 DataConnectorsCheckRequirementsOperationsClient object to access its operations. - * + * * @return the DataConnectorsCheckRequirementsOperationsClient object. */ DataConnectorsCheckRequirementsOperationsClient getDataConnectorsCheckRequirementsOperations(); /** * 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/SecurityMLAnalyticsSettingsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityMLAnalyticsSettingsClient.java index 421b46427588..37b2930cb76f 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 @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner; -/** An instance of this class provides access to all the operations defined in SecurityMLAnalyticsSettingsClient. */ +/** + * 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. @@ -28,7 +30,7 @@ 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. * @param context The context to associate with this operation. @@ -38,105 +40,98 @@ public interface SecurityMLAnalyticsSettingsClient { * @return all Security ML Analytics Settings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, Context context); + 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 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 com.azure.core.management.exception.ManagementException 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. + * @return the Security ML Analytics Settings along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityMLAnalyticsSettingInner get(String resourceGroupName, String workspaceName, String settingsResourceName); + Response getWithResponse(String resourceGroupName, String workspaceName, + String settingsResourceName, 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 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 com.azure.core.management.exception.ManagementException 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}. + * @return the Security ML Analytics Settings. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String settingsResourceName, Context context); + SecurityMLAnalyticsSettingInner get(String resourceGroupName, String workspaceName, String settingsResourceName); /** * 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 com.azure.core.management.exception.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. + * @return security ML Analytics Setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityMLAnalyticsSettingInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String settingsResourceName, - SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, Context 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 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 com.azure.core.management.exception.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}. + * @return security ML Analytics Setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String settingsResourceName, - SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, - Context context); + SecurityMLAnalyticsSettingInner createOrUpdate(String resourceGroupName, String workspaceName, + String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting); /** * 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 com.azure.core.management.exception.ManagementException 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) - void delete(String resourceGroupName, String workspaceName, String settingsResourceName); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String settingsResourceName, + Context 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 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 com.azure.core.management.exception.ManagementException 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 settingsResourceName, Context context); + void delete(String resourceGroupName, String workspaceName, String settingsResourceName); } 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 10a75e9aee2e..5bed6ffdb489 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 @@ -11,129 +11,128 @@ import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner; import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner; -/** An instance of this class provides access to all the operations defined in SentinelOnboardingStatesClient. */ +/** + * An instance of this class provides access to all the operations defined in SentinelOnboardingStatesClient. + */ public interface SentinelOnboardingStatesClient { /** * Get Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return sentinel onboarding state along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SentinelOnboardingStateInner get( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + Response getWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, Context context); /** * Get Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return sentinel onboarding state. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context); + SentinelOnboardingStateInner get(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName); /** * Create Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param sentinelOnboardingStateParameter The Sentinel onboarding state parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sentinel onboarding state. + * @return sentinel onboarding state along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SentinelOnboardingStateInner create( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + Response createWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, SentinelOnboardingStateInner sentinelOnboardingStateParameter, + Context context); /** * Create Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. - * @param sentinelOnboardingStateParameter The Sentinel onboarding state parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sentinel onboarding state along with {@link Response}. + * @return sentinel onboarding state. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String workspaceName, - String sentinelOnboardingStateName, - SentinelOnboardingStateInner sentinelOnboardingStateParameter, - Context context); + SentinelOnboardingStateInner create(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName); /** * Delete Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, Context context); /** * Delete Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 sentinelOnboardingStateName, Context context); + void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); /** * Gets all Sentinel onboarding states. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Sentinel onboarding states. + * @return all Sentinel onboarding states along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SentinelOnboardingStatesListInner list(String resourceGroupName, String workspaceName); + Response listWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * Gets all Sentinel onboarding states. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return all Sentinel onboarding states. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String workspaceName, Context context); + SentinelOnboardingStatesListInner list(String resourceGroupName, String workspaceName); } 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 index df97d27b4605..0ae114003f4d 100644 --- 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 @@ -9,30 +9,33 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; -import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; -/** An instance of this class provides access to all the operations defined in SourceControlsClient. */ +/** + * An instance of this class provides access to all the operations defined in SourceControlsClient. + */ public interface SourceControlsClient { /** * Gets a list of repositories metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param repoType The repo type. + * @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 a list of repositories metadata as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRepositories(String resourceGroupName, String workspaceName, RepoType repoType); + 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 repoType The repo type. + * @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. @@ -40,6 +43,6 @@ public interface SourceControlsClient { * @return a list of repositories metadata as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRepositories( - String resourceGroupName, String workspaceName, RepoType repoType, Context context); + 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/SourceControlsOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsOperationsClient.java index cbf7109c8ebb..2e2ebfff8bc8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsOperationsClient.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsOperationsClient.java @@ -10,12 +10,16 @@ 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 SourceControlsOperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in SourceControlsOperationsClient. + */ public interface SourceControlsOperationsClient { /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -28,7 +32,7 @@ public interface SourceControlsOperationsClient { /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -42,97 +46,97 @@ public interface SourceControlsOperationsClient { /** * Gets a source control byt its identifier. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a source control byt its identifier. + * @return a source control byt its identifier along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SourceControlInner get(String resourceGroupName, String workspaceName, String sourceControlId); + 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 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}. + * @return a source control byt its identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String sourceControlId, Context context); + SourceControlInner get(String resourceGroupName, String workspaceName, String sourceControlId); /** - * Delete a source control. - * + * Creates a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SourceControl in Azure Security Insights along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String sourceControlId); + Response createWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, SourceControlInner sourceControl, Context context); /** - * Delete a source control. - * + * Creates a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param context The context to associate with this operation. + * @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 the {@link Response}. + * @return represents a SourceControl in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String sourceControlId, Context context); + SourceControlInner create(String resourceGroupName, String workspaceName, String sourceControlId, + SourceControlInner sourceControl); /** - * Creates a source control. - * + * Delete a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param sourceControl The SourceControl. + * @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 represents a SourceControl in Azure Security Insights. + * @return warning response structure along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SourceControlInner create( - String resourceGroupName, String workspaceName, String sourceControlId, SourceControlInner sourceControl); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess, Context context); /** - * Creates a source control. - * + * Delete a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param sourceControl The SourceControl. - * @param context The context to associate with this operation. + * @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 represents a SourceControl in Azure Security Insights along with {@link Response}. + * @return warning response structure. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String workspaceName, - String sourceControlId, - SourceControlInner sourceControl, - Context context); + 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/SystemsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SystemsClient.java new file mode 100644 index 000000000000..3d8ac53c0f32 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SystemsClient.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.ActionInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SystemResourceInner; + +/** + * An instance of this class provides access to all the operations defined in SystemsClient. + */ +public interface SystemsClient { + /** + * Creates or updates the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param systemToUpsert The system to upsert. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the system within the agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, SystemResourceInner systemToUpsert, Context context); + + /** + * Creates or updates the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the system within the agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SystemResourceInner createOrUpdate(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName); + + /** + * Gets the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Context context); + + /** + * Gets the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SystemResourceInner get(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName); + + /** + * Deletes the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 agentResourceName, + String systemResourceName, Context context); + + /** + * Deletes the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 agentResourceName, String systemResourceName); + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 list of Agent's Systems as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String agentResourceName); + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param filter Filters the results, based on a Boolean condition. 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 list of Agent's Systems as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String agentResourceName, + String filter, String skipToken, Context context); + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 actions for a system to perform as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listActions(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName); + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param filter Filters the results, based on a Boolean condition. 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 list all actions for a system to perform as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listActions(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName, String filter, String skipToken, Context context); + + /** + * Undo action, based on the actionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Undo action, based on the actionId. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 undoActionWithResponse(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName, Object payload, Context context); + + /** + * Undo action, based on the actionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 undoAction(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName); + + /** + * Report the status of the action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Report a status of the action that was performed by the agent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 reportActionStatusWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload, Context context); + + /** + * Report the status of the action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reportActionStatus(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName); +} 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 326b9eedc2e1..37b1ef902430 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 @@ -16,30 +16,30 @@ 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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). + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source) along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThreatIntelligenceMetricsListInner list(String resourceGroupName, String workspaceName); + Response listWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String workspaceName, Context context); + ThreatIntelligenceMetricsListInner list(String resourceGroupName, String workspaceName); } 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 1e34a2b75f05..a49a1116b11b 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 @@ -14,143 +14,135 @@ import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; -/** An instance of this class provides access to all the operations defined in ThreatIntelligenceIndicatorsClient. */ +/** + * 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. + * @return threat intelligence information object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThreatIntelligenceInformationInner createIndicator( - String resourceGroupName, String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 threat intelligence information object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createIndicatorWithResponse( - String resourceGroupName, - String workspaceName, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - Context context); + 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 name Threat intelligence indicator name field. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object. + * @return threat intelligence information object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThreatIntelligenceInformationInner get(String resourceGroupName, String workspaceName, String name); + Response getWithResponse(String resourceGroupName, String workspaceName, + String name, Context context); /** * View a threat intelligence indicator by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 threat intelligence information object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + ThreatIntelligenceInformationInner get(String resourceGroupName, String workspaceName, String name); /** * Update a threat Intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object. + * @return threat intelligence information object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThreatIntelligenceInformationInner create( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties); + Response createWithResponse(String resourceGroupName, String workspaceName, + String name, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, Context context); /** * Update a threat Intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 threat intelligence information object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - Context context); + ThreatIntelligenceInformationInner create(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceIndicatorModel threatIntelligenceProperties); /** * Delete a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String name); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, Context context); /** * Delete a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 name, Context context); + 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. @@ -160,14 +152,12 @@ Response createWithResponse( * @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, + 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. @@ -178,88 +168,71 @@ PagedIterable queryIndicators( * @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); + PagedIterable queryIndicators(String resourceGroupName, String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, Context context); /** * Append tags to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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) - void appendTags( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceAppendTags threatIntelligenceAppendTags); + Response appendTagsWithResponse(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, Context context); /** * Append tags to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceAppendTags The threat intelligence append tags request body. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 appendTagsWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceAppendTags threatIntelligenceAppendTags, - Context context); + void appendTags(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags); /** * Replace tags added to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object. + * @return threat intelligence information object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThreatIntelligenceInformationInner replaceTags( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags); + Response replaceTagsWithResponse(String resourceGroupName, String workspaceName, + String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, Context context); /** * Replace tags added to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 threat intelligence information object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response replaceTagsWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, - Context context); + ThreatIntelligenceInformationInner replaceTags(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags); } 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 bbb61deb6dee..43278d6b9d9c 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 @@ -17,7 +17,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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,15 +30,15 @@ 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 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. + * 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. @@ -46,12 +46,6 @@ public interface ThreatIntelligenceIndicatorsOperationsClient { * @return all threat intelligence indicators 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); + 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/ThreatIntelligencesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligencesClient.java new file mode 100644 index 000000000000..f81c650bd869 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.QueryAutoGenerated; +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, Query 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, + QueryAutoGenerated 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..91613c00afdd --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..106808e9b72c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/UpdatesClient.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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; +import java.util.UUID; + +/** + * 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, + UUID 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, UUID 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 80ba49f0d3be..0a2a50c8270e 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 @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner; -/** An instance of this class provides access to all the operations defined in WatchlistItemsClient. */ +/** + * An instance of this class provides access to all the operations defined in WatchlistItemsClient. + */ public interface WatchlistItemsClient { /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -29,13 +31,13 @@ public interface WatchlistItemsClient { /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @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. + * 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. @@ -43,114 +45,105 @@ public interface WatchlistItemsClient { * @return all watchlist Items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String workspaceName, String watchlistAlias, String skipToken, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, + String skipToken, Context context); /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a watchlist, without its watchlist items along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistItemInner get( - String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, Context context); /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a watchlist, without its watchlist items. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId, Context context); + WatchlistItemInner get(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId); /** * Delete a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, Context context); /** * Delete a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 watchlistAlias, String watchlistItemId, Context context); + void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); /** * Creates or updates a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). * @param watchlistItem The watchlist item. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Watchlist item in Azure Security Insights. + * @return represents a Watchlist item in Azure Security Insights along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistItemInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - String watchlistItemId, - WatchlistItemInner watchlistItem); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, String watchlistItemId, WatchlistItemInner watchlistItem, Context context); /** * Creates or updates a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). * @param watchlistItem The watchlist item. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 represents a Watchlist item in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - String watchlistItemId, - WatchlistItemInner watchlistItem, - Context context); + WatchlistItemInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, WatchlistItemInner watchlistItem); } 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 10b174e1207f..a07baaa967ac 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 @@ -13,11 +13,13 @@ import com.azure.resourcemanager.securityinsights.models.WatchlistsCreateOrUpdateResponse; import com.azure.resourcemanager.securityinsights.models.WatchlistsDeleteResponse; -/** An instance of this class provides access to all the operations defined in WatchlistsClient. */ +/** + * An instance of this class provides access to all the operations defined in WatchlistsClient. + */ public interface WatchlistsClient { /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,12 +32,12 @@ public interface WatchlistsClient { /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @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. + * 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. @@ -43,67 +45,67 @@ public interface WatchlistsClient { * @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); + PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, + Context context); /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a watchlist, without its watchlist items along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias); + Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + Context context); /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a watchlist, without its watchlist items. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias); /** * Delete a watchlist. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String workspaceName, String watchlistAlias); + WatchlistsDeleteResponse deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + Context context); /** * Delete a watchlist. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistsDeleteResponse deleteWithResponse( - String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + 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 @@ -111,19 +113,20 @@ WatchlistsDeleteResponse deleteWithResponse( * contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). The SAS * URI enables the creation of large watchlist, where the content size can go up to 500 MB. The status of processing * such large file can be polled through the URL returned in Azure-AsyncOperation header. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlist The watchlist. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a Watchlist in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistInner createOrUpdate( - String resourceGroupName, String workspaceName, String watchlistAlias, WatchlistInner watchlist); + WatchlistsCreateOrUpdateResponse createOrUpdateWithResponse(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 @@ -131,22 +134,17 @@ WatchlistInner createOrUpdate( * contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). The SAS * URI enables the creation of large watchlist, where the content size can go up to 500 MB. The status of processing * such large file can be polled through the URL returned in Azure-AsyncOperation header. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlist The watchlist. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a Watchlist in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistsCreateOrUpdateResponse createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - WatchlistInner watchlist, - Context context); + WatchlistInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + WatchlistInner watchlist); } 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..b1df7c351eab --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.JobInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerAssignmentJobsClient. + */ +public interface WorkspaceManagerAssignmentJobsClient { + /** + * 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); + + /** + * 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); +} 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..1df3dbe69149 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerAssignmentsClient. + */ +public interface WorkspaceManagerAssignmentsClient { + /** + * 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); + + /** + * 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); +} 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..fdfda6fb9a86 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerConfigurationsClient. + */ +public interface WorkspaceManagerConfigurationsClient { + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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..6a62e785bc72 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerGroupsClient. + */ +public interface WorkspaceManagerGroupsClient { + /** + * 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); + + /** + * 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); +} 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..c082ae91d74c --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerMembersClient. + */ +public interface WorkspaceManagerMembersClient { + /** + * 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); + + /** + * 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); +} 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 index ca6a6d8e19e0..b4e84a34de6c 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** AAD (Azure Active Directory) requirements check properties. */ +/** + * AADIP (Azure Active Directory Identity Protection) requirements check properties. + */ @Fluent public final class AadCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of AadCheckRequirementsProperties class. + */ + public AadCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public AadCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public AadCheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index be85a145cdd0..e437a9ac9a88 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; import com.fasterxml.jackson.annotation.JsonProperty; -/** AAD (Azure Active Directory) data connector properties. */ +/** + * AADIP (Azure Active Directory Identity Protection) data connector properties. + */ @Fluent public final class AadDataConnectorProperties extends DataConnectorTenantId { /* @@ -18,9 +20,15 @@ public final class AadDataConnectorProperties extends DataConnectorTenantId { @JsonProperty(value = "dataTypes") private AlertsDataTypeOfDataConnector dataTypes; + /** + * Creates an instance of AadDataConnectorProperties class. + */ + public AadDataConnectorProperties() { + } + /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -29,7 +37,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the AadDataConnectorProperties object itself. */ @@ -38,7 +46,9 @@ public AadDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector da return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AadDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -47,7 +57,7 @@ public AadDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index ee6d93cd9141..e326ce5d97d6 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** AATP (Azure Advanced Threat Protection) requirements check properties. */ +/** + * AATP (Azure Advanced Threat Protection) requirements check properties. + */ @Fluent public final class AatpCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of AatpCheckRequirementsProperties class. + */ + public AatpCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public AatpCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public AatpCheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 3a0bdc1ed428..3080a0382970 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; import com.fasterxml.jackson.annotation.JsonProperty; -/** AATP (Azure Advanced Threat Protection) data connector properties. */ +/** + * AATP (Azure Advanced Threat Protection) data connector properties. + */ @Fluent public final class AatpDataConnectorProperties extends DataConnectorTenantId { /* @@ -18,9 +20,15 @@ public final class AatpDataConnectorProperties extends DataConnectorTenantId { @JsonProperty(value = "dataTypes") private AlertsDataTypeOfDataConnector dataTypes; + /** + * Creates an instance of AatpDataConnectorProperties class. + */ + public AatpDataConnectorProperties() { + } + /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -29,7 +37,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the AatpDataConnectorProperties object itself. */ @@ -38,7 +46,9 @@ public AatpDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector d return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AatpDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -47,7 +57,7 @@ public AatpDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 22c53e70b336..71e6c628df60 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; -/** Account entity property bag. */ +/** + * Account entity property bag. + */ @Immutable public final class AccountEntityProperties extends EntityCommonProperties { /* @@ -25,8 +27,7 @@ public final class AccountEntityProperties extends EntityCommonProperties { private String aadUserId; /* - * The name of the account. This field should hold only the name without any domain added to it, i.e. - * administrator. + * The name of the account. This field should hold only the name without any domain added to it, i.e. administrator. */ @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) private String accountName; @@ -56,8 +57,7 @@ public final class AccountEntityProperties extends EntityCommonProperties { private String ntDomain; /* - * The objectGUID attribute is a single-value attribute that is the unique identifier for the object, assigned by - * active directory. + * The objectGUID attribute is a single-value attribute that is the unique identifier for the object, assigned by active directory. */ @JsonProperty(value = "objectGuid", access = JsonProperty.Access.WRITE_ONLY) private UUID objectGuid; @@ -86,9 +86,15 @@ public final class AccountEntityProperties extends EntityCommonProperties { @JsonProperty(value = "dnsDomain", access = JsonProperty.Access.WRITE_ONLY) private String dnsDomain; + /** + * Creates an instance of AccountEntityProperties class. + */ + public AccountEntityProperties() { + } + /** * Get the aadTenantId property: The Azure Active Directory tenant id. - * + * * @return the aadTenantId value. */ public String aadTenantId() { @@ -97,7 +103,7 @@ public String aadTenantId() { /** * Get the aadUserId property: The Azure Active Directory user id. - * + * * @return the aadUserId value. */ public String aadUserId() { @@ -107,7 +113,7 @@ public String aadUserId() { /** * Get the accountName property: The name of the account. This field should hold only the name without any domain * added to it, i.e. administrator. - * + * * @return the accountName value. */ public String accountName() { @@ -116,7 +122,7 @@ public String accountName() { /** * Get the displayName property: The display name of the account. - * + * * @return the displayName value. */ public String displayName() { @@ -126,7 +132,7 @@ public String displayName() { /** * Get the hostEntityId property: The Host entity id that contains the account in case it is a local account (not * domain joined). - * + * * @return the hostEntityId value. */ public String hostEntityId() { @@ -135,7 +141,7 @@ public String hostEntityId() { /** * Get the isDomainJoined property: Determines whether this is a domain account. - * + * * @return the isDomainJoined value. */ public Boolean isDomainJoined() { @@ -145,7 +151,7 @@ public Boolean isDomainJoined() { /** * Get the ntDomain property: The NetBIOS domain name as it appears in the alert format domain/username. Examples: * NT AUTHORITY. - * + * * @return the ntDomain value. */ public String ntDomain() { @@ -155,7 +161,7 @@ public String ntDomain() { /** * Get the objectGuid property: The objectGUID attribute is a single-value attribute that is the unique identifier * for the object, assigned by active directory. - * + * * @return the objectGuid value. */ public UUID objectGuid() { @@ -164,7 +170,7 @@ public UUID objectGuid() { /** * Get the puid property: The Azure Active Directory Passport User ID. - * + * * @return the puid value. */ public String puid() { @@ -173,7 +179,7 @@ public String puid() { /** * Get the sid property: The account security identifier, e.g. S-1-5-18. - * + * * @return the sid value. */ public String sid() { @@ -183,7 +189,7 @@ public String sid() { /** * Get the upnSuffix property: The user principal name suffix for the account, in some cases it is also the domain * name. Examples: contoso.com. - * + * * @return the upnSuffix value. */ public String upnSuffix() { @@ -192,7 +198,7 @@ public String upnSuffix() { /** * Get the dnsDomain property: The fully qualified domain DNS name. - * + * * @return the dnsDomain value. */ public String dnsDomain() { @@ -201,7 +207,7 @@ public String dnsDomain() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionInner.java new file mode 100644 index 000000000000..830141f25245 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionInner.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.securityinsights.models.ListActionKind; +import com.azure.resourcemanager.securityinsights.models.LockUserAction; +import com.azure.resourcemanager.securityinsights.models.UnlockUserAction; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an action to perform on a specific system. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ActionInner.class, visible = true) +@JsonTypeName("Action") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "LockUser", value = LockUserAction.class), + @JsonSubTypes.Type(name = "UnlockUser", value = UnlockUserAction.class) }) +@Immutable +public class ActionInner { + /* + * The actions kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ListActionKind kind; + + /** + * Creates an instance of ActionInner class. + */ + public ActionInner() { + this.kind = ListActionKind.fromString("Action"); + } + + /** + * Get the kind property: The actions kind. + * + * @return the kind value. + */ + public ListActionKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionRequestProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionRequestProperties.java index 412a0c40b92e..5d8d153f6520 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 @@ -9,18 +9,26 @@ import com.azure.resourcemanager.securityinsights.models.ActionPropertiesBase; import com.fasterxml.jackson.annotation.JsonProperty; -/** Action property bag. */ +/** + * Action property bag. + */ @Fluent public final class ActionRequestProperties extends ActionPropertiesBase { /* * Logic App Callback URL for this specific workflow. */ - @JsonProperty(value = "triggerUri", required = true) + @JsonProperty(value = "triggerUri") private String triggerUri; + /** + * Creates an instance of ActionRequestProperties class. + */ + public ActionRequestProperties() { + } + /** * Get the triggerUri property: Logic App Callback URL for this specific workflow. - * + * * @return the triggerUri value. */ public String triggerUri() { @@ -29,7 +37,7 @@ public String triggerUri() { /** * Set the triggerUri property: Logic App Callback URL for this specific workflow. - * + * * @param triggerUri the triggerUri value to set. * @return the ActionRequestProperties object itself. */ @@ -38,7 +46,9 @@ public ActionRequestProperties withTriggerUri(String triggerUri) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActionRequestProperties withLogicAppResourceId(String logicAppResourceId) { super.withLogicAppResourceId(logicAppResourceId); @@ -47,17 +57,16 @@ public ActionRequestProperties withLogicAppResourceId(String logicAppResourceId) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (triggerUri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property triggerUri in model ActionRequestProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property triggerUri in model ActionRequestProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseInner.java index 3122bbedd575..2331ded58f3a 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import com.fasterxml.jackson.annotation.JsonProperty; -/** Action for alert rule. */ +/** + * Action for alert rule. + */ @Fluent public final class ActionResponseInner extends ResourceWithEtag { /* @@ -17,16 +19,24 @@ public final class ActionResponseInner extends ResourceWithEtag { @JsonProperty(value = "properties") private ActionResponseProperties innerProperties; + /** + * Creates an instance of ActionResponseInner class. + */ + public ActionResponseInner() { + } + /** * Get the innerProperties property: Action properties for get request. - * + * * @return the innerProperties value. */ private ActionResponseProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActionResponseInner withEtag(String etag) { super.withEtag(etag); @@ -35,7 +45,7 @@ public ActionResponseInner withEtag(String etag) { /** * Get the workflowId property: The name of the logic app's workflow. - * + * * @return the workflowId value. */ public String workflowId() { @@ -44,7 +54,7 @@ public String 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. */ @@ -59,7 +69,7 @@ public ActionResponseInner withWorkflowId(String workflowId) { /** * Get the logicAppResourceId property: Logic App Resource Id, * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. - * + * * @return the logicAppResourceId value. */ public String logicAppResourceId() { @@ -69,7 +79,7 @@ public String 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. */ @@ -83,7 +93,7 @@ public ActionResponseInner withLogicAppResourceId(String logicAppResourceId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 0661a17d6444..8b1aa091f768 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.models.ActionPropertiesBase; import com.fasterxml.jackson.annotation.JsonProperty; -/** Action property bag. */ +/** + * Action property bag. + */ @Fluent public final class ActionResponseProperties extends ActionPropertiesBase { /* @@ -17,9 +19,15 @@ public final class ActionResponseProperties extends ActionPropertiesBase { @JsonProperty(value = "workflowId") private String workflowId; + /** + * Creates an instance of ActionResponseProperties class. + */ + public ActionResponseProperties() { + } + /** * Get the workflowId property: The name of the logic app's workflow. - * + * * @return the workflowId value. */ public String workflowId() { @@ -28,7 +36,7 @@ public String 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. */ @@ -37,7 +45,9 @@ public ActionResponseProperties withWorkflowId(String workflowId) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActionResponseProperties withLogicAppResourceId(String logicAppResourceId) { super.withLogicAppResourceId(logicAppResourceId); @@ -46,7 +56,7 @@ public ActionResponseProperties withLogicAppResourceId(String logicAppResourceId /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index e3017231f55d..32f5f7abbec7 100644 --- 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 @@ -13,7 +13,9 @@ import java.util.List; import java.util.Map; -/** Describes activity entity query properties. */ +/** + * Describes activity entity query properties. + */ @Fluent public final class ActivityEntityQueriesProperties { /* @@ -83,9 +85,15 @@ public final class ActivityEntityQueriesProperties { @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) 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() { @@ -94,7 +102,7 @@ public String title() { /** * Set the title property: The entity query title. - * + * * @param title the title value to set. * @return the ActivityEntityQueriesProperties object itself. */ @@ -105,7 +113,7 @@ public ActivityEntityQueriesProperties withTitle(String title) { /** * Get the content property: The entity query content to display in timeline. - * + * * @return the content value. */ public String content() { @@ -114,7 +122,7 @@ public String 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. */ @@ -125,7 +133,7 @@ public ActivityEntityQueriesProperties withContent(String content) { /** * Get the description property: The entity query description. - * + * * @return the description value. */ public String description() { @@ -134,7 +142,7 @@ public String description() { /** * Set the description property: The entity query description. - * + * * @param description the description value to set. * @return the ActivityEntityQueriesProperties object itself. */ @@ -145,7 +153,7 @@ public ActivityEntityQueriesProperties withDescription(String description) { /** * Get the queryDefinitions property: The Activity query definitions. - * + * * @return the queryDefinitions value. */ public ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions() { @@ -154,19 +162,19 @@ public ActivityEntityQueriesPropertiesQueryDefinitions 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) { + 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() { @@ -175,7 +183,7 @@ public EntityType 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. */ @@ -187,7 +195,7 @@ public ActivityEntityQueriesProperties withInputEntityType(EntityType inputEntit /** * 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() { @@ -197,7 +205,7 @@ public List> 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. */ @@ -208,7 +216,7 @@ public ActivityEntityQueriesProperties withRequiredInputFieldsSets(List> entitiesFilter() { @@ -217,7 +225,7 @@ public Map> 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. */ @@ -228,7 +236,7 @@ public ActivityEntityQueriesProperties withEntitiesFilter(Map> entitiesFilter; + /** + * Creates an instance of ActivityEntityQueryTemplateProperties class. + */ + public ActivityEntityQueryTemplateProperties() { + } + /** * Get the title property: The entity query title. - * + * * @return the title value. */ public String title() { @@ -76,7 +84,7 @@ public String title() { /** * Set the title property: The entity query title. - * + * * @param title the title value to set. * @return the ActivityEntityQueryTemplateProperties object itself. */ @@ -87,7 +95,7 @@ public ActivityEntityQueryTemplateProperties withTitle(String title) { /** * Get the content property: The entity query content to display in timeline. - * + * * @return the content value. */ public String content() { @@ -96,7 +104,7 @@ public String content() { /** * Set the content property: The entity query content to display in timeline. - * + * * @param content the content value to set. * @return the ActivityEntityQueryTemplateProperties object itself. */ @@ -107,7 +115,7 @@ public ActivityEntityQueryTemplateProperties withContent(String content) { /** * Get the description property: The entity query description. - * + * * @return the description value. */ public String description() { @@ -116,7 +124,7 @@ public String description() { /** * Set the description property: The entity query description. - * + * * @param description the description value to set. * @return the ActivityEntityQueryTemplateProperties object itself. */ @@ -127,7 +135,7 @@ public ActivityEntityQueryTemplateProperties withDescription(String description) /** * Get the queryDefinitions property: The Activity query definitions. - * + * * @return the queryDefinitions value. */ public ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions() { @@ -136,19 +144,19 @@ public ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions() /** * Set the queryDefinitions property: The Activity query definitions. - * + * * @param queryDefinitions the queryDefinitions value to set. * @return the ActivityEntityQueryTemplateProperties object itself. */ - public ActivityEntityQueryTemplateProperties withQueryDefinitions( - ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions) { + public ActivityEntityQueryTemplateProperties + withQueryDefinitions(ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions) { this.queryDefinitions = queryDefinitions; return this; } /** * Get the dataTypes property: List of required data types for the given entity query template. - * + * * @return the dataTypes value. */ public List dataTypes() { @@ -157,7 +165,7 @@ public List dataTypes() { /** * Set the dataTypes property: List of required data types for the given entity query template. - * + * * @param dataTypes the dataTypes value to set. * @return the ActivityEntityQueryTemplateProperties object itself. */ @@ -168,7 +176,7 @@ public ActivityEntityQueryTemplateProperties withDataTypes(List> requiredInputFieldsSets() { @@ -199,19 +207,19 @@ public List> requiredInputFieldsSets() { /** * Set the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the * query. - * + * * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. * @return the ActivityEntityQueryTemplateProperties object itself. */ - public ActivityEntityQueryTemplateProperties withRequiredInputFieldsSets( - List> requiredInputFieldsSets) { + public ActivityEntityQueryTemplateProperties + withRequiredInputFieldsSets(List> requiredInputFieldsSets) { this.requiredInputFieldsSets = requiredInputFieldsSets; return this; } /** * Get the entitiesFilter property: The query applied only to entities matching to all filters. - * + * * @return the entitiesFilter value. */ public Map> entitiesFilter() { @@ -220,7 +228,7 @@ public Map> entitiesFilter() { /** * Set the entitiesFilter property: The query applied only to entities matching to all filters. - * + * * @param entitiesFilter the entitiesFilter value to set. * @return the ActivityEntityQueryTemplateProperties object itself. */ @@ -231,7 +239,7 @@ public ActivityEntityQueryTemplateProperties withEntitiesFilter(Map agentSystems; + + /* + * The displayName property. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * The lastModifiedTimeUtc property. + */ + @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTimeUtc; + + /** + * Creates an instance of AgentProperties class. + */ + public AgentProperties() { + } + + /** + * Get the configuration property: Describes the configuration of a Business Application Agent. + * + * @return the configuration value. + */ + public AgentConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Describes the configuration of a Business Application Agent. + * + * @param configuration the configuration value to set. + * @return the AgentProperties object itself. + */ + public AgentProperties withConfiguration(AgentConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the agentSystems property: The agentSystems property. + * + * @return the agentSystems value. + */ + public List agentSystems() { + return this.agentSystems; + } + + /** + * Get the displayName property: The displayName property. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The displayName property. + * + * @param displayName the displayName value to set. + * @return the AgentProperties object itself. + */ + public AgentProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the lastModifiedTimeUtc property: The lastModifiedTimeUtc property. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property configuration in model AgentProperties")); + } else { + configuration().validate(); + } + if (agentSystems() != null) { + agentSystems().forEach(e -> e.validate()); + } + if (displayName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property displayName in model AgentProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AgentProperties.class); +} 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 f3346f5f0a50..3d42abd430b0 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 @@ -5,23 +5,24 @@ package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; +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.MLBehaviorAnalyticsAlertRule; import com.azure.resourcemanager.securityinsights.models.NrtAlertRule; import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRule; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRule; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Alert rule. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = AlertRuleInner.class) +/** + * Alert rule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AlertRuleInner.class, visible = true) @JsonTypeName("AlertRule") @JsonSubTypes({ @JsonSubTypes.Type(name = "MLBehaviorAnalytics", value = MLBehaviorAnalyticsAlertRule.class), @@ -31,11 +32,35 @@ name = "MicrosoftSecurityIncidentCreation", value = MicrosoftSecurityIncidentCreationAlertRule.class), @JsonSubTypes.Type(name = "Scheduled", value = ScheduledAlertRule.class), - @JsonSubTypes.Type(name = "NRT", value = NrtAlertRule.class) -}) + @JsonSubTypes.Type(name = "NRT", value = NrtAlertRule.class) }) @Fluent public class AlertRuleInner extends ResourceWithEtag { - /** {@inheritDoc} */ + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind; + + /** + * Creates an instance of AlertRuleInner class. + */ + public AlertRuleInner() { + this.kind = AlertRuleKind.fromString("AlertRule"); + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + public AlertRuleKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ @Override public AlertRuleInner withEtag(String etag) { super.withEtag(etag); @@ -44,7 +69,7 @@ public AlertRuleInner withEtag(String etag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 a3b8dba66899..903707b4844f 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 @@ -7,23 +7,23 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +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.MLBehaviorAnalyticsAlertRuleTemplate; import com.azure.resourcemanager.securityinsights.models.NrtAlertRuleTemplate; import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRuleTemplate; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRuleTemplate; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Alert rule template. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = AlertRuleTemplateInner.class) +/** + * Alert rule template. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AlertRuleTemplateInner.class, visible = true) @JsonTypeName("AlertRuleTemplate") @JsonSubTypes({ @JsonSubTypes.Type(name = "MLBehaviorAnalytics", value = MLBehaviorAnalyticsAlertRuleTemplate.class), @@ -33,19 +33,41 @@ name = "MicrosoftSecurityIncidentCreation", value = MicrosoftSecurityIncidentCreationAlertRuleTemplate.class), @JsonSubTypes.Type(name = "Scheduled", value = ScheduledAlertRuleTemplate.class), - @JsonSubTypes.Type(name = "NRT", value = NrtAlertRuleTemplate.class) -}) + @JsonSubTypes.Type(name = "NRT", value = NrtAlertRuleTemplate.class) }) @Immutable public class AlertRuleTemplateInner extends ProxyResource { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** + * Creates an instance of AlertRuleTemplateInner class. + */ + public AlertRuleTemplateInner() { + this.kind = AlertRuleKind.fromString("AlertRuleTemplate"); + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + public AlertRuleKind kind() { + return this.kind; + } + /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -54,7 +76,7 @@ public SystemData systemData() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..e9b0eeac6fd0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnalyticsRuleRunTriggerProperties.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * The Analytics Rule Run Trigger properties. + */ +@Fluent +public final class AnalyticsRuleRunTriggerProperties { + /* + * The executionTimeUtc property. + */ + @JsonProperty(value = "executionTimeUtc", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (executionTimeUtc() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property executionTimeUtc in model AnalyticsRuleRunTriggerProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AnalyticsRuleRunTriggerProperties.class); +} 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 index 1dbd5f5a9d02..5daa8aed19fc 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Anomalies property bag. */ +/** + * Anomalies property bag. + */ @Immutable public final class AnomaliesSettingsProperties { /* @@ -16,9 +18,15 @@ public final class AnomaliesSettingsProperties { @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) 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() { @@ -27,7 +35,7 @@ public Boolean isEnabled() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomalySecurityMLAnalyticsSettingsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomalySecurityMLAnalyticsSettingsProperties.java index 039d66c00674..406a8fea9256 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 @@ -15,7 +15,9 @@ import java.util.List; import java.util.UUID; -/** AnomalySecurityMLAnalytics settings base property bag. */ +/** + * AnomalySecurityMLAnalytics settings base property bag. + */ @Fluent public final class AnomalySecurityMLAnalyticsSettingsProperties { /* @@ -91,8 +93,7 @@ public final class AnomalySecurityMLAnalyticsSettingsProperties { private boolean isDefaultSettings; /* - * The anomaly settings version of the Anomaly security ml analytics settings that dictates whether job version - * gets updated or not. + * The anomaly settings version of the Anomaly security ml analytics settings that dictates whether job version gets updated or not. */ @JsonProperty(value = "anomalySettingsVersion") private Integer anomalySettingsVersion; @@ -103,9 +104,15 @@ public final class AnomalySecurityMLAnalyticsSettingsProperties { @JsonProperty(value = "settingsDefinitionId") private UUID settingsDefinitionId; + /** + * Creates an instance of AnomalySecurityMLAnalyticsSettingsProperties class. + */ + public AnomalySecurityMLAnalyticsSettingsProperties() { + } + /** * Get the description property: The description of the SecurityMLAnalyticsSettings. - * + * * @return the description value. */ public String description() { @@ -114,7 +121,7 @@ public String description() { /** * Set the description property: The description of the SecurityMLAnalyticsSettings. - * + * * @param description the description value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -125,7 +132,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withDescription(String descr /** * Get the displayName property: The display name for settings created by this SecurityMLAnalyticsSettings. - * + * * @return the displayName value. */ public String displayName() { @@ -134,7 +141,7 @@ public String displayName() { /** * Set the displayName property: The display name for settings created by this SecurityMLAnalyticsSettings. - * + * * @param displayName the displayName value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -145,7 +152,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withDisplayName(String displ /** * Get the enabled property: Determines whether this settings is enabled or disabled. - * + * * @return the enabled value. */ public boolean enabled() { @@ -154,7 +161,7 @@ public boolean enabled() { /** * Set the enabled property: Determines whether this settings is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -165,7 +172,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withEnabled(boolean enabled) /** * Get the lastModifiedUtc property: The last time that this SecurityMLAnalyticsSettings has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -174,7 +181,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the requiredDataConnectors property: The required data sources for this SecurityMLAnalyticsSettings. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -183,19 +190,19 @@ public List requiredDataConnectors() { /** * Set the requiredDataConnectors property: The required data sources for this SecurityMLAnalyticsSettings. - * + * * @param requiredDataConnectors the requiredDataConnectors value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ - public AnomalySecurityMLAnalyticsSettingsProperties withRequiredDataConnectors( - List requiredDataConnectors) { + public AnomalySecurityMLAnalyticsSettingsProperties + withRequiredDataConnectors(List requiredDataConnectors) { this.requiredDataConnectors = requiredDataConnectors; return this; } /** * Get the tactics property: The tactics of the SecurityMLAnalyticsSettings. - * + * * @return the tactics value. */ public List tactics() { @@ -204,7 +211,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the SecurityMLAnalyticsSettings. - * + * * @param tactics the tactics value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -215,7 +222,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withTactics(List techniques() { @@ -224,7 +231,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the SecurityMLAnalyticsSettings. - * + * * @param techniques the techniques value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -235,7 +242,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withTechniques(List /** * Get the anomalyVersion property: The anomaly version of the AnomalySecurityMLAnalyticsSettings. - * + * * @return the anomalyVersion value. */ public String anomalyVersion() { @@ -244,7 +251,7 @@ public String anomalyVersion() { /** * Set the anomalyVersion property: The anomaly version of the AnomalySecurityMLAnalyticsSettings. - * + * * @param anomalyVersion the anomalyVersion value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -256,7 +263,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withAnomalyVersion(String an /** * Get the customizableObservations property: The customizable observations of the * AnomalySecurityMLAnalyticsSettings. - * + * * @return the customizableObservations value. */ public Object customizableObservations() { @@ -266,7 +273,7 @@ public Object customizableObservations() { /** * Set the customizableObservations property: The customizable observations of the * AnomalySecurityMLAnalyticsSettings. - * + * * @param customizableObservations the customizableObservations value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -277,7 +284,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withCustomizableObservations /** * Get the frequency property: The frequency that this SecurityMLAnalyticsSettings will be run. - * + * * @return the frequency value. */ public Duration frequency() { @@ -286,7 +293,7 @@ public Duration frequency() { /** * Set the frequency property: The frequency that this SecurityMLAnalyticsSettings will be run. - * + * * @param frequency the frequency value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -297,7 +304,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withFrequency(Duration frequ /** * Get the settingsStatus property: The anomaly SecurityMLAnalyticsSettings status. - * + * * @return the settingsStatus value. */ public SettingsStatus settingsStatus() { @@ -306,7 +313,7 @@ public SettingsStatus settingsStatus() { /** * Set the settingsStatus property: The anomaly SecurityMLAnalyticsSettings status. - * + * * @param settingsStatus the settingsStatus value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -318,7 +325,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withSettingsStatus(SettingsS /** * Get the isDefaultSettings property: Determines whether this anomaly security ml analytics settings is a default * settings. - * + * * @return the isDefaultSettings value. */ public boolean isDefaultSettings() { @@ -328,7 +335,7 @@ public boolean isDefaultSettings() { /** * Set the isDefaultSettings property: Determines whether this anomaly security ml analytics settings is a default * settings. - * + * * @param isDefaultSettings the isDefaultSettings value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -340,7 +347,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withIsDefaultSettings(boolea /** * Get the anomalySettingsVersion property: The anomaly settings version of the Anomaly security ml analytics * settings that dictates whether job version gets updated or not. - * + * * @return the anomalySettingsVersion value. */ public Integer anomalySettingsVersion() { @@ -350,7 +357,7 @@ public Integer anomalySettingsVersion() { /** * Set the anomalySettingsVersion property: The anomaly settings version of the Anomaly security ml analytics * settings that dictates whether job version gets updated or not. - * + * * @param anomalySettingsVersion the anomalySettingsVersion value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -361,7 +368,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withAnomalySettingsVersion(I /** * Get the settingsDefinitionId property: The anomaly settings definition Id. - * + * * @return the settingsDefinitionId value. */ public UUID settingsDefinitionId() { @@ -370,7 +377,7 @@ public UUID settingsDefinitionId() { /** * Set the settingsDefinitionId property: The anomaly settings definition Id. - * + * * @param settingsDefinitionId the settingsDefinitionId value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ @@ -381,38 +388,32 @@ public AnomalySecurityMLAnalyticsSettingsProperties withSettingsDefinitionId(UUI /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model AnomalySecurityMLAnalyticsSettingsProperties")); + 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 - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property anomalyVersion in model" - + " AnomalySecurityMLAnalyticsSettingsProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property anomalyVersion in model AnomalySecurityMLAnalyticsSettingsProperties")); } if (frequency() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property frequency in model AnomalySecurityMLAnalyticsSettingsProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property frequency in model AnomalySecurityMLAnalyticsSettingsProperties")); } if (settingsStatus() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property settingsStatus in model" - + " AnomalySecurityMLAnalyticsSettingsProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property settingsStatus in model AnomalySecurityMLAnalyticsSettingsProperties")); } } 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 index 4e31c9709d7d..d83ad48a0514 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents Codeless API Polling data connector. */ +/** + * Represents Codeless API Polling data connector. + */ @Fluent public final class ApiPollingParameters { /* @@ -24,9 +26,15 @@ public final class ApiPollingParameters { @JsonProperty(value = "pollingConfig") 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() { @@ -35,7 +43,7 @@ public CodelessUiConnectorConfigProperties connectorUiConfig() { /** * Set the connectorUiConfig property: Config to describe the instructions blade. - * + * * @param connectorUiConfig the connectorUiConfig value to set. * @return the ApiPollingParameters object itself. */ @@ -46,7 +54,7 @@ public ApiPollingParameters withConnectorUiConfig(CodelessUiConnectorConfigPrope /** * Get the pollingConfig property: Config to describe the polling instructions. - * + * * @return the pollingConfig value. */ public CodelessConnectorPollingConfigProperties pollingConfig() { @@ -55,7 +63,7 @@ public CodelessConnectorPollingConfigProperties pollingConfig() { /** * Set the pollingConfig property: Config to describe the polling instructions. - * + * * @param pollingConfig the pollingConfig value to set. * @return the ApiPollingParameters object itself. */ @@ -66,7 +74,7 @@ public ApiPollingParameters withPollingConfig(CodelessConnectorPollingConfigProp /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscCheckRequirementsProperties.java index c7755a357b32..2df11cf3f030 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** ASC (Azure Security Center) requirements check properties. */ +/** + * ASC (Azure Security Center) requirements check properties. + */ @Fluent public final class AscCheckRequirementsProperties { /* @@ -16,9 +18,15 @@ public final class AscCheckRequirementsProperties { @JsonProperty(value = "subscriptionId") 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() { @@ -27,7 +35,7 @@ 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 AscCheckRequirementsProperties object itself. */ @@ -38,7 +46,7 @@ public AscCheckRequirementsProperties withSubscriptionId(String subscriptionId) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscDataConnectorProperties.java index 486d75131f91..35836c4180e6 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.DataConnectorWithAlertsProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** ASC (Azure Security Center) data connector properties. */ +/** + * ASC (Azure Security Center) data connector properties. + */ @Fluent public final class AscDataConnectorProperties extends DataConnectorWithAlertsProperties { /* @@ -18,9 +20,15 @@ public final class AscDataConnectorProperties extends DataConnectorWithAlertsPro @JsonProperty(value = "subscriptionId") private String subscriptionId; + /** + * Creates an instance of AscDataConnectorProperties class. + */ + public AscDataConnectorProperties() { + } + /** * Get the subscriptionId property: The subscription id to connect to, and get the data from. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -29,7 +37,7 @@ 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. */ @@ -38,7 +46,9 @@ public AscDataConnectorProperties withSubscriptionId(String subscriptionId) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AscDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { super.withDataTypes(dataTypes); @@ -47,7 +57,7 @@ public AscDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector da /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 1880bf1f167c..bc48fb5b68c4 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 @@ -14,7 +14,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** The AutomationRule model. */ +/** + * The AutomationRule model. + */ @Fluent public final class AutomationRuleInner extends ResourceWithEtag { /* @@ -23,16 +25,24 @@ public final class AutomationRuleInner extends ResourceWithEtag { @JsonProperty(value = "properties", required = true) private AutomationRuleProperties innerProperties = new AutomationRuleProperties(); + /** + * Creates an instance of AutomationRuleInner class. + */ + public AutomationRuleInner() { + } + /** * Get the innerProperties property: Automation rule properties. - * + * * @return the innerProperties value. */ private AutomationRuleProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutomationRuleInner withEtag(String etag) { super.withEtag(etag); @@ -41,7 +51,7 @@ public AutomationRuleInner withEtag(String etag) { /** * Get the displayName property: The display name of the automation rule. - * + * * @return the displayName value. */ public String displayName() { @@ -50,7 +60,7 @@ public String displayName() { /** * Set the displayName property: The display name of the automation rule. - * + * * @param displayName the displayName value to set. * @return the AutomationRuleInner object itself. */ @@ -64,7 +74,7 @@ public AutomationRuleInner withDisplayName(String displayName) { /** * Get the order property: The order of execution of the automation rule. - * + * * @return the order value. */ public int order() { @@ -73,7 +83,7 @@ public int order() { /** * Set the order property: The order of execution of the automation rule. - * + * * @param order the order value to set. * @return the AutomationRuleInner object itself. */ @@ -87,7 +97,7 @@ public AutomationRuleInner withOrder(int order) { /** * Get the triggeringLogic property: Describes automation rule triggering logic. - * + * * @return the triggeringLogic value. */ public AutomationRuleTriggeringLogic triggeringLogic() { @@ -96,7 +106,7 @@ public AutomationRuleTriggeringLogic triggeringLogic() { /** * Set the triggeringLogic property: Describes automation rule triggering logic. - * + * * @param triggeringLogic the triggeringLogic value to set. * @return the AutomationRuleInner object itself. */ @@ -110,7 +120,7 @@ public AutomationRuleInner withTriggeringLogic(AutomationRuleTriggeringLogic tri /** * Get the actions property: The actions to execute when the automation rule is triggered. - * + * * @return the actions value. */ public List actions() { @@ -119,7 +129,7 @@ public List actions() { /** * Set the actions property: The actions to execute when the automation rule is triggered. - * + * * @param actions the actions value to set. * @return the AutomationRuleInner object itself. */ @@ -133,7 +143,7 @@ public AutomationRuleInner withActions(List actions) { /** * Get the lastModifiedTimeUtc property: The last time the automation rule was updated. - * + * * @return the lastModifiedTimeUtc value. */ public OffsetDateTime lastModifiedTimeUtc() { @@ -142,7 +152,7 @@ public OffsetDateTime lastModifiedTimeUtc() { /** * Get the createdTimeUtc property: The time the automation rule was created. - * + * * @return the createdTimeUtc value. */ public OffsetDateTime createdTimeUtc() { @@ -151,7 +161,7 @@ public OffsetDateTime createdTimeUtc() { /** * Get the lastModifiedBy property: Information on the client (user or application) that made some action. - * + * * @return the lastModifiedBy value. */ public ClientInfo lastModifiedBy() { @@ -160,7 +170,7 @@ public ClientInfo lastModifiedBy() { /** * Get the createdBy property: Information on the client (user or application) that made some action. - * + * * @return the createdBy value. */ public ClientInfo createdBy() { @@ -169,17 +179,16 @@ public ClientInfo createdBy() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model AutomationRuleInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model AutomationRuleInner")); } else { innerProperties().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleProperties.java index 7208c57ed3b7..8d4873f0ff4d 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 @@ -13,7 +13,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Automation rule properties. */ +/** + * Automation rule properties. + */ @Fluent public final class AutomationRuleProperties { /* @@ -64,9 +66,15 @@ public final class AutomationRuleProperties { @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) private ClientInfo createdBy; + /** + * Creates an instance of AutomationRuleProperties class. + */ + public AutomationRuleProperties() { + } + /** * Get the displayName property: The display name of the automation rule. - * + * * @return the displayName value. */ public String displayName() { @@ -75,7 +83,7 @@ public String displayName() { /** * Set the displayName property: The display name of the automation rule. - * + * * @param displayName the displayName value to set. * @return the AutomationRuleProperties object itself. */ @@ -86,7 +94,7 @@ public AutomationRuleProperties withDisplayName(String displayName) { /** * Get the order property: The order of execution of the automation rule. - * + * * @return the order value. */ public int order() { @@ -95,7 +103,7 @@ public int order() { /** * Set the order property: The order of execution of the automation rule. - * + * * @param order the order value to set. * @return the AutomationRuleProperties object itself. */ @@ -106,7 +114,7 @@ public AutomationRuleProperties withOrder(int order) { /** * Get the triggeringLogic property: Describes automation rule triggering logic. - * + * * @return the triggeringLogic value. */ public AutomationRuleTriggeringLogic triggeringLogic() { @@ -115,7 +123,7 @@ public AutomationRuleTriggeringLogic triggeringLogic() { /** * Set the triggeringLogic property: Describes automation rule triggering logic. - * + * * @param triggeringLogic the triggeringLogic value to set. * @return the AutomationRuleProperties object itself. */ @@ -126,7 +134,7 @@ public AutomationRuleProperties withTriggeringLogic(AutomationRuleTriggeringLogi /** * Get the actions property: The actions to execute when the automation rule is triggered. - * + * * @return the actions value. */ public List actions() { @@ -135,7 +143,7 @@ public List actions() { /** * Set the actions property: The actions to execute when the automation rule is triggered. - * + * * @param actions the actions value to set. * @return the AutomationRuleProperties object itself. */ @@ -146,7 +154,7 @@ public AutomationRuleProperties withActions(List actions) /** * Get the lastModifiedTimeUtc property: The last time the automation rule was updated. - * + * * @return the lastModifiedTimeUtc value. */ public OffsetDateTime lastModifiedTimeUtc() { @@ -155,7 +163,7 @@ public OffsetDateTime lastModifiedTimeUtc() { /** * Get the createdTimeUtc property: The time the automation rule was created. - * + * * @return the createdTimeUtc value. */ public OffsetDateTime createdTimeUtc() { @@ -164,7 +172,7 @@ public OffsetDateTime createdTimeUtc() { /** * Get the lastModifiedBy property: Information on the client (user or application) that made some action. - * + * * @return the lastModifiedBy value. */ public ClientInfo lastModifiedBy() { @@ -173,7 +181,7 @@ public ClientInfo lastModifiedBy() { /** * Get the createdBy property: Information on the client (user or application) that made some action. - * + * * @return the createdBy value. */ public ClientInfo createdBy() { @@ -182,29 +190,26 @@ public ClientInfo createdBy() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model AutomationRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property displayName in model AutomationRuleProperties")); } if (triggeringLogic() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property triggeringLogic in model AutomationRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property triggeringLogic in model AutomationRuleProperties")); } else { triggeringLogic().validate(); } if (actions() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property actions in model AutomationRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property actions in model AutomationRuleProperties")); } else { actions().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsCloudTrailDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsCloudTrailDataConnectorProperties.java index 49ef9cc2defa..c06c56aa3d6a 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.AwsCloudTrailDataConnectorDataTypes; import com.fasterxml.jackson.annotation.JsonProperty; -/** Amazon Web Services CloudTrail data connector properties. */ +/** + * Amazon Web Services CloudTrail data connector properties. + */ @Fluent public final class AwsCloudTrailDataConnectorProperties { /* @@ -24,10 +26,16 @@ public final class AwsCloudTrailDataConnectorProperties { @JsonProperty(value = "dataTypes", required = true) private AwsCloudTrailDataConnectorDataTypes dataTypes; + /** + * Creates an instance of AwsCloudTrailDataConnectorProperties class. + */ + public AwsCloudTrailDataConnectorProperties() { + } + /** * Get the awsRoleArn property: The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws * account. - * + * * @return the awsRoleArn value. */ public String awsRoleArn() { @@ -37,7 +45,7 @@ public String awsRoleArn() { /** * Set the awsRoleArn property: The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws * account. - * + * * @param awsRoleArn the awsRoleArn value to set. * @return the AwsCloudTrailDataConnectorProperties object itself. */ @@ -48,7 +56,7 @@ public AwsCloudTrailDataConnectorProperties withAwsRoleArn(String awsRoleArn) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AwsCloudTrailDataConnectorDataTypes dataTypes() { @@ -57,7 +65,7 @@ public AwsCloudTrailDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the AwsCloudTrailDataConnectorProperties object itself. */ @@ -68,15 +76,14 @@ public AwsCloudTrailDataConnectorProperties withDataTypes(AwsCloudTrailDataConne /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model AwsCloudTrailDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model AwsCloudTrailDataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsS3DataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsS3DataConnectorProperties.java index fb81e27a8457..994776e019f9 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Amazon Web Services S3 data connector properties. */ +/** + * Amazon Web Services S3 data connector properties. + */ @Fluent public final class AwsS3DataConnectorProperties { /* @@ -37,9 +39,15 @@ public final class AwsS3DataConnectorProperties { @JsonProperty(value = "dataTypes", required = true) 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() { @@ -48,7 +56,7 @@ public String destinationTable() { /** * Set the destinationTable property: The logs destination table name in LogAnalytics. - * + * * @param destinationTable the destinationTable value to set. * @return the AwsS3DataConnectorProperties object itself. */ @@ -59,7 +67,7 @@ public AwsS3DataConnectorProperties withDestinationTable(String destinationTable /** * Get the sqsUrls property: The AWS sqs urls for the connector. - * + * * @return the sqsUrls value. */ public List sqsUrls() { @@ -68,7 +76,7 @@ public List sqsUrls() { /** * Set the sqsUrls property: The AWS sqs urls for the connector. - * + * * @param sqsUrls the sqsUrls value to set. * @return the AwsS3DataConnectorProperties object itself. */ @@ -79,7 +87,7 @@ public AwsS3DataConnectorProperties withSqsUrls(List sqsUrls) { /** * Get the roleArn property: The Aws Role Arn that is used to access the Aws account. - * + * * @return the roleArn value. */ public String roleArn() { @@ -88,7 +96,7 @@ public String 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. */ @@ -99,7 +107,7 @@ public AwsS3DataConnectorProperties withRoleArn(String roleArn) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AwsS3DataConnectorDataTypes dataTypes() { @@ -108,7 +116,7 @@ public AwsS3DataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the AwsS3DataConnectorProperties object itself. */ @@ -119,33 +127,29 @@ public AwsS3DataConnectorProperties withDataTypes(AwsS3DataConnectorDataTypes da /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (destinationTable() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destinationTable in model AwsS3DataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationTable in model AwsS3DataConnectorProperties")); } if (sqsUrls() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sqsUrls in model AwsS3DataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sqsUrls in model AwsS3DataConnectorProperties")); } if (roleArn() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property roleArn in model AwsS3DataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property roleArn in model AwsS3DataConnectorProperties")); } if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model AwsS3DataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model AwsS3DataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AzureResourceEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AzureResourceEntityProperties.java index e73dcc2482d4..7debbb63f91d 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** AzureResource entity property bag. */ +/** + * AzureResource entity property bag. + */ @Immutable public final class AzureResourceEntityProperties extends EntityCommonProperties { /* @@ -23,9 +25,15 @@ public final class AzureResourceEntityProperties extends EntityCommonProperties @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) private String subscriptionId; + /** + * Creates an instance of AzureResourceEntityProperties class. + */ + public AzureResourceEntityProperties() { + } + /** * Get the resourceId property: The azure resource id of the resource. - * + * * @return the resourceId value. */ public String resourceId() { @@ -34,7 +42,7 @@ public String resourceId() { /** * Get the subscriptionId property: The subscription id of the resource. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -43,7 +51,7 @@ public String subscriptionId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..7084cfd4aad3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BillingStatisticInner.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.securityinsights.models.AzureEntityResource; +import com.azure.resourcemanager.securityinsights.models.BillingStatisticKind; +import com.azure.resourcemanager.securityinsights.models.SapSolutionUsageStatistic; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Billing statistic. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = BillingStatisticInner.class, visible = true) +@JsonTypeName("BillingStatistic") +@JsonSubTypes({ @JsonSubTypes.Type(name = "SapSolutionUsage", value = SapSolutionUsageStatistic.class) }) +@Immutable +public class BillingStatisticInner extends AzureEntityResource { + /* + * The kind of the billing statistic + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private BillingStatisticKind kind; + + /** + * Creates an instance of BillingStatisticInner class. + */ + public BillingStatisticInner() { + this.kind = BillingStatisticKind.fromString("BillingStatistic"); + } + + /** + * Get the kind property: The kind of the billing statistic. + * + * @return the kind value. + */ + public BillingStatisticKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkExpandResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkExpandResponseInner.java index 24e6c6ae3a87..ae50dfe8c477 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata; import com.fasterxml.jackson.annotation.JsonProperty; -/** The entity expansion result operation response. */ +/** + * The entity expansion result operation response. + */ @Fluent public final class BookmarkExpandResponseInner { /* @@ -24,9 +26,15 @@ public final class BookmarkExpandResponseInner { @JsonProperty(value = "value") private BookmarkExpandResponseValue value; + /** + * Creates an instance of BookmarkExpandResponseInner class. + */ + public BookmarkExpandResponseInner() { + } + /** * Get the metadata property: The metadata from the expansion operation results. - * + * * @return the metadata value. */ public ExpansionResultsMetadata metadata() { @@ -35,7 +43,7 @@ public ExpansionResultsMetadata metadata() { /** * Set the metadata property: The metadata from the expansion operation results. - * + * * @param metadata the metadata value to set. * @return the BookmarkExpandResponseInner object itself. */ @@ -46,7 +54,7 @@ public BookmarkExpandResponseInner withMetadata(ExpansionResultsMetadata metadat /** * Get the value property: The expansion result values. - * + * * @return the value value. */ public BookmarkExpandResponseValue value() { @@ -55,7 +63,7 @@ public BookmarkExpandResponseValue value() { /** * Set the value property: The expansion result values. - * + * * @param value the value value to set. * @return the BookmarkExpandResponseInner object itself. */ @@ -66,7 +74,7 @@ public BookmarkExpandResponseInner withValue(BookmarkExpandResponseValue value) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkInner.java index 5d04c419ecc5..1440dfb54553 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 @@ -14,7 +14,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Represents a bookmark in Azure Security Insights. */ +/** + * Represents a bookmark in Azure Security Insights. + */ @Fluent public final class BookmarkInner extends ResourceWithEtag { /* @@ -23,16 +25,24 @@ public final class BookmarkInner extends ResourceWithEtag { @JsonProperty(value = "properties") private BookmarkProperties innerProperties; + /** + * Creates an instance of BookmarkInner class. + */ + public BookmarkInner() { + } + /** * Get the innerProperties property: Bookmark properties. - * + * * @return the innerProperties value. */ private BookmarkProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public BookmarkInner withEtag(String etag) { super.withEtag(etag); @@ -41,7 +51,7 @@ public BookmarkInner withEtag(String etag) { /** * Get the created property: The time the bookmark was created. - * + * * @return the created value. */ public OffsetDateTime created() { @@ -50,7 +60,7 @@ public OffsetDateTime created() { /** * Set the created property: The time the bookmark was created. - * + * * @param created the created value to set. * @return the BookmarkInner object itself. */ @@ -64,7 +74,7 @@ public BookmarkInner withCreated(OffsetDateTime created) { /** * Get the createdBy property: Describes a user that created the bookmark. - * + * * @return the createdBy value. */ public UserInfo createdBy() { @@ -73,7 +83,7 @@ public UserInfo createdBy() { /** * Set the createdBy property: Describes a user that created the bookmark. - * + * * @param createdBy the createdBy value to set. * @return the BookmarkInner object itself. */ @@ -87,7 +97,7 @@ public BookmarkInner withCreatedBy(UserInfo createdBy) { /** * Get the displayName property: The display name of the bookmark. - * + * * @return the displayName value. */ public String displayName() { @@ -96,7 +106,7 @@ public String displayName() { /** * Set the displayName property: The display name of the bookmark. - * + * * @param displayName the displayName value to set. * @return the BookmarkInner object itself. */ @@ -110,7 +120,7 @@ public BookmarkInner withDisplayName(String displayName) { /** * Get the labels property: List of labels relevant to this bookmark. - * + * * @return the labels value. */ public List labels() { @@ -119,7 +129,7 @@ public List labels() { /** * Set the labels property: List of labels relevant to this bookmark. - * + * * @param labels the labels value to set. * @return the BookmarkInner object itself. */ @@ -133,7 +143,7 @@ public BookmarkInner withLabels(List labels) { /** * Get the notes property: The notes of the bookmark. - * + * * @return the notes value. */ public String notes() { @@ -142,7 +152,7 @@ public String notes() { /** * Set the notes property: The notes of the bookmark. - * + * * @param notes the notes value to set. * @return the BookmarkInner object itself. */ @@ -156,7 +166,7 @@ public BookmarkInner withNotes(String notes) { /** * Get the query property: The query of the bookmark. - * + * * @return the query value. */ public String query() { @@ -165,7 +175,7 @@ public String query() { /** * Set the query property: The query of the bookmark. - * + * * @param query the query value to set. * @return the BookmarkInner object itself. */ @@ -179,7 +189,7 @@ public BookmarkInner withQuery(String query) { /** * Get the queryResult property: The query result of the bookmark. - * + * * @return the queryResult value. */ public String queryResult() { @@ -188,7 +198,7 @@ public String queryResult() { /** * Set the queryResult property: The query result of the bookmark. - * + * * @param queryResult the queryResult value to set. * @return the BookmarkInner object itself. */ @@ -202,7 +212,7 @@ public BookmarkInner withQueryResult(String queryResult) { /** * Get the updated property: The last time the bookmark was updated. - * + * * @return the updated value. */ public OffsetDateTime updated() { @@ -211,7 +221,7 @@ public OffsetDateTime updated() { /** * Set the updated property: The last time the bookmark was updated. - * + * * @param updated the updated value to set. * @return the BookmarkInner object itself. */ @@ -225,7 +235,7 @@ public BookmarkInner withUpdated(OffsetDateTime updated) { /** * Get the updatedBy property: Describes a user that updated the bookmark. - * + * * @return the updatedBy value. */ public UserInfo updatedBy() { @@ -234,7 +244,7 @@ public UserInfo updatedBy() { /** * Set the updatedBy property: Describes a user that updated the bookmark. - * + * * @param updatedBy the updatedBy value to set. * @return the BookmarkInner object itself. */ @@ -248,7 +258,7 @@ public BookmarkInner withUpdatedBy(UserInfo updatedBy) { /** * Get the eventTime property: The bookmark event time. - * + * * @return the eventTime value. */ public OffsetDateTime eventTime() { @@ -257,7 +267,7 @@ public OffsetDateTime eventTime() { /** * Set the eventTime property: The bookmark event time. - * + * * @param eventTime the eventTime value to set. * @return the BookmarkInner object itself. */ @@ -271,7 +281,7 @@ public BookmarkInner withEventTime(OffsetDateTime eventTime) { /** * Get the queryStartTime property: The start time for the query. - * + * * @return the queryStartTime value. */ public OffsetDateTime queryStartTime() { @@ -280,7 +290,7 @@ public OffsetDateTime queryStartTime() { /** * Set the queryStartTime property: The start time for the query. - * + * * @param queryStartTime the queryStartTime value to set. * @return the BookmarkInner object itself. */ @@ -294,7 +304,7 @@ public BookmarkInner withQueryStartTime(OffsetDateTime queryStartTime) { /** * Get the queryEndTime property: The end time for the query. - * + * * @return the queryEndTime value. */ public OffsetDateTime queryEndTime() { @@ -303,7 +313,7 @@ public OffsetDateTime queryEndTime() { /** * Set the queryEndTime property: The end time for the query. - * + * * @param queryEndTime the queryEndTime value to set. * @return the BookmarkInner object itself. */ @@ -317,7 +327,7 @@ public BookmarkInner withQueryEndTime(OffsetDateTime queryEndTime) { /** * Get the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @return the incidentInfo value. */ public IncidentInfo incidentInfo() { @@ -326,7 +336,7 @@ public IncidentInfo incidentInfo() { /** * Set the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @param incidentInfo the incidentInfo value to set. * @return the BookmarkInner object itself. */ @@ -340,7 +350,7 @@ public BookmarkInner withIncidentInfo(IncidentInfo incidentInfo) { /** * Get the entityMappings property: Describes the entity mappings of the bookmark. - * + * * @return the entityMappings value. */ public List entityMappings() { @@ -349,7 +359,7 @@ public List entityMappings() { /** * Set the entityMappings property: Describes the entity mappings of the bookmark. - * + * * @param entityMappings the entityMappings value to set. * @return the BookmarkInner object itself. */ @@ -363,7 +373,7 @@ public BookmarkInner withEntityMappings(List entityMappi /** * Get the tactics property: A list of relevant mitre attacks. - * + * * @return the tactics value. */ public List tactics() { @@ -372,7 +382,7 @@ public List tactics() { /** * Set the tactics property: A list of relevant mitre attacks. - * + * * @param tactics the tactics value to set. * @return the BookmarkInner object itself. */ @@ -386,7 +396,7 @@ public BookmarkInner withTactics(List tactics) { /** * Get the techniques property: A list of relevant mitre techniques. - * + * * @return the techniques value. */ public List techniques() { @@ -395,7 +405,7 @@ public List techniques() { /** * Set the techniques property: A list of relevant mitre techniques. - * + * * @param techniques the techniques value to set. * @return the BookmarkInner object itself. */ @@ -409,7 +419,7 @@ public BookmarkInner withTechniques(List techniques) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 44be7d59238a..27de9eecf5f4 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 @@ -14,7 +14,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Describes bookmark properties. */ +/** + * Describes bookmark properties. + */ @Fluent public final class BookmarkProperties { /* @@ -113,9 +115,15 @@ public final class BookmarkProperties { @JsonProperty(value = "techniques") private List techniques; + /** + * Creates an instance of BookmarkProperties class. + */ + public BookmarkProperties() { + } + /** * Get the created property: The time the bookmark was created. - * + * * @return the created value. */ public OffsetDateTime created() { @@ -124,7 +132,7 @@ public OffsetDateTime created() { /** * Set the created property: The time the bookmark was created. - * + * * @param created the created value to set. * @return the BookmarkProperties object itself. */ @@ -135,7 +143,7 @@ public BookmarkProperties withCreated(OffsetDateTime created) { /** * Get the createdBy property: Describes a user that created the bookmark. - * + * * @return the createdBy value. */ public UserInfo createdBy() { @@ -144,7 +152,7 @@ public UserInfo createdBy() { /** * Set the createdBy property: Describes a user that created the bookmark. - * + * * @param createdBy the createdBy value to set. * @return the BookmarkProperties object itself. */ @@ -155,7 +163,7 @@ public BookmarkProperties withCreatedBy(UserInfo createdBy) { /** * Get the displayName property: The display name of the bookmark. - * + * * @return the displayName value. */ public String displayName() { @@ -164,7 +172,7 @@ public String displayName() { /** * Set the displayName property: The display name of the bookmark. - * + * * @param displayName the displayName value to set. * @return the BookmarkProperties object itself. */ @@ -175,7 +183,7 @@ public BookmarkProperties withDisplayName(String displayName) { /** * Get the labels property: List of labels relevant to this bookmark. - * + * * @return the labels value. */ public List labels() { @@ -184,7 +192,7 @@ public List labels() { /** * Set the labels property: List of labels relevant to this bookmark. - * + * * @param labels the labels value to set. * @return the BookmarkProperties object itself. */ @@ -195,7 +203,7 @@ public BookmarkProperties withLabels(List labels) { /** * Get the notes property: The notes of the bookmark. - * + * * @return the notes value. */ public String notes() { @@ -204,7 +212,7 @@ public String notes() { /** * Set the notes property: The notes of the bookmark. - * + * * @param notes the notes value to set. * @return the BookmarkProperties object itself. */ @@ -215,7 +223,7 @@ public BookmarkProperties withNotes(String notes) { /** * Get the query property: The query of the bookmark. - * + * * @return the query value. */ public String query() { @@ -224,7 +232,7 @@ public String query() { /** * Set the query property: The query of the bookmark. - * + * * @param query the query value to set. * @return the BookmarkProperties object itself. */ @@ -235,7 +243,7 @@ public BookmarkProperties withQuery(String query) { /** * Get the queryResult property: The query result of the bookmark. - * + * * @return the queryResult value. */ public String queryResult() { @@ -244,7 +252,7 @@ public String queryResult() { /** * Set the queryResult property: The query result of the bookmark. - * + * * @param queryResult the queryResult value to set. * @return the BookmarkProperties object itself. */ @@ -255,7 +263,7 @@ public BookmarkProperties withQueryResult(String queryResult) { /** * Get the updated property: The last time the bookmark was updated. - * + * * @return the updated value. */ public OffsetDateTime updated() { @@ -264,7 +272,7 @@ public OffsetDateTime updated() { /** * Set the updated property: The last time the bookmark was updated. - * + * * @param updated the updated value to set. * @return the BookmarkProperties object itself. */ @@ -275,7 +283,7 @@ public BookmarkProperties withUpdated(OffsetDateTime updated) { /** * Get the updatedBy property: Describes a user that updated the bookmark. - * + * * @return the updatedBy value. */ public UserInfo updatedBy() { @@ -284,7 +292,7 @@ public UserInfo updatedBy() { /** * Set the updatedBy property: Describes a user that updated the bookmark. - * + * * @param updatedBy the updatedBy value to set. * @return the BookmarkProperties object itself. */ @@ -295,7 +303,7 @@ public BookmarkProperties withUpdatedBy(UserInfo updatedBy) { /** * Get the eventTime property: The bookmark event time. - * + * * @return the eventTime value. */ public OffsetDateTime eventTime() { @@ -304,7 +312,7 @@ public OffsetDateTime eventTime() { /** * Set the eventTime property: The bookmark event time. - * + * * @param eventTime the eventTime value to set. * @return the BookmarkProperties object itself. */ @@ -315,7 +323,7 @@ public BookmarkProperties withEventTime(OffsetDateTime eventTime) { /** * Get the queryStartTime property: The start time for the query. - * + * * @return the queryStartTime value. */ public OffsetDateTime queryStartTime() { @@ -324,7 +332,7 @@ public OffsetDateTime queryStartTime() { /** * Set the queryStartTime property: The start time for the query. - * + * * @param queryStartTime the queryStartTime value to set. * @return the BookmarkProperties object itself. */ @@ -335,7 +343,7 @@ public BookmarkProperties withQueryStartTime(OffsetDateTime queryStartTime) { /** * Get the queryEndTime property: The end time for the query. - * + * * @return the queryEndTime value. */ public OffsetDateTime queryEndTime() { @@ -344,7 +352,7 @@ public OffsetDateTime queryEndTime() { /** * Set the queryEndTime property: The end time for the query. - * + * * @param queryEndTime the queryEndTime value to set. * @return the BookmarkProperties object itself. */ @@ -355,7 +363,7 @@ public BookmarkProperties withQueryEndTime(OffsetDateTime queryEndTime) { /** * Get the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @return the incidentInfo value. */ public IncidentInfo incidentInfo() { @@ -364,7 +372,7 @@ public IncidentInfo incidentInfo() { /** * Set the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @param incidentInfo the incidentInfo value to set. * @return the BookmarkProperties object itself. */ @@ -375,7 +383,7 @@ public BookmarkProperties withIncidentInfo(IncidentInfo incidentInfo) { /** * Get the entityMappings property: Describes the entity mappings of the bookmark. - * + * * @return the entityMappings value. */ public List entityMappings() { @@ -384,7 +392,7 @@ public List entityMappings() { /** * Set the entityMappings property: Describes the entity mappings of the bookmark. - * + * * @param entityMappings the entityMappings value to set. * @return the BookmarkProperties object itself. */ @@ -395,7 +403,7 @@ public BookmarkProperties withEntityMappings(List entity /** * Get the tactics property: A list of relevant mitre attacks. - * + * * @return the tactics value. */ public List tactics() { @@ -404,7 +412,7 @@ public List tactics() { /** * Set the tactics property: A list of relevant mitre attacks. - * + * * @param tactics the tactics value to set. * @return the BookmarkProperties object itself. */ @@ -415,7 +423,7 @@ public BookmarkProperties withTactics(List tactics) { /** * Get the techniques property: A list of relevant mitre techniques. - * + * * @return the techniques value. */ public List techniques() { @@ -424,7 +432,7 @@ public List techniques() { /** * Set the techniques property: A list of relevant mitre techniques. - * + * * @param techniques the techniques value to set. * @return the BookmarkProperties object itself. */ @@ -435,7 +443,7 @@ public BookmarkProperties withTechniques(List techniques) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -443,14 +451,12 @@ public void validate() { createdBy().validate(); } if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property displayName in model BookmarkProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property displayName in model BookmarkProperties")); } if (query() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property query in model BookmarkProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property query in model BookmarkProperties")); } if (updatedBy() != null) { updatedBy().validate(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BusinessApplicationAgentResourceInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BusinessApplicationAgentResourceInner.java new file mode 100644 index 000000000000..95421b38cc02 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BusinessApplicationAgentResourceInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AgentConfiguration; +import com.azure.resourcemanager.securityinsights.models.AgentSystem; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Describes the configuration of a Business Application Agent. + */ +@Fluent +public final class BusinessApplicationAgentResourceInner extends ResourceWithEtag { + /* + * The properties property. + */ + @JsonProperty(value = "properties", required = true) + private AgentProperties innerProperties = new AgentProperties(); + + /** + * Creates an instance of BusinessApplicationAgentResourceInner class. + */ + public BusinessApplicationAgentResourceInner() { + } + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private AgentProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public BusinessApplicationAgentResourceInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the configuration property: Describes the configuration of a Business Application Agent. + * + * @return the configuration value. + */ + public AgentConfiguration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Set the configuration property: Describes the configuration of a Business Application Agent. + * + * @param configuration the configuration value to set. + * @return the BusinessApplicationAgentResourceInner object itself. + */ + public BusinessApplicationAgentResourceInner withConfiguration(AgentConfiguration configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentProperties(); + } + this.innerProperties().withConfiguration(configuration); + return this; + } + + /** + * Get the agentSystems property: The agentSystems property. + * + * @return the agentSystems value. + */ + public List agentSystems() { + return this.innerProperties() == null ? null : this.innerProperties().agentSystems(); + } + + /** + * Get the displayName property: The displayName property. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The displayName property. + * + * @param displayName the displayName value to set. + * @return the BusinessApplicationAgentResourceInner object itself. + */ + public BusinessApplicationAgentResourceInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the lastModifiedTimeUtc property: The lastModifiedTimeUtc property. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model BusinessApplicationAgentResourceInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BusinessApplicationAgentResourceInner.class); +} 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 3b8a4b7b7a4e..b0a3cb7f2bd3 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** CloudApplication entity property bag. */ +/** + * CloudApplication entity property bag. + */ @Immutable public final class CloudApplicationEntityProperties extends EntityCommonProperties { /* @@ -24,15 +26,20 @@ public final class CloudApplicationEntityProperties extends EntityCommonProperti private String appName; /* - * The user defined instance name of the cloud application. It is often used to distinguish between several - * applications of the same type that a customer has. + * The user defined instance name of the cloud application. It is often used to distinguish between several applications of the same type that a customer has. */ @JsonProperty(value = "instanceName", access = JsonProperty.Access.WRITE_ONLY) private String instanceName; + /** + * Creates an instance of CloudApplicationEntityProperties class. + */ + public CloudApplicationEntityProperties() { + } + /** * Get the appId property: The technical identifier of the application. - * + * * @return the appId value. */ public Integer appId() { @@ -41,7 +48,7 @@ public Integer appId() { /** * Get the appName property: The name of the related cloud application. - * + * * @return the appName value. */ public String appName() { @@ -51,7 +58,7 @@ public String appName() { /** * Get the instanceName property: The user defined instance name of the cloud application. It is often used to * distinguish between several applications of the same type that a customer has. - * + * * @return the instanceName value. */ public String instanceName() { @@ -60,7 +67,7 @@ public String instanceName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index ec2fa5baa272..262030f9743f 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents Codeless UI data connector. */ +/** + * Represents Codeless UI data connector. + */ @Fluent public final class CodelessParameters { /* @@ -17,9 +19,15 @@ public final class CodelessParameters { @JsonProperty(value = "connectorUiConfig") 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() { @@ -28,7 +36,7 @@ public CodelessUiConnectorConfigProperties connectorUiConfig() { /** * Set the connectorUiConfig property: Config to describe the instructions blade. - * + * * @param connectorUiConfig the connectorUiConfig value to set. * @return the CodelessParameters object itself. */ @@ -39,7 +47,7 @@ public CodelessParameters withConnectorUiConfig(CodelessUiConnectorConfigPropert /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..94739b0a0bd3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CustomizableConnectorDefinitionProperties.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectionsConfig; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * The UiConfig for 'Customizable' connector definition kind. + */ +@Fluent +public final class CustomizableConnectorDefinitionProperties { + /* + * Gets or sets the connector definition created date in UTC format. + */ + @JsonProperty(value = "createdTimeUtc") + private OffsetDateTime createdTimeUtc; + + /* + * Gets or sets the connector definition last modified date in UTC format. + */ + @JsonProperty(value = "lastModifiedUtc") + private OffsetDateTime lastModifiedUtc; + + /* + * The UiConfig for 'Customizable' connector definition kind. + */ + @JsonProperty(value = "connectorUiConfig", required = true) + private CustomizableConnectorUiConfig connectorUiConfig; + + /* + * The UiConfig for 'Customizable' connector definition kind. + */ + @JsonProperty(value = "connectionsConfig") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectorUiConfig() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectorUiConfig in model CustomizableConnectorDefinitionProperties")); + } else { + connectorUiConfig().validate(); + } + if (connectionsConfig() != null) { + connectionsConfig().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomizableConnectorDefinitionProperties.class); +} 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..2100dddcf6dd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorDefinitionInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorDefinition; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinitionKind; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = DataConnectorDefinitionInner.class, + visible = true) +@JsonTypeName("DataConnectorDefinition") +@JsonSubTypes({ @JsonSubTypes.Type(name = "Customizable", value = CustomizableConnectorDefinition.class) }) +@Fluent +public class DataConnectorDefinitionInner extends ResourceWithEtag { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorDefinitionKind kind; + + /** + * Creates an instance of DataConnectorDefinitionInner class. + */ + public DataConnectorDefinitionInner() { + this.kind = DataConnectorDefinitionKind.fromString("DataConnectorDefinition"); + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + public DataConnectorDefinitionKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Override + public DataConnectorDefinitionInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorInner.java index cfec062d1609..3b7457bd8b4f 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 @@ -12,10 +12,13 @@ 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.McasDataConnector; import com.azure.resourcemanager.securityinsights.models.MdatpDataConnector; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionDataConnector; import com.azure.resourcemanager.securityinsights.models.MstiDataConnector; import com.azure.resourcemanager.securityinsights.models.MtpDataConnector; import com.azure.resourcemanager.securityinsights.models.Office365ProjectDataConnector; @@ -24,18 +27,19 @@ import com.azure.resourcemanager.securityinsights.models.OfficeIrmDataConnector; import com.azure.resourcemanager.securityinsights.models.OfficePowerBIDataConnector; import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerDataConnector; import com.azure.resourcemanager.securityinsights.models.TIDataConnector; import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnector; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Data connector. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = DataConnectorInner.class) +/** + * Data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = DataConnectorInner.class, visible = true) @JsonTypeName("DataConnector") @JsonSubTypes({ @JsonSubTypes.Type(name = "AzureActiveDirectory", value = AadDataConnector.class), @@ -45,9 +49,14 @@ @JsonSubTypes.Type(name = "AzureSecurityCenter", value = AscDataConnector.class), @JsonSubTypes.Type(name = "AmazonWebServicesCloudTrail", value = AwsCloudTrailDataConnector.class), @JsonSubTypes.Type(name = "AmazonWebServicesS3", value = AwsS3DataConnector.class), + @JsonSubTypes.Type(name = "RestApiPoller", value = RestApiPollerDataConnector.class), + @JsonSubTypes.Type(name = "GCP", value = GcpDataConnector.class), @JsonSubTypes.Type(name = "MicrosoftCloudAppSecurity", value = McasDataConnector.class), @JsonSubTypes.Type(name = "Dynamics365", value = Dynamics365DataConnector.class), @JsonSubTypes.Type(name = "OfficeATP", value = OfficeAtpDataConnector.class), + @JsonSubTypes.Type( + name = "MicrosoftPurviewInformationProtection", + value = MicrosoftPurviewInformationProtectionDataConnector.class), @JsonSubTypes.Type(name = "Office365Project", value = Office365ProjectDataConnector.class), @JsonSubTypes.Type(name = "OfficePowerBI", value = OfficePowerBIDataConnector.class), @JsonSubTypes.Type(name = "OfficeIRM", value = OfficeIrmDataConnector.class), @@ -57,11 +66,35 @@ @JsonSubTypes.Type(name = "ThreatIntelligenceTaxii", value = TiTaxiiDataConnector.class), @JsonSubTypes.Type(name = "IOT", value = IoTDataConnector.class), @JsonSubTypes.Type(name = "GenericUI", value = CodelessUiDataConnector.class), - @JsonSubTypes.Type(name = "APIPolling", value = CodelessApiPollingDataConnector.class) -}) + @JsonSubTypes.Type(name = "APIPolling", value = CodelessApiPollingDataConnector.class) }) @Fluent public class DataConnectorInner extends ResourceWithEtag { - /** {@inheritDoc} */ + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind; + + /** + * Creates an instance of DataConnectorInner class. + */ + public DataConnectorInner() { + this.kind = DataConnectorKind.fromString("DataConnector"); + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + public DataConnectorKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ @Override public DataConnectorInner withEtag(String etag) { super.withEtag(etag); @@ -70,7 +103,7 @@ public DataConnectorInner withEtag(String etag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 6fde14a69e47..ef5dd067d14f 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.DataConnectorLicenseState; import com.fasterxml.jackson.annotation.JsonProperty; -/** Data connector requirements status. */ +/** + * Data connector requirements status. + */ @Fluent public final class DataConnectorRequirementsStateInner { /* @@ -24,9 +26,15 @@ public final class DataConnectorRequirementsStateInner { @JsonProperty(value = "licenseState") private DataConnectorLicenseState licenseState; + /** + * Creates an instance of DataConnectorRequirementsStateInner class. + */ + public DataConnectorRequirementsStateInner() { + } + /** * Get the authorizationState property: Authorization state for this connector. - * + * * @return the authorizationState value. */ public DataConnectorAuthorizationState authorizationState() { @@ -35,19 +43,19 @@ public DataConnectorAuthorizationState authorizationState() { /** * Set the authorizationState property: Authorization state for this connector. - * + * * @param authorizationState the authorizationState value to set. * @return the DataConnectorRequirementsStateInner object itself. */ - public DataConnectorRequirementsStateInner withAuthorizationState( - DataConnectorAuthorizationState authorizationState) { + public DataConnectorRequirementsStateInner + withAuthorizationState(DataConnectorAuthorizationState authorizationState) { this.authorizationState = authorizationState; return this; } /** * Get the licenseState property: License state for this connector. - * + * * @return the licenseState value. */ public DataConnectorLicenseState licenseState() { @@ -56,7 +64,7 @@ public DataConnectorLicenseState licenseState() { /** * Set the licenseState property: License state for this connector. - * + * * @param licenseState the licenseState value to set. * @return the DataConnectorRequirementsStateInner object itself. */ @@ -67,7 +75,7 @@ public DataConnectorRequirementsStateInner withLicenseState(DataConnectorLicense /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DnsEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DnsEntityProperties.java index 5565c6456bf3..8c4501e57b27 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Dns entity property bag. */ +/** + * Dns entity property bag. + */ @Immutable public final class DnsEntityProperties extends EntityCommonProperties { /* @@ -36,9 +38,15 @@ public final class DnsEntityProperties extends EntityCommonProperties { @JsonProperty(value = "ipAddressEntityIds", access = JsonProperty.Access.WRITE_ONLY) private List ipAddressEntityIds; + /** + * Creates an instance of DnsEntityProperties class. + */ + public DnsEntityProperties() { + } + /** * Get the dnsServerIpEntityId property: An ip entity id for the dns server resolving the request. - * + * * @return the dnsServerIpEntityId value. */ public String dnsServerIpEntityId() { @@ -47,7 +55,7 @@ public String dnsServerIpEntityId() { /** * Get the domainName property: The name of the dns record associated with the alert. - * + * * @return the domainName value. */ public String domainName() { @@ -56,7 +64,7 @@ public String domainName() { /** * Get the hostIpAddressEntityId property: An ip entity id for the dns request client. - * + * * @return the hostIpAddressEntityId value. */ public String hostIpAddressEntityId() { @@ -65,7 +73,7 @@ public String hostIpAddressEntityId() { /** * Get the ipAddressEntityIds property: Ip entity identifiers for the resolved ip address. - * + * * @return the ipAddressEntityIds value. */ public List ipAddressEntityIds() { @@ -74,7 +82,7 @@ public List ipAddressEntityIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index e88e1fce95ed..ae49ec491445 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** Dynamics365 requirements check properties. */ +/** + * Dynamics365 requirements check properties. + */ @Fluent public final class Dynamics365CheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of Dynamics365CheckRequirementsProperties class. + */ + public Dynamics365CheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public Dynamics365CheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public Dynamics365CheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index bde2773bc7c9..1dc5a559b63c 100644 --- 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 @@ -10,7 +10,9 @@ import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes; import com.fasterxml.jackson.annotation.JsonProperty; -/** Dynamics365 data connector properties. */ +/** + * Dynamics365 data connector properties. + */ @Fluent public final class Dynamics365DataConnectorProperties extends DataConnectorTenantId { /* @@ -19,9 +21,15 @@ public final class Dynamics365DataConnectorProperties extends DataConnectorTenan @JsonProperty(value = "dataTypes", required = true) 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() { @@ -30,7 +38,7 @@ public Dynamics365DataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the Dynamics365DataConnectorProperties object itself. */ @@ -39,7 +47,9 @@ public Dynamics365DataConnectorProperties withDataTypes(Dynamics365DataConnector return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Dynamics365DataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -48,17 +58,16 @@ public Dynamics365DataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model Dynamics365DataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model Dynamics365DataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentDomainWhoisInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentDomainWhoisInner.java index 17b9864df9bb..c46d44221768 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Whois information for a given domain and associated metadata. */ +/** + * Whois information for a given domain and associated metadata. + */ @Fluent public final class EnrichmentDomainWhoisInner { /* @@ -48,9 +50,15 @@ public final class EnrichmentDomainWhoisInner { @JsonProperty(value = "parsedWhois") private EnrichmentDomainWhoisDetails parsedWhois; + /** + * Creates an instance of EnrichmentDomainWhoisInner class. + */ + public EnrichmentDomainWhoisInner() { + } + /** * Get the domain property: The domain for this whois record. - * + * * @return the domain value. */ public String domain() { @@ -59,7 +67,7 @@ public String domain() { /** * Set the domain property: The domain for this whois record. - * + * * @param domain the domain value to set. * @return the EnrichmentDomainWhoisInner object itself. */ @@ -70,7 +78,7 @@ public EnrichmentDomainWhoisInner withDomain(String domain) { /** * Get the server property: The hostname of this registrar's whois server. - * + * * @return the server value. */ public String server() { @@ -79,7 +87,7 @@ public String server() { /** * Set the server property: The hostname of this registrar's whois server. - * + * * @param server the server value to set. * @return the EnrichmentDomainWhoisInner object itself. */ @@ -90,7 +98,7 @@ public EnrichmentDomainWhoisInner withServer(String server) { /** * Get the created property: The timestamp at which this record was created. - * + * * @return the created value. */ public OffsetDateTime created() { @@ -99,7 +107,7 @@ public OffsetDateTime created() { /** * Set the created property: The timestamp at which this record was created. - * + * * @param created the created value to set. * @return the EnrichmentDomainWhoisInner object itself. */ @@ -110,7 +118,7 @@ public EnrichmentDomainWhoisInner withCreated(OffsetDateTime created) { /** * Get the updated property: The timestamp at which this record was last updated. - * + * * @return the updated value. */ public OffsetDateTime updated() { @@ -119,7 +127,7 @@ public OffsetDateTime updated() { /** * Set the updated property: The timestamp at which this record was last updated. - * + * * @param updated the updated value to set. * @return the EnrichmentDomainWhoisInner object itself. */ @@ -130,7 +138,7 @@ public EnrichmentDomainWhoisInner withUpdated(OffsetDateTime updated) { /** * Get the expires property: The timestamp at which this record will expire. - * + * * @return the expires value. */ public OffsetDateTime expires() { @@ -139,7 +147,7 @@ public OffsetDateTime expires() { /** * Set the expires property: The timestamp at which this record will expire. - * + * * @param expires the expires value to set. * @return the EnrichmentDomainWhoisInner object itself. */ @@ -150,7 +158,7 @@ public EnrichmentDomainWhoisInner withExpires(OffsetDateTime expires) { /** * Get the parsedWhois property: The whois record for a given domain. - * + * * @return the parsedWhois value. */ public EnrichmentDomainWhoisDetails parsedWhois() { @@ -159,7 +167,7 @@ public EnrichmentDomainWhoisDetails parsedWhois() { /** * Set the parsedWhois property: The whois record for a given domain. - * + * * @param parsedWhois the parsedWhois value to set. * @return the EnrichmentDomainWhoisInner object itself. */ @@ -170,7 +178,7 @@ public EnrichmentDomainWhoisInner withParsedWhois(EnrichmentDomainWhoisDetails p /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentIpGeodataInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentIpGeodataInner.java index 8fc05f9c066a..be5266c8ea3d 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Geodata information for a given IP address. */ +/** + * Geodata information for a given IP address. + */ @Fluent public final class EnrichmentIpGeodataInner { /* @@ -31,8 +33,8 @@ public final class EnrichmentIpGeodataInner { /* * A numeric rating of confidence that the value in the 'city' field is correct, on a scale of 0-100 */ - @JsonProperty(value = "cityCf") - private Integer cityCf; + @JsonProperty(value = "cityConfidenceFactor") + private Integer cityConfidenceFactor; /* * The continent this IP address is located on @@ -49,8 +51,8 @@ public final class EnrichmentIpGeodataInner { /* * A numeric rating of confidence that the value in the 'country' field is correct on a scale of 0-100 */ - @JsonProperty(value = "countryCf") - private Integer countryCf; + @JsonProperty(value = "countryConfidenceFactor") + private Integer countryConfidenceFactor; /* * The dotted-decimal or colon-separated string representation of the IP address @@ -103,8 +105,8 @@ public final class EnrichmentIpGeodataInner { /* * A numeric rating of confidence that the value in the 'state' field is correct on a scale of 0-100 */ - @JsonProperty(value = "stateCf") - private Integer stateCf; + @JsonProperty(value = "stateConfidenceFactor") + private Integer stateConfidenceFactor; /* * The abbreviated name for the state this IP address is located in @@ -112,9 +114,15 @@ public final class EnrichmentIpGeodataInner { @JsonProperty(value = "stateCode") private String stateCode; + /** + * Creates an instance of EnrichmentIpGeodataInner class. + */ + public EnrichmentIpGeodataInner() { + } + /** * Get the asn property: The autonomous system number associated with this IP address. - * + * * @return the asn value. */ public String asn() { @@ -123,7 +131,7 @@ public String asn() { /** * Set the asn property: The autonomous system number associated with this IP address. - * + * * @param asn the asn value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -134,7 +142,7 @@ public EnrichmentIpGeodataInner withAsn(String asn) { /** * Get the carrier property: The name of the carrier for this IP address. - * + * * @return the carrier value. */ public String carrier() { @@ -143,7 +151,7 @@ public String carrier() { /** * Set the carrier property: The name of the carrier for this IP address. - * + * * @param carrier the carrier value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -154,7 +162,7 @@ public EnrichmentIpGeodataInner withCarrier(String carrier) { /** * Get the city property: The city this IP address is located in. - * + * * @return the city value. */ public String city() { @@ -163,7 +171,7 @@ public String city() { /** * Set the city property: The city this IP address is located in. - * + * * @param city the city value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -173,30 +181,30 @@ public EnrichmentIpGeodataInner withCity(String city) { } /** - * Get the cityCf property: A numeric rating of confidence that the value in the 'city' field is correct, on a scale - * of 0-100. - * - * @return the cityCf value. + * 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 cityCf() { - return this.cityCf; + public Integer cityConfidenceFactor() { + return this.cityConfidenceFactor; } /** - * Set the cityCf property: A numeric rating of confidence that the value in the 'city' field is correct, on a scale - * of 0-100. - * - * @param cityCf the cityCf value to set. + * Set the cityConfidenceFactor property: A numeric rating of confidence that the value in the 'city' field is + * correct, on a scale of 0-100. + * + * @param cityConfidenceFactor the cityConfidenceFactor value to set. * @return the EnrichmentIpGeodataInner object itself. */ - public EnrichmentIpGeodataInner withCityCf(Integer cityCf) { - this.cityCf = cityCf; + public EnrichmentIpGeodataInner withCityConfidenceFactor(Integer cityConfidenceFactor) { + this.cityConfidenceFactor = cityConfidenceFactor; return this; } /** * Get the continent property: The continent this IP address is located on. - * + * * @return the continent value. */ public String continent() { @@ -205,7 +213,7 @@ public String continent() { /** * Set the continent property: The continent this IP address is located on. - * + * * @param continent the continent value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -216,7 +224,7 @@ public EnrichmentIpGeodataInner withContinent(String continent) { /** * Get the country property: The county this IP address is located in. - * + * * @return the country value. */ public String country() { @@ -225,7 +233,7 @@ public String country() { /** * Set the country property: The county this IP address is located in. - * + * * @param country the country value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -235,30 +243,30 @@ public EnrichmentIpGeodataInner withCountry(String country) { } /** - * Get the countryCf property: A numeric rating of confidence that the value in the 'country' field is correct on a - * scale of 0-100. - * - * @return the countryCf value. + * 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 countryCf() { - return this.countryCf; + public Integer countryConfidenceFactor() { + return this.countryConfidenceFactor; } /** - * Set the countryCf property: A numeric rating of confidence that the value in the 'country' field is correct on a - * scale of 0-100. - * - * @param countryCf the countryCf value to set. + * Set the countryConfidenceFactor property: A numeric rating of confidence that the value in the 'country' field is + * correct on a scale of 0-100. + * + * @param countryConfidenceFactor the countryConfidenceFactor value to set. * @return the EnrichmentIpGeodataInner object itself. */ - public EnrichmentIpGeodataInner withCountryCf(Integer countryCf) { - this.countryCf = countryCf; + public EnrichmentIpGeodataInner withCountryConfidenceFactor(Integer countryConfidenceFactor) { + this.countryConfidenceFactor = countryConfidenceFactor; return this; } /** * Get the ipAddr property: The dotted-decimal or colon-separated string representation of the IP address. - * + * * @return the ipAddr value. */ public String ipAddr() { @@ -267,7 +275,7 @@ public String ipAddr() { /** * Set the ipAddr property: The dotted-decimal or colon-separated string representation of the IP address. - * + * * @param ipAddr the ipAddr value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -278,7 +286,7 @@ public EnrichmentIpGeodataInner withIpAddr(String ipAddr) { /** * Get the ipRoutingType property: A description of the connection type of this IP address. - * + * * @return the ipRoutingType value. */ public String ipRoutingType() { @@ -287,7 +295,7 @@ public String ipRoutingType() { /** * Set the ipRoutingType property: A description of the connection type of this IP address. - * + * * @param ipRoutingType the ipRoutingType value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -298,7 +306,7 @@ public EnrichmentIpGeodataInner withIpRoutingType(String ipRoutingType) { /** * Get the latitude property: The latitude of this IP address. - * + * * @return the latitude value. */ public String latitude() { @@ -307,7 +315,7 @@ public String latitude() { /** * Set the latitude property: The latitude of this IP address. - * + * * @param latitude the latitude value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -318,7 +326,7 @@ public EnrichmentIpGeodataInner withLatitude(String latitude) { /** * Get the longitude property: The longitude of this IP address. - * + * * @return the longitude value. */ public String longitude() { @@ -327,7 +335,7 @@ public String longitude() { /** * Set the longitude property: The longitude of this IP address. - * + * * @param longitude the longitude value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -338,7 +346,7 @@ public EnrichmentIpGeodataInner withLongitude(String longitude) { /** * Get the organization property: The name of the organization for this IP address. - * + * * @return the organization value. */ public String organization() { @@ -347,7 +355,7 @@ public String organization() { /** * Set the organization property: The name of the organization for this IP address. - * + * * @param organization the organization value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -358,7 +366,7 @@ public EnrichmentIpGeodataInner withOrganization(String organization) { /** * Get the organizationType property: The type of the organization for this IP address. - * + * * @return the organizationType value. */ public String organizationType() { @@ -367,7 +375,7 @@ public String organizationType() { /** * Set the organizationType property: The type of the organization for this IP address. - * + * * @param organizationType the organizationType value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -378,7 +386,7 @@ public EnrichmentIpGeodataInner withOrganizationType(String organizationType) { /** * Get the region property: The geographic region this IP address is located in. - * + * * @return the region value. */ public String region() { @@ -387,7 +395,7 @@ public String region() { /** * Set the region property: The geographic region this IP address is located in. - * + * * @param region the region value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -398,7 +406,7 @@ public EnrichmentIpGeodataInner withRegion(String region) { /** * Get the state property: The state this IP address is located in. - * + * * @return the state value. */ public String state() { @@ -407,7 +415,7 @@ public String state() { /** * Set the state property: The state this IP address is located in. - * + * * @param state the state value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -417,30 +425,30 @@ public EnrichmentIpGeodataInner withState(String state) { } /** - * Get the stateCf property: A numeric rating of confidence that the value in the 'state' field is correct on a - * scale of 0-100. - * - * @return the stateCf value. + * 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 stateCf() { - return this.stateCf; + public Integer stateConfidenceFactor() { + return this.stateConfidenceFactor; } /** - * Set the stateCf property: A numeric rating of confidence that the value in the 'state' field is correct on a - * scale of 0-100. - * - * @param stateCf the stateCf value to set. + * Set the stateConfidenceFactor property: A numeric rating of confidence that the value in the 'state' field is + * correct on a scale of 0-100. + * + * @param stateConfidenceFactor the stateConfidenceFactor value to set. * @return the EnrichmentIpGeodataInner object itself. */ - public EnrichmentIpGeodataInner withStateCf(Integer stateCf) { - this.stateCf = stateCf; + public EnrichmentIpGeodataInner withStateConfidenceFactor(Integer stateConfidenceFactor) { + this.stateConfidenceFactor = stateConfidenceFactor; return this; } /** * Get the stateCode property: The abbreviated name for the state this IP address is located in. - * + * * @return the stateCode value. */ public String stateCode() { @@ -449,7 +457,7 @@ public String stateCode() { /** * Set the stateCode property: The abbreviated name for the state this IP address is located in. - * + * * @param stateCode the stateCode value to set. * @return the EnrichmentIpGeodataInner object itself. */ @@ -460,7 +468,7 @@ public EnrichmentIpGeodataInner withStateCode(String stateCode) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityAnalyticsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityAnalyticsProperties.java index 286aa9d87ccc..efc4af5c190b 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** EntityAnalytics property bag. */ +/** + * EntityAnalytics property bag. + */ @Fluent public final class EntityAnalyticsProperties { /* @@ -18,9 +20,15 @@ public final class EntityAnalyticsProperties { @JsonProperty(value = "entityProviders") 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() { @@ -29,7 +37,7 @@ public List entityProviders() { /** * Set the entityProviders property: The relevant entity providers that are synced. - * + * * @param entityProviders the entityProviders value to set. * @return the EntityAnalyticsProperties object itself. */ @@ -40,7 +48,7 @@ public EntityAnalyticsProperties withEntityProviders(List entit /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityExpandResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityExpandResponseInner.java index 1526fff102b4..99520f9be2a9 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata; import com.fasterxml.jackson.annotation.JsonProperty; -/** The entity expansion result operation response. */ +/** + * The entity expansion result operation response. + */ @Fluent public final class EntityExpandResponseInner { /* @@ -24,9 +26,15 @@ public final class EntityExpandResponseInner { @JsonProperty(value = "value") private EntityExpandResponseValue value; + /** + * Creates an instance of EntityExpandResponseInner class. + */ + public EntityExpandResponseInner() { + } + /** * Get the metadata property: The metadata from the expansion operation results. - * + * * @return the metadata value. */ public ExpansionResultsMetadata metadata() { @@ -35,7 +43,7 @@ public ExpansionResultsMetadata metadata() { /** * Set the metadata property: The metadata from the expansion operation results. - * + * * @param metadata the metadata value to set. * @return the EntityExpandResponseInner object itself. */ @@ -46,7 +54,7 @@ public EntityExpandResponseInner withMetadata(ExpansionResultsMetadata metadata) /** * Get the value property: The expansion result values. - * + * * @return the value value. */ public EntityExpandResponseValue value() { @@ -55,7 +63,7 @@ public EntityExpandResponseValue value() { /** * Set the value property: The expansion result values. - * + * * @param value the value value to set. * @return the EntityExpandResponseInner object itself. */ @@ -66,7 +74,7 @@ public EntityExpandResponseInner withValue(EntityExpandResponseValue value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityGetInsightsResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityGetInsightsResponseInner.java index 0b2543093f8e..b5f1ddd85b61 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The Get Insights result operation response. */ +/** + * The Get Insights result operation response. + */ @Fluent public final class EntityGetInsightsResponseInner { /* @@ -25,9 +27,15 @@ public final class EntityGetInsightsResponseInner { @JsonProperty(value = "value") private List value; + /** + * Creates an instance of EntityGetInsightsResponseInner class. + */ + public EntityGetInsightsResponseInner() { + } + /** * Get the metadata property: The metadata from the get insights operation results. - * + * * @return the metadata value. */ public GetInsightsResultsMetadata metadata() { @@ -36,7 +44,7 @@ public GetInsightsResultsMetadata metadata() { /** * Set the metadata property: The metadata from the get insights operation results. - * + * * @param metadata the metadata value to set. * @return the EntityGetInsightsResponseInner object itself. */ @@ -47,7 +55,7 @@ public EntityGetInsightsResponseInner withMetadata(GetInsightsResultsMetadata me /** * Get the value property: The insights result values. - * + * * @return the value value. */ public List value() { @@ -56,7 +64,7 @@ public List value() { /** * Set the value property: The insights result values. - * + * * @param value the value value to set. * @return the EntityGetInsightsResponseInner object itself. */ @@ -67,7 +75,7 @@ public EntityGetInsightsResponseInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityInner.java index f829a29d3b07..dfa7e35f2c15 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityInner.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityInner.java @@ -11,15 +11,16 @@ import com.azure.resourcemanager.securityinsights.models.AzureResourceEntity; import com.azure.resourcemanager.securityinsights.models.CloudApplicationEntity; import com.azure.resourcemanager.securityinsights.models.DnsEntity; +import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; import com.azure.resourcemanager.securityinsights.models.FileEntity; import com.azure.resourcemanager.securityinsights.models.FileHashEntity; import com.azure.resourcemanager.securityinsights.models.HostEntity; import com.azure.resourcemanager.securityinsights.models.HuntingBookmark; import com.azure.resourcemanager.securityinsights.models.IoTDeviceEntity; import com.azure.resourcemanager.securityinsights.models.IpEntity; +import com.azure.resourcemanager.securityinsights.models.MailboxEntity; import com.azure.resourcemanager.securityinsights.models.MailClusterEntity; import com.azure.resourcemanager.securityinsights.models.MailMessageEntity; -import com.azure.resourcemanager.securityinsights.models.MailboxEntity; import com.azure.resourcemanager.securityinsights.models.MalwareEntity; import com.azure.resourcemanager.securityinsights.models.NicEntity; import com.azure.resourcemanager.securityinsights.models.ProcessEntity; @@ -31,15 +32,14 @@ import com.azure.resourcemanager.securityinsights.models.UrlEntity; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Specific entity. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = EntityInner.class) +/** + * Specific entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = EntityInner.class, visible = true) @JsonTypeName("Entity") @JsonSubTypes({ @JsonSubTypes.Type(name = "SecurityAlert", value = SecurityAlert.class), @@ -63,19 +63,41 @@ @JsonSubTypes.Type(name = "SecurityGroup", value = SecurityGroupEntity.class), @JsonSubTypes.Type(name = "SubmissionMail", value = SubmissionMailEntity.class), @JsonSubTypes.Type(name = "Url", value = UrlEntity.class), - @JsonSubTypes.Type(name = "Nic", value = NicEntity.class) -}) + @JsonSubTypes.Type(name = "Nic", value = NicEntity.class) }) @Immutable public class EntityInner extends ProxyResource { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** + * Creates an instance of EntityInner class. + */ + public EntityInner() { + this.kind = EntityKindEnum.fromString("Entity"); + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -84,7 +106,7 @@ public SystemData systemData() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryInner.java index f1bdc7049f0e..39b515d1869b 100644 --- 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 @@ -6,26 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.ActivityEntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityQueryKind; import com.azure.resourcemanager.securityinsights.models.ExpansionEntityQuery; import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Specific entity query. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = EntityQueryInner.class) +/** + * Specific entity query. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = EntityQueryInner.class, visible = true) @JsonTypeName("EntityQuery") @JsonSubTypes({ @JsonSubTypes.Type(name = "Expansion", value = ExpansionEntityQuery.class), - @JsonSubTypes.Type(name = "Activity", value = ActivityEntityQuery.class) -}) + @JsonSubTypes.Type(name = "Activity", value = ActivityEntityQuery.class) }) @Fluent public class EntityQueryInner extends ResourceWithEtag { - /** {@inheritDoc} */ + /* + * the entity query kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityQueryKind kind; + + /** + * Creates an instance of EntityQueryInner class. + */ + public EntityQueryInner() { + this.kind = EntityQueryKind.fromString("EntityQuery"); + } + + /** + * Get the kind property: the entity query kind. + * + * @return the kind value. + */ + public EntityQueryKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ @Override public EntityQueryInner withEtag(String etag) { super.withEtag(etag); @@ -34,7 +59,7 @@ public EntityQueryInner withEtag(String etag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index b0d7b460f1ae..a9fb01a2f7d2 100644 --- 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 @@ -8,30 +8,57 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplate; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Specific entity query template. */ +/** + * Specific entity query template. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = EntityQueryTemplateInner.class) + defaultImpl = EntityQueryTemplateInner.class, + visible = true) @JsonTypeName("EntityQueryTemplate") -@JsonSubTypes({@JsonSubTypes.Type(name = "Activity", value = ActivityEntityQueryTemplate.class)}) +@JsonSubTypes({ @JsonSubTypes.Type(name = "Activity", value = ActivityEntityQueryTemplate.class) }) @Immutable public class EntityQueryTemplateInner extends ProxyResource { + /* + * the entity query template kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityQueryTemplateKind kind; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** + * Creates an instance of EntityQueryTemplateInner class. + */ + public EntityQueryTemplateInner() { + this.kind = EntityQueryTemplateKind.fromString("EntityQueryTemplate"); + } + + /** + * Get the kind property: the entity query template kind. + * + * @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() { @@ -40,7 +67,7 @@ public SystemData systemData() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityTimelineResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityTimelineResponseInner.java index 14d25888dac9..fcce405e7719 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The entity timeline result operation response. */ +/** + * The entity timeline result operation response. + */ @Fluent public final class EntityTimelineResponseInner { /* @@ -25,9 +27,15 @@ public final class EntityTimelineResponseInner { @JsonProperty(value = "value") private List value; + /** + * Creates an instance of EntityTimelineResponseInner class. + */ + public EntityTimelineResponseInner() { + } + /** * Get the metadata property: The metadata from the timeline operation results. - * + * * @return the metadata value. */ public TimelineResultsMetadata metadata() { @@ -36,7 +44,7 @@ public TimelineResultsMetadata metadata() { /** * Set the metadata property: The metadata from the timeline operation results. - * + * * @param metadata the metadata value to set. * @return the EntityTimelineResponseInner object itself. */ @@ -47,7 +55,7 @@ public EntityTimelineResponseInner withMetadata(TimelineResultsMetadata metadata /** * Get the value property: The timeline result values. - * + * * @return the value value. */ public List value() { @@ -56,7 +64,7 @@ public List value() { /** * Set the value property: The timeline result values. - * + * * @param value the value value to set. * @return the EntityTimelineResponseInner object itself. */ @@ -67,7 +75,7 @@ public EntityTimelineResponseInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ExpansionEntityQueriesProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ExpansionEntityQueriesProperties.java index 5f1ff9e9d6f5..ca72d9fc4ddc 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes expansion entity query properties. */ +/** + * Describes expansion entity query properties. + */ @Fluent public final class ExpansionEntityQueriesProperties { /* @@ -48,9 +50,15 @@ public final class ExpansionEntityQueriesProperties { @JsonProperty(value = "queryTemplate") private String queryTemplate; + /** + * Creates an instance of ExpansionEntityQueriesProperties class. + */ + public ExpansionEntityQueriesProperties() { + } + /** * Get the dataSources property: List of the data sources that are required to run the query. - * + * * @return the dataSources value. */ public List dataSources() { @@ -59,7 +67,7 @@ public List dataSources() { /** * Set the dataSources property: List of the data sources that are required to run the query. - * + * * @param dataSources the dataSources value to set. * @return the ExpansionEntityQueriesProperties object itself. */ @@ -70,7 +78,7 @@ public ExpansionEntityQueriesProperties withDataSources(List dataSources /** * Get the displayName property: The query display name. - * + * * @return the displayName value. */ public String displayName() { @@ -79,7 +87,7 @@ public String displayName() { /** * Set the displayName property: The query display name. - * + * * @param displayName the displayName value to set. * @return the ExpansionEntityQueriesProperties object itself. */ @@ -90,7 +98,7 @@ public ExpansionEntityQueriesProperties withDisplayName(String displayName) { /** * Get the inputEntityType property: The type of the query's source entity. - * + * * @return the inputEntityType value. */ public EntityType inputEntityType() { @@ -99,7 +107,7 @@ public EntityType inputEntityType() { /** * Set the inputEntityType property: The type of the query's source entity. - * + * * @param inputEntityType the inputEntityType value to set. * @return the ExpansionEntityQueriesProperties object itself. */ @@ -110,7 +118,7 @@ public ExpansionEntityQueriesProperties withInputEntityType(EntityType inputEnti /** * 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() { @@ -119,7 +127,7 @@ public List inputFields() { /** * Set the inputFields property: List of the fields of the source entity that are required to run the query. - * + * * @param inputFields the inputFields value to set. * @return the ExpansionEntityQueriesProperties object itself. */ @@ -130,7 +138,7 @@ public ExpansionEntityQueriesProperties withInputFields(List inputFields /** * Get the outputEntityTypes property: List of the desired output types to be constructed from the result. - * + * * @return the outputEntityTypes value. */ public List outputEntityTypes() { @@ -139,7 +147,7 @@ public List outputEntityTypes() { /** * Set the outputEntityTypes property: List of the desired output types to be constructed from the result. - * + * * @param outputEntityTypes the outputEntityTypes value to set. * @return the ExpansionEntityQueriesProperties object itself. */ @@ -150,7 +158,7 @@ public ExpansionEntityQueriesProperties withOutputEntityTypes(List o /** * Get the queryTemplate property: The template query string to be parsed and formatted. - * + * * @return the queryTemplate value. */ public String queryTemplate() { @@ -159,7 +167,7 @@ public String queryTemplate() { /** * Set the queryTemplate property: The template query string to be parsed and formatted. - * + * * @param queryTemplate the queryTemplate value to set. * @return the ExpansionEntityQueriesProperties object itself. */ @@ -170,7 +178,7 @@ public ExpansionEntityQueriesProperties withQueryTemplate(String queryTemplate) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EyesOnSettingsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EyesOnSettingsProperties.java index 90e3adfec3d7..e987c1fdff2b 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** EyesOn property bag. */ +/** + * EyesOn property bag. + */ @Immutable public final class EyesOnSettingsProperties { /* @@ -16,9 +18,15 @@ public final class EyesOnSettingsProperties { @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) 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() { @@ -27,7 +35,7 @@ public Boolean isEnabled() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileEntityProperties.java index 7588902fa603..64c739c9450d 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** File entity property bag. */ +/** + * File entity property bag. + */ @Immutable public final class FileEntityProperties extends EntityCommonProperties { /* @@ -36,9 +38,15 @@ public final class FileEntityProperties extends EntityCommonProperties { @JsonProperty(value = "hostEntityId", access = JsonProperty.Access.WRITE_ONLY) private String hostEntityId; + /** + * Creates an instance of FileEntityProperties class. + */ + public FileEntityProperties() { + } + /** * Get the directory property: The full path to the file. - * + * * @return the directory value. */ public String directory() { @@ -47,7 +55,7 @@ public String directory() { /** * Get the fileHashEntityIds property: The file hash entity identifiers associated with this file. - * + * * @return the fileHashEntityIds value. */ public List fileHashEntityIds() { @@ -56,7 +64,7 @@ public List fileHashEntityIds() { /** * Get the fileName property: The file name without path (some alerts might not include path). - * + * * @return the fileName value. */ public String fileName() { @@ -65,7 +73,7 @@ public String fileName() { /** * Get the hostEntityId property: The Host entity id which the file belongs to. - * + * * @return the hostEntityId value. */ public String hostEntityId() { @@ -74,7 +82,7 @@ public String hostEntityId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 8ebadc287860..9820b4f636ac 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.FileHashAlgorithm; import com.fasterxml.jackson.annotation.JsonProperty; -/** FileHash entity property bag. */ +/** + * FileHash entity property bag. + */ @Immutable public final class FileHashEntityProperties extends EntityCommonProperties { /* @@ -24,9 +26,15 @@ public final class FileHashEntityProperties extends EntityCommonProperties { @JsonProperty(value = "hashValue", access = JsonProperty.Access.WRITE_ONLY) private String hashValue; + /** + * Creates an instance of FileHashEntityProperties class. + */ + public FileHashEntityProperties() { + } + /** * Get the algorithm property: The hash algorithm type. - * + * * @return the algorithm value. */ public FileHashAlgorithm algorithm() { @@ -35,7 +43,7 @@ public FileHashAlgorithm algorithm() { /** * Get the hashValue property: The file hash value. - * + * * @return the hashValue value. */ public String hashValue() { @@ -44,7 +52,7 @@ public String hashValue() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index fe47f14b590c..ca187ccb252e 100644 --- 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 @@ -16,7 +16,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Represents a file import in Azure Security Insights. */ +/** + * Represents a file import in Azure Security Insights. + */ @Fluent public final class FileImportInner extends ProxyResource { /* @@ -31,9 +33,15 @@ public final class FileImportInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** + * Creates an instance of FileImportInner class. + */ + public FileImportInner() { + } + /** * Get the innerProperties property: File import properties. - * + * * @return the innerProperties value. */ private FileImportProperties innerProperties() { @@ -42,7 +50,7 @@ private FileImportProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -51,7 +59,7 @@ public SystemData systemData() { /** * Get the ingestionMode property: Describes how to ingest the records in the file. - * + * * @return the ingestionMode value. */ public IngestionMode ingestionMode() { @@ -60,7 +68,7 @@ public IngestionMode 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. */ @@ -74,7 +82,7 @@ public FileImportInner withIngestionMode(IngestionMode ingestionMode) { /** * Get the contentType property: The content type of this file. - * + * * @return the contentType value. */ public FileImportContentType contentType() { @@ -83,7 +91,7 @@ public FileImportContentType contentType() { /** * Set the contentType property: The content type of this file. - * + * * @param contentType the contentType value to set. * @return the FileImportInner object itself. */ @@ -97,7 +105,7 @@ public FileImportInner withContentType(FileImportContentType contentType) { /** * Get the createdTimeUtc property: The time the file was imported. - * + * * @return the createdTimeUtc value. */ public OffsetDateTime createdTimeUtc() { @@ -107,7 +115,7 @@ public OffsetDateTime 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() { @@ -116,7 +124,7 @@ public FileMetadata 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() { @@ -125,7 +133,7 @@ public List errorsPreview() { /** * Get the importFile property: Represents the imported file. - * + * * @return the importFile value. */ public FileMetadata importFile() { @@ -134,7 +142,7 @@ public FileMetadata importFile() { /** * Set the importFile property: Represents the imported file. - * + * * @param importFile the importFile value to set. * @return the FileImportInner object itself. */ @@ -148,7 +156,7 @@ public FileImportInner withImportFile(FileMetadata importFile) { /** * Get the ingestedRecordCount property: The number of records that have been successfully ingested. - * + * * @return the ingestedRecordCount value. */ public Integer ingestedRecordCount() { @@ -157,7 +165,7 @@ public Integer ingestedRecordCount() { /** * Get the source property: The source for the data in the file. - * + * * @return the source value. */ public String source() { @@ -166,7 +174,7 @@ public String 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. */ @@ -180,7 +188,7 @@ public FileImportInner withSource(String source) { /** * Get the state property: The state of the file import. - * + * * @return the state value. */ public FileImportState state() { @@ -189,7 +197,7 @@ public FileImportState state() { /** * Get the totalRecordCount property: The number of records in the file. - * + * * @return the totalRecordCount value. */ public Integer totalRecordCount() { @@ -198,7 +206,7 @@ public Integer totalRecordCount() { /** * Get the validRecordCount property: The number of records that have passed validation. - * + * * @return the validRecordCount value. */ public Integer validRecordCount() { @@ -208,7 +216,7 @@ public Integer 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() { @@ -218,7 +226,7 @@ public OffsetDateTime 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() { @@ -227,7 +235,7 @@ public OffsetDateTime importValidUntilTimeUtc() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportProperties.java index 1ae17de2e493..7be8abf7c5df 100644 --- 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 @@ -15,7 +15,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Describes the FileImport's properties. */ +/** + * Describes the FileImport's properties. + */ @Fluent public final class FileImportProperties { /* @@ -96,9 +98,15 @@ public final class FileImportProperties { @JsonProperty(value = "importValidUntilTimeUTC", access = JsonProperty.Access.WRITE_ONLY) 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() { @@ -107,7 +115,7 @@ public IngestionMode 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. */ @@ -118,7 +126,7 @@ public FileImportProperties withIngestionMode(IngestionMode ingestionMode) { /** * Get the contentType property: The content type of this file. - * + * * @return the contentType value. */ public FileImportContentType contentType() { @@ -127,7 +135,7 @@ public FileImportContentType contentType() { /** * Set the contentType property: The content type of this file. - * + * * @param contentType the contentType value to set. * @return the FileImportProperties object itself. */ @@ -138,7 +146,7 @@ public FileImportProperties withContentType(FileImportContentType contentType) { /** * Get the createdTimeUtc property: The time the file was imported. - * + * * @return the createdTimeUtc value. */ public OffsetDateTime createdTimeUtc() { @@ -148,7 +156,7 @@ public OffsetDateTime 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() { @@ -157,7 +165,7 @@ public FileMetadata 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() { @@ -166,7 +174,7 @@ public List errorsPreview() { /** * Get the importFile property: Represents the imported file. - * + * * @return the importFile value. */ public FileMetadata importFile() { @@ -175,7 +183,7 @@ public FileMetadata importFile() { /** * Set the importFile property: Represents the imported file. - * + * * @param importFile the importFile value to set. * @return the FileImportProperties object itself. */ @@ -186,7 +194,7 @@ public FileImportProperties withImportFile(FileMetadata importFile) { /** * Get the ingestedRecordCount property: The number of records that have been successfully ingested. - * + * * @return the ingestedRecordCount value. */ public Integer ingestedRecordCount() { @@ -195,7 +203,7 @@ public Integer ingestedRecordCount() { /** * Get the source property: The source for the data in the file. - * + * * @return the source value. */ public String source() { @@ -204,7 +212,7 @@ public String 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. */ @@ -215,7 +223,7 @@ public FileImportProperties withSource(String source) { /** * Get the state property: The state of the file import. - * + * * @return the state value. */ public FileImportState state() { @@ -224,7 +232,7 @@ public FileImportState state() { /** * Get the totalRecordCount property: The number of records in the file. - * + * * @return the totalRecordCount value. */ public Integer totalRecordCount() { @@ -233,7 +241,7 @@ public Integer totalRecordCount() { /** * Get the validRecordCount property: The number of records that have passed validation. - * + * * @return the validRecordCount value. */ public Integer validRecordCount() { @@ -243,7 +251,7 @@ public Integer 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() { @@ -253,7 +261,7 @@ public OffsetDateTime 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() { @@ -262,21 +270,19 @@ public OffsetDateTime importValidUntilTimeUtc() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (ingestionMode() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ingestionMode in model FileImportProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ingestionMode in model FileImportProperties")); } if (contentType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property contentType in model FileImportProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property contentType in model FileImportProperties")); } if (errorFile() != null) { errorFile().validate(); @@ -285,16 +291,15 @@ public void validate() { errorsPreview().forEach(e -> e.validate()); } if (importFile() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property importFile in model FileImportProperties")); } else { importFile().validate(); } if (source() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property source in model FileImportProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property source in model FileImportProperties")); } } 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 3ce589c95ac6..86fbf1c082c5 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 @@ -14,7 +14,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Fusion alert rule base property bag. */ +/** + * Fusion alert rule base property bag. + */ @Fluent public final class FusionAlertRuleProperties { /* @@ -77,9 +79,21 @@ public final class FusionAlertRuleProperties { @JsonProperty(value = "techniques", access = JsonProperty.Access.WRITE_ONLY) private List techniques; + /* + * The sub-techniques of the alert rule + */ + @JsonProperty(value = "subTechniques", access = JsonProperty.Access.WRITE_ONLY) + private List subTechniques; + + /** + * Creates an instance of FusionAlertRuleProperties class. + */ + public FusionAlertRuleProperties() { + } + /** * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @return the alertRuleTemplateName value. */ public String alertRuleTemplateName() { @@ -88,7 +102,7 @@ public String alertRuleTemplateName() { /** * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @param alertRuleTemplateName the alertRuleTemplateName value to set. * @return the FusionAlertRuleProperties object itself. */ @@ -99,7 +113,7 @@ public FusionAlertRuleProperties withAlertRuleTemplateName(String alertRuleTempl /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -108,7 +122,7 @@ public String description() { /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -117,7 +131,7 @@ public String displayName() { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public boolean enabled() { @@ -126,7 +140,7 @@ public boolean enabled() { /** * Set the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the FusionAlertRuleProperties object itself. */ @@ -137,7 +151,7 @@ public FusionAlertRuleProperties withEnabled(boolean enabled) { /** * Get the sourceSettings property: Configuration for all supported source signals in fusion detection. - * + * * @return the sourceSettings value. */ public List sourceSettings() { @@ -146,7 +160,7 @@ public List 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. */ @@ -157,7 +171,7 @@ public FusionAlertRuleProperties withSourceSettings(List s /** * Get the scenarioExclusionPatterns property: Configuration to exclude scenarios in fusion detection. - * + * * @return the scenarioExclusionPatterns value. */ public List scenarioExclusionPatterns() { @@ -166,19 +180,19 @@ public List 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) { + public FusionAlertRuleProperties + withScenarioExclusionPatterns(List scenarioExclusionPatterns) { this.scenarioExclusionPatterns = scenarioExclusionPatterns; return this; } /** * Get the lastModifiedUtc property: The last time that this alert has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -187,7 +201,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -196,7 +210,7 @@ public AlertSeverity severity() { /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -205,24 +219,32 @@ public List 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (alertRuleTemplateName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alertRuleTemplateName in model FusionAlertRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property alertRuleTemplateName in model FusionAlertRuleProperties")); } if (sourceSettings() != null) { sourceSettings().forEach(e -> e.validate()); 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 162717edb32f..d7af7e9d2c55 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 @@ -14,7 +14,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Fusion alert rule template properties. */ +/** + * Fusion alert rule template properties. + */ @Fluent public final class FusionAlertRuleTemplateProperties { /* @@ -77,15 +79,27 @@ public final class FusionAlertRuleTemplateProperties { @JsonProperty(value = "techniques") private List techniques; + /* + * The sub-techniques of the alert rule + */ + @JsonProperty(value = "subTechniques") + private List subTechniques; + /* * All supported source signal configurations consumed in fusion detection. */ @JsonProperty(value = "sourceSettings") private List sourceSettings; + /** + * Creates an instance of FusionAlertRuleTemplateProperties class. + */ + public FusionAlertRuleTemplateProperties() { + } + /** * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @return the alertRulesCreatedByTemplateCount value. */ public Integer alertRulesCreatedByTemplateCount() { @@ -94,19 +108,19 @@ public Integer 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) { + public FusionAlertRuleTemplateProperties + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { this.alertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; return this; } /** * Get the createdDateUtc property: The time that this alert rule template has been added. - * + * * @return the createdDateUtc value. */ public OffsetDateTime createdDateUtc() { @@ -115,7 +129,7 @@ public OffsetDateTime createdDateUtc() { /** * Get the lastUpdatedDateUtc property: The time that this alert rule template was last updated. - * + * * @return the lastUpdatedDateUtc value. */ public OffsetDateTime lastUpdatedDateUtc() { @@ -124,7 +138,7 @@ public OffsetDateTime lastUpdatedDateUtc() { /** * Get the description property: The description of the alert rule template. - * + * * @return the description value. */ public String description() { @@ -133,7 +147,7 @@ public String description() { /** * Set the description property: The description of the alert rule template. - * + * * @param description the description value to set. * @return the FusionAlertRuleTemplateProperties object itself. */ @@ -144,7 +158,7 @@ public FusionAlertRuleTemplateProperties withDescription(String description) { /** * Get the displayName property: The display name for alert rule template. - * + * * @return the displayName value. */ public String displayName() { @@ -153,7 +167,7 @@ public String displayName() { /** * Set the displayName property: The display name for alert rule template. - * + * * @param displayName the displayName value to set. * @return the FusionAlertRuleTemplateProperties object itself. */ @@ -164,7 +178,7 @@ public FusionAlertRuleTemplateProperties withDisplayName(String displayName) { /** * Get the requiredDataConnectors property: The required data connectors for this template. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -173,19 +187,19 @@ public List 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) { + public FusionAlertRuleTemplateProperties + withRequiredDataConnectors(List requiredDataConnectors) { this.requiredDataConnectors = requiredDataConnectors; return this; } /** * Get the status property: The alert rule template status. - * + * * @return the status value. */ public TemplateStatus status() { @@ -194,7 +208,7 @@ public TemplateStatus status() { /** * Set the status property: The alert rule template status. - * + * * @param status the status value to set. * @return the FusionAlertRuleTemplateProperties object itself. */ @@ -205,7 +219,7 @@ public FusionAlertRuleTemplateProperties withStatus(TemplateStatus status) { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -214,7 +228,7 @@ public AlertSeverity 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. */ @@ -225,7 +239,7 @@ public FusionAlertRuleTemplateProperties withSeverity(AlertSeverity severity) { /** * Get the tactics property: The tactics of the alert rule template. - * + * * @return the tactics value. */ public List tactics() { @@ -234,7 +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 FusionAlertRuleTemplateProperties object itself. */ @@ -245,7 +259,7 @@ public FusionAlertRuleTemplateProperties withTactics(List tactics) /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -254,7 +268,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the FusionAlertRuleTemplateProperties object itself. */ @@ -263,9 +277,29 @@ public FusionAlertRuleTemplateProperties 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 FusionAlertRuleTemplateProperties object itself. + */ + public FusionAlertRuleTemplateProperties withSubTechniques(List subTechniques) { + this.subTechniques = subTechniques; + return this; + } + /** * Get the sourceSettings property: All supported source signal configurations consumed in fusion detection. - * + * * @return the sourceSettings value. */ public List sourceSettings() { @@ -274,7 +308,7 @@ public List sourceSettings() { /** * Set the sourceSettings property: All supported source signal configurations consumed in fusion detection. - * + * * @param sourceSettings the sourceSettings value to set. * @return the FusionAlertRuleTemplateProperties object itself. */ @@ -285,7 +319,7 @@ public FusionAlertRuleTemplateProperties withSourceSettings(List value; + /** + * Creates an instance of GetQueriesResponseInner class. + */ + public GetQueriesResponseInner() { + } + /** * Get the value property: The query result values. - * + * * @return the value value. */ public List value() { @@ -29,7 +37,7 @@ public List value() { /** * Set the value property: The query result values. - * + * * @param value the value value to set. * @return the GetQueriesResponseInner object itself. */ @@ -40,7 +48,7 @@ public GetQueriesResponseInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HostEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HostEntityProperties.java index 16f676846108..09a78c35621d 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.OSFamily; import com.fasterxml.jackson.annotation.JsonProperty; -/** Host entity property bag. */ +/** + * Host entity property bag. + */ @Fluent public final class HostEntityProperties extends EntityCommonProperties { /* @@ -61,15 +63,20 @@ public final class HostEntityProperties extends EntityCommonProperties { private OSFamily osFamily; /* - * A free text representation of the operating system. This field is meant to hold specific versions the are more - * fine grained than OSFamily or future values not supported by OSFamily enumeration + * A free text representation of the operating system. This field is meant to hold specific versions the are more fine grained than OSFamily or future values not supported by OSFamily enumeration */ @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) private String osVersion; + /** + * Creates an instance of HostEntityProperties class. + */ + public HostEntityProperties() { + } + /** * Get the azureId property: The azure resource id of the VM. - * + * * @return the azureId value. */ public String azureId() { @@ -79,7 +86,7 @@ public String azureId() { /** * Get the dnsDomain property: The DNS domain that this host belongs to. Should contain the compete DNS suffix for * the domain. - * + * * @return the dnsDomain value. */ public String dnsDomain() { @@ -88,7 +95,7 @@ public String dnsDomain() { /** * Get the hostname property: The hostname without the domain suffix. - * + * * @return the hostname value. */ public String hostname() { @@ -97,7 +104,7 @@ public String hostname() { /** * Get the isDomainJoined property: Determines whether this host belongs to a domain. - * + * * @return the isDomainJoined value. */ public Boolean isDomainJoined() { @@ -106,7 +113,7 @@ public Boolean isDomainJoined() { /** * Get the netBiosName property: The host name (pre-windows2000). - * + * * @return the netBiosName value. */ public String netBiosName() { @@ -115,7 +122,7 @@ public String netBiosName() { /** * Get the ntDomain property: The NT domain that this host belongs to. - * + * * @return the ntDomain value. */ public String ntDomain() { @@ -124,7 +131,7 @@ public String ntDomain() { /** * Get the omsAgentId property: The OMS agent id, if the host has OMS agent installed. - * + * * @return the omsAgentId value. */ public String omsAgentId() { @@ -133,7 +140,7 @@ public String omsAgentId() { /** * Get the osFamily property: The operating system type. - * + * * @return the osFamily value. */ public OSFamily osFamily() { @@ -142,7 +149,7 @@ public OSFamily osFamily() { /** * Set the osFamily property: The operating system type. - * + * * @param osFamily the osFamily value to set. * @return the HostEntityProperties object itself. */ @@ -154,7 +161,7 @@ public HostEntityProperties withOsFamily(OSFamily osFamily) { /** * Get the osVersion property: A free text representation of the operating system. This field is meant to hold * specific versions the are more fine grained than OSFamily or future values not supported by OSFamily enumeration. - * + * * @return the osVersion value. */ public String osVersion() { @@ -163,7 +170,7 @@ public String osVersion() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..d3c41f5bc7d0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a Hunt Comment in Azure Security Insights. + */ +@Fluent +public final class HuntCommentInner extends ResourceWithEtag { + /* + * Hunt Comment properties + */ + @JsonProperty(value = "properties") + private HuntCommentProperties innerProperties; + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public HuntCommentInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..2fff2a46665f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentProperties.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a hunt comment properties. + */ +@Fluent +public final class HuntCommentProperties { + /* + * The message for the comment + */ + @JsonProperty(value = "message", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (message() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property message in model HuntCommentProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HuntCommentProperties.class); +} 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..2267916c727f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntInner.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +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.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents a Hunt in Azure Security Insights. + */ +@Fluent +public final class HuntInner extends ResourceWithEtag { + /* + * Hunt properties + */ + @JsonProperty(value = "properties") + private HuntProperties innerProperties; + + /** + * Creates an instance of HuntInner class. + */ + public HuntInner() { + } + + /** + * Get the innerProperties property: Hunt properties. + * + * @return the innerProperties value. + */ + private HuntProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public HuntInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..e58ef00d6413 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntProperties.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes hunt properties. + */ +@Fluent +public final class HuntProperties { + /* + * The display name of the hunt + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * The description of the hunt + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * The status of the hunt. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * The hypothesis status of the hunt. + */ + @JsonProperty(value = "hypothesisStatus") + private HypothesisStatus hypothesisStatus; + + /* + * A list of mitre attack tactics the hunt is associated with + */ + @JsonProperty(value = "attackTactics") + private List attackTactics; + + /* + * A list of a mitre attack techniques the hunt is associated with + */ + @JsonProperty(value = "attackTechniques") + private List attackTechniques; + + /* + * List of labels relevant to this hunt + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * Describes a user that the hunt is assigned to + */ + @JsonProperty(value = "owner") + 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; + } + + /** + * 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 HuntProperties")); + } + if (description() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property description in model HuntProperties")); + } + if (owner() != null) { + owner().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HuntProperties.class); +} 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..277c214fa45f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents a Hunt Relation in Azure Security Insights. + */ +@Fluent +public final class HuntRelationInner extends ResourceWithEtag { + /* + * Hunt Relation properties + */ + @JsonProperty(value = "properties") + private HuntRelationProperties innerProperties; + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public HuntRelationInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..d0841ebf625c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes hunt relation properties. + */ +@Fluent +public final class HuntRelationProperties { + /* + * The id of the related resource + */ + @JsonProperty(value = "relatedResourceId", required = true) + private String relatedResourceId; + + /* + * The name of the related resource + */ + @JsonProperty(value = "relatedResourceName", access = JsonProperty.Access.WRITE_ONLY) + private String relatedResourceName; + + /* + * The type of the hunt relation + */ + @JsonProperty(value = "relationType", access = JsonProperty.Access.WRITE_ONLY) + private String relationType; + + /* + * The resource that the relation is related to + */ + @JsonProperty(value = "relatedResourceKind", access = JsonProperty.Access.WRITE_ONLY) + private String relatedResourceKind; + + /* + * List of labels relevant to this hunt + */ + @JsonProperty(value = "labels") + 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; + } + + /** + * 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 HuntRelationProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HuntRelationProperties.class); +} 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 5be6c7dc4e9b..f1dc0c6c2949 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 @@ -13,7 +13,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Describes bookmark properties. */ +/** + * Describes bookmark properties. + */ @Fluent public final class HuntingBookmarkProperties extends EntityCommonProperties { /* @@ -82,9 +84,15 @@ public final class HuntingBookmarkProperties extends EntityCommonProperties { @JsonProperty(value = "incidentInfo") private IncidentInfo incidentInfo; + /** + * Creates an instance of HuntingBookmarkProperties class. + */ + public HuntingBookmarkProperties() { + } + /** * Get the created property: The time the bookmark was created. - * + * * @return the created value. */ public OffsetDateTime created() { @@ -93,7 +101,7 @@ public OffsetDateTime created() { /** * Set the created property: The time the bookmark was created. - * + * * @param created the created value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -104,7 +112,7 @@ public HuntingBookmarkProperties withCreated(OffsetDateTime created) { /** * Get the createdBy property: Describes a user that created the bookmark. - * + * * @return the createdBy value. */ public UserInfo createdBy() { @@ -113,7 +121,7 @@ public UserInfo createdBy() { /** * Set the createdBy property: Describes a user that created the bookmark. - * + * * @param createdBy the createdBy value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -124,7 +132,7 @@ public HuntingBookmarkProperties withCreatedBy(UserInfo createdBy) { /** * Get the displayName property: The display name of the bookmark. - * + * * @return the displayName value. */ public String displayName() { @@ -133,7 +141,7 @@ public String displayName() { /** * Set the displayName property: The display name of the bookmark. - * + * * @param displayName the displayName value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -144,7 +152,7 @@ public HuntingBookmarkProperties withDisplayName(String displayName) { /** * Get the eventTime property: The time of the event. - * + * * @return the eventTime value. */ public OffsetDateTime eventTime() { @@ -153,7 +161,7 @@ public OffsetDateTime eventTime() { /** * Set the eventTime property: The time of the event. - * + * * @param eventTime the eventTime value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -164,7 +172,7 @@ public HuntingBookmarkProperties withEventTime(OffsetDateTime eventTime) { /** * Get the labels property: List of labels relevant to this bookmark. - * + * * @return the labels value. */ public List labels() { @@ -173,7 +181,7 @@ public List labels() { /** * Set the labels property: List of labels relevant to this bookmark. - * + * * @param labels the labels value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -184,7 +192,7 @@ public HuntingBookmarkProperties withLabels(List labels) { /** * Get the notes property: The notes of the bookmark. - * + * * @return the notes value. */ public String notes() { @@ -193,7 +201,7 @@ public String notes() { /** * Set the notes property: The notes of the bookmark. - * + * * @param notes the notes value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -204,7 +212,7 @@ public HuntingBookmarkProperties withNotes(String notes) { /** * Get the query property: The query of the bookmark. - * + * * @return the query value. */ public String query() { @@ -213,7 +221,7 @@ public String query() { /** * Set the query property: The query of the bookmark. - * + * * @param query the query value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -224,7 +232,7 @@ public HuntingBookmarkProperties withQuery(String query) { /** * Get the queryResult property: The query result of the bookmark. - * + * * @return the queryResult value. */ public String queryResult() { @@ -233,7 +241,7 @@ public String queryResult() { /** * Set the queryResult property: The query result of the bookmark. - * + * * @param queryResult the queryResult value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -244,7 +252,7 @@ public HuntingBookmarkProperties withQueryResult(String queryResult) { /** * Get the updated property: The last time the bookmark was updated. - * + * * @return the updated value. */ public OffsetDateTime updated() { @@ -253,7 +261,7 @@ public OffsetDateTime updated() { /** * Set the updated property: The last time the bookmark was updated. - * + * * @param updated the updated value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -264,7 +272,7 @@ public HuntingBookmarkProperties withUpdated(OffsetDateTime updated) { /** * Get the updatedBy property: Describes a user that updated the bookmark. - * + * * @return the updatedBy value. */ public UserInfo updatedBy() { @@ -273,7 +281,7 @@ public UserInfo updatedBy() { /** * Set the updatedBy property: Describes a user that updated the bookmark. - * + * * @param updatedBy the updatedBy value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -284,7 +292,7 @@ public HuntingBookmarkProperties withUpdatedBy(UserInfo updatedBy) { /** * Get the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @return the incidentInfo value. */ public IncidentInfo incidentInfo() { @@ -293,7 +301,7 @@ public IncidentInfo incidentInfo() { /** * Set the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @param incidentInfo the incidentInfo value to set. * @return the HuntingBookmarkProperties object itself. */ @@ -304,7 +312,7 @@ public HuntingBookmarkProperties withIncidentInfo(IncidentInfo incidentInfo) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -314,14 +322,13 @@ public void validate() { createdBy().validate(); } if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model HuntingBookmarkProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property displayName in model HuntingBookmarkProperties")); } if (query() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property query in model HuntingBookmarkProperties")); } if (updatedBy() != null) { 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 18459e1b4f13..ea431765b666 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of incident alerts. */ +/** + * List of incident alerts. + */ @Fluent public final class IncidentAlertListInner { /* @@ -19,9 +21,15 @@ public final class IncidentAlertListInner { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of IncidentAlertListInner class. + */ + public IncidentAlertListInner() { + } + /** * Get the value property: Array of incident alerts. - * + * * @return the value value. */ public List value() { @@ -30,7 +38,7 @@ public List value() { /** * Set the value property: Array of incident alerts. - * + * * @param value the value value to set. * @return the IncidentAlertListInner object itself. */ @@ -41,14 +49,13 @@ public IncidentAlertListInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model IncidentAlertListInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model IncidentAlertListInner")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentBookmarkListInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentBookmarkListInner.java index aa6aec92f588..1c3279a7ba59 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of incident bookmarks. */ +/** + * List of incident bookmarks. + */ @Fluent public final class IncidentBookmarkListInner { /* @@ -19,9 +21,15 @@ public final class IncidentBookmarkListInner { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of IncidentBookmarkListInner class. + */ + public IncidentBookmarkListInner() { + } + /** * Get the value property: Array of incident bookmarks. - * + * * @return the value value. */ public List value() { @@ -30,7 +38,7 @@ public List value() { /** * Set the value property: Array of incident bookmarks. - * + * * @param value the value value to set. * @return the IncidentBookmarkListInner object itself. */ @@ -41,13 +49,13 @@ public IncidentBookmarkListInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property value in model IncidentBookmarkListInner")); } else { value().forEach(e -> e.validate()); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentInner.java index 5bde60b473fa..6a6fff44f68b 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Represents an incident comment. */ +/** + * Represents an incident comment. + */ @Fluent public final class IncidentCommentInner extends ResourceWithEtag { /* @@ -19,43 +21,33 @@ public final class IncidentCommentInner extends ResourceWithEtag { @JsonProperty(value = "properties") private IncidentCommentProperties innerProperties; + /** + * Creates an instance of IncidentCommentInner class. + */ + public IncidentCommentInner() { + } + /** * Get the innerProperties property: Incident comment properties. - * + * * @return the innerProperties value. */ private IncidentCommentProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public IncidentCommentInner withEtag(String etag) { super.withEtag(etag); return this; } - /** - * Get the createdTimeUtc property: The time the comment was created. - * - * @return the createdTimeUtc value. - */ - public OffsetDateTime createdTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); - } - - /** - * Get the lastModifiedTimeUtc property: The time the comment was updated. - * - * @return the lastModifiedTimeUtc value. - */ - public OffsetDateTime lastModifiedTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); - } - /** * Get the message property: The comment message. - * + * * @return the message value. */ public String message() { @@ -64,7 +56,7 @@ public String message() { /** * Set the message property: The comment message. - * + * * @param message the message value to set. * @return the IncidentCommentInner object itself. */ @@ -76,9 +68,27 @@ public IncidentCommentInner withMessage(String message) { 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 author property: Describes the client that created the comment. - * + * * @return the author value. */ public ClientInfo author() { @@ -87,7 +97,7 @@ public ClientInfo author() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 6cc4d172a5e2..14d7f1fe1001 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 @@ -10,9 +10,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Incident comment property bag. */ +/** + * Incident comment property bag. + */ @Fluent public final class IncidentCommentProperties { + /* + * The comment message + */ + @JsonProperty(value = "message", required = true) + private String message; + /* * The time the comment was created */ @@ -25,12 +33,6 @@ public final class IncidentCommentProperties { @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastModifiedTimeUtc; - /* - * The comment message - */ - @JsonProperty(value = "message", required = true) - private String message; - /* * Describes the client that created the comment */ @@ -38,26 +40,14 @@ public final class IncidentCommentProperties { private ClientInfo author; /** - * Get the createdTimeUtc property: The time the comment was created. - * - * @return the createdTimeUtc value. - */ - public OffsetDateTime createdTimeUtc() { - return this.createdTimeUtc; - } - - /** - * Get the lastModifiedTimeUtc property: The time the comment was updated. - * - * @return the lastModifiedTimeUtc value. + * Creates an instance of IncidentCommentProperties class. */ - public OffsetDateTime lastModifiedTimeUtc() { - return this.lastModifiedTimeUtc; + public IncidentCommentProperties() { } /** * Get the message property: The comment message. - * + * * @return the message value. */ public String message() { @@ -66,7 +56,7 @@ public String message() { /** * Set the message property: The comment message. - * + * * @param message the message value to set. * @return the IncidentCommentProperties object itself. */ @@ -75,9 +65,27 @@ public IncidentCommentProperties withMessage(String message) { return this; } + /** + * Get the createdTimeUtc property: The time the comment was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.createdTimeUtc; + } + + /** + * Get the lastModifiedTimeUtc property: The time the comment was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + /** * Get the author property: Describes the client that created the comment. - * + * * @return the author value. */ public ClientInfo author() { @@ -86,15 +94,14 @@ public ClientInfo author() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (message() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property message in model IncidentCommentProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property message in model IncidentCommentProperties")); } if (author() != null) { author().validate(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentEntitiesResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentEntitiesResponseInner.java index 3f6dbe089b16..742a5c3551dc 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentEntitiesResponseInner.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentEntitiesResponseInner.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The incident related entities response. */ +/** + * The incident related entities response. + */ @Fluent public final class IncidentEntitiesResponseInner { /* @@ -24,9 +26,15 @@ public final class IncidentEntitiesResponseInner { @JsonProperty(value = "metaData") private List metadata; + /** + * Creates an instance of IncidentEntitiesResponseInner class. + */ + public IncidentEntitiesResponseInner() { + } + /** * Get the entities property: Array of the incident related entities. - * + * * @return the entities value. */ public List entities() { @@ -35,7 +43,7 @@ public List entities() { /** * Set the entities property: Array of the incident related entities. - * + * * @param entities the entities value to set. * @return the IncidentEntitiesResponseInner object itself. */ @@ -46,7 +54,7 @@ public IncidentEntitiesResponseInner withEntities(List entities) { /** * Get the metadata property: The metadata from the incident related entities results. - * + * * @return the metadata value. */ public List metadata() { @@ -55,7 +63,7 @@ public List 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. */ @@ -66,7 +74,7 @@ public IncidentEntitiesResponseInner withMetadata(List labels() { - return this.innerProperties() == null ? null : this.innerProperties().labels(); + public IncidentOwnerInfo owner() { + return this.innerProperties() == null ? null : this.innerProperties().owner(); } /** - * Set the labels property: List of labels relevant to this incident. - * - * @param labels the labels value to set. + * Set the owner property: Describes a user that the incident is assigned to. + * + * @param owner the owner value to set. * @return the IncidentInner object itself. */ - public IncidentInner withLabels(List labels) { + public IncidentInner withOwner(IncidentOwnerInfo owner) { if (this.innerProperties() == null) { this.innerProperties = new IncidentPropertiesInner(); } - this.innerProperties().withLabels(labels); + this.innerProperties().withOwner(owner); return this; } /** - * Get the providerName property: The name of the source provider that generated the incident. - * - * @return the providerName value. + * Get the labels property: List of labels relevant to this incident. + * + * @return the labels value. */ - public String providerName() { - return this.innerProperties() == null ? null : this.innerProperties().providerName(); + public List labels() { + return this.innerProperties() == null ? null : this.innerProperties().labels(); } /** - * Set the providerName property: The name of the source provider that generated the incident. - * - * @param providerName the providerName value to set. + * Set the labels property: List of labels relevant to this incident. + * + * @param labels the labels value to set. * @return the IncidentInner object itself. */ - public IncidentInner withProviderName(String providerName) { + public IncidentInner withLabels(List labels) { if (this.innerProperties() == null) { this.innerProperties = new IncidentPropertiesInner(); } - this.innerProperties().withProviderName(providerName); + this.innerProperties().withLabels(labels); return this; } /** - * Get the providerIncidentId property: The incident ID assigned by the incident provider. - * - * @return the providerIncidentId value. + * Get the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @return the firstActivityTimeUtc value. */ - public String providerIncidentId() { - return this.innerProperties() == null ? null : this.innerProperties().providerIncidentId(); + public OffsetDateTime firstActivityTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().firstActivityTimeUtc(); } /** - * Set the providerIncidentId property: The incident ID assigned by the incident provider. - * - * @param providerIncidentId the providerIncidentId value to set. + * 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 withProviderIncidentId(String providerIncidentId) { + public IncidentInner withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { if (this.innerProperties() == null) { this.innerProperties = new IncidentPropertiesInner(); } - this.innerProperties().withProviderIncidentId(providerIncidentId); + this.innerProperties().withFirstActivityTimeUtc(firstActivityTimeUtc); return this; } /** * Get the lastActivityTimeUtc property: The time of the last activity in the incident. - * + * * @return the lastActivityTimeUtc value. */ public OffsetDateTime lastActivityTimeUtc() { @@ -273,7 +293,7 @@ public OffsetDateTime lastActivityTimeUtc() { /** * Set the lastActivityTimeUtc property: The time of the last activity in the incident. - * + * * @param lastActivityTimeUtc the lastActivityTimeUtc value to set. * @return the IncidentInner object itself. */ @@ -287,7 +307,7 @@ public IncidentInner withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc) /** * Get the lastModifiedTimeUtc property: The last time the incident was updated. - * + * * @return the lastModifiedTimeUtc value. */ public OffsetDateTime lastModifiedTimeUtc() { @@ -295,86 +315,71 @@ public OffsetDateTime lastModifiedTimeUtc() { } /** - * Get the owner property: Describes a user that the incident is assigned to. - * - * @return the owner value. + * Get the createdTimeUtc property: The time the incident was created. + * + * @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. - * - * @param owner the owner value to set. - * @return the IncidentInner object itself. + * Get the incidentNumber property: A sequential number. + * + * @return the incidentNumber value. */ - public IncidentInner withOwner(IncidentOwnerInfo owner) { - if (this.innerProperties() == null) { - this.innerProperties = new IncidentPropertiesInner(); - } - 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. - * - * @return the relatedAnalyticRuleIds value. + * Get the additionalData property: Additional data on the incident. + * + * @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. - * - * @return the severity value. + * Get the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. + * + * @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. - * - * @param severity the severity value to set. - * @return the IncidentInner object itself. + * Get the incidentUrl property: The deep-link url to the incident in Azure portal. + * + * @return the incidentUrl value. */ - public IncidentInner withSeverity(IncidentSeverity severity) { - if (this.innerProperties() == null) { - this.innerProperties = new IncidentPropertiesInner(); - } - 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. - * - * @return the status value. + * Get the providerName property: The name of the source provider that generated the incident. + * + * @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. - * - * @param status the status value to set. - * @return the IncidentInner object itself. + * Get the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @return the providerIncidentId value. */ - public IncidentInner withStatus(IncidentStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new IncidentPropertiesInner(); - } - this.innerProperties().withStatus(status); - return this; + public String providerIncidentId() { + return this.innerProperties() == null ? null : this.innerProperties().providerIncidentId(); } /** * Get the teamInformation property: Describes a team for the incident. - * + * * @return the teamInformation value. */ public TeamInformationInner teamInformation() { @@ -383,7 +388,7 @@ public TeamInformationInner teamInformation() { /** * Set the teamInformation property: Describes a team for the incident. - * + * * @param teamInformation the teamInformation value to set. * @return the IncidentInner object itself. */ @@ -395,32 +400,9 @@ public IncidentInner withTeamInformation(TeamInformationInner teamInformation) { return this; } - /** - * Get the title property: The title of the incident. - * - * @return the title value. - */ - public String title() { - return this.innerProperties() == null ? null : this.innerProperties().title(); - } - - /** - * Set the title property: The title of the incident. - * - * @param title the title value to set. - * @return the IncidentInner object itself. - */ - public IncidentInner withTitle(String title) { - if (this.innerProperties() == null) { - this.innerProperties = new IncidentPropertiesInner(); - } - this.innerProperties().withTitle(title); - return this; - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentPropertiesInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentPropertiesInner.java index 5262e2c3ba58..0d5e5ca47013 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentPropertiesInner.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentPropertiesInner.java @@ -17,62 +17,58 @@ import java.time.OffsetDateTime; import java.util.List; -/** Describes incident properties. */ +/** + * The IncidentProperties model. + */ @Fluent public final class IncidentPropertiesInner { /* - * Additional data on the incident - */ - @JsonProperty(value = "additionalData", access = JsonProperty.Access.WRITE_ONLY) - private IncidentAdditionalData additionalData; - - /* - * The reason the incident was closed + * The title of the incident */ - @JsonProperty(value = "classification") - private IncidentClassification classification; + @JsonProperty(value = "title", required = true) + private String title; /* - * Describes the reason the incident was closed + * The description of the incident */ - @JsonProperty(value = "classificationComment") - private String classificationComment; + @JsonProperty(value = "description") + private String description; /* - * The classification reason the incident was closed with + * The severity of the incident */ - @JsonProperty(value = "classificationReason") - private IncidentClassificationReason classificationReason; + @JsonProperty(value = "severity", required = true) + private IncidentSeverity severity; /* - * The time the incident was created + * The status of the incident */ - @JsonProperty(value = "createdTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdTimeUtc; + @JsonProperty(value = "status", required = true) + private IncidentStatus status; /* - * The description of the incident + * The reason the incident was closed */ - @JsonProperty(value = "description") - private String description; + @JsonProperty(value = "classification") + private IncidentClassification classification; /* - * The time of the first activity in the incident + * The classification reason the incident was closed with */ - @JsonProperty(value = "firstActivityTimeUtc") - private OffsetDateTime firstActivityTimeUtc; + @JsonProperty(value = "classificationReason") + private IncidentClassificationReason classificationReason; /* - * The deep-link url to the incident in Azure portal + * Describes the reason the incident was closed */ - @JsonProperty(value = "incidentUrl", access = JsonProperty.Access.WRITE_ONLY) - private String incidentUrl; + @JsonProperty(value = "classificationComment") + private String classificationComment; /* - * A sequential number + * Describes a user that the incident is assigned to */ - @JsonProperty(value = "incidentNumber", access = JsonProperty.Access.WRITE_ONLY) - private Integer incidentNumber; + @JsonProperty(value = "owner") + private IncidentOwnerInfo owner; /* * List of labels relevant to this incident @@ -81,16 +77,10 @@ public final class IncidentPropertiesInner { private List labels; /* - * The name of the source provider that generated the incident - */ - @JsonProperty(value = "providerName") - private String providerName; - - /* - * The incident ID assigned by the incident provider + * The time of the first activity in the incident */ - @JsonProperty(value = "providerIncidentId") - private String providerIncidentId; + @JsonProperty(value = "firstActivityTimeUtc") + private OffsetDateTime firstActivityTimeUtc; /* * The time of the last activity in the incident @@ -105,10 +95,22 @@ public final class IncidentPropertiesInner { private OffsetDateTime lastModifiedTimeUtc; /* - * Describes a user that the incident is assigned to + * The time the incident was created */ - @JsonProperty(value = "owner") - private IncidentOwnerInfo owner; + @JsonProperty(value = "createdTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimeUtc; + + /* + * A sequential number + */ + @JsonProperty(value = "incidentNumber", access = JsonProperty.Access.WRITE_ONLY) + private Integer incidentNumber; + + /* + * Additional data on the incident + */ + @JsonProperty(value = "additionalData", access = JsonProperty.Access.WRITE_ONLY) + private IncidentAdditionalData additionalData; /* * List of resource ids of Analytic rules related to the incident @@ -117,228 +119,238 @@ public final class IncidentPropertiesInner { private List relatedAnalyticRuleIds; /* - * The severity of the incident + * The deep-link url to the incident in Azure portal */ - @JsonProperty(value = "severity", required = true) - private IncidentSeverity severity; + @JsonProperty(value = "incidentUrl", access = JsonProperty.Access.WRITE_ONLY) + private String incidentUrl; /* - * The status of the incident + * The name of the source provider that generated the incident */ - @JsonProperty(value = "status", required = true) - private IncidentStatus status; + @JsonProperty(value = "providerName", access = JsonProperty.Access.WRITE_ONLY) + private String providerName; /* - * Describes a team for the incident + * The incident ID assigned by the incident provider */ - @JsonProperty(value = "teamInformation") - private TeamInformationInner teamInformation; + @JsonProperty(value = "providerIncidentId", access = JsonProperty.Access.WRITE_ONLY) + private String providerIncidentId; /* - * The title of the incident + * Describes a team for the incident */ - @JsonProperty(value = "title", required = true) - private String title; + @JsonProperty(value = "teamInformation") + private TeamInformationInner teamInformation; /** - * Get the additionalData property: Additional data on the incident. - * - * @return the additionalData value. + * Creates an instance of IncidentPropertiesInner class. */ - public IncidentAdditionalData additionalData() { - return this.additionalData; + public IncidentPropertiesInner() { } /** - * Get the classification property: The reason the incident was closed. - * - * @return the classification value. + * Get the title property: The title of the incident. + * + * @return the title value. */ - public IncidentClassification classification() { - return this.classification; + public String title() { + return this.title; } /** - * Set the classification property: The reason the incident was closed. - * - * @param classification the classification value to set. + * Set the title property: The title of the incident. + * + * @param title the title value to set. * @return the IncidentPropertiesInner object itself. */ - public IncidentPropertiesInner withClassification(IncidentClassification classification) { - this.classification = classification; + public IncidentPropertiesInner withTitle(String title) { + this.title = title; return this; } /** - * Get the classificationComment property: Describes the reason the incident was closed. - * - * @return the classificationComment value. + * Get the description property: The description of the incident. + * + * @return the description value. */ - public String classificationComment() { - return this.classificationComment; + public String description() { + return this.description; } /** - * Set the classificationComment property: Describes the reason the incident was closed. - * - * @param classificationComment the classificationComment value to set. + * Set the description property: The description of the incident. + * + * @param description the description value to set. * @return the IncidentPropertiesInner object itself. */ - public IncidentPropertiesInner withClassificationComment(String classificationComment) { - this.classificationComment = classificationComment; + public IncidentPropertiesInner withDescription(String description) { + this.description = description; return this; } /** - * Get the classificationReason property: The classification reason the incident was closed with. - * - * @return the classificationReason value. + * Get the severity property: The severity of the incident. + * + * @return the severity value. */ - public IncidentClassificationReason classificationReason() { - return this.classificationReason; + public IncidentSeverity severity() { + return this.severity; } /** - * Set the classificationReason property: The classification reason the incident was closed with. - * - * @param classificationReason the classificationReason value to set. + * Set the severity property: The severity of the incident. + * + * @param severity the severity value to set. * @return the IncidentPropertiesInner object itself. */ - public IncidentPropertiesInner withClassificationReason(IncidentClassificationReason classificationReason) { - this.classificationReason = classificationReason; + public IncidentPropertiesInner withSeverity(IncidentSeverity severity) { + this.severity = severity; return this; } /** - * Get the createdTimeUtc property: The time the incident was created. - * - * @return the createdTimeUtc value. + * Get the status property: The status of the incident. + * + * @return the status value. */ - public OffsetDateTime createdTimeUtc() { - return this.createdTimeUtc; + public IncidentStatus status() { + return this.status; } /** - * Get the description property: The description of the incident. - * - * @return the description value. + * Set the status property: The status of the incident. + * + * @param status the status value to set. + * @return the IncidentPropertiesInner object itself. */ - public String description() { - return this.description; + public IncidentPropertiesInner withStatus(IncidentStatus status) { + this.status = status; + return this; } /** - * Set the description property: The description of the incident. - * - * @param description the description value to set. + * Get the classification property: The reason the incident was closed. + * + * @return the classification value. + */ + public IncidentClassification classification() { + return this.classification; + } + + /** + * Set the classification property: The reason the incident was closed. + * + * @param classification the classification value to set. * @return the IncidentPropertiesInner object itself. */ - public IncidentPropertiesInner withDescription(String description) { - this.description = description; + public IncidentPropertiesInner withClassification(IncidentClassification classification) { + this.classification = classification; return this; } /** - * Get the firstActivityTimeUtc property: The time of the first activity in the incident. - * - * @return the firstActivityTimeUtc value. + * Get the classificationReason property: The classification reason the incident was closed with. + * + * @return the classificationReason value. */ - public OffsetDateTime firstActivityTimeUtc() { - return this.firstActivityTimeUtc; + public IncidentClassificationReason classificationReason() { + return this.classificationReason; } /** - * Set the firstActivityTimeUtc property: The time of the first activity in the incident. - * - * @param firstActivityTimeUtc the firstActivityTimeUtc value to set. + * Set the classificationReason property: The classification reason the incident was closed with. + * + * @param classificationReason the classificationReason value to set. * @return the IncidentPropertiesInner object itself. */ - public IncidentPropertiesInner withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { - this.firstActivityTimeUtc = firstActivityTimeUtc; + public IncidentPropertiesInner withClassificationReason(IncidentClassificationReason classificationReason) { + this.classificationReason = classificationReason; return this; } /** - * Get the incidentUrl property: The deep-link url to the incident in Azure portal. - * - * @return the incidentUrl value. + * Get the classificationComment property: Describes the reason the incident was closed. + * + * @return the classificationComment value. */ - public String incidentUrl() { - return this.incidentUrl; + public String classificationComment() { + return this.classificationComment; } /** - * Get the incidentNumber property: A sequential number. - * - * @return the incidentNumber value. + * Set the classificationComment property: Describes the reason the incident was closed. + * + * @param classificationComment the classificationComment value to set. + * @return the IncidentPropertiesInner object itself. */ - public Integer incidentNumber() { - return this.incidentNumber; + public IncidentPropertiesInner withClassificationComment(String classificationComment) { + this.classificationComment = classificationComment; + return this; } /** - * Get the labels property: List of labels relevant to this incident. - * - * @return the labels value. + * Get the owner property: Describes a user that the incident is assigned to. + * + * @return the owner value. */ - public List labels() { - return this.labels; + public IncidentOwnerInfo owner() { + return this.owner; } /** - * Set the labels property: List of labels relevant to this incident. - * - * @param labels the labels value to set. + * Set the owner property: Describes a user that the incident is assigned to. + * + * @param owner the owner value to set. * @return the IncidentPropertiesInner object itself. */ - public IncidentPropertiesInner withLabels(List labels) { - this.labels = labels; + public IncidentPropertiesInner withOwner(IncidentOwnerInfo owner) { + this.owner = owner; return this; } /** - * Get the providerName property: The name of the source provider that generated the incident. - * - * @return the providerName value. + * Get the labels property: List of labels relevant to this incident. + * + * @return the labels value. */ - public String providerName() { - return this.providerName; + public List labels() { + return this.labels; } /** - * Set the providerName property: The name of the source provider that generated the incident. - * - * @param providerName the providerName value to set. + * Set the labels property: List of labels relevant to this incident. + * + * @param labels the labels value to set. * @return the IncidentPropertiesInner object itself. */ - public IncidentPropertiesInner withProviderName(String providerName) { - this.providerName = providerName; + public IncidentPropertiesInner withLabels(List labels) { + this.labels = labels; return this; } /** - * Get the providerIncidentId property: The incident ID assigned by the incident provider. - * - * @return the providerIncidentId value. + * Get the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @return the firstActivityTimeUtc value. */ - public String providerIncidentId() { - return this.providerIncidentId; + public OffsetDateTime firstActivityTimeUtc() { + return this.firstActivityTimeUtc; } /** - * Set the providerIncidentId property: The incident ID assigned by the incident provider. - * - * @param providerIncidentId the providerIncidentId value to set. + * Set the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @param firstActivityTimeUtc the firstActivityTimeUtc value to set. * @return the IncidentPropertiesInner object itself. */ - public IncidentPropertiesInner withProviderIncidentId(String providerIncidentId) { - this.providerIncidentId = providerIncidentId; + public IncidentPropertiesInner withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { + this.firstActivityTimeUtc = firstActivityTimeUtc; return this; } /** * Get the lastActivityTimeUtc property: The time of the last activity in the incident. - * + * * @return the lastActivityTimeUtc value. */ public OffsetDateTime lastActivityTimeUtc() { @@ -347,7 +359,7 @@ public OffsetDateTime lastActivityTimeUtc() { /** * Set the lastActivityTimeUtc property: The time of the last activity in the incident. - * + * * @param lastActivityTimeUtc the lastActivityTimeUtc value to set. * @return the IncidentPropertiesInner object itself. */ @@ -358,7 +370,7 @@ public IncidentPropertiesInner withLastActivityTimeUtc(OffsetDateTime lastActivi /** * Get the lastModifiedTimeUtc property: The last time the incident was updated. - * + * * @return the lastModifiedTimeUtc value. */ public OffsetDateTime lastModifiedTimeUtc() { @@ -366,77 +378,71 @@ public OffsetDateTime lastModifiedTimeUtc() { } /** - * Get the owner property: Describes a user that the incident is assigned to. - * - * @return the owner value. + * Get the createdTimeUtc property: The time the incident was created. + * + * @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. - * - * @param owner the owner value to set. - * @return the IncidentPropertiesInner object itself. + * Get the incidentNumber property: A sequential number. + * + * @return the incidentNumber value. */ - public IncidentPropertiesInner 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. - * - * @return the relatedAnalyticRuleIds value. + * Get the additionalData property: Additional data on the incident. + * + * @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. - * - * @return the severity value. + * Get the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. + * + * @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. - * - * @param severity the severity value to set. - * @return the IncidentPropertiesInner object itself. + * Get the incidentUrl property: The deep-link url to the incident in Azure portal. + * + * @return the incidentUrl value. */ - public IncidentPropertiesInner withSeverity(IncidentSeverity severity) { - this.severity = severity; - return this; + public String incidentUrl() { + return this.incidentUrl; } /** - * Get the status property: The status of the incident. - * - * @return the status value. + * Get the providerName property: The name of the source provider that generated the incident. + * + * @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. - * - * @param status the status value to set. - * @return the IncidentPropertiesInner object itself. + * Get the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @return the providerIncidentId value. */ - public IncidentPropertiesInner withStatus(IncidentStatus status) { - this.status = status; - return this; + public String providerIncidentId() { + return this.providerIncidentId; } /** * Get the teamInformation property: Describes a team for the incident. - * + * * @return the teamInformation value. */ public TeamInformationInner teamInformation() { @@ -445,7 +451,7 @@ public TeamInformationInner teamInformation() { /** * Set the teamInformation property: Describes a team for the incident. - * + * * @param teamInformation the teamInformation value to set. * @return the IncidentPropertiesInner object itself. */ @@ -454,60 +460,37 @@ public IncidentPropertiesInner withTeamInformation(TeamInformationInner teamInfo return this; } - /** - * Get the title property: The title of the incident. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: The title of the incident. - * - * @param title the title value to set. - * @return the IncidentPropertiesInner object itself. - */ - public IncidentPropertiesInner withTitle(String title) { - this.title = title; - return this; - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (additionalData() != null) { - additionalData().validate(); + if (title() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property title in model IncidentPropertiesInner")); } - if (labels() != null) { - labels().forEach(e -> e.validate()); + if (severity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property severity in model IncidentPropertiesInner")); + } + if (status() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property status in model IncidentPropertiesInner")); } if (owner() != null) { owner().validate(); } - if (severity() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property severity in model IncidentPropertiesInner")); + if (labels() != null) { + labels().forEach(e -> e.validate()); } - if (status() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property status in model IncidentPropertiesInner")); + if (additionalData() != null) { + additionalData().validate(); } if (teamInformation() != null) { teamInformation().validate(); } - if (title() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property title in model IncidentPropertiesInner")); - } } private static final ClientLogger LOGGER = new ClientLogger(IncidentPropertiesInner.class); 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..67c9c4f9c27e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskInner.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * The IncidentTask model. + */ +@Fluent +public final class IncidentTaskInner extends ResourceWithEtag { + /* + * The properties property. + */ + @JsonProperty(value = "properties", required = true) + private IncidentTaskProperties innerProperties = new IncidentTaskProperties(); + + /** + * Creates an instance of IncidentTaskInner class. + */ + public IncidentTaskInner() { + } + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private IncidentTaskProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public IncidentTaskInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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 property. + * + * @return the status value. + */ + public IncidentTaskStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status property. + * + * @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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model IncidentTaskInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IncidentTaskInner.class); +} 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..5eaac9735b20 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskProperties.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * The IncidentTaskProperties model. + */ +@Fluent +public final class IncidentTaskProperties { + /* + * The title of the task + */ + @JsonProperty(value = "title", required = true) + private String title; + + /* + * The description of the task + */ + @JsonProperty(value = "description") + private String description; + + /* + * The status property. + */ + @JsonProperty(value = "status", required = true) + private IncidentTaskStatus status; + + /* + * The time the task was created + */ + @JsonProperty(value = "createdTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimeUtc; + + /* + * The last time the task was updated + */ + @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTimeUtc; + + /* + * Information on the client (user or application) that made some action + */ + @JsonProperty(value = "createdBy") + private ClientInfo createdBy; + + /* + * Information on the client (user or application) that made some action + */ + @JsonProperty(value = "lastModifiedBy") + 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 property. + * + * @return the status value. + */ + public IncidentTaskStatus status() { + return this.status; + } + + /** + * Set the status property: The status property. + * + * @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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (title() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property title in model IncidentTaskProperties")); + } + if (status() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property status in model IncidentTaskProperties")); + } + if (createdBy() != null) { + createdBy().validate(); + } + if (lastModifiedBy() != null) { + lastModifiedBy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IncidentTaskProperties.class); +} 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 index 63643c5077a2..48303cc04240 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** IoT requirements check properties. */ +/** + * IoT requirements check properties. + */ @Fluent public final class IoTCheckRequirementsProperties { /* @@ -16,9 +18,15 @@ public final class IoTCheckRequirementsProperties { @JsonProperty(value = "subscriptionId") 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() { @@ -27,7 +35,7 @@ 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 IoTCheckRequirementsProperties object itself. */ @@ -38,7 +46,7 @@ public IoTCheckRequirementsProperties withSubscriptionId(String subscriptionId) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDataConnectorProperties.java index 1917add910f9..703752555809 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.DataConnectorWithAlertsProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** IoT data connector properties. */ +/** + * IoT data connector properties. + */ @Fluent public final class IoTDataConnectorProperties extends DataConnectorWithAlertsProperties { /* @@ -18,9 +20,15 @@ public final class IoTDataConnectorProperties extends DataConnectorWithAlertsPro @JsonProperty(value = "subscriptionId") 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() { @@ -29,7 +37,7 @@ 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 IoTDataConnectorProperties object itself. */ @@ -38,7 +46,9 @@ public IoTDataConnectorProperties withSubscriptionId(String subscriptionId) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public IoTDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { super.withDataTypes(dataTypes); @@ -47,7 +57,7 @@ public IoTDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector da /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 971f9f13da46..7d3b945c4bd0 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 @@ -12,7 +12,9 @@ import java.util.List; import java.util.UUID; -/** IoTDevice entity property bag. */ +/** + * IoTDevice entity property bag. + */ @Fluent public final class IoTDeviceEntityProperties extends EntityCommonProperties { /* @@ -183,9 +185,15 @@ public final class IoTDeviceEntityProperties extends EntityCommonProperties { @JsonProperty(value = "isScanner", access = JsonProperty.Access.WRITE_ONLY) private Boolean isScanner; + /** + * Creates an instance of IoTDeviceEntityProperties class. + */ + public IoTDeviceEntityProperties() { + } + /** * Get the deviceId property: The ID of the IoT Device in the IoT Hub. - * + * * @return the deviceId value. */ public String deviceId() { @@ -194,7 +202,7 @@ public String deviceId() { /** * Get the deviceName property: The friendly name of the device. - * + * * @return the deviceName value. */ public String deviceName() { @@ -203,7 +211,7 @@ public String deviceName() { /** * Get the source property: The source of the device. - * + * * @return the source value. */ public String source() { @@ -212,7 +220,7 @@ public String source() { /** * Get the iotSecurityAgentId property: The ID of the security agent running on the device. - * + * * @return the iotSecurityAgentId value. */ public UUID iotSecurityAgentId() { @@ -221,7 +229,7 @@ public UUID iotSecurityAgentId() { /** * Get the deviceType property: The type of the device. - * + * * @return the deviceType value. */ public String deviceType() { @@ -230,7 +238,7 @@ public String deviceType() { /** * Get the vendor property: The vendor of the device. - * + * * @return the vendor value. */ public String vendor() { @@ -239,7 +247,7 @@ public String vendor() { /** * Get the edgeId property: The ID of the edge device. - * + * * @return the edgeId value. */ public String edgeId() { @@ -248,7 +256,7 @@ public String edgeId() { /** * Get the macAddress property: The MAC address of the device. - * + * * @return the macAddress value. */ public String macAddress() { @@ -257,7 +265,7 @@ public String macAddress() { /** * Get the model property: The model of the device. - * + * * @return the model value. */ public String model() { @@ -266,7 +274,7 @@ public String model() { /** * Get the serialNumber property: The serial number of the device. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -275,7 +283,7 @@ public String serialNumber() { /** * Get the firmwareVersion property: The firmware version of the device. - * + * * @return the firmwareVersion value. */ public String firmwareVersion() { @@ -284,7 +292,7 @@ public String firmwareVersion() { /** * Get the operatingSystem property: The operating system of the device. - * + * * @return the operatingSystem value. */ public String operatingSystem() { @@ -293,7 +301,7 @@ public String operatingSystem() { /** * Get the iotHubEntityId property: The AzureResource entity id of the IoT Hub. - * + * * @return the iotHubEntityId value. */ public String iotHubEntityId() { @@ -302,7 +310,7 @@ public String iotHubEntityId() { /** * Get the hostEntityId property: The Host entity id of this device. - * + * * @return the hostEntityId value. */ public String hostEntityId() { @@ -311,7 +319,7 @@ public String hostEntityId() { /** * Get the ipAddressEntityId property: The IP entity if of this device. - * + * * @return the ipAddressEntityId value. */ public String ipAddressEntityId() { @@ -320,7 +328,7 @@ public String ipAddressEntityId() { /** * Get the threatIntelligence property: A list of TI contexts attached to the IoTDevice entity. - * + * * @return the threatIntelligence value. */ public List threatIntelligence() { @@ -329,7 +337,7 @@ public List threatIntelligence() { /** * Get the protocols property: A list of protocols of the IoTDevice entity. - * + * * @return the protocols value. */ public List protocols() { @@ -338,7 +346,7 @@ public List protocols() { /** * Get the owners property: A list of owners of the IoTDevice entity. - * + * * @return the owners value. */ public List owners() { @@ -347,7 +355,7 @@ public List owners() { /** * Get the nicEntityIds property: A list of Nic entity ids of the IoTDevice entity. - * + * * @return the nicEntityIds value. */ public List nicEntityIds() { @@ -356,7 +364,7 @@ public List nicEntityIds() { /** * Get the site property: The site of the device. - * + * * @return the site value. */ public String site() { @@ -365,7 +373,7 @@ public String site() { /** * Get the zone property: The zone location of the device within a site. - * + * * @return the zone value. */ public String zone() { @@ -374,7 +382,7 @@ public String zone() { /** * Get the sensor property: The sensor the device is monitored by. - * + * * @return the sensor value. */ public String sensor() { @@ -383,7 +391,7 @@ public String sensor() { /** * Get the deviceSubType property: The subType of the device ('PLC', 'HMI', 'EWS', etc.). - * + * * @return the deviceSubType value. */ public String deviceSubType() { @@ -392,7 +400,7 @@ public String deviceSubType() { /** * Get the importance property: Device importance, determines if the device classified as 'crown jewel'. - * + * * @return the importance value. */ public DeviceImportance importance() { @@ -401,7 +409,7 @@ public DeviceImportance importance() { /** * Set the importance property: Device importance, determines if the device classified as 'crown jewel'. - * + * * @param importance the importance value to set. * @return the IoTDeviceEntityProperties object itself. */ @@ -412,7 +420,7 @@ public IoTDeviceEntityProperties withImportance(DeviceImportance importance) { /** * Get the purdueLayer property: The Purdue Layer of the device. - * + * * @return the purdueLayer value. */ public String purdueLayer() { @@ -421,7 +429,7 @@ public String purdueLayer() { /** * Get the isAuthorized property: Determines whether the device classified as authorized device. - * + * * @return the isAuthorized value. */ public Boolean isAuthorized() { @@ -430,7 +438,7 @@ public Boolean isAuthorized() { /** * Get the isProgramming property: Determines whether the device classified as programming device. - * + * * @return the isProgramming value. */ public Boolean isProgramming() { @@ -439,7 +447,7 @@ public Boolean isProgramming() { /** * Get the isScanner property: Is the device classified as a scanner device. - * + * * @return the isScanner value. */ public Boolean isScanner() { @@ -448,7 +456,7 @@ public Boolean isScanner() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 fa6b07dd783f..574368f90cb9 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 @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Ip entity property bag. */ +/** + * Ip entity property bag. + */ @Immutable public final class IpEntityProperties extends EntityCommonProperties { /* @@ -32,9 +34,15 @@ public final class IpEntityProperties extends EntityCommonProperties { @JsonProperty(value = "threatIntelligence", access = JsonProperty.Access.WRITE_ONLY) private List threatIntelligence; + /** + * Creates an instance of IpEntityProperties class. + */ + public IpEntityProperties() { + } + /** * Get the address property: The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6). - * + * * @return the address value. */ public String address() { @@ -43,7 +51,7 @@ public String address() { /** * Get the location property: The geo-location context attached to the ip entity. - * + * * @return the location value. */ public GeoLocation location() { @@ -52,7 +60,7 @@ public GeoLocation location() { /** * Get the threatIntelligence property: A list of TI contexts attached to the ip entity. - * + * * @return the threatIntelligence value. */ public List threatIntelligence() { @@ -61,7 +69,7 @@ public List threatIntelligence() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..414247dd3c86 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobInner.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.JobItem; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The assignment job. + */ +@Fluent +public final class JobInner extends ResourceWithEtag { + /* + * The job object + */ + @JsonProperty(value = "properties") + private JobProperties innerProperties; + + /** + * Creates an instance of JobInner class. + */ + public JobInner() { + } + + /** + * Get the innerProperties property: The job object. + * + * @return the innerProperties value. + */ + private JobProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JobInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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(); + } + + /** + * Set the items property: List of items published by the job. + * + * @param items the items value to set. + * @return the JobInner object itself. + */ + public JobInner withItems(List items) { + if (this.innerProperties() == null) { + this.innerProperties = new JobProperties(); + } + this.innerProperties().withItems(items); + return this; + } + + /** + * Get the provisioningState property: State of the job. + * + * @return the provisioningState value. + */ + public ProvisioningState 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..69cfb18fe26d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.JobItem; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The job properties. + */ +@Fluent +public final class JobProperties { + /* + * The time the job completed + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /* + * List of items published by the job + */ + @JsonProperty(value = "items") + private List items; + + /* + * State of the job + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The time the job started + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * Message to describe error, if an error exists + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /** + * Creates an instance of JobProperties class. + */ + public 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; + } + + /** + * Set the items property: List of items published by the job. + * + * @param items the items value to set. + * @return the JobProperties object itself. + */ + public JobProperties withItems(List items) { + this.items = items; + return this; + } + + /** + * Get the provisioningState property: State of the job. + * + * @return the provisioningState value. + */ + public ProvisioningState 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (items() != null) { + items().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleProperties.java index 423fdf2974b6..a4d32a835982 100644 --- 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 @@ -12,7 +12,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** MLBehaviorAnalytics alert rule base property bag. */ +/** + * MLBehaviorAnalytics alert rule base property bag. + */ @Fluent public final class MLBehaviorAnalyticsAlertRuleProperties { /* @@ -63,9 +65,21 @@ public final class MLBehaviorAnalyticsAlertRuleProperties { @JsonProperty(value = "techniques", access = JsonProperty.Access.WRITE_ONLY) private List techniques; + /* + * The sub-techniques of the alert rule + */ + @JsonProperty(value = "subTechniques", access = JsonProperty.Access.WRITE_ONLY) + 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() { @@ -74,7 +88,7 @@ public String 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. */ @@ -85,7 +99,7 @@ public MLBehaviorAnalyticsAlertRuleProperties withAlertRuleTemplateName(String a /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -94,7 +108,7 @@ public String description() { /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -103,7 +117,7 @@ public String displayName() { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public boolean enabled() { @@ -112,7 +126,7 @@ public boolean 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. */ @@ -123,7 +137,7 @@ public MLBehaviorAnalyticsAlertRuleProperties withEnabled(boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this alert rule has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -132,7 +146,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -141,7 +155,7 @@ public AlertSeverity severity() { /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -150,25 +164,32 @@ public List 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (alertRuleTemplateName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alertRuleTemplateName in model" - + " MLBehaviorAnalyticsAlertRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property alertRuleTemplateName in model MLBehaviorAnalyticsAlertRuleProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleTemplateProperties.java index c048baca3053..d0841c4c0027 100644 --- 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 @@ -14,7 +14,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** MLBehaviorAnalytics alert rule template properties. */ +/** + * MLBehaviorAnalytics alert rule template properties. + */ @Fluent public final class MLBehaviorAnalyticsAlertRuleTemplateProperties extends AlertRuleTemplateWithMitreProperties { /* @@ -23,9 +25,15 @@ public final class MLBehaviorAnalyticsAlertRuleTemplateProperties extends AlertR @JsonProperty(value = "severity", required = true) private AlertSeverity severity; + /** + * Creates an instance of MLBehaviorAnalyticsAlertRuleTemplateProperties class. + */ + public MLBehaviorAnalyticsAlertRuleTemplateProperties() { + } + /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -34,7 +42,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity for alerts created by this alert rule. - * + * * @param severity the severity value to set. * @return the MLBehaviorAnalyticsAlertRuleTemplateProperties object itself. */ @@ -43,51 +51,65 @@ public MLBehaviorAnalyticsAlertRuleTemplateProperties withSeverity(AlertSeverity return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLBehaviorAnalyticsAlertRuleTemplateProperties withTactics(List tactics) { super.withTactics(tactics); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLBehaviorAnalyticsAlertRuleTemplateProperties withTechniques(List techniques) { super.withTechniques(techniques); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public MLBehaviorAnalyticsAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( - Integer alertRulesCreatedByTemplateCount) { + public MLBehaviorAnalyticsAlertRuleTemplateProperties + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLBehaviorAnalyticsAlertRuleTemplateProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLBehaviorAnalyticsAlertRuleTemplateProperties withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public MLBehaviorAnalyticsAlertRuleTemplateProperties withRequiredDataConnectors( - List requiredDataConnectors) { + public MLBehaviorAnalyticsAlertRuleTemplateProperties + withRequiredDataConnectors(List requiredDataConnectors) { super.withRequiredDataConnectors(requiredDataConnectors); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLBehaviorAnalyticsAlertRuleTemplateProperties withStatus(TemplateStatus status) { super.withStatus(status); @@ -96,17 +118,16 @@ public MLBehaviorAnalyticsAlertRuleTemplateProperties withStatus(TemplateStatus /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (severity() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property severity in model MLBehaviorAnalyticsAlertRuleTemplateProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property severity in model MLBehaviorAnalyticsAlertRuleTemplateProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailClusterEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailClusterEntityProperties.java index 62c3cc3aec6a..4435e7e2580d 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 @@ -10,7 +10,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Mail cluster entity property bag. */ +/** + * Mail cluster entity property bag. + */ @Immutable public final class MailClusterEntityProperties extends EntityCommonProperties { /* @@ -103,9 +105,15 @@ public final class MailClusterEntityProperties extends EntityCommonProperties { @JsonProperty(value = "clusterGroup", access = JsonProperty.Access.WRITE_ONLY) private String clusterGroup; + /** + * Creates an instance of MailClusterEntityProperties class. + */ + public MailClusterEntityProperties() { + } + /** * Get the networkMessageIds property: The mail message IDs that are part of the mail cluster. - * + * * @return the networkMessageIds value. */ public List networkMessageIds() { @@ -114,7 +122,7 @@ public List networkMessageIds() { /** * Get the countByDeliveryStatus property: Count of mail messages by DeliveryStatus string representation. - * + * * @return the countByDeliveryStatus value. */ public Object countByDeliveryStatus() { @@ -123,7 +131,7 @@ public Object countByDeliveryStatus() { /** * Get the countByThreatType property: Count of mail messages by ThreatType string representation. - * + * * @return the countByThreatType value. */ public Object countByThreatType() { @@ -132,7 +140,7 @@ public Object countByThreatType() { /** * Get the countByProtectionStatus property: Count of mail messages by ProtectionStatus string representation. - * + * * @return the countByProtectionStatus value. */ public Object countByProtectionStatus() { @@ -141,7 +149,7 @@ public Object countByProtectionStatus() { /** * Get the threats property: The threats of mail messages that are part of the mail cluster. - * + * * @return the threats value. */ public List threats() { @@ -150,7 +158,7 @@ public List threats() { /** * Get the query property: The query that was used to identify the messages of the mail cluster. - * + * * @return the query value. */ public String query() { @@ -159,7 +167,7 @@ public String query() { /** * Get the queryTime property: The query time. - * + * * @return the queryTime value. */ public OffsetDateTime queryTime() { @@ -168,7 +176,7 @@ public OffsetDateTime queryTime() { /** * Get the mailCount property: The number of mail messages that are part of the mail cluster. - * + * * @return the mailCount value. */ public Integer mailCount() { @@ -177,7 +185,7 @@ public Integer mailCount() { /** * Get the isVolumeAnomaly property: Is this a volume anomaly mail cluster. - * + * * @return the isVolumeAnomaly value. */ public Boolean isVolumeAnomaly() { @@ -186,7 +194,7 @@ public Boolean isVolumeAnomaly() { /** * Get the source property: The source of the mail cluster (default is 'O365 ATP'). - * + * * @return the source value. */ public String source() { @@ -195,7 +203,7 @@ public String source() { /** * Get the clusterSourceIdentifier property: The id of the cluster source. - * + * * @return the clusterSourceIdentifier value. */ public String clusterSourceIdentifier() { @@ -204,7 +212,7 @@ public String clusterSourceIdentifier() { /** * Get the clusterSourceType property: The type of the cluster source. - * + * * @return the clusterSourceType value. */ public String clusterSourceType() { @@ -213,7 +221,7 @@ public String clusterSourceType() { /** * Get the clusterQueryStartTime property: The cluster query start time. - * + * * @return the clusterQueryStartTime value. */ public OffsetDateTime clusterQueryStartTime() { @@ -222,7 +230,7 @@ public OffsetDateTime clusterQueryStartTime() { /** * Get the clusterQueryEndTime property: The cluster query end time. - * + * * @return the clusterQueryEndTime value. */ public OffsetDateTime clusterQueryEndTime() { @@ -231,7 +239,7 @@ public OffsetDateTime clusterQueryEndTime() { /** * Get the clusterGroup property: The cluster group. - * + * * @return the clusterGroup value. */ public String clusterGroup() { @@ -240,7 +248,7 @@ public String clusterGroup() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 e2d92d2606a6..cbb554f0f08d 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 @@ -14,7 +14,9 @@ import java.util.List; import java.util.UUID; -/** Mail message entity property bag. */ +/** + * Mail message entity property bag. + */ @Fluent public final class MailMessageEntityProperties extends EntityCommonProperties { /* @@ -24,8 +26,7 @@ public final class MailMessageEntityProperties extends EntityCommonProperties { private List fileEntityIds; /* - * The recipient of this mail message. Note that in case of multiple recipients the mail message is forked and each - * copy has one recipient + * The recipient of this mail message. Note that in case of multiple recipients the mail message is forked and each copy has one recipient */ @JsonProperty(value = "recipient", access = JsonProperty.Access.WRITE_ONLY) private String recipient; @@ -168,9 +169,15 @@ public final class MailMessageEntityProperties extends EntityCommonProperties { @JsonProperty(value = "deliveryLocation") private DeliveryLocation deliveryLocation; + /** + * Creates an instance of MailMessageEntityProperties class. + */ + public MailMessageEntityProperties() { + } + /** * Get the fileEntityIds property: The File entity ids of this mail message's attachments. - * + * * @return the fileEntityIds value. */ public List fileEntityIds() { @@ -180,7 +187,7 @@ public List fileEntityIds() { /** * Get the recipient property: The recipient of this mail message. Note that in case of multiple recipients the mail * message is forked and each copy has one recipient. - * + * * @return the recipient value. */ public String recipient() { @@ -189,7 +196,7 @@ public String recipient() { /** * Get the urls property: The Urls contained in this mail message. - * + * * @return the urls value. */ public List urls() { @@ -198,7 +205,7 @@ public List urls() { /** * Get the threats property: The threats of this mail message. - * + * * @return the threats value. */ public List threats() { @@ -207,7 +214,7 @@ public List threats() { /** * Get the p1Sender property: The p1 sender's email address. - * + * * @return the p1Sender value. */ public String p1Sender() { @@ -216,7 +223,7 @@ public String p1Sender() { /** * Get the p1SenderDisplayName property: The p1 sender's display name. - * + * * @return the p1SenderDisplayName value. */ public String p1SenderDisplayName() { @@ -225,7 +232,7 @@ public String p1SenderDisplayName() { /** * Get the p1SenderDomain property: The p1 sender's domain. - * + * * @return the p1SenderDomain value. */ public String p1SenderDomain() { @@ -234,7 +241,7 @@ public String p1SenderDomain() { /** * Get the senderIp property: The sender's IP address. - * + * * @return the senderIp value. */ public String senderIp() { @@ -243,7 +250,7 @@ public String senderIp() { /** * Get the p2Sender property: The p2 sender's email address. - * + * * @return the p2Sender value. */ public String p2Sender() { @@ -252,7 +259,7 @@ public String p2Sender() { /** * Get the p2SenderDisplayName property: The p2 sender's display name. - * + * * @return the p2SenderDisplayName value. */ public String p2SenderDisplayName() { @@ -261,7 +268,7 @@ public String p2SenderDisplayName() { /** * Get the p2SenderDomain property: The p2 sender's domain. - * + * * @return the p2SenderDomain value. */ public String p2SenderDomain() { @@ -270,7 +277,7 @@ public String p2SenderDomain() { /** * Get the receiveDate property: The receive date of this message. - * + * * @return the receiveDate value. */ public OffsetDateTime receiveDate() { @@ -279,7 +286,7 @@ public OffsetDateTime receiveDate() { /** * Get the networkMessageId property: The network message id of this mail message. - * + * * @return the networkMessageId value. */ public UUID networkMessageId() { @@ -288,7 +295,7 @@ public UUID networkMessageId() { /** * Get the internetMessageId property: The internet message id of this mail message. - * + * * @return the internetMessageId value. */ public String internetMessageId() { @@ -297,7 +304,7 @@ public String internetMessageId() { /** * Get the subject property: The subject of this mail message. - * + * * @return the subject value. */ public String subject() { @@ -306,7 +313,7 @@ public String subject() { /** * Get the language property: The language of this mail message. - * + * * @return the language value. */ public String language() { @@ -315,7 +322,7 @@ public String language() { /** * Get the threatDetectionMethods property: The threat detection methods. - * + * * @return the threatDetectionMethods value. */ public List threatDetectionMethods() { @@ -324,7 +331,7 @@ public List threatDetectionMethods() { /** * Get the bodyFingerprintBin1 property: The bodyFingerprintBin1. - * + * * @return the bodyFingerprintBin1 value. */ public Integer bodyFingerprintBin1() { @@ -333,7 +340,7 @@ public Integer bodyFingerprintBin1() { /** * Set the bodyFingerprintBin1 property: The bodyFingerprintBin1. - * + * * @param bodyFingerprintBin1 the bodyFingerprintBin1 value to set. * @return the MailMessageEntityProperties object itself. */ @@ -344,7 +351,7 @@ public MailMessageEntityProperties withBodyFingerprintBin1(Integer bodyFingerpri /** * Get the bodyFingerprintBin2 property: The bodyFingerprintBin2. - * + * * @return the bodyFingerprintBin2 value. */ public Integer bodyFingerprintBin2() { @@ -353,7 +360,7 @@ public Integer bodyFingerprintBin2() { /** * Set the bodyFingerprintBin2 property: The bodyFingerprintBin2. - * + * * @param bodyFingerprintBin2 the bodyFingerprintBin2 value to set. * @return the MailMessageEntityProperties object itself. */ @@ -364,7 +371,7 @@ public MailMessageEntityProperties withBodyFingerprintBin2(Integer bodyFingerpri /** * Get the bodyFingerprintBin3 property: The bodyFingerprintBin3. - * + * * @return the bodyFingerprintBin3 value. */ public Integer bodyFingerprintBin3() { @@ -373,7 +380,7 @@ public Integer bodyFingerprintBin3() { /** * Set the bodyFingerprintBin3 property: The bodyFingerprintBin3. - * + * * @param bodyFingerprintBin3 the bodyFingerprintBin3 value to set. * @return the MailMessageEntityProperties object itself. */ @@ -384,7 +391,7 @@ public MailMessageEntityProperties withBodyFingerprintBin3(Integer bodyFingerpri /** * Get the bodyFingerprintBin4 property: The bodyFingerprintBin4. - * + * * @return the bodyFingerprintBin4 value. */ public Integer bodyFingerprintBin4() { @@ -393,7 +400,7 @@ public Integer bodyFingerprintBin4() { /** * Set the bodyFingerprintBin4 property: The bodyFingerprintBin4. - * + * * @param bodyFingerprintBin4 the bodyFingerprintBin4 value to set. * @return the MailMessageEntityProperties object itself. */ @@ -404,7 +411,7 @@ public MailMessageEntityProperties withBodyFingerprintBin4(Integer bodyFingerpri /** * Get the bodyFingerprintBin5 property: The bodyFingerprintBin5. - * + * * @return the bodyFingerprintBin5 value. */ public Integer bodyFingerprintBin5() { @@ -413,7 +420,7 @@ public Integer bodyFingerprintBin5() { /** * Set the bodyFingerprintBin5 property: The bodyFingerprintBin5. - * + * * @param bodyFingerprintBin5 the bodyFingerprintBin5 value to set. * @return the MailMessageEntityProperties object itself. */ @@ -424,7 +431,7 @@ public MailMessageEntityProperties withBodyFingerprintBin5(Integer bodyFingerpri /** * Get the antispamDirection property: The directionality of this mail message. - * + * * @return the antispamDirection value. */ public AntispamMailDirection antispamDirection() { @@ -433,7 +440,7 @@ public AntispamMailDirection antispamDirection() { /** * Set the antispamDirection property: The directionality of this mail message. - * + * * @param antispamDirection the antispamDirection value to set. * @return the MailMessageEntityProperties object itself. */ @@ -444,7 +451,7 @@ public MailMessageEntityProperties withAntispamDirection(AntispamMailDirection a /** * Get the deliveryAction property: The delivery action of this mail message like Delivered, Blocked, Replaced etc. - * + * * @return the deliveryAction value. */ public DeliveryAction deliveryAction() { @@ -453,7 +460,7 @@ public DeliveryAction 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. */ @@ -464,7 +471,7 @@ public MailMessageEntityProperties withDeliveryAction(DeliveryAction deliveryAct /** * Get the deliveryLocation property: The delivery location of this mail message like Inbox, JunkFolder etc. - * + * * @return the deliveryLocation value. */ public DeliveryLocation deliveryLocation() { @@ -473,7 +480,7 @@ public DeliveryLocation 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. */ @@ -484,7 +491,7 @@ public MailMessageEntityProperties withDeliveryLocation(DeliveryLocation deliver /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 c0ec6c6fdaee..ef53f83f6308 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; -/** Mailbox entity property bag. */ +/** + * Mailbox entity property bag. + */ @Immutable public final class MailboxEntityProperties extends EntityCommonProperties { /* @@ -31,15 +33,20 @@ public final class MailboxEntityProperties extends EntityCommonProperties { private String upn; /* - * The AzureAD identifier of mailbox. Similar to AadUserId in account entity but this property is specific to - * mailbox object on office side + * The AzureAD identifier of mailbox. Similar to AadUserId in account entity but this property is specific to mailbox object on office side */ @JsonProperty(value = "externalDirectoryObjectId", access = JsonProperty.Access.WRITE_ONLY) private UUID externalDirectoryObjectId; + /** + * Creates an instance of MailboxEntityProperties class. + */ + public MailboxEntityProperties() { + } + /** * Get the mailboxPrimaryAddress property: The mailbox's primary address. - * + * * @return the mailboxPrimaryAddress value. */ public String mailboxPrimaryAddress() { @@ -48,7 +55,7 @@ public String mailboxPrimaryAddress() { /** * Get the displayName property: The mailbox's display name. - * + * * @return the displayName value. */ public String displayName() { @@ -57,7 +64,7 @@ public String displayName() { /** * Get the upn property: The mailbox's UPN. - * + * * @return the upn value. */ public String upn() { @@ -67,7 +74,7 @@ public String upn() { /** * Get the externalDirectoryObjectId property: The AzureAD identifier of mailbox. Similar to AadUserId in account * entity but this property is specific to mailbox object on office side. - * + * * @return the externalDirectoryObjectId value. */ public UUID externalDirectoryObjectId() { @@ -76,7 +83,7 @@ public UUID externalDirectoryObjectId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 ded00f33417f..350f06faae10 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Malware entity property bag. */ +/** + * Malware entity property bag. + */ @Immutable public final class MalwareEntityProperties extends EntityCommonProperties { /* @@ -36,9 +38,15 @@ public final class MalwareEntityProperties extends EntityCommonProperties { @JsonProperty(value = "processEntityIds", access = JsonProperty.Access.WRITE_ONLY) private List processEntityIds; + /** + * Creates an instance of MalwareEntityProperties class. + */ + public MalwareEntityProperties() { + } + /** * Get the category property: The malware category by the vendor, e.g. Trojan. - * + * * @return the category value. */ public String category() { @@ -47,7 +55,7 @@ public String category() { /** * Get the fileEntityIds property: List of linked file entity identifiers on which the malware was found. - * + * * @return the fileEntityIds value. */ public List fileEntityIds() { @@ -56,7 +64,7 @@ public List fileEntityIds() { /** * Get the malwareName property: The malware name by the vendor, e.g. Win32/Toga!rfn. - * + * * @return the malwareName value. */ public String malwareName() { @@ -65,7 +73,7 @@ public String malwareName() { /** * Get the processEntityIds property: List of linked process entity identifiers on which the malware was found. - * + * * @return the processEntityIds value. */ public List processEntityIds() { @@ -74,7 +82,7 @@ public List processEntityIds() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 529764ae709a..6bb89bdd5612 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** MCAS (Microsoft Cloud App Security) requirements check properties. */ +/** + * MCAS (Microsoft Cloud App Security) requirements check properties. + */ @Fluent public final class McasCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of McasCheckRequirementsProperties class. + */ + public McasCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public McasCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public McasCheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 38068dd10782..88e456107a3c 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/McasDataConnectorProperties.java @@ -10,7 +10,9 @@ import com.azure.resourcemanager.securityinsights.models.McasDataConnectorDataTypes; import com.fasterxml.jackson.annotation.JsonProperty; -/** MCAS (Microsoft Cloud App Security) data connector properties. */ +/** + * MCAS (Microsoft Cloud App Security) data connector properties. + */ @Fluent public final class McasDataConnectorProperties extends DataConnectorTenantId { /* @@ -19,9 +21,15 @@ public final class McasDataConnectorProperties extends DataConnectorTenantId { @JsonProperty(value = "dataTypes", required = true) 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() { @@ -30,7 +38,7 @@ public McasDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the McasDataConnectorProperties object itself. */ @@ -39,7 +47,9 @@ public McasDataConnectorProperties withDataTypes(McasDataConnectorDataTypes data return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public McasDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -48,17 +58,16 @@ public McasDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model McasDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model McasDataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpCheckRequirementsProperties.java index 789441efbf97..db9f6a2b148c 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties. */ +/** + * MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties. + */ @Fluent public final class MdatpCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of MdatpCheckRequirementsProperties class. + */ + public MdatpCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public MdatpCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public MdatpCheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index a1466e451fb0..327981856819 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; import com.fasterxml.jackson.annotation.JsonProperty; -/** MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. */ +/** + * MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. + */ @Fluent public final class MdatpDataConnectorProperties extends DataConnectorTenantId { /* @@ -18,9 +20,15 @@ public final class MdatpDataConnectorProperties extends DataConnectorTenantId { @JsonProperty(value = "dataTypes") private AlertsDataTypeOfDataConnector dataTypes; + /** + * Creates an instance of MdatpDataConnectorProperties class. + */ + public MdatpDataConnectorProperties() { + } + /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -29,7 +37,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the MdatpDataConnectorProperties object itself. */ @@ -38,7 +46,9 @@ public MdatpDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MdatpDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -47,7 +57,7 @@ public MdatpDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 25c3b5166242..77be39ee79ef 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; -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; @@ -16,7 +15,9 @@ import java.time.LocalDate; import java.util.List; -/** Metadata resource definition. */ +/** + * Metadata resource definition. + */ @Fluent public final class MetadataModelInner extends ResourceWithEtag { /* @@ -25,16 +26,24 @@ public final class MetadataModelInner extends ResourceWithEtag { @JsonProperty(value = "properties") private MetadataProperties innerProperties; + /** + * Creates an instance of MetadataModelInner class. + */ + public MetadataModelInner() { + } + /** * Get the innerProperties property: Metadata properties. - * + * * @return the innerProperties value. */ private MetadataProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MetadataModelInner withEtag(String etag) { super.withEtag(etag); @@ -45,7 +54,7 @@ public MetadataModelInner withEtag(String etag) { * 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() { @@ -56,7 +65,7 @@ public String contentId() { * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the * resource name. - * + * * @param contentId the contentId value to set. * @return the MetadataModelInner object itself. */ @@ -71,7 +80,7 @@ public MetadataModelInner withContentId(String contentId) { /** * 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() { @@ -81,7 +90,7 @@ public String 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. */ @@ -97,7 +106,7 @@ public MetadataModelInner withParentId(String parentId) { * 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() { @@ -108,7 +117,7 @@ public String 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. */ @@ -122,20 +131,20 @@ public MetadataModelInner withVersion(String version) { /** * Get the kind property: The kind of content the metadata is for. - * + * * @return the kind value. */ - public Kind kind() { + 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(Kind kind) { + public MetadataModelInner withKind(String kind) { if (this.innerProperties() == null) { this.innerProperties = new MetadataProperties(); } @@ -145,7 +154,7 @@ public MetadataModelInner withKind(Kind kind) { /** * Get the source property: Source of the content. This is where/how it was created. - * + * * @return the source value. */ public MetadataSource source() { @@ -154,7 +163,7 @@ public MetadataSource 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. */ @@ -168,7 +177,7 @@ public MetadataModelInner withSource(MetadataSource source) { /** * Get the author property: The creator of the content item. - * + * * @return the author value. */ public MetadataAuthor author() { @@ -177,7 +186,7 @@ public MetadataAuthor author() { /** * Set the author property: The creator of the content item. - * + * * @param author the author value to set. * @return the MetadataModelInner object itself. */ @@ -191,7 +200,7 @@ public MetadataModelInner withAuthor(MetadataAuthor author) { /** * Get the support property: Support information for the metadata - type, name, contact information. - * + * * @return the support value. */ public MetadataSupport support() { @@ -200,7 +209,7 @@ public MetadataSupport 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. */ @@ -216,7 +225,7 @@ public MetadataModelInner withSupport(MetadataSupport 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() { @@ -227,7 +236,7 @@ public MetadataDependencies 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. */ @@ -241,7 +250,7 @@ public MetadataModelInner withDependencies(MetadataDependencies dependencies) { /** * Get the categories property: Categories for the solution content item. - * + * * @return the categories value. */ public MetadataCategories categories() { @@ -250,7 +259,7 @@ public MetadataCategories categories() { /** * Set the categories property: Categories for the solution content item. - * + * * @param categories the categories value to set. * @return the MetadataModelInner object itself. */ @@ -264,7 +273,7 @@ public MetadataModelInner withCategories(MetadataCategories categories) { /** * Get the providers property: Providers for the solution content item. - * + * * @return the providers value. */ public List providers() { @@ -273,7 +282,7 @@ public List providers() { /** * Set the providers property: Providers for the solution content item. - * + * * @param providers the providers value to set. * @return the MetadataModelInner object itself. */ @@ -287,7 +296,7 @@ public MetadataModelInner withProviders(List providers) { /** * Get the firstPublishDate property: first publish date solution content item. - * + * * @return the firstPublishDate value. */ public LocalDate firstPublishDate() { @@ -296,7 +305,7 @@ public LocalDate firstPublishDate() { /** * Set the firstPublishDate property: first publish date solution content item. - * + * * @param firstPublishDate the firstPublishDate value to set. * @return the MetadataModelInner object itself. */ @@ -310,7 +319,7 @@ public MetadataModelInner withFirstPublishDate(LocalDate firstPublishDate) { /** * Get the lastPublishDate property: last publish date for the solution content item. - * + * * @return the lastPublishDate value. */ public LocalDate lastPublishDate() { @@ -319,7 +328,7 @@ public LocalDate lastPublishDate() { /** * Set the lastPublishDate property: last publish date for the solution content item. - * + * * @param lastPublishDate the lastPublishDate value to set. * @return the MetadataModelInner object itself. */ @@ -333,7 +342,7 @@ public MetadataModelInner withLastPublishDate(LocalDate lastPublishDate) { /** * Get the customVersion property: The custom version of the content. A optional free text. - * + * * @return the customVersion value. */ public String customVersion() { @@ -342,7 +351,7 @@ public String 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. */ @@ -357,7 +366,7 @@ public MetadataModelInner withCustomVersion(String 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() { @@ -367,7 +376,7 @@ public String 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. */ @@ -381,7 +390,7 @@ public MetadataModelInner withContentSchemaVersion(String contentSchemaVersion) /** * Get the icon property: the icon identifier. this id can later be fetched from the solution template. - * + * * @return the icon value. */ public String icon() { @@ -390,7 +399,7 @@ public String 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. */ @@ -404,7 +413,7 @@ public MetadataModelInner withIcon(String icon) { /** * Get the threatAnalysisTactics property: the tactics the resource covers. - * + * * @return the threatAnalysisTactics value. */ public List threatAnalysisTactics() { @@ -413,7 +422,7 @@ public List threatAnalysisTactics() { /** * Set the threatAnalysisTactics property: the tactics the resource covers. - * + * * @param threatAnalysisTactics the threatAnalysisTactics value to set. * @return the MetadataModelInner object itself. */ @@ -428,7 +437,7 @@ public MetadataModelInner withThreatAnalysisTactics(List threatAnalysisT /** * 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() { @@ -438,7 +447,7 @@ public List 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. */ @@ -452,7 +461,7 @@ public MetadataModelInner withThreatAnalysisTechniques(List threatAnalys /** * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. - * + * * @return the previewImages value. */ public List previewImages() { @@ -461,7 +470,7 @@ public List 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. */ @@ -476,7 +485,7 @@ public MetadataModelInner withPreviewImages(List 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() { @@ -486,7 +495,7 @@ public List 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. */ @@ -500,7 +509,7 @@ public MetadataModelInner withPreviewImagesDark(List previewImagesDark) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 3fed7e25da81..a5b7e351599a 100644 --- 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 @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.securityinsights.models.Kind; import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; import com.azure.resourcemanager.securityinsights.models.MetadataCategories; import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; @@ -16,26 +15,25 @@ import java.time.LocalDate; import java.util.List; -/** Metadata property bag. */ +/** + * Metadata property bag. + */ @Fluent public final class MetadataProperties { /* - * 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 + * Static ID for the content. Used to identify dependencies and content from solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the resource name */ @JsonProperty(value = "contentId") private String contentId; /* - * Full parent resource ID of the content item the metadata is for. This is the full resource ID including the - * scope (subscription and resource group) + * Full parent resource ID of the content item the metadata is for. This is the full resource ID including the scope (subscription and resource group) */ @JsonProperty(value = "parentId", required = true) private String parentId; /* - * Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM - * template best practices. Can also be any string, but then we cannot guarantee any version checks + * Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version checks */ @JsonProperty(value = "version") private String version; @@ -44,7 +42,7 @@ public final class MetadataProperties { * The kind of content the metadata is for. */ @JsonProperty(value = "kind", required = true) - private Kind kind; + private String kind; /* * Source of the content. This is where/how it was created. @@ -65,9 +63,7 @@ public final class MetadataProperties { 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. + * Dependencies for the content item, what other content items it requires to work. Can describe more complex dependencies using a recursive/nested structure. For a single dependency an id/kind/version can be supplied or operator/criteria for complex formats. */ @JsonProperty(value = "dependencies") private MetadataDependencies dependencies; @@ -138,11 +134,17 @@ public final class MetadataProperties { @JsonProperty(value = "previewImagesDark") 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. Dynamic for user-created. This is the * resource name. - * + * * @return the contentId value. */ public String contentId() { @@ -153,7 +155,7 @@ public String contentId() { * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the * resource name. - * + * * @param contentId the contentId value to set. * @return the MetadataProperties object itself. */ @@ -165,7 +167,7 @@ public MetadataProperties withContentId(String contentId) { /** * 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() { @@ -175,7 +177,7 @@ public String 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. */ @@ -188,7 +190,7 @@ public MetadataProperties withParentId(String parentId) { * 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() { @@ -199,7 +201,7 @@ public String 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. */ @@ -210,27 +212,27 @@ public MetadataProperties withVersion(String version) { /** * Get the kind property: The kind of content the metadata is for. - * + * * @return the kind value. */ - public Kind kind() { + 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(Kind kind) { + 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() { @@ -239,7 +241,7 @@ public MetadataSource 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. */ @@ -250,7 +252,7 @@ public MetadataProperties withSource(MetadataSource source) { /** * Get the author property: The creator of the content item. - * + * * @return the author value. */ public MetadataAuthor author() { @@ -259,7 +261,7 @@ public MetadataAuthor author() { /** * Set the author property: The creator of the content item. - * + * * @param author the author value to set. * @return the MetadataProperties object itself. */ @@ -270,7 +272,7 @@ public MetadataProperties withAuthor(MetadataAuthor author) { /** * Get the support property: Support information for the metadata - type, name, contact information. - * + * * @return the support value. */ public MetadataSupport support() { @@ -279,7 +281,7 @@ public MetadataSupport 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. */ @@ -292,7 +294,7 @@ public MetadataProperties withSupport(MetadataSupport 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() { @@ -303,7 +305,7 @@ public MetadataDependencies 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. */ @@ -314,7 +316,7 @@ public MetadataProperties withDependencies(MetadataDependencies dependencies) { /** * Get the categories property: Categories for the solution content item. - * + * * @return the categories value. */ public MetadataCategories categories() { @@ -323,7 +325,7 @@ public MetadataCategories categories() { /** * Set the categories property: Categories for the solution content item. - * + * * @param categories the categories value to set. * @return the MetadataProperties object itself. */ @@ -334,7 +336,7 @@ public MetadataProperties withCategories(MetadataCategories categories) { /** * Get the providers property: Providers for the solution content item. - * + * * @return the providers value. */ public List providers() { @@ -343,7 +345,7 @@ public List providers() { /** * Set the providers property: Providers for the solution content item. - * + * * @param providers the providers value to set. * @return the MetadataProperties object itself. */ @@ -354,7 +356,7 @@ public MetadataProperties withProviders(List providers) { /** * Get the firstPublishDate property: first publish date solution content item. - * + * * @return the firstPublishDate value. */ public LocalDate firstPublishDate() { @@ -363,7 +365,7 @@ public LocalDate firstPublishDate() { /** * Set the firstPublishDate property: first publish date solution content item. - * + * * @param firstPublishDate the firstPublishDate value to set. * @return the MetadataProperties object itself. */ @@ -374,7 +376,7 @@ public MetadataProperties withFirstPublishDate(LocalDate firstPublishDate) { /** * Get the lastPublishDate property: last publish date for the solution content item. - * + * * @return the lastPublishDate value. */ public LocalDate lastPublishDate() { @@ -383,7 +385,7 @@ public LocalDate lastPublishDate() { /** * Set the lastPublishDate property: last publish date for the solution content item. - * + * * @param lastPublishDate the lastPublishDate value to set. * @return the MetadataProperties object itself. */ @@ -394,7 +396,7 @@ public MetadataProperties withLastPublishDate(LocalDate lastPublishDate) { /** * Get the customVersion property: The custom version of the content. A optional free text. - * + * * @return the customVersion value. */ public String customVersion() { @@ -403,7 +405,7 @@ public String 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. */ @@ -415,7 +417,7 @@ public MetadataProperties withCustomVersion(String 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() { @@ -425,7 +427,7 @@ public String 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. */ @@ -436,7 +438,7 @@ public MetadataProperties withContentSchemaVersion(String contentSchemaVersion) /** * Get the icon property: the icon identifier. this id can later be fetched from the solution template. - * + * * @return the icon value. */ public String icon() { @@ -445,7 +447,7 @@ public String 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. */ @@ -456,7 +458,7 @@ public MetadataProperties withIcon(String icon) { /** * Get the threatAnalysisTactics property: the tactics the resource covers. - * + * * @return the threatAnalysisTactics value. */ public List threatAnalysisTactics() { @@ -465,7 +467,7 @@ public List threatAnalysisTactics() { /** * Set the threatAnalysisTactics property: the tactics the resource covers. - * + * * @param threatAnalysisTactics the threatAnalysisTactics value to set. * @return the MetadataProperties object itself. */ @@ -477,7 +479,7 @@ public MetadataProperties withThreatAnalysisTactics(List threatAnalysisT /** * 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() { @@ -487,7 +489,7 @@ public List 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. */ @@ -498,7 +500,7 @@ public MetadataProperties withThreatAnalysisTechniques(List threatAnalys /** * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. - * + * * @return the previewImages value. */ public List previewImages() { @@ -507,7 +509,7 @@ public List 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. */ @@ -519,7 +521,7 @@ public MetadataProperties withPreviewImages(List 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() { @@ -529,7 +531,7 @@ public List 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. */ @@ -540,19 +542,17 @@ public MetadataProperties withPreviewImagesDark(List previewImagesDark) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (parentId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property parentId in model MetadataProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property parentId in model MetadataProperties")); } if (kind() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property kind in model MetadataProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property kind in model MetadataProperties")); } if (source() != null) { source().validate(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataPropertiesPatch.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataPropertiesPatch.java index 470f6f2cb684..335006d86fa4 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; -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; @@ -15,26 +14,25 @@ import java.time.LocalDate; import java.util.List; -/** Metadata property bag for patch requests. This is the same as the MetadataProperties, but with nothing required. */ +/** + * Metadata property bag for patch requests. This is the same as the MetadataProperties, but with nothing required. + */ @Fluent public final class MetadataPropertiesPatch { /* - * 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 + * Static ID for the content. Used to identify dependencies and content from solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the resource name */ @JsonProperty(value = "contentId") private String contentId; /* - * Full parent resource ID of the content item the metadata is for. This is the full resource ID including the - * scope (subscription and resource group) + * Full parent resource ID of the content item the metadata is for. This is the full resource ID including the scope (subscription and resource group) */ @JsonProperty(value = "parentId") private String parentId; /* - * Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM - * template best practices. Can also be any string, but then we cannot guarantee any version checks + * Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version checks */ @JsonProperty(value = "version") private String version; @@ -43,7 +41,7 @@ public final class MetadataPropertiesPatch { * The kind of content the metadata is for. */ @JsonProperty(value = "kind") - private Kind kind; + private String kind; /* * Source of the content. This is where/how it was created. @@ -64,9 +62,7 @@ public final class MetadataPropertiesPatch { 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. + * Dependencies for the content item, what other content items it requires to work. Can describe more complex dependencies using a recursive/nested structure. For a single dependency an id/kind/version can be supplied or operator/criteria for complex formats. */ @JsonProperty(value = "dependencies") private MetadataDependencies dependencies; @@ -137,11 +133,17 @@ public final class MetadataPropertiesPatch { @JsonProperty(value = "previewImagesDark") 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. Dynamic for user-created. This is the * resource name. - * + * * @return the contentId value. */ public String contentId() { @@ -152,7 +154,7 @@ public String contentId() { * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the * resource name. - * + * * @param contentId the contentId value to set. * @return the MetadataPropertiesPatch object itself. */ @@ -164,7 +166,7 @@ public MetadataPropertiesPatch withContentId(String contentId) { /** * 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() { @@ -174,7 +176,7 @@ public String 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. */ @@ -187,7 +189,7 @@ public MetadataPropertiesPatch withParentId(String parentId) { * 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() { @@ -198,7 +200,7 @@ public String 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. */ @@ -209,27 +211,27 @@ public MetadataPropertiesPatch withVersion(String version) { /** * Get the kind property: The kind of content the metadata is for. - * + * * @return the kind value. */ - public Kind kind() { + 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(Kind kind) { + 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() { @@ -238,7 +240,7 @@ public MetadataSource 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. */ @@ -249,7 +251,7 @@ public MetadataPropertiesPatch withSource(MetadataSource source) { /** * Get the author property: The creator of the content item. - * + * * @return the author value. */ public MetadataAuthor author() { @@ -258,7 +260,7 @@ public MetadataAuthor author() { /** * Set the author property: The creator of the content item. - * + * * @param author the author value to set. * @return the MetadataPropertiesPatch object itself. */ @@ -269,7 +271,7 @@ public MetadataPropertiesPatch withAuthor(MetadataAuthor author) { /** * Get the support property: Support information for the metadata - type, name, contact information. - * + * * @return the support value. */ public MetadataSupport support() { @@ -278,7 +280,7 @@ public MetadataSupport 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. */ @@ -291,7 +293,7 @@ public MetadataPropertiesPatch withSupport(MetadataSupport 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() { @@ -302,7 +304,7 @@ public MetadataDependencies 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. */ @@ -313,7 +315,7 @@ public MetadataPropertiesPatch withDependencies(MetadataDependencies dependencie /** * Get the categories property: Categories for the solution content item. - * + * * @return the categories value. */ public MetadataCategories categories() { @@ -322,7 +324,7 @@ public MetadataCategories categories() { /** * Set the categories property: Categories for the solution content item. - * + * * @param categories the categories value to set. * @return the MetadataPropertiesPatch object itself. */ @@ -333,7 +335,7 @@ public MetadataPropertiesPatch withCategories(MetadataCategories categories) { /** * Get the providers property: Providers for the solution content item. - * + * * @return the providers value. */ public List providers() { @@ -342,7 +344,7 @@ public List providers() { /** * Set the providers property: Providers for the solution content item. - * + * * @param providers the providers value to set. * @return the MetadataPropertiesPatch object itself. */ @@ -353,7 +355,7 @@ public MetadataPropertiesPatch withProviders(List providers) { /** * Get the firstPublishDate property: first publish date solution content item. - * + * * @return the firstPublishDate value. */ public LocalDate firstPublishDate() { @@ -362,7 +364,7 @@ public LocalDate firstPublishDate() { /** * Set the firstPublishDate property: first publish date solution content item. - * + * * @param firstPublishDate the firstPublishDate value to set. * @return the MetadataPropertiesPatch object itself. */ @@ -373,7 +375,7 @@ public MetadataPropertiesPatch withFirstPublishDate(LocalDate firstPublishDate) /** * Get the lastPublishDate property: last publish date for the solution content item. - * + * * @return the lastPublishDate value. */ public LocalDate lastPublishDate() { @@ -382,7 +384,7 @@ public LocalDate lastPublishDate() { /** * Set the lastPublishDate property: last publish date for the solution content item. - * + * * @param lastPublishDate the lastPublishDate value to set. * @return the MetadataPropertiesPatch object itself. */ @@ -393,7 +395,7 @@ public MetadataPropertiesPatch withLastPublishDate(LocalDate lastPublishDate) { /** * Get the customVersion property: The custom version of the content. A optional free text. - * + * * @return the customVersion value. */ public String customVersion() { @@ -402,7 +404,7 @@ public String 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. */ @@ -414,7 +416,7 @@ public MetadataPropertiesPatch withCustomVersion(String 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() { @@ -424,7 +426,7 @@ public String 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. */ @@ -435,7 +437,7 @@ public MetadataPropertiesPatch withContentSchemaVersion(String contentSchemaVers /** * Get the icon property: the icon identifier. this id can later be fetched from the solution template. - * + * * @return the icon value. */ public String icon() { @@ -444,7 +446,7 @@ public String 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. */ @@ -455,7 +457,7 @@ public MetadataPropertiesPatch withIcon(String icon) { /** * Get the threatAnalysisTactics property: the tactics the resource covers. - * + * * @return the threatAnalysisTactics value. */ public List threatAnalysisTactics() { @@ -464,7 +466,7 @@ public List threatAnalysisTactics() { /** * Set the threatAnalysisTactics property: the tactics the resource covers. - * + * * @param threatAnalysisTactics the threatAnalysisTactics value to set. * @return the MetadataPropertiesPatch object itself. */ @@ -476,7 +478,7 @@ public MetadataPropertiesPatch withThreatAnalysisTactics(List threatAnal /** * 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() { @@ -486,7 +488,7 @@ public List 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. */ @@ -497,7 +499,7 @@ public MetadataPropertiesPatch withThreatAnalysisTechniques(List threatA /** * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. - * + * * @return the previewImages value. */ public List previewImages() { @@ -506,7 +508,7 @@ public List 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. */ @@ -518,7 +520,7 @@ public MetadataPropertiesPatch withPreviewImages(List 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() { @@ -528,7 +530,7 @@ public List 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. */ @@ -539,7 +541,7 @@ public MetadataPropertiesPatch withPreviewImagesDark(List previewImagesD /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..b290af219b58 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionCheckRequirementsProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; + +/** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..9d687a159277 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionDataConnectorProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypes; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Microsoft Purview Information Protection data connector properties. + */ +@Fluent +public final class MicrosoftPurviewInformationProtectionDataConnectorProperties extends DataConnectorTenantId { + /* + * The available data types for the connector. + */ + @JsonProperty(value = "dataTypes", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataTypes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model MicrosoftPurviewInformationProtectionDataConnectorProperties")); + } else { + dataTypes().validate(); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(MicrosoftPurviewInformationProtectionDataConnectorProperties.class); +} 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 6c482ad3565a..47bfb5c46446 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 @@ -13,7 +13,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** MicrosoftSecurityIncidentCreation rule property bag. */ +/** + * MicrosoftSecurityIncidentCreation rule property bag. + */ @Fluent public final class MicrosoftSecurityIncidentCreationAlertRuleProperties extends MicrosoftSecurityIncidentCreationAlertRuleCommonProperties { @@ -47,9 +49,15 @@ public final class MicrosoftSecurityIncidentCreationAlertRuleProperties @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastModifiedUtc; + /** + * Creates an instance of MicrosoftSecurityIncidentCreationAlertRuleProperties class. + */ + public MicrosoftSecurityIncidentCreationAlertRuleProperties() { + } + /** * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @return the alertRuleTemplateName value. */ public String alertRuleTemplateName() { @@ -58,19 +66,19 @@ public String alertRuleTemplateName() { /** * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @param alertRuleTemplateName the alertRuleTemplateName value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleProperties object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleProperties withAlertRuleTemplateName( - String alertRuleTemplateName) { + public MicrosoftSecurityIncidentCreationAlertRuleProperties + withAlertRuleTemplateName(String alertRuleTemplateName) { this.alertRuleTemplateName = alertRuleTemplateName; return this; } /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -79,7 +87,7 @@ public String description() { /** * Set the description property: The description of the alert rule. - * + * * @param description the description value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleProperties object itself. */ @@ -90,7 +98,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleProperties withDescription(Stri /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -99,7 +107,7 @@ public String displayName() { /** * Set the displayName property: The display name for alerts created by this alert rule. - * + * * @param displayName the displayName value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleProperties object itself. */ @@ -110,7 +118,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleProperties withDisplayName(Stri /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public boolean enabled() { @@ -119,7 +127,7 @@ public boolean enabled() { /** * Set the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleProperties object itself. */ @@ -130,62 +138,68 @@ public MicrosoftSecurityIncidentCreationAlertRuleProperties withEnabled(boolean /** * Get the lastModifiedUtc property: The last time that this alert has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { return this.lastModifiedUtc; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public MicrosoftSecurityIncidentCreationAlertRuleProperties withDisplayNamesFilter( - List displayNamesFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleProperties + withDisplayNamesFilter(List displayNamesFilter) { super.withDisplayNamesFilter(displayNamesFilter); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public MicrosoftSecurityIncidentCreationAlertRuleProperties withDisplayNamesExcludeFilter( - List displayNamesExcludeFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleProperties + withDisplayNamesExcludeFilter(List displayNamesExcludeFilter) { super.withDisplayNamesExcludeFilter(displayNamesExcludeFilter); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public MicrosoftSecurityIncidentCreationAlertRuleProperties withProductFilter( - MicrosoftSecurityProductName productFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleProperties + withProductFilter(MicrosoftSecurityProductName productFilter) { super.withProductFilter(productFilter); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public MicrosoftSecurityIncidentCreationAlertRuleProperties withSeveritiesFilter( - List severitiesFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleProperties + withSeveritiesFilter(List severitiesFilter) { super.withSeveritiesFilter(severitiesFilter); return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model" - + " MicrosoftSecurityIncidentCreationAlertRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property displayName in model MicrosoftSecurityIncidentCreationAlertRuleProperties")); } } - private static final ClientLogger LOGGER = - new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleProperties.class); + private static final ClientLogger LOGGER + = new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleProperties.class); } 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 d5732a0625a0..e5f98b4ac650 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 @@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** MicrosoftSecurityIncidentCreation rule template properties. */ +/** + * MicrosoftSecurityIncidentCreation rule template properties. + */ @Fluent public final class MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties extends AlertRuleTemplatePropertiesBase { @@ -41,9 +43,15 @@ public final class MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties @JsonProperty(value = "severitiesFilter") private List severitiesFilter; + /** + * Creates an instance of MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties class. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties() { + } + /** * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. - * + * * @return the displayNamesFilter value. */ public List displayNamesFilter() { @@ -52,19 +60,19 @@ public List 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) { + 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() { @@ -73,19 +81,19 @@ public List displayNamesExcludeFilter() { /** * Set the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. - * + * * @param displayNamesExcludeFilter the displayNamesExcludeFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withDisplayNamesExcludeFilter( - List displayNamesExcludeFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + withDisplayNamesExcludeFilter(List displayNamesExcludeFilter) { this.displayNamesExcludeFilter = displayNamesExcludeFilter; return this; } /** * Get the productFilter property: The alerts' productName on which the cases will be generated. - * + * * @return the productFilter value. */ public MicrosoftSecurityProductName productFilter() { @@ -94,19 +102,19 @@ public MicrosoftSecurityProductName productFilter() { /** * Set the productFilter property: The alerts' productName on which the cases will be generated. - * + * * @param productFilter the productFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withProductFilter( - MicrosoftSecurityProductName productFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + withProductFilter(MicrosoftSecurityProductName productFilter) { this.productFilter = productFilter; return this; } /** * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. - * + * * @return the severitiesFilter value. */ public List severitiesFilter() { @@ -115,47 +123,57 @@ public List severitiesFilter() { /** * Set the severitiesFilter property: the alerts' severities on which the cases will be generated. - * + * * @param severitiesFilter the severitiesFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withSeveritiesFilter( - List severitiesFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + withSeveritiesFilter(List severitiesFilter) { this.severitiesFilter = severitiesFilter; return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( - Integer alertRulesCreatedByTemplateCount) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withRequiredDataConnectors( - List requiredDataConnectors) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + withRequiredDataConnectors(List requiredDataConnectors) { super.withRequiredDataConnectors(requiredDataConnectors); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withStatus(TemplateStatus status) { super.withStatus(status); @@ -164,7 +182,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withStatus(T /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 6688b38be2fb..60cfa9f76842 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** Microsoft Threat Intelligence requirements check properties. */ +/** + * Microsoft Threat Intelligence requirements check properties. + */ @Fluent public final class MstiCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of MstiCheckRequirementsProperties class. + */ + public MstiCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public MstiCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public MstiCheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 7bef9230fe38..f1b0321d34b8 100644 --- 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 @@ -10,7 +10,9 @@ import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypes; import com.fasterxml.jackson.annotation.JsonProperty; -/** Microsoft Threat Intelligence data connector properties. */ +/** + * Microsoft Threat Intelligence data connector properties. + */ @Fluent public final class MstiDataConnectorProperties extends DataConnectorTenantId { /* @@ -19,9 +21,15 @@ public final class MstiDataConnectorProperties extends DataConnectorTenantId { @JsonProperty(value = "dataTypes", required = true) 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() { @@ -30,7 +38,7 @@ public MstiDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the MstiDataConnectorProperties object itself. */ @@ -39,7 +47,9 @@ public MstiDataConnectorProperties withDataTypes(MstiDataConnectorDataTypes data return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MstiDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -48,17 +58,16 @@ public MstiDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model MstiDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model MstiDataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MtpCheckRequirementsProperties.java index 68d2ff985a20..e3ce2d8c6f61 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** MTP (Microsoft Threat Protection) requirements check properties. */ +/** + * MTP (Microsoft Threat Protection) requirements check properties. + */ @Fluent public final class MtpCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of MtpCheckRequirementsProperties class. + */ + public MtpCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public MtpCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public MtpCheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 2399f7dba165..061b98f8f4d1 100644 --- 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 @@ -8,9 +8,12 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; import com.azure.resourcemanager.securityinsights.models.MtpDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MtpFilteredProviders; import com.fasterxml.jackson.annotation.JsonProperty; -/** MTP (Microsoft Threat Protection) data connector properties. */ +/** + * MTP (Microsoft Threat Protection) data connector properties. + */ @Fluent public final class MtpDataConnectorProperties extends DataConnectorTenantId { /* @@ -19,9 +22,21 @@ public final class MtpDataConnectorProperties extends DataConnectorTenantId { @JsonProperty(value = "dataTypes", required = true) private MtpDataConnectorDataTypes dataTypes; + /* + * The available filtered providers for the connector. + */ + @JsonProperty(value = "filteredProviders") + 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() { @@ -30,7 +45,7 @@ public MtpDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the MtpDataConnectorProperties object itself. */ @@ -39,7 +54,29 @@ public MtpDataConnectorProperties withDataTypes(MtpDataConnectorDataTypes dataTy return this; } - /** {@inheritDoc} */ + /** + * 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); @@ -48,20 +85,22 @@ public MtpDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model MtpDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model MtpDataConnectorProperties")); } else { dataTypes().validate(); } + if (filteredProviders() != null) { + filteredProviders().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(MtpDataConnectorProperties.class); 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 index 810e29f8c340..8e932132eb82 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Nic entity property bag. */ +/** + * Nic entity property bag. + */ @Immutable public final class NicEntityProperties extends EntityCommonProperties { /* @@ -30,9 +32,15 @@ public final class NicEntityProperties extends EntityCommonProperties { @JsonProperty(value = "vlans", access = JsonProperty.Access.WRITE_ONLY) private List vlans; + /** + * Creates an instance of NicEntityProperties class. + */ + public NicEntityProperties() { + } + /** * Get the macAddress property: The MAC address of this network interface. - * + * * @return the macAddress value. */ public String macAddress() { @@ -41,7 +49,7 @@ public String macAddress() { /** * Get the ipAddressEntityId property: The IP entity id of this network interface. - * + * * @return the ipAddressEntityId value. */ public String ipAddressEntityId() { @@ -50,7 +58,7 @@ public String ipAddressEntityId() { /** * Get the vlans property: A list of VLANs of the network interface entity. - * + * * @return the vlans value. */ public List vlans() { @@ -59,7 +67,7 @@ public List vlans() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 2d2b3f5d6791..48b32fbbc9a4 100644 --- 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 @@ -12,6 +12,7 @@ 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 com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.Duration; @@ -19,7 +20,9 @@ import java.util.List; import java.util.Map; -/** Nrt alert rule base property bag. */ +/** + * Nrt alert rule base property bag. + */ @Fluent public final class NrtAlertRuleProperties { /* @@ -29,8 +32,7 @@ public final class NrtAlertRuleProperties { 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> + * The version of the alert rule template used to create this rule - in format , where all are numbers, for example 0 <1.0.2> */ @JsonProperty(value = "templateVersion") private String templateVersion; @@ -59,6 +61,12 @@ public final class NrtAlertRuleProperties { @JsonProperty(value = "techniques") private List techniques; + /* + * The sub-techniques of the alert rule + */ + @JsonProperty(value = "subTechniques") + private List subTechniques; + /* * The display name for alerts created by this alert rule. */ @@ -126,9 +134,21 @@ public final class NrtAlertRuleProperties { @JsonProperty(value = "eventGroupingSettings") private EventGroupingSettings eventGroupingSettings; + /* + * Array of the sentinel entity mappings of the alert rule + */ + @JsonProperty(value = "sentinelEntitiesMappings") + 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() { @@ -137,7 +157,7 @@ public String 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. */ @@ -149,7 +169,7 @@ public NrtAlertRuleProperties withAlertRuleTemplateName(String alertRuleTemplate /** * 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() { @@ -159,7 +179,7 @@ public String 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. */ @@ -170,7 +190,7 @@ public NrtAlertRuleProperties withTemplateVersion(String templateVersion) { /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -179,7 +199,7 @@ public String description() { /** * Set the description property: The description of the alert rule. - * + * * @param description the description value to set. * @return the NrtAlertRuleProperties object itself. */ @@ -190,7 +210,7 @@ public NrtAlertRuleProperties withDescription(String description) { /** * Get the query property: The query that creates alerts for this rule. - * + * * @return the query value. */ public String query() { @@ -199,7 +219,7 @@ public String 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. */ @@ -210,7 +230,7 @@ public NrtAlertRuleProperties withQuery(String query) { /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -219,7 +239,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the alert rule. - * + * * @param tactics the tactics value to set. * @return the NrtAlertRuleProperties object itself. */ @@ -230,7 +250,7 @@ public NrtAlertRuleProperties withTactics(List tactics) { /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -239,7 +259,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the NrtAlertRuleProperties object itself. */ @@ -248,9 +268,29 @@ public NrtAlertRuleProperties 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 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() { @@ -259,7 +299,7 @@ public String 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. */ @@ -270,7 +310,7 @@ public NrtAlertRuleProperties withDisplayName(String displayName) { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public boolean enabled() { @@ -279,7 +319,7 @@ public boolean 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. */ @@ -290,7 +330,7 @@ public NrtAlertRuleProperties withEnabled(boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this alert rule has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -300,7 +340,7 @@ public OffsetDateTime 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() { @@ -310,7 +350,7 @@ public Duration 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. */ @@ -322,7 +362,7 @@ public NrtAlertRuleProperties withSuppressionDuration(Duration suppressionDurati /** * Get the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or * disabled. - * + * * @return the suppressionEnabled value. */ public boolean suppressionEnabled() { @@ -332,7 +372,7 @@ public boolean 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. */ @@ -343,7 +383,7 @@ public NrtAlertRuleProperties withSuppressionEnabled(boolean suppressionEnabled) /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -352,7 +392,7 @@ public AlertSeverity 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. */ @@ -364,7 +404,7 @@ public NrtAlertRuleProperties withSeverity(AlertSeverity severity) { /** * 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() { @@ -374,7 +414,7 @@ public IncidentConfiguration 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. */ @@ -385,7 +425,7 @@ public NrtAlertRuleProperties withIncidentConfiguration(IncidentConfiguration in /** * 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() { @@ -394,7 +434,7 @@ public Map 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. */ @@ -405,7 +445,7 @@ public NrtAlertRuleProperties withCustomDetails(Map customDetail /** * Get the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @return the entityMappings value. */ public List entityMappings() { @@ -414,7 +454,7 @@ public List 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. */ @@ -425,7 +465,7 @@ public NrtAlertRuleProperties withEntityMappings(List entityMappi /** * Get the alertDetailsOverride property: The alert details override settings. - * + * * @return the alertDetailsOverride value. */ public AlertDetailsOverride alertDetailsOverride() { @@ -434,7 +474,7 @@ public AlertDetailsOverride alertDetailsOverride() { /** * Set the alertDetailsOverride property: The alert details override settings. - * + * * @param alertDetailsOverride the alertDetailsOverride value to set. * @return the NrtAlertRuleProperties object itself. */ @@ -445,7 +485,7 @@ public NrtAlertRuleProperties withAlertDetailsOverride(AlertDetailsOverride aler /** * Get the eventGroupingSettings property: The event grouping settings. - * + * * @return the eventGroupingSettings value. */ public EventGroupingSettings eventGroupingSettings() { @@ -454,7 +494,7 @@ public EventGroupingSettings eventGroupingSettings() { /** * Set the eventGroupingSettings property: The event grouping settings. - * + * * @param eventGroupingSettings the eventGroupingSettings value to set. * @return the NrtAlertRuleProperties object itself. */ @@ -463,32 +503,49 @@ public NrtAlertRuleProperties withEventGroupingSettings(EventGroupingSettings ev 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (query() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property query in model NrtAlertRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property query in model NrtAlertRuleProperties")); } if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model NrtAlertRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property displayName in model NrtAlertRuleProperties")); } if (suppressionDuration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property suppressionDuration in model NrtAlertRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property suppressionDuration in model NrtAlertRuleProperties")); } if (severity() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property severity in model NrtAlertRuleProperties")); } if (incidentConfiguration() != null) { @@ -503,6 +560,9 @@ public void validate() { if (eventGroupingSettings() != null) { eventGroupingSettings().validate(); } + if (sentinelEntitiesMappings() != null) { + sentinelEntitiesMappings().forEach(e -> e.validate()); + } } private static final ClientLogger LOGGER = new ClientLogger(NrtAlertRuleProperties.class); 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 index 97788b8fd862..913ea7b62b56 100644 --- 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 @@ -12,13 +12,16 @@ 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.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; -/** NRT alert rule template properties. */ +/** + * NRT alert rule template properties. + */ @Fluent public final class NrtAlertRuleTemplateProperties extends AlertRuleTemplateWithMitreProperties { /* @@ -64,9 +67,21 @@ public final class NrtAlertRuleTemplateProperties extends AlertRuleTemplateWithM @JsonProperty(value = "eventGroupingSettings") private EventGroupingSettings eventGroupingSettings; + /* + * Array of the sentinel entity mappings of the alert rule + */ + @JsonProperty(value = "sentinelEntitiesMappings") + private List sentinelEntitiesMappings; + + /** + * Creates an instance of NrtAlertRuleTemplateProperties class. + */ + public NrtAlertRuleTemplateProperties() { + } + /** * Get the query property: The query that creates alerts for this rule. - * + * * @return the query value. */ public String query() { @@ -75,7 +90,7 @@ public String query() { /** * Set the query property: The query that creates alerts for this rule. - * + * * @param query the query value to set. * @return the NrtAlertRuleTemplateProperties object itself. */ @@ -86,7 +101,7 @@ public NrtAlertRuleTemplateProperties withQuery(String query) { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -95,7 +110,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity for alerts created by this alert rule. - * + * * @param severity the severity value to set. * @return the NrtAlertRuleTemplateProperties object itself. */ @@ -107,7 +122,7 @@ public NrtAlertRuleTemplateProperties withSeverity(AlertSeverity 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() { @@ -117,7 +132,7 @@ public String version() { /** * Set the version property: The version of this template - in format <a.b.c>, where all are numbers. For * example <1.0.2>. - * + * * @param version the version value to set. * @return the NrtAlertRuleTemplateProperties object itself. */ @@ -128,7 +143,7 @@ public NrtAlertRuleTemplateProperties withVersion(String 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() { @@ -137,7 +152,7 @@ public Map customDetails() { /** * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. - * + * * @param customDetails the customDetails value to set. * @return the NrtAlertRuleTemplateProperties object itself. */ @@ -148,7 +163,7 @@ public NrtAlertRuleTemplateProperties withCustomDetails(Map cust /** * Get the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @return the entityMappings value. */ public List entityMappings() { @@ -157,7 +172,7 @@ public List entityMappings() { /** * Set the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @param entityMappings the entityMappings value to set. * @return the NrtAlertRuleTemplateProperties object itself. */ @@ -168,7 +183,7 @@ public NrtAlertRuleTemplateProperties withEntityMappings(List ent /** * Get the alertDetailsOverride property: The alert details override settings. - * + * * @return the alertDetailsOverride value. */ public AlertDetailsOverride alertDetailsOverride() { @@ -177,7 +192,7 @@ public AlertDetailsOverride alertDetailsOverride() { /** * Set the alertDetailsOverride property: The alert details override settings. - * + * * @param alertDetailsOverride the alertDetailsOverride value to set. * @return the NrtAlertRuleTemplateProperties object itself. */ @@ -188,7 +203,7 @@ public NrtAlertRuleTemplateProperties withAlertDetailsOverride(AlertDetailsOverr /** * Get the eventGroupingSettings property: The event grouping settings. - * + * * @return the eventGroupingSettings value. */ public EventGroupingSettings eventGroupingSettings() { @@ -197,7 +212,7 @@ public EventGroupingSettings eventGroupingSettings() { /** * Set the eventGroupingSettings property: The event grouping settings. - * + * * @param eventGroupingSettings the eventGroupingSettings value to set. * @return the NrtAlertRuleTemplateProperties object itself. */ @@ -206,51 +221,86 @@ public NrtAlertRuleTemplateProperties withEventGroupingSettings(EventGroupingSet return this; } - /** {@inheritDoc} */ + /** + * 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 NrtAlertRuleTemplateProperties object itself. + */ + public NrtAlertRuleTemplateProperties + withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + this.sentinelEntitiesMappings = sentinelEntitiesMappings; + return this; + } + + /** + * {@inheritDoc} + */ @Override public NrtAlertRuleTemplateProperties withTactics(List tactics) { super.withTactics(tactics); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NrtAlertRuleTemplateProperties withTechniques(List techniques) { super.withTechniques(techniques); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public NrtAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( - Integer alertRulesCreatedByTemplateCount) { + public NrtAlertRuleTemplateProperties + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NrtAlertRuleTemplateProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NrtAlertRuleTemplateProperties withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public NrtAlertRuleTemplateProperties withRequiredDataConnectors( - List requiredDataConnectors) { + public NrtAlertRuleTemplateProperties + withRequiredDataConnectors(List requiredDataConnectors) { super.withRequiredDataConnectors(requiredDataConnectors); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NrtAlertRuleTemplateProperties withStatus(TemplateStatus status) { super.withStatus(status); @@ -259,7 +309,7 @@ public NrtAlertRuleTemplateProperties withStatus(TemplateStatus status) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -274,5 +324,8 @@ public void validate() { if (eventGroupingSettings() != null) { eventGroupingSettings().validate(); } + if (sentinelEntitiesMappings() != null) { + sentinelEntitiesMappings().forEach(e -> e.validate()); + } } } 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 index e79cb5b7768f..1feb60fc3ebd 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** Office365 Project requirements check properties. */ +/** + * Office365 Project requirements check properties. + */ @Fluent public final class Office365ProjectCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of Office365ProjectCheckRequirementsProperties class. + */ + public Office365ProjectCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public Office365ProjectCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public Office365ProjectCheckRequirementsProperties withTenantId(String tenantId) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 86464533c6a1..9ff3b5ad51a1 100644 --- 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 @@ -10,7 +10,9 @@ import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes; import com.fasterxml.jackson.annotation.JsonProperty; -/** Office Microsoft Project data connector properties. */ +/** + * Office Microsoft Project data connector properties. + */ @Fluent public final class Office365ProjectDataConnectorProperties extends DataConnectorTenantId { /* @@ -19,9 +21,15 @@ public final class Office365ProjectDataConnectorProperties extends DataConnector @JsonProperty(value = "dataTypes", required = true) 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() { @@ -30,7 +38,7 @@ public Office365ProjectConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the Office365ProjectDataConnectorProperties object itself. */ @@ -39,7 +47,9 @@ public Office365ProjectDataConnectorProperties withDataTypes(Office365ProjectCon return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Office365ProjectDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -48,17 +58,16 @@ public Office365ProjectDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model Office365ProjectDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model Office365ProjectDataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeAtpCheckRequirementsProperties.java index 7e6a246d93cb..50efca7ef82d 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** OfficeATP (Office 365 Advanced Threat Protection) requirements check properties. */ +/** + * OfficeATP (Office 365 Advanced Threat Protection) requirements check properties. + */ @Fluent public final class OfficeAtpCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of OfficeAtpCheckRequirementsProperties class. + */ + public OfficeAtpCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public OfficeAtpCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public OfficeAtpCheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 9a64b134a987..5921372981d0 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; import com.fasterxml.jackson.annotation.JsonProperty; -/** OfficeATP (Office 365 Advanced Threat Protection) data connector properties. */ +/** + * OfficeATP (Office 365 Advanced Threat Protection) data connector properties. + */ @Fluent public final class OfficeAtpDataConnectorProperties extends DataConnectorTenantId { /* @@ -18,9 +20,15 @@ public final class OfficeAtpDataConnectorProperties extends DataConnectorTenantI @JsonProperty(value = "dataTypes") private AlertsDataTypeOfDataConnector dataTypes; + /** + * Creates an instance of OfficeAtpDataConnectorProperties class. + */ + public OfficeAtpDataConnectorProperties() { + } + /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -29,7 +37,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the OfficeAtpDataConnectorProperties object itself. */ @@ -38,7 +46,9 @@ public OfficeAtpDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnec return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OfficeAtpDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -47,7 +57,7 @@ public OfficeAtpDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index e1ef2000626c..1304b4e3f28e 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.core.management.SystemData; import com.fasterxml.jackson.annotation.JsonProperty; -/** Consent for Office365 tenant that already made. */ +/** + * Consent for Office365 tenant that already made. + */ @Fluent public final class OfficeConsentInner extends ProxyResource { /* @@ -24,9 +26,15 @@ public final class OfficeConsentInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** + * Creates an instance of OfficeConsentInner class. + */ + public OfficeConsentInner() { + } + /** * Get the innerProperties property: Office consent properties. - * + * * @return the innerProperties value. */ private OfficeConsentProperties innerProperties() { @@ -35,7 +43,7 @@ private OfficeConsentProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -44,7 +52,7 @@ public SystemData systemData() { /** * Get the tenantId property: The tenantId of the Office365 with the consent. - * + * * @return the tenantId value. */ public String tenantId() { @@ -53,7 +61,7 @@ public String tenantId() { /** * Set the tenantId property: The tenantId of the Office365 with the consent. - * + * * @param tenantId the tenantId value to set. * @return the OfficeConsentInner object itself. */ @@ -67,7 +75,7 @@ public OfficeConsentInner withTenantId(String tenantId) { /** * Get the consentId property: Help to easily cascade among the data layers. - * + * * @return the consentId value. */ public String consentId() { @@ -76,7 +84,7 @@ public String consentId() { /** * Set the consentId property: Help to easily cascade among the data layers. - * + * * @param consentId the consentId value to set. * @return the OfficeConsentInner object itself. */ @@ -90,7 +98,7 @@ public OfficeConsentInner withConsentId(String consentId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentProperties.java index ef163ee8eda7..ec5ec2d69c27 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Consent property bag. */ +/** + * Consent property bag. + */ @Fluent public final class OfficeConsentProperties { /* @@ -22,9 +24,15 @@ public final class OfficeConsentProperties { @JsonProperty(value = "consentId") private String consentId; + /** + * Creates an instance of OfficeConsentProperties class. + */ + public OfficeConsentProperties() { + } + /** * Get the tenantId property: The tenantId of the Office365 with the consent. - * + * * @return the tenantId value. */ public String tenantId() { @@ -33,7 +41,7 @@ public String tenantId() { /** * Set the tenantId property: The tenantId of the Office365 with the consent. - * + * * @param tenantId the tenantId value to set. * @return the OfficeConsentProperties object itself. */ @@ -44,7 +52,7 @@ public OfficeConsentProperties withTenantId(String tenantId) { /** * Get the consentId property: Help to easily cascade among the data layers. - * + * * @return the consentId value. */ public String consentId() { @@ -53,7 +61,7 @@ public String consentId() { /** * Set the consentId property: Help to easily cascade among the data layers. - * + * * @param consentId the consentId value to set. * @return the OfficeConsentProperties object itself. */ @@ -64,7 +72,7 @@ public OfficeConsentProperties withConsentId(String consentId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeDataConnectorProperties.java index 4b02a823625c..632a7c549167 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 @@ -10,7 +10,9 @@ import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypes; import com.fasterxml.jackson.annotation.JsonProperty; -/** Office data connector properties. */ +/** + * Office data connector properties. + */ @Fluent public final class OfficeDataConnectorProperties extends DataConnectorTenantId { /* @@ -19,9 +21,15 @@ public final class OfficeDataConnectorProperties extends DataConnectorTenantId { @JsonProperty(value = "dataTypes", required = true) private OfficeDataConnectorDataTypes dataTypes; + /** + * Creates an instance of OfficeDataConnectorProperties class. + */ + public OfficeDataConnectorProperties() { + } + /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public OfficeDataConnectorDataTypes dataTypes() { @@ -30,7 +38,7 @@ public OfficeDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the OfficeDataConnectorProperties object itself. */ @@ -39,7 +47,9 @@ public OfficeDataConnectorProperties withDataTypes(OfficeDataConnectorDataTypes return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OfficeDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -48,17 +58,16 @@ public OfficeDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model OfficeDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model OfficeDataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmCheckRequirementsProperties.java index 5ae6bc407935..1e08f20e6725 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmCheckRequirementsProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmCheckRequirementsProperties.java @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** OfficeIRM (Microsoft Insider Risk Management) requirements check properties. */ +/** + * OfficeIRM (Microsoft Insider Risk Management) requirements check properties. + */ @Fluent public final class OfficeIrmCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of OfficeIrmCheckRequirementsProperties class. + */ + public OfficeIrmCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public OfficeIrmCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public OfficeIrmCheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmDataConnectorProperties.java index c3e618acc5a3..0b2d41446684 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmDataConnectorProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIrmDataConnectorProperties.java @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; import com.fasterxml.jackson.annotation.JsonProperty; -/** OfficeIRM (Microsoft Insider Risk Management) data connector properties. */ +/** + * OfficeIRM (Microsoft Insider Risk Management) data connector properties. + */ @Fluent public final class OfficeIrmDataConnectorProperties extends DataConnectorTenantId { /* @@ -18,9 +20,15 @@ public final class OfficeIrmDataConnectorProperties extends DataConnectorTenantI @JsonProperty(value = "dataTypes") private AlertsDataTypeOfDataConnector dataTypes; + /** + * Creates an instance of OfficeIrmDataConnectorProperties class. + */ + public OfficeIrmDataConnectorProperties() { + } + /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -29,7 +37,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the OfficeIrmDataConnectorProperties object itself. */ @@ -38,7 +46,9 @@ public OfficeIrmDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnec return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OfficeIrmDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -47,7 +57,7 @@ public OfficeIrmDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index b64db3bd6270..b884cead14e9 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** Office PowerBI requirements check properties. */ +/** + * Office PowerBI requirements check properties. + */ @Fluent public final class OfficePowerBICheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of OfficePowerBICheckRequirementsProperties class. + */ + public OfficePowerBICheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public OfficePowerBICheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public OfficePowerBICheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 4f19d046961e..22a7a47f5e41 100644 --- 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 @@ -10,7 +10,9 @@ import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypes; import com.fasterxml.jackson.annotation.JsonProperty; -/** Office Microsoft PowerBI data connector properties. */ +/** + * Office Microsoft PowerBI data connector properties. + */ @Fluent public final class OfficePowerBIDataConnectorProperties extends DataConnectorTenantId { /* @@ -19,9 +21,15 @@ public final class OfficePowerBIDataConnectorProperties extends DataConnectorTen @JsonProperty(value = "dataTypes", required = true) 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() { @@ -30,7 +38,7 @@ public OfficePowerBIConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the OfficePowerBIDataConnectorProperties object itself. */ @@ -39,7 +47,9 @@ public OfficePowerBIDataConnectorProperties withDataTypes(OfficePowerBIConnector return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OfficePowerBIDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -48,17 +58,16 @@ public OfficePowerBIDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model OfficePowerBIDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model OfficePowerBIDataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OperationInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OperationInner.java index ec5a4d2872bb..1f34a01ba398 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.models.OperationDisplay; import com.fasterxml.jackson.annotation.JsonProperty; -/** Operation provided by provider. */ +/** + * Operation provided by provider. + */ @Fluent public final class OperationInner { /* @@ -35,9 +37,15 @@ public final class OperationInner { @JsonProperty(value = "isDataAction") private Boolean isDataAction; + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + /** * Get the display property: Properties of the operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -46,7 +54,7 @@ public OperationDisplay display() { /** * Set the display property: Properties of the operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -57,7 +65,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * Get the name property: Name of the operation. - * + * * @return the name value. */ public String name() { @@ -66,7 +74,7 @@ public String name() { /** * Set the name property: Name of the operation. - * + * * @param name the name value to set. * @return the OperationInner object itself. */ @@ -77,7 +85,7 @@ public OperationInner withName(String name) { /** * Get the origin property: The origin of the operation. - * + * * @return the origin value. */ public String origin() { @@ -86,7 +94,7 @@ public String origin() { /** * Set the origin property: The origin of the operation. - * + * * @param origin the origin value to set. * @return the OperationInner object itself. */ @@ -97,7 +105,7 @@ public OperationInner withOrigin(String origin) { /** * Get the isDataAction property: Indicates whether the operation is a data action. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -106,7 +114,7 @@ public Boolean 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. */ @@ -117,7 +125,7 @@ public OperationInner withIsDataAction(Boolean isDataAction) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..4cbc1ace43b7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageModelInner.java @@ -0,0 +1,600 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** + * Represents a Package in Azure Security Insights. + */ +@Fluent +public final class PackageModelInner extends ResourceWithEtag { + /* + * package properties + */ + @JsonProperty(value = "properties") + private PackageProperties innerProperties; + + /** + * Creates an instance of PackageModelInner class. + */ + public PackageModelInner() { + } + + /** + * Get the innerProperties property: package properties. + * + * @return the innerProperties value. + */ + private PackageProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageModelInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..45a695018cd4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageProperties.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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.time.LocalDate; +import java.util.List; + +/** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProcessEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProcessEntityProperties.java index b1dde6737938..682a2624e926 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Process entity property bag. */ +/** + * Process entity property bag. + */ @Fluent public final class ProcessEntityProperties extends EntityCommonProperties { /* @@ -67,9 +69,15 @@ public final class ProcessEntityProperties extends EntityCommonProperties { @JsonProperty(value = "processId", access = JsonProperty.Access.WRITE_ONLY) private String processId; + /** + * Creates an instance of ProcessEntityProperties class. + */ + public ProcessEntityProperties() { + } + /** * Get the accountEntityId property: The account entity id running the processes. - * + * * @return the accountEntityId value. */ public String accountEntityId() { @@ -78,7 +86,7 @@ public String accountEntityId() { /** * Get the commandLine property: The command line used to create the process. - * + * * @return the commandLine value. */ public String commandLine() { @@ -87,7 +95,7 @@ public String commandLine() { /** * Get the creationTimeUtc property: The time when the process started to run. - * + * * @return the creationTimeUtc value. */ public OffsetDateTime creationTimeUtc() { @@ -96,7 +104,7 @@ public OffsetDateTime creationTimeUtc() { /** * Get the elevationToken property: The elevation token associated with the process. - * + * * @return the elevationToken value. */ public ElevationToken elevationToken() { @@ -105,7 +113,7 @@ public ElevationToken elevationToken() { /** * Set the elevationToken property: The elevation token associated with the process. - * + * * @param elevationToken the elevationToken value to set. * @return the ProcessEntityProperties object itself. */ @@ -116,7 +124,7 @@ public ProcessEntityProperties withElevationToken(ElevationToken elevationToken) /** * Get the hostEntityId property: The host entity id on which the process was running. - * + * * @return the hostEntityId value. */ public String hostEntityId() { @@ -125,7 +133,7 @@ public String hostEntityId() { /** * Get the hostLogonSessionEntityId property: The session entity id in which the process was running. - * + * * @return the hostLogonSessionEntityId value. */ public String hostLogonSessionEntityId() { @@ -134,7 +142,7 @@ public String hostLogonSessionEntityId() { /** * Get the imageFileEntityId property: Image file entity id. - * + * * @return the imageFileEntityId value. */ public String imageFileEntityId() { @@ -143,7 +151,7 @@ public String imageFileEntityId() { /** * Get the parentProcessEntityId property: The parent process entity id. - * + * * @return the parentProcessEntityId value. */ public String parentProcessEntityId() { @@ -152,7 +160,7 @@ public String parentProcessEntityId() { /** * Get the processId property: The process ID. - * + * * @return the processId value. */ public String processId() { @@ -161,7 +169,7 @@ public String processId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..3101ae9084bd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageModelInner.java @@ -0,0 +1,669 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** + * Represents a Package in Azure Security Insights. + */ +@Fluent +public final class ProductPackageModelInner extends ResourceWithEtag { + /* + * package properties + */ + @JsonProperty(value = "properties") + private ProductPackageProperties innerProperties; + + /** + * Creates an instance of ProductPackageModelInner class. + */ + public ProductPackageModelInner() { + } + + /** + * Get the innerProperties property: package properties. + * + * @return the innerProperties value. + */ + private ProductPackageProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageModelInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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(); + } + + /** + * Set the installedVersion property: The version of the installed package, null or absent means not installed. + * + * @param installedVersion the installedVersion value to set. + * @return the ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withInstalledVersion(String installedVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + this.innerProperties().withInstalledVersion(installedVersion); + return this; + } + + /** + * Get the metadataResourceId property: The metadata resource id. + * + * @return the metadataResourceId value. + */ + public String metadataResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().metadataResourceId(); + } + + /** + * Set the metadataResourceId property: The metadata resource id. + * + * @param metadataResourceId the metadataResourceId value to set. + * @return the ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withMetadataResourceId(String metadataResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + this.innerProperties().withMetadataResourceId(metadataResourceId); + return this; + } + + /** + * 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(); + } + + /** + * Set the packagedContent property: The json of the ARM template to deploy. Expandable. + * + * @param packagedContent the packagedContent value to set. + * @return the ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withPackagedContent(Object packagedContent) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + this.innerProperties().withPackagedContent(packagedContent); + return this; + } + + /** + * 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withContentId(String contentId) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withContentProductId(String contentProductId) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withContentKind(PackageKind contentKind) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withContentSchemaVersion(String contentSchemaVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withIsNew(Flag isNew) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withIsPreview(Flag isPreview) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withIsFeatured(Flag isFeatured) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withIsDeprecated(Flag isDeprecated) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withPublisherDisplayName(String publisherDisplayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withSource(MetadataSource source) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withAuthor(MetadataAuthor author) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withSupport(MetadataSupport support) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withDependencies(MetadataDependencies dependencies) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withProviders(List providers) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withFirstPublishDate(LocalDate firstPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withLastPublishDate(LocalDate lastPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withCategories(MetadataCategories categories) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withThreatAnalysisTactics(List threatAnalysisTactics) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withThreatAnalysisTechniques(List threatAnalysisTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + 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 ProductPackageModelInner object itself. + */ + public ProductPackageModelInner withIcon(String icon) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductPackageProperties(); + } + this.innerProperties().withIcon(icon); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..9f5e9f359a0b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageProperties.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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 com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** + * Describes package properties. + */ +@Fluent +public final class ProductPackageProperties extends PackageBaseProperties { + /* + * The version of the installed package, null or absent means not installed. + */ + @JsonProperty(value = "installedVersion") + private String installedVersion; + + /* + * The metadata resource id. + */ + @JsonProperty(value = "metadataResourceId") + private String metadataResourceId; + + /* + * The json of the ARM template to deploy. Expandable. + */ + @JsonProperty(value = "packagedContent") + private Object packagedContent; + + /** + * Creates an instance of ProductPackageProperties class. + */ + public ProductPackageProperties() { + } + + /** + * 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; + } + + /** + * Set the installedVersion property: The version of the installed package, null or absent means not installed. + * + * @param installedVersion the installedVersion value to set. + * @return the ProductPackageProperties object itself. + */ + public ProductPackageProperties withInstalledVersion(String installedVersion) { + this.installedVersion = installedVersion; + return this; + } + + /** + * Get the metadataResourceId property: The metadata resource id. + * + * @return the metadataResourceId value. + */ + public String metadataResourceId() { + return this.metadataResourceId; + } + + /** + * Set the metadataResourceId property: The metadata resource id. + * + * @param metadataResourceId the metadataResourceId value to set. + * @return the ProductPackageProperties object itself. + */ + public ProductPackageProperties withMetadataResourceId(String metadataResourceId) { + this.metadataResourceId = metadataResourceId; + return this; + } + + /** + * Get the packagedContent property: The json of the ARM template to deploy. Expandable. + * + * @return the packagedContent value. + */ + public Object packagedContent() { + return this.packagedContent; + } + + /** + * Set the packagedContent property: The json of the ARM template to deploy. Expandable. + * + * @param packagedContent the packagedContent value to set. + * @return the ProductPackageProperties object itself. + */ + public ProductPackageProperties withPackagedContent(Object packagedContent) { + this.packagedContent = packagedContent; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withContentId(String contentId) { + super.withContentId(contentId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withContentProductId(String contentProductId) { + super.withContentProductId(contentProductId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withContentKind(PackageKind contentKind) { + super.withContentKind(contentKind); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withContentSchemaVersion(String contentSchemaVersion) { + super.withContentSchemaVersion(contentSchemaVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withIsNew(Flag isNew) { + super.withIsNew(isNew); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withIsPreview(Flag isPreview) { + super.withIsPreview(isPreview); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withIsFeatured(Flag isFeatured) { + super.withIsFeatured(isFeatured); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withIsDeprecated(Flag isDeprecated) { + super.withIsDeprecated(isDeprecated); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withPublisherDisplayName(String publisherDisplayName) { + super.withPublisherDisplayName(publisherDisplayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withSource(MetadataSource source) { + super.withSource(source); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withAuthor(MetadataAuthor author) { + super.withAuthor(author); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withSupport(MetadataSupport support) { + super.withSupport(support); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withDependencies(MetadataDependencies dependencies) { + super.withDependencies(dependencies); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withProviders(List providers) { + super.withProviders(providers); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withFirstPublishDate(LocalDate firstPublishDate) { + super.withFirstPublishDate(firstPublishDate); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withLastPublishDate(LocalDate lastPublishDate) { + super.withLastPublishDate(lastPublishDate); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withCategories(MetadataCategories categories) { + super.withCategories(categories); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withThreatAnalysisTactics(List threatAnalysisTactics) { + super.withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withThreatAnalysisTechniques(List threatAnalysisTechniques) { + super.withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductPackageProperties withIcon(String icon) { + super.withIcon(icon); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..14620c8f7dba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateModelInner.java @@ -0,0 +1,676 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** + * Template resource definition. + */ +@Fluent +public final class ProductTemplateModelInner extends ResourceWithEtag { + /* + * template properties + */ + @JsonProperty(value = "properties") + private ProductTemplateProperties innerProperties; + + /** + * Creates an instance of ProductTemplateModelInner class. + */ + public ProductTemplateModelInner() { + } + + /** + * Get the innerProperties property: template properties. + * + * @return the innerProperties value. + */ + private ProductTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateModelInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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(); + } + + /** + * Set the packagedContent property: The json of the ARM template to deploy. + * + * @param packagedContent the packagedContent value to set. + * @return the ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withPackagedContent(Object packagedContent) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + this.innerProperties().withPackagedContent(packagedContent); + return this; + } + + /** + * Get the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @return the contentId value. + */ + public String contentId() { + return this.innerProperties() == null ? null : this.innerProperties().contentId(); + } + + /** + * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions + * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the + * resource name. + * + * @param contentId the contentId value to set. + * @return the ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withContentId(String contentId) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withContentProductId(String contentProductId) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withPackageVersion(String packageVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withContentKind(Kind contentKind) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withSource(MetadataSource source) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withAuthor(MetadataAuthor author) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withSupport(MetadataSupport support) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withDependencies(MetadataDependencies dependencies) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withCategories(MetadataCategories categories) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withProviders(List providers) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withFirstPublishDate(LocalDate firstPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withLastPublishDate(LocalDate lastPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withCustomVersion(String customVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withContentSchemaVersion(String contentSchemaVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withIcon(String icon) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withThreatAnalysisTactics(List threatAnalysisTactics) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withThreatAnalysisTechniques(List threatAnalysisTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withPreviewImages(List previewImages) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withPreviewImagesDark(List previewImagesDark) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withPackageId(String packageId) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withPackageKind(PackageKind packageKind) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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 ProductTemplateModelInner object itself. + */ + public ProductTemplateModelInner withPackageName(String packageName) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductTemplateProperties(); + } + 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..4f3eeec07eb8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateProperties.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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.TemplateBaseProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** + * Template property bag. + */ +@Fluent +public final class ProductTemplateProperties extends TemplateBaseProperties { + /* + * The json of the ARM template to deploy + */ + @JsonProperty(value = "packagedContent") + private Object packagedContent; + + /** + * Creates an instance of ProductTemplateProperties class. + */ + public ProductTemplateProperties() { + } + + /** + * Get the packagedContent property: The json of the ARM template to deploy. + * + * @return the packagedContent value. + */ + public Object packagedContent() { + return this.packagedContent; + } + + /** + * Set the packagedContent property: The json of the ARM template to deploy. + * + * @param packagedContent the packagedContent value to set. + * @return the ProductTemplateProperties object itself. + */ + public ProductTemplateProperties withPackagedContent(Object packagedContent) { + this.packagedContent = packagedContent; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withContentId(String contentId) { + super.withContentId(contentId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withContentProductId(String contentProductId) { + super.withContentProductId(contentProductId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withPackageVersion(String packageVersion) { + super.withPackageVersion(packageVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withContentKind(Kind contentKind) { + super.withContentKind(contentKind); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withSource(MetadataSource source) { + super.withSource(source); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withAuthor(MetadataAuthor author) { + super.withAuthor(author); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withSupport(MetadataSupport support) { + super.withSupport(support); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withDependencies(MetadataDependencies dependencies) { + super.withDependencies(dependencies); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withCategories(MetadataCategories categories) { + super.withCategories(categories); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withProviders(List providers) { + super.withProviders(providers); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withFirstPublishDate(LocalDate firstPublishDate) { + super.withFirstPublishDate(firstPublishDate); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withLastPublishDate(LocalDate lastPublishDate) { + super.withLastPublishDate(lastPublishDate); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withCustomVersion(String customVersion) { + super.withCustomVersion(customVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withContentSchemaVersion(String contentSchemaVersion) { + super.withContentSchemaVersion(contentSchemaVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withIcon(String icon) { + super.withIcon(icon); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withThreatAnalysisTactics(List threatAnalysisTactics) { + super.withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withThreatAnalysisTechniques(List threatAnalysisTechniques) { + super.withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withPreviewImages(List previewImages) { + super.withPreviewImages(previewImages); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withPreviewImagesDark(List previewImagesDark) { + super.withPreviewImagesDark(previewImagesDark); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withPackageId(String packageId) { + super.withPackageId(packageId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withPackageKind(PackageKind packageKind) { + super.withPackageKind(packageKind); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ProductTemplateProperties withPackageName(String packageName) { + super.withPackageName(packageName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..ec947d46f7b7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/QueryProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.ConditionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the query properties. + */ +@Fluent +public final class QueryProperties { + /* + * Represents a condition used to query for TI objects. + */ + @JsonProperty(value = "condition") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (condition() != null) { + condition().validate(); + } + } +} 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..39edaa723347 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationInner.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.RecommendedSuggestion; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.State; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Recommendation object. + */ +@Fluent +public final class RecommendationInner extends ResourceWithEtag { + /* + * Recommendation properties object. + */ + @JsonProperty(value = "properties") + private RecommendationProperties innerProperties; + + /** + * Creates an instance of RecommendationInner class. + */ + public RecommendationInner() { + } + + /** + * Get the innerProperties property: Recommendation properties object. + * + * @return the innerProperties value. + */ + private RecommendationProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public RecommendationInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the recommendationTypeId property: Id of the recommendation type. + * + * @return the recommendationTypeId value. + */ + public String recommendationTypeId() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationTypeId(); + } + + /** + * Set the recommendationTypeId property: Id of the recommendation type. + * + * @param recommendationTypeId the recommendationTypeId value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withRecommendationTypeId(String recommendationTypeId) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withRecommendationTypeId(recommendationTypeId); + return this; + } + + /** + * Get the state property: State of the recommendation. + * + * @return the state value. + */ + public State state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: State of the recommendation. + * + * @param state the state value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withState(State state) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the title property: Title of the recommendation. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * Set the title property: Title of the recommendation. + * + * @param title the title value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withTitle(String title) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withTitle(title); + return this; + } + + /** + * Get the description property: Description of the recommendation. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Description of the recommendation. + * + * @param description the description value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * 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(); + } + + /** + * Set the creationTimeUtc property: The time stamp (UTC) when the recommendation was created. + * + * @param creationTimeUtc the creationTimeUtc value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withCreationTimeUtc(OffsetDateTime creationTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withCreationTimeUtc(creationTimeUtc); + return this; + } + + /** + * 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(); + } + + /** + * Set the lastEvaluatedTimeUtc property: The time stamp (UTC) when the recommendation was last evaluated. + * + * @param lastEvaluatedTimeUtc the lastEvaluatedTimeUtc value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withLastEvaluatedTimeUtc(OffsetDateTime lastEvaluatedTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withLastEvaluatedTimeUtc(lastEvaluatedTimeUtc); + return this; + } + + /** + * 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(); + } + + /** + * Set the lastModifiedTimeUtc property: The time stamp (UTC) when the recommendation was last modified. + * + * @param lastModifiedTimeUtc the lastModifiedTimeUtc value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withLastModifiedTimeUtc(OffsetDateTime lastModifiedTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withLastModifiedTimeUtc(lastModifiedTimeUtc); + return this; + } + + /** + * 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(); + } + + /** + * Set the suggestions property: List of suggestions to take for this recommendation. + * + * @param suggestions the suggestions value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withSuggestions(List suggestions) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withSuggestions(suggestions); + return this; + } + + /** + * 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(); + } + + /** + * Set the resourceId property: Id of the resource this recommendation refers to. + * + * @param resourceId the resourceId value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withResourceId(String resourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withResourceId(resourceId); + return this; + } + + /** + * 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(); + } + + /** + * Set the additionalProperties property: Collection of additional properties for the recommendation. + * + * @param additionalProperties the additionalProperties value to set. + * @return the RecommendationInner object itself. + */ + public RecommendationInner withAdditionalProperties(Map additionalProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withAdditionalProperties(additionalProperties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationListInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationListInner.java new file mode 100644 index 000000000000..ae49338e0a93 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationListInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of recommendations. + */ +@Fluent +public final class RecommendationListInner { + /* + * An list of recommendations + */ + @JsonProperty(value = "value") + private List value; + + /** + * Creates an instance of RecommendationListInner class. + */ + public RecommendationListInner() { + } + + /** + * Get the value property: An list of recommendations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An list of recommendations. + * + * @param value the value value to set. + * @return the RecommendationListInner object itself. + */ + public RecommendationListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..9944120d2aa8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationProperties.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.RecommendedSuggestion; +import com.azure.resourcemanager.securityinsights.models.State; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Recommendation properties object. + */ +@Fluent +public final class RecommendationProperties { + /* + * Id of the recommendation type. + */ + @JsonProperty(value = "recommendationTypeId", required = true) + private String recommendationTypeId; + + /* + * State of the recommendation. + */ + @JsonProperty(value = "state", required = true) + private State state; + + /* + * Title of the recommendation. + */ + @JsonProperty(value = "title", required = true) + private String title; + + /* + * Description of the recommendation. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * The time stamp (UTC) when the recommendation was created. + */ + @JsonProperty(value = "creationTimeUtc", required = true) + private OffsetDateTime creationTimeUtc; + + /* + * The time stamp (UTC) when the recommendation was last evaluated. + */ + @JsonProperty(value = "lastEvaluatedTimeUtc", required = true) + private OffsetDateTime lastEvaluatedTimeUtc; + + /* + * The time stamp (UTC) when the recommendation was last modified. + */ + @JsonProperty(value = "lastModifiedTimeUtc", required = true) + private OffsetDateTime lastModifiedTimeUtc; + + /* + * List of suggestions to take for this recommendation. + */ + @JsonProperty(value = "suggestions", required = true) + private List suggestions; + + /* + * Id of the resource this recommendation refers to. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Collection of additional properties for the recommendation. + */ + @JsonProperty(value = "additionalProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalProperties; + + /** + * Creates an instance of RecommendationProperties class. + */ + public RecommendationProperties() { + } + + /** + * Get the recommendationTypeId property: Id of the recommendation type. + * + * @return the recommendationTypeId value. + */ + public String recommendationTypeId() { + return this.recommendationTypeId; + } + + /** + * Set the recommendationTypeId property: Id of the recommendation type. + * + * @param recommendationTypeId the recommendationTypeId value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withRecommendationTypeId(String recommendationTypeId) { + this.recommendationTypeId = recommendationTypeId; + return this; + } + + /** + * 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 RecommendationProperties object itself. + */ + public RecommendationProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Get the title property: Title of the recommendation. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Title of the recommendation. + * + * @param title the title value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Description of the recommendation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the recommendation. + * + * @param description the description value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the creationTimeUtc property: The time stamp (UTC) when the recommendation was created. + * + * @return the creationTimeUtc value. + */ + public OffsetDateTime creationTimeUtc() { + return this.creationTimeUtc; + } + + /** + * Set the creationTimeUtc property: The time stamp (UTC) when the recommendation was created. + * + * @param creationTimeUtc the creationTimeUtc value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withCreationTimeUtc(OffsetDateTime creationTimeUtc) { + this.creationTimeUtc = creationTimeUtc; + return this; + } + + /** + * Get the lastEvaluatedTimeUtc property: The time stamp (UTC) when the recommendation was last evaluated. + * + * @return the lastEvaluatedTimeUtc value. + */ + public OffsetDateTime lastEvaluatedTimeUtc() { + return this.lastEvaluatedTimeUtc; + } + + /** + * Set the lastEvaluatedTimeUtc property: The time stamp (UTC) when the recommendation was last evaluated. + * + * @param lastEvaluatedTimeUtc the lastEvaluatedTimeUtc value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withLastEvaluatedTimeUtc(OffsetDateTime lastEvaluatedTimeUtc) { + this.lastEvaluatedTimeUtc = lastEvaluatedTimeUtc; + return this; + } + + /** + * Get the lastModifiedTimeUtc property: The time stamp (UTC) when the recommendation was last modified. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + + /** + * Set the lastModifiedTimeUtc property: The time stamp (UTC) when the recommendation was last modified. + * + * @param lastModifiedTimeUtc the lastModifiedTimeUtc value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withLastModifiedTimeUtc(OffsetDateTime lastModifiedTimeUtc) { + this.lastModifiedTimeUtc = lastModifiedTimeUtc; + return this; + } + + /** + * Get the suggestions property: List of suggestions to take for this recommendation. + * + * @return the suggestions value. + */ + public List suggestions() { + return this.suggestions; + } + + /** + * Set the suggestions property: List of suggestions to take for this recommendation. + * + * @param suggestions the suggestions value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withSuggestions(List suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get the resourceId property: Id of the resource this recommendation refers to. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Id of the resource this recommendation refers to. + * + * @param resourceId the resourceId value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the additionalProperties property: Collection of additional properties for the recommendation. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Collection of additional properties for the recommendation. + * + * @param additionalProperties the additionalProperties value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recommendationTypeId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property recommendationTypeId in model RecommendationProperties")); + } + if (state() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property state in model RecommendationProperties")); + } + if (title() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property title in model RecommendationProperties")); + } + if (description() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property description in model RecommendationProperties")); + } + if (creationTimeUtc() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property creationTimeUtc in model RecommendationProperties")); + } + if (lastEvaluatedTimeUtc() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property lastEvaluatedTimeUtc in model RecommendationProperties")); + } + if (lastModifiedTimeUtc() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property lastModifiedTimeUtc in model RecommendationProperties")); + } + if (suggestions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property suggestions in model RecommendationProperties")); + } else { + suggestions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecommendationProperties.class); +} 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..a0add2d09161 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ReevaluateResponseInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Reevaluate response object. + */ +@Fluent +public final class ReevaluateResponseInner { + /* + * The time stamp (UTC) when the recommendation was last evaluated. + */ + @JsonProperty(value = "lastEvaluatedTimeUtc") + private OffsetDateTime lastEvaluatedTimeUtc; + + /** + * Creates an instance of ReevaluateResponseInner class. + */ + public 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; + } + + /** + * Set the lastEvaluatedTimeUtc property: The time stamp (UTC) when the recommendation was last evaluated. + * + * @param lastEvaluatedTimeUtc the lastEvaluatedTimeUtc value to set. + * @return the ReevaluateResponseInner object itself. + */ + public ReevaluateResponseInner withLastEvaluatedTimeUtc(OffsetDateTime lastEvaluatedTimeUtc) { + this.lastEvaluatedTimeUtc = lastEvaluatedTimeUtc; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryKeyEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryKeyEntityProperties.java index 405ab6789eaf..5e2a00017453 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.RegistryHive; import com.fasterxml.jackson.annotation.JsonProperty; -/** RegistryKey entity property bag. */ +/** + * RegistryKey entity property bag. + */ @Immutable public final class RegistryKeyEntityProperties extends EntityCommonProperties { /* @@ -24,9 +26,15 @@ public final class RegistryKeyEntityProperties extends EntityCommonProperties { @JsonProperty(value = "key", access = JsonProperty.Access.WRITE_ONLY) private String key; + /** + * Creates an instance of RegistryKeyEntityProperties class. + */ + public RegistryKeyEntityProperties() { + } + /** * Get the hive property: the hive that holds the registry key. - * + * * @return the hive value. */ public RegistryHive hive() { @@ -35,7 +43,7 @@ public RegistryHive hive() { /** * Get the key property: The registry key path. - * + * * @return the key value. */ public String key() { @@ -44,7 +52,7 @@ public String key() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 a15af888fb1b..ed2214d2d25a 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.securityinsights.models.RegistryValueKind; import com.fasterxml.jackson.annotation.JsonProperty; -/** RegistryValue entity property bag. */ +/** + * RegistryValue entity property bag. + */ @Immutable public final class RegistryValueEntityProperties extends EntityCommonProperties { /* @@ -31,15 +33,20 @@ public final class RegistryValueEntityProperties extends EntityCommonProperties private String valueName; /* - * Specifies the data types to use when storing values in the registry, or identifies the data type of a value in - * the registry. + * Specifies the data types to use when storing values in the registry, or identifies the data type of a value in the registry. */ @JsonProperty(value = "valueType", access = JsonProperty.Access.WRITE_ONLY) private RegistryValueKind valueType; + /** + * Creates an instance of RegistryValueEntityProperties class. + */ + public RegistryValueEntityProperties() { + } + /** * Get the keyEntityId property: The registry key entity id. - * + * * @return the keyEntityId value. */ public String keyEntityId() { @@ -48,7 +55,7 @@ public String keyEntityId() { /** * Get the valueData property: String formatted representation of the value data. - * + * * @return the valueData value. */ public String valueData() { @@ -57,7 +64,7 @@ public String valueData() { /** * Get the valueName property: The registry value name. - * + * * @return the valueName value. */ public String valueName() { @@ -67,7 +74,7 @@ public String valueName() { /** * Get the valueType property: Specifies the data types to use when storing values in the registry, or identifies * the data type of a value in the registry. - * + * * @return the valueType value. */ public RegistryValueKind valueType() { @@ -76,7 +83,7 @@ public RegistryValueKind valueType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 40a02c226353..7270dcb2686a 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents a relation between two resources. */ +/** + * Represents a relation between two resources. + */ @Fluent public final class RelationInner extends ResourceWithEtag { /* @@ -17,16 +19,24 @@ public final class RelationInner extends ResourceWithEtag { @JsonProperty(value = "properties") private RelationProperties innerProperties; + /** + * Creates an instance of RelationInner class. + */ + public RelationInner() { + } + /** * Get the innerProperties property: Relation properties. - * + * * @return the innerProperties value. */ private RelationProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public RelationInner withEtag(String etag) { super.withEtag(etag); @@ -35,7 +45,7 @@ public RelationInner withEtag(String etag) { /** * Get the relatedResourceId property: The resource ID of the related resource. - * + * * @return the relatedResourceId value. */ public String relatedResourceId() { @@ -44,7 +54,7 @@ public String relatedResourceId() { /** * Set the relatedResourceId property: The resource ID of the related resource. - * + * * @param relatedResourceId the relatedResourceId value to set. * @return the RelationInner object itself. */ @@ -58,7 +68,7 @@ public RelationInner withRelatedResourceId(String relatedResourceId) { /** * Get the relatedResourceName property: The name of the related resource. - * + * * @return the relatedResourceName value. */ public String relatedResourceName() { @@ -67,7 +77,7 @@ public String relatedResourceName() { /** * Get the relatedResourceType property: The resource type of the related resource. - * + * * @return the relatedResourceType value. */ public String relatedResourceType() { @@ -76,7 +86,7 @@ public String relatedResourceType() { /** * Get the relatedResourceKind property: The resource kind of the related resource. - * + * * @return the relatedResourceKind value. */ public String relatedResourceKind() { @@ -85,7 +95,7 @@ public String relatedResourceKind() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 99e3df52c8c1..f3e0288ea219 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Relation property bag. */ +/** + * Relation property bag. + */ @Fluent public final class RelationProperties { /* @@ -35,9 +37,15 @@ public final class RelationProperties { @JsonProperty(value = "relatedResourceKind", access = JsonProperty.Access.WRITE_ONLY) private String relatedResourceKind; + /** + * Creates an instance of RelationProperties class. + */ + public RelationProperties() { + } + /** * Get the relatedResourceId property: The resource ID of the related resource. - * + * * @return the relatedResourceId value. */ public String relatedResourceId() { @@ -46,7 +54,7 @@ public String relatedResourceId() { /** * Set the relatedResourceId property: The resource ID of the related resource. - * + * * @param relatedResourceId the relatedResourceId value to set. * @return the RelationProperties object itself. */ @@ -57,7 +65,7 @@ public RelationProperties withRelatedResourceId(String relatedResourceId) { /** * Get the relatedResourceName property: The name of the related resource. - * + * * @return the relatedResourceName value. */ public String relatedResourceName() { @@ -66,7 +74,7 @@ public String relatedResourceName() { /** * Get the relatedResourceType property: The resource type of the related resource. - * + * * @return the relatedResourceType value. */ public String relatedResourceType() { @@ -75,7 +83,7 @@ public String relatedResourceType() { /** * Get the relatedResourceKind property: The resource kind of the related resource. - * + * * @return the relatedResourceKind value. */ public String relatedResourceKind() { @@ -84,15 +92,14 @@ public String relatedResourceKind() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (relatedResourceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property relatedResourceId in model RelationProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property relatedResourceId in model RelationProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepoInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepoInner.java index dff64861cae5..203c44624149 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents a repository. */ +/** + * Represents a repository. + */ @Fluent public final class RepoInner { /* @@ -23,15 +25,27 @@ public final class RepoInner { @JsonProperty(value = "fullName") private String fullName; + /* + * The installation id of the repository. + */ + @JsonProperty(value = "installationId") + private Long installationId; + /* * Array of branches. */ @JsonProperty(value = "branches") private List branches; + /** + * Creates an instance of RepoInner class. + */ + public RepoInner() { + } + /** * Get the url property: The url to access the repository. - * + * * @return the url value. */ public String url() { @@ -40,7 +54,7 @@ public String url() { /** * Set the url property: The url to access the repository. - * + * * @param url the url value to set. * @return the RepoInner object itself. */ @@ -51,7 +65,7 @@ public RepoInner withUrl(String url) { /** * Get the fullName property: The name of the repository. - * + * * @return the fullName value. */ public String fullName() { @@ -60,7 +74,7 @@ public String fullName() { /** * Set the fullName property: The name of the repository. - * + * * @param fullName the fullName value to set. * @return the RepoInner object itself. */ @@ -69,9 +83,29 @@ public RepoInner withFullName(String fullName) { return this; } + /** + * Get the installationId property: The installation id of the repository. + * + * @return the installationId value. + */ + public Long installationId() { + return this.installationId; + } + + /** + * Set the installationId property: The installation id of the repository. + * + * @param installationId the installationId value to set. + * @return the RepoInner object itself. + */ + public RepoInner withInstallationId(Long installationId) { + this.installationId = installationId; + return this; + } + /** * Get the branches property: Array of branches. - * + * * @return the branches value. */ public List branches() { @@ -80,7 +114,7 @@ public List branches() { /** * Set the branches property: Array of branches. - * + * * @param branches the branches value to set. * @return the RepoInner object itself. */ @@ -91,7 +125,7 @@ public RepoInner withBranches(List branches) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..124e11eda90d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccess.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Credentials to access repository. + */ +@Fluent +public final class RepositoryAccess { + /* + * The kind of repository access credentials + */ + @JsonProperty(value = "kind", required = true) + private RepositoryAccessKind kind; + + /* + * OAuth Code. Required when `kind` is `OAuth` + */ + @JsonProperty(value = "code") + private String code; + + /* + * OAuth State. Required when `kind` is `OAuth` + */ + @JsonProperty(value = "state") + private String state; + + /* + * OAuth ClientId. Required when `kind` is `OAuth` + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * Personal Access Token. Required when `kind` is `PAT` + */ + @JsonProperty(value = "token") + private String token; + + /* + * Application installation ID. Required when `kind` is `App`. Supported by `GitHub` only. + */ + @JsonProperty(value = "installationId") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kind() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property kind in model RepositoryAccess")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RepositoryAccess.class); +} 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..a29f895911a6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccessObject.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Credentials to access repository. + */ +@Fluent +public final class RepositoryAccessObject { + /* + * RepositoryAccess properties + */ + @JsonProperty(value = "repositoryAccess", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerRepositoryAccess() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerRepositoryAccess in model RepositoryAccessObject")); + } else { + innerRepositoryAccess().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RepositoryAccessObject.class); +} 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..e64c6f065174 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RestApiPollerDataConnectorProperties.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Rest Api Poller data connector properties. + */ +@Fluent +public final class RestApiPollerDataConnectorProperties { + /* + * The connector definition name (the dataConnectorDefinition resource id). + */ + @JsonProperty(value = "connectorDefinitionName", required = true) + private String connectorDefinitionName; + + /* + * The a authentication model. + */ + @JsonProperty(value = "auth", required = true) + private CcpAuthConfig auth; + + /* + * The request configuration. + */ + @JsonProperty(value = "request", required = true) + private RestApiPollerRequestConfig request; + + /* + * The DCR related properties. + */ + @JsonProperty(value = "dcrConfig") + private DcrConfiguration dcrConfig; + + /* + * Indicates whether the connector is active or not. + */ + @JsonProperty(value = "isActive") + private Boolean isActive; + + /* + * The Log Analytics table destination. + */ + @JsonProperty(value = "dataType") + private String dataType; + + /* + * The response configuration. + */ + @JsonProperty(value = "response") + private CcpResponseConfig response; + + /* + * The paging configuration. + */ + @JsonProperty(value = "paging") + 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. + */ + @JsonProperty(value = "addOnAttributes") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectorDefinitionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectorDefinitionName in model RestApiPollerDataConnectorProperties")); + } + if (auth() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property auth in model RestApiPollerDataConnectorProperties")); + } else { + auth().validate(); + } + if (request() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property request in model RestApiPollerDataConnectorProperties")); + } else { + request().validate(); + } + if (dcrConfig() != null) { + dcrConfig().validate(); + } + if (response() != null) { + response().validate(); + } + if (paging() != null) { + paging().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RestApiPollerDataConnectorProperties.class); +} 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..183afb331796 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SapSolutionUsageStatisticProperties.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the billing statistic about the Microsoft Sentinel solution for SAP usage. + */ +@Immutable +public final class SapSolutionUsageStatisticProperties { + /* + * The latest count of active SAP system IDs under the Microsoft Sentinel solution for SAP Usage + */ + @JsonProperty(value = "activeSystemIdCount", access = JsonProperty.Access.WRITE_ONLY) + private Long activeSystemIdCount; + + /** + * Creates an instance of SapSolutionUsageStatisticProperties class. + */ + public 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleProperties.java index 98738e4e2029..a528574327d7 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 @@ -13,6 +13,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 com.fasterxml.jackson.annotation.JsonProperty; import java.time.Duration; @@ -20,7 +21,9 @@ import java.util.List; import java.util.Map; -/** Scheduled alert rule base property bag. */ +/** + * Scheduled alert rule base property bag. + */ @Fluent public final class ScheduledAlertRuleProperties extends ScheduledAlertRuleCommonProperties { /* @@ -30,8 +33,7 @@ public final class ScheduledAlertRuleProperties extends ScheduledAlertRuleCommon 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> + * The version of the alert rule template used to create this rule - in format , where all are numbers, for example 0 <1.0.2> */ @JsonProperty(value = "templateVersion") private String templateVersion; @@ -84,15 +86,27 @@ public final class ScheduledAlertRuleProperties extends ScheduledAlertRuleCommon @JsonProperty(value = "techniques") private List techniques; + /* + * The sub-techniques of the alert rule + */ + @JsonProperty(value = "subTechniques") + private List subTechniques; + /* * The settings of the incidents that created from alerts triggered by this analytics rule */ @JsonProperty(value = "incidentConfiguration") private IncidentConfiguration incidentConfiguration; + /** + * Creates an instance of ScheduledAlertRuleProperties class. + */ + public ScheduledAlertRuleProperties() { + } + /** * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @return the alertRuleTemplateName value. */ public String alertRuleTemplateName() { @@ -101,7 +115,7 @@ public String alertRuleTemplateName() { /** * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @param alertRuleTemplateName the alertRuleTemplateName value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -113,7 +127,7 @@ public ScheduledAlertRuleProperties withAlertRuleTemplateName(String alertRuleTe /** * 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() { @@ -123,7 +137,7 @@ public String templateVersion() { /** * Set the templateVersion property: The version of the alert rule template used to create this rule - in format * <a.b.c>, where all are numbers, for example 0 <1.0.2>. - * + * * @param templateVersion the templateVersion value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -134,7 +148,7 @@ public ScheduledAlertRuleProperties withTemplateVersion(String templateVersion) /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -143,7 +157,7 @@ public String description() { /** * Set the description property: The description of the alert rule. - * + * * @param description the description value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -154,7 +168,7 @@ public ScheduledAlertRuleProperties withDescription(String description) { /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -163,7 +177,7 @@ public String displayName() { /** * Set the displayName property: The display name for alerts created by this alert rule. - * + * * @param displayName the displayName value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -174,7 +188,7 @@ public ScheduledAlertRuleProperties withDisplayName(String displayName) { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public boolean enabled() { @@ -183,7 +197,7 @@ public boolean enabled() { /** * Set the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -194,7 +208,7 @@ public ScheduledAlertRuleProperties withEnabled(boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this alert rule has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -204,7 +218,7 @@ public OffsetDateTime 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() { @@ -214,7 +228,7 @@ public Duration suppressionDuration() { /** * Set the suppressionDuration property: The suppression (in ISO 8601 duration format) to wait since last time this * alert rule been triggered. - * + * * @param suppressionDuration the suppressionDuration value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -226,7 +240,7 @@ public ScheduledAlertRuleProperties withSuppressionDuration(Duration suppression /** * Get the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or * disabled. - * + * * @return the suppressionEnabled value. */ public boolean suppressionEnabled() { @@ -236,7 +250,7 @@ public boolean suppressionEnabled() { /** * Set the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or * disabled. - * + * * @param suppressionEnabled the suppressionEnabled value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -247,7 +261,7 @@ public ScheduledAlertRuleProperties withSuppressionEnabled(boolean suppressionEn /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -256,7 +270,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the alert rule. - * + * * @param tactics the tactics value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -267,7 +281,7 @@ public ScheduledAlertRuleProperties withTactics(List tactics) { /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -276,7 +290,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -285,10 +299,30 @@ 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. - * + * * @return the incidentConfiguration value. */ public IncidentConfiguration incidentConfiguration() { @@ -298,7 +332,7 @@ public IncidentConfiguration incidentConfiguration() { /** * Set the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this * analytics rule. - * + * * @param incidentConfiguration the incidentConfiguration value to set. * @return the ScheduledAlertRuleProperties object itself. */ @@ -307,95 +341,123 @@ public ScheduledAlertRuleProperties withIncidentConfiguration(IncidentConfigurat return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withQuery(String query) { super.withQuery(query); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withQueryFrequency(Duration queryFrequency) { super.withQueryFrequency(queryFrequency); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withQueryPeriod(Duration queryPeriod) { super.withQueryPeriod(queryPeriod); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withSeverity(AlertSeverity severity) { super.withSeverity(severity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withTriggerOperator(TriggerOperator triggerOperator) { super.withTriggerOperator(triggerOperator); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withTriggerThreshold(Integer triggerThreshold) { super.withTriggerThreshold(triggerThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withEventGroupingSettings(EventGroupingSettings eventGroupingSettings) { super.withEventGroupingSettings(eventGroupingSettings); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withCustomDetails(Map customDetails) { super.withCustomDetails(customDetails); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withEntityMappings(List entityMappings) { super.withEntityMappings(entityMappings); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRuleProperties withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { super.withAlertDetailsOverride(alertDetailsOverride); return this; } + /** + * {@inheritDoc} + */ + @Override + public ScheduledAlertRuleProperties + withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + super.withSentinelEntitiesMappings(sentinelEntitiesMappings); + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model ScheduledAlertRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property displayName in model ScheduledAlertRuleProperties")); } if (suppressionDuration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property suppressionDuration in model ScheduledAlertRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property suppressionDuration in model ScheduledAlertRuleProperties")); } if (incidentConfiguration() != null) { incidentConfiguration().validate(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleTemplateProperties.java index 42be47785289..49cfffe9e444 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 @@ -11,6 +11,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 com.fasterxml.jackson.annotation.JsonInclude; @@ -20,7 +21,9 @@ import java.util.List; import java.util.Map; -/** Scheduled alert rule template properties. */ +/** + * Scheduled alert rule template properties. + */ @Fluent public final class ScheduledAlertRuleTemplateProperties { /* @@ -113,6 +116,12 @@ public final class ScheduledAlertRuleTemplateProperties { @JsonProperty(value = "techniques") private List techniques; + /* + * The sub-techniques of the alert rule + */ + @JsonProperty(value = "subTechniques") + private List subTechniques; + /* * The version of this template - in format , where all are numbers. For example <1.0.2>. */ @@ -144,9 +153,21 @@ public final class ScheduledAlertRuleTemplateProperties { @JsonProperty(value = "alertDetailsOverride") private AlertDetailsOverride alertDetailsOverride; + /* + * Array of the sentinel entity mappings of the alert rule + */ + @JsonProperty(value = "sentinelEntitiesMappings") + private List sentinelEntitiesMappings; + + /** + * Creates an instance of ScheduledAlertRuleTemplateProperties class. + */ + public ScheduledAlertRuleTemplateProperties() { + } + /** * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @return the alertRulesCreatedByTemplateCount value. */ public Integer alertRulesCreatedByTemplateCount() { @@ -155,19 +176,19 @@ public Integer 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) { + public ScheduledAlertRuleTemplateProperties + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { this.alertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; return this; } /** * Get the createdDateUtc property: The time that this alert rule template has been added. - * + * * @return the createdDateUtc value. */ public OffsetDateTime createdDateUtc() { @@ -176,7 +197,7 @@ public OffsetDateTime createdDateUtc() { /** * Get the lastUpdatedDateUtc property: The time that this alert rule template was last updated. - * + * * @return the lastUpdatedDateUtc value. */ public OffsetDateTime lastUpdatedDateUtc() { @@ -185,7 +206,7 @@ public OffsetDateTime lastUpdatedDateUtc() { /** * Get the description property: The description of the alert rule template. - * + * * @return the description value. */ public String description() { @@ -194,7 +215,7 @@ public String description() { /** * Set the description property: The description of the alert rule template. - * + * * @param description the description value to set. * @return the ScheduledAlertRuleTemplateProperties object itself. */ @@ -205,7 +226,7 @@ public ScheduledAlertRuleTemplateProperties withDescription(String description) /** * Get the displayName property: The display name for alert rule template. - * + * * @return the displayName value. */ public String displayName() { @@ -214,7 +235,7 @@ public String displayName() { /** * Set the displayName property: The display name for alert rule template. - * + * * @param displayName the displayName value to set. * @return the ScheduledAlertRuleTemplateProperties object itself. */ @@ -225,7 +246,7 @@ public ScheduledAlertRuleTemplateProperties withDisplayName(String displayName) /** * Get the requiredDataConnectors property: The required data connectors for this template. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -234,19 +255,19 @@ public List 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) { + public ScheduledAlertRuleTemplateProperties + withRequiredDataConnectors(List requiredDataConnectors) { this.requiredDataConnectors = requiredDataConnectors; return this; } /** * Get the status property: The alert rule template status. - * + * * @return the status value. */ public TemplateStatus status() { @@ -255,7 +276,7 @@ public TemplateStatus status() { /** * Set the status property: The alert rule template status. - * + * * @param status the status value to set. * @return the ScheduledAlertRuleTemplateProperties object itself. */ @@ -266,7 +287,7 @@ public ScheduledAlertRuleTemplateProperties withStatus(TemplateStatus status) { /** * Get the query property: The query that creates alerts for this rule. - * + * * @return the query value. */ public String query() { @@ -275,7 +296,7 @@ public String 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. */ @@ -286,7 +307,7 @@ public ScheduledAlertRuleTemplateProperties withQuery(String query) { /** * Get the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. - * + * * @return the queryFrequency value. */ public Duration queryFrequency() { @@ -295,7 +316,7 @@ public Duration 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. */ @@ -306,7 +327,7 @@ public ScheduledAlertRuleTemplateProperties withQueryFrequency(Duration queryFre /** * Get the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. - * + * * @return the queryPeriod value. */ public Duration queryPeriod() { @@ -315,7 +336,7 @@ public Duration 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. */ @@ -326,7 +347,7 @@ public ScheduledAlertRuleTemplateProperties withQueryPeriod(Duration queryPeriod /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -335,7 +356,7 @@ public AlertSeverity 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. */ @@ -346,7 +367,7 @@ public ScheduledAlertRuleTemplateProperties withSeverity(AlertSeverity severity) /** * Get the triggerOperator property: The operation against the threshold that triggers alert rule. - * + * * @return the triggerOperator value. */ public TriggerOperator triggerOperator() { @@ -355,7 +376,7 @@ public TriggerOperator 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. */ @@ -366,7 +387,7 @@ public ScheduledAlertRuleTemplateProperties withTriggerOperator(TriggerOperator /** * Get the triggerThreshold property: The threshold triggers this alert rule. - * + * * @return the triggerThreshold value. */ public Integer triggerThreshold() { @@ -375,7 +396,7 @@ public Integer triggerThreshold() { /** * Set the triggerThreshold property: The threshold triggers this alert rule. - * + * * @param triggerThreshold the triggerThreshold value to set. * @return the ScheduledAlertRuleTemplateProperties object itself. */ @@ -386,7 +407,7 @@ public ScheduledAlertRuleTemplateProperties withTriggerThreshold(Integer trigger /** * Get the tactics property: The tactics of the alert rule template. - * + * * @return the tactics value. */ public List tactics() { @@ -395,7 +416,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. */ @@ -406,7 +427,7 @@ public ScheduledAlertRuleTemplateProperties withTactics(List tacti /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -415,7 +436,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the ScheduledAlertRuleTemplateProperties object itself. */ @@ -424,10 +445,30 @@ public ScheduledAlertRuleTemplateProperties withTechniques(List techniqu 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 ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties withSubTechniques(List subTechniques) { + this.subTechniques = subTechniques; + return this; + } + /** * Get the version property: The version of this template - in format <a.b.c>, where all are numbers. For * example <1.0.2>. - * + * * @return the version value. */ public String version() { @@ -437,7 +478,7 @@ public String 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. */ @@ -448,7 +489,7 @@ public ScheduledAlertRuleTemplateProperties withVersion(String version) { /** * Get the eventGroupingSettings property: The event grouping settings. - * + * * @return the eventGroupingSettings value. */ public EventGroupingSettings eventGroupingSettings() { @@ -457,7 +498,7 @@ public EventGroupingSettings eventGroupingSettings() { /** * Set the eventGroupingSettings property: The event grouping settings. - * + * * @param eventGroupingSettings the eventGroupingSettings value to set. * @return the ScheduledAlertRuleTemplateProperties object itself. */ @@ -468,7 +509,7 @@ public ScheduledAlertRuleTemplateProperties withEventGroupingSettings(EventGroup /** * 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() { @@ -477,7 +518,7 @@ public Map 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. */ @@ -488,7 +529,7 @@ public ScheduledAlertRuleTemplateProperties withCustomDetails(Map entityMappings() { @@ -497,7 +538,7 @@ public List 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. */ @@ -508,7 +549,7 @@ public ScheduledAlertRuleTemplateProperties withEntityMappings(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 ScheduledAlertRuleTemplateProperties object itself. + */ + public ScheduledAlertRuleTemplateProperties + withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + this.sentinelEntitiesMappings = sentinelEntitiesMappings; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -544,5 +606,8 @@ public void validate() { if (alertDetailsOverride() != null) { alertDetailsOverride().validate(); } + if (sentinelEntitiesMappings() != null) { + sentinelEntitiesMappings().forEach(e -> e.validate()); + } } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityAlertProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityAlertProperties.java index 21db1aca93e5..9e9c58527e54 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 @@ -17,7 +17,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** SecurityAlert entity property bag. */ +/** + * SecurityAlert entity property bag. + */ @Fluent public final class SecurityAlertProperties extends EntityCommonProperties { /* @@ -57,8 +59,7 @@ public final class SecurityAlertProperties extends EntityCommonProperties { private Double confidenceScore; /* - * The confidence score calculation status, i.e. indicating if score calculation is pending for this alert, not - * applicable or final. + * The confidence score calculation status, i.e. indicating if score calculation is pending for this alert, not applicable or final. */ @JsonProperty(value = "confidenceScoreStatus", access = JsonProperty.Access.WRITE_ONLY) private ConfidenceScoreStatus confidenceScoreStatus; @@ -171,9 +172,15 @@ public final class SecurityAlertProperties extends EntityCommonProperties { @JsonProperty(value = "resourceIdentifiers", access = JsonProperty.Access.WRITE_ONLY) private List resourceIdentifiers; + /** + * Creates an instance of SecurityAlertProperties class. + */ + public SecurityAlertProperties() { + } + /** * Get the alertDisplayName property: The display name of the alert. - * + * * @return the alertDisplayName value. */ public String alertDisplayName() { @@ -182,7 +189,7 @@ public String alertDisplayName() { /** * Get the alertType property: The type name of the alert. - * + * * @return the alertType value. */ public String alertType() { @@ -191,7 +198,7 @@ public String alertType() { /** * Get the compromisedEntity property: Display name of the main entity being reported on. - * + * * @return the compromisedEntity value. */ public String compromisedEntity() { @@ -200,7 +207,7 @@ public String compromisedEntity() { /** * Get the confidenceLevel property: The confidence level of this alert. - * + * * @return the confidenceLevel value. */ public ConfidenceLevel confidenceLevel() { @@ -209,7 +216,7 @@ public ConfidenceLevel confidenceLevel() { /** * Get the confidenceReasons property: The confidence reasons. - * + * * @return the confidenceReasons value. */ public List confidenceReasons() { @@ -218,7 +225,7 @@ public List confidenceReasons() { /** * Get the confidenceScore property: The confidence score of the alert. - * + * * @return the confidenceScore value. */ public Double confidenceScore() { @@ -228,7 +235,7 @@ public Double confidenceScore() { /** * Get the confidenceScoreStatus property: The confidence score calculation status, i.e. indicating if score * calculation is pending for this alert, not applicable or final. - * + * * @return the confidenceScoreStatus value. */ public ConfidenceScoreStatus confidenceScoreStatus() { @@ -237,7 +244,7 @@ public ConfidenceScoreStatus confidenceScoreStatus() { /** * Get the description property: Alert description. - * + * * @return the description value. */ public String description() { @@ -247,7 +254,7 @@ public String description() { /** * Get the endTimeUtc property: The impact end time of the alert (the time of the last event contributing to the * alert). - * + * * @return the endTimeUtc value. */ public OffsetDateTime endTimeUtc() { @@ -256,7 +263,7 @@ public OffsetDateTime endTimeUtc() { /** * Get the intent property: Holds the alert intent stage(s) mapping for this alert. - * + * * @return the intent value. */ public KillChainIntent intent() { @@ -265,7 +272,7 @@ public KillChainIntent intent() { /** * Get the providerAlertId property: The identifier of the alert inside the product which generated the alert. - * + * * @return the providerAlertId value. */ public String providerAlertId() { @@ -274,7 +281,7 @@ public String providerAlertId() { /** * Get the processingEndTime property: The time the alert was made available for consumption. - * + * * @return the processingEndTime value. */ public OffsetDateTime processingEndTime() { @@ -283,7 +290,7 @@ public OffsetDateTime processingEndTime() { /** * Get the productComponentName property: The name of a component inside the product which generated the alert. - * + * * @return the productComponentName value. */ public String productComponentName() { @@ -292,7 +299,7 @@ public String productComponentName() { /** * Get the productName property: The name of the product which published this alert. - * + * * @return the productName value. */ public String productName() { @@ -301,7 +308,7 @@ public String productName() { /** * Get the productVersion property: The version of the product generating the alert. - * + * * @return the productVersion value. */ public String productVersion() { @@ -310,7 +317,7 @@ public String productVersion() { /** * Get the remediationSteps property: Manual action items to take to remediate the alert. - * + * * @return the remediationSteps value. */ public List remediationSteps() { @@ -319,7 +326,7 @@ public List remediationSteps() { /** * Get the severity property: The severity of the alert. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -328,7 +335,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity of the alert. - * + * * @param severity the severity value to set. * @return the SecurityAlertProperties object itself. */ @@ -340,7 +347,7 @@ public SecurityAlertProperties withSeverity(AlertSeverity severity) { /** * Get the startTimeUtc property: The impact start time of the alert (the time of the first event contributing to * the alert). - * + * * @return the startTimeUtc value. */ public OffsetDateTime startTimeUtc() { @@ -349,7 +356,7 @@ public OffsetDateTime startTimeUtc() { /** * Get the status property: The lifecycle status of the alert. - * + * * @return the status value. */ public AlertStatus status() { @@ -358,7 +365,7 @@ public AlertStatus status() { /** * Get the systemAlertId property: Holds the product identifier of the alert for the product. - * + * * @return the systemAlertId value. */ public String systemAlertId() { @@ -367,7 +374,7 @@ public String systemAlertId() { /** * Get the tactics property: The tactics of the alert. - * + * * @return the tactics value. */ public List tactics() { @@ -376,7 +383,7 @@ public List tactics() { /** * Get the timeGenerated property: The time the alert was generated. - * + * * @return the timeGenerated value. */ public OffsetDateTime timeGenerated() { @@ -385,7 +392,7 @@ public OffsetDateTime timeGenerated() { /** * Get the vendorName property: The name of the vendor that raise the alert. - * + * * @return the vendorName value. */ public String vendorName() { @@ -394,7 +401,7 @@ public String vendorName() { /** * Get the alertLink property: The uri link of the alert. - * + * * @return the alertLink value. */ public String alertLink() { @@ -403,7 +410,7 @@ public String alertLink() { /** * Get the resourceIdentifiers property: The list of resource identifiers of the alert. - * + * * @return the resourceIdentifiers value. */ public List resourceIdentifiers() { @@ -412,7 +419,7 @@ public List resourceIdentifiers() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 e6bf9c697c0a..9c754c915787 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; -/** SecurityGroup entity property bag. */ +/** + * SecurityGroup entity property bag. + */ @Immutable public final class SecurityGroupEntityProperties extends EntityCommonProperties { /* @@ -30,9 +32,15 @@ public final class SecurityGroupEntityProperties extends EntityCommonProperties @JsonProperty(value = "sid", access = JsonProperty.Access.WRITE_ONLY) private String sid; + /** + * Creates an instance of SecurityGroupEntityProperties class. + */ + public SecurityGroupEntityProperties() { + } + /** * Get the distinguishedName property: The group distinguished name. - * + * * @return the distinguishedName value. */ public String distinguishedName() { @@ -42,7 +50,7 @@ public String distinguishedName() { /** * Get the objectGuid property: A single-value attribute that is the unique identifier for the object, assigned by * active directory. - * + * * @return the objectGuid value. */ public UUID objectGuid() { @@ -52,7 +60,7 @@ public UUID objectGuid() { /** * Get the sid property: The SID attribute is a single-value attribute that specifies the security identifier (SID) * of the group. - * + * * @return the sid value. */ public String sid() { @@ -61,7 +69,7 @@ public String sid() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 8bf08cc6714d..648442dbd85b 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 @@ -7,21 +7,51 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.AnomalySecurityMLAnalyticsSettings; import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsKind; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Security ML Analytics Setting. */ +/** + * Security ML Analytics Setting. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = SecurityMLAnalyticsSettingInner.class) + defaultImpl = SecurityMLAnalyticsSettingInner.class, + visible = true) @JsonTypeName("SecurityMLAnalyticsSetting") -@JsonSubTypes({@JsonSubTypes.Type(name = "Anomaly", value = AnomalySecurityMLAnalyticsSettings.class)}) +@JsonSubTypes({ @JsonSubTypes.Type(name = "Anomaly", value = AnomalySecurityMLAnalyticsSettings.class) }) @Fluent public class SecurityMLAnalyticsSettingInner extends ResourceWithEtag { - /** {@inheritDoc} */ + /* + * The kind of security ML Analytics Settings + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private SecurityMLAnalyticsSettingsKind kind; + + /** + * Creates an instance of SecurityMLAnalyticsSettingInner class. + */ + public SecurityMLAnalyticsSettingInner() { + this.kind = SecurityMLAnalyticsSettingsKind.fromString("SecurityMLAnalyticsSetting"); + } + + /** + * Get the kind property: The kind of security ML Analytics Settings. + * + * @return the kind value. + */ + public SecurityMLAnalyticsSettingsKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ @Override public SecurityMLAnalyticsSettingInner withEtag(String etag) { super.withEtag(etag); @@ -30,7 +60,7 @@ public SecurityMLAnalyticsSettingInner withEtag(String etag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 e46fd29c170a..34c7e3cd4def 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import com.fasterxml.jackson.annotation.JsonProperty; -/** Sentinel onboarding state. */ +/** + * Sentinel onboarding state. + */ @Fluent public final class SentinelOnboardingStateInner extends ResourceWithEtag { /* @@ -17,16 +19,24 @@ public final class SentinelOnboardingStateInner extends ResourceWithEtag { @JsonProperty(value = "properties") private SentinelOnboardingStateProperties innerProperties; + /** + * Creates an instance of SentinelOnboardingStateInner class. + */ + public SentinelOnboardingStateInner() { + } + /** * Get the innerProperties property: The Sentinel onboarding state object. - * + * * @return the innerProperties value. */ private SentinelOnboardingStateProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SentinelOnboardingStateInner withEtag(String etag) { super.withEtag(etag); @@ -35,7 +45,7 @@ public SentinelOnboardingStateInner withEtag(String etag) { /** * Get the customerManagedKey property: Flag that indicates the status of the CMK setting. - * + * * @return the customerManagedKey value. */ public Boolean customerManagedKey() { @@ -44,7 +54,7 @@ public Boolean customerManagedKey() { /** * Set the customerManagedKey property: Flag that indicates the status of the CMK setting. - * + * * @param customerManagedKey the customerManagedKey value to set. * @return the SentinelOnboardingStateInner object itself. */ @@ -58,7 +68,7 @@ public SentinelOnboardingStateInner withCustomerManagedKey(Boolean customerManag /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 d1067a68a26d..2b44dcb41c3b 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Sentinel onboarding state properties. */ +/** + * The Sentinel onboarding state properties. + */ @Fluent public final class SentinelOnboardingStateProperties { /* @@ -16,9 +18,15 @@ public final class SentinelOnboardingStateProperties { @JsonProperty(value = "customerManagedKey") private Boolean customerManagedKey; + /** + * Creates an instance of SentinelOnboardingStateProperties class. + */ + public SentinelOnboardingStateProperties() { + } + /** * Get the customerManagedKey property: Flag that indicates the status of the CMK setting. - * + * * @return the customerManagedKey value. */ public Boolean customerManagedKey() { @@ -27,7 +35,7 @@ public Boolean customerManagedKey() { /** * Set the customerManagedKey property: Flag that indicates the status of the CMK setting. - * + * * @param customerManagedKey the customerManagedKey value to set. * @return the SentinelOnboardingStateProperties object itself. */ @@ -38,7 +46,7 @@ public SentinelOnboardingStateProperties withCustomerManagedKey(Boolean customer /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStatesListInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStatesListInner.java index 420eae2ca857..aa998b4548bc 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of the Sentinel onboarding states. */ +/** + * List of the Sentinel onboarding states. + */ @Fluent public final class SentinelOnboardingStatesListInner { /* @@ -18,9 +20,15 @@ public final class SentinelOnboardingStatesListInner { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of SentinelOnboardingStatesListInner class. + */ + public SentinelOnboardingStatesListInner() { + } + /** * Get the value property: Array of Sentinel onboarding states. - * + * * @return the value value. */ public List value() { @@ -29,7 +37,7 @@ public List value() { /** * Set the value property: Array of Sentinel onboarding states. - * + * * @param value the value value to set. * @return the SentinelOnboardingStatesListInner object itself. */ @@ -40,15 +48,14 @@ public SentinelOnboardingStatesListInner withValue(List e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingListInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingListInner.java index bc77b021a5b5..56fd107fc34d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingListInner.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingListInner.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the settings. */ +/** + * List of all the settings. + */ @Fluent public final class SettingListInner { /* @@ -18,9 +20,15 @@ public final class SettingListInner { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of SettingListInner class. + */ + public SettingListInner() { + } + /** * Get the value property: Array of settings. - * + * * @return the value value. */ public List value() { @@ -29,7 +37,7 @@ public List value() { /** * Set the value property: Array of settings. - * + * * @param value the value value to set. * @return the SettingListInner object itself. */ @@ -40,14 +48,13 @@ public SettingListInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SettingListInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SettingListInner")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingsInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingsInner.java index fe11570beafc..7399611e6228 100644 --- 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 @@ -9,27 +9,52 @@ import com.azure.resourcemanager.securityinsights.models.EntityAnalytics; import com.azure.resourcemanager.securityinsights.models.EyesOn; import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.SettingKind; import com.azure.resourcemanager.securityinsights.models.Ueba; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Setting. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = SettingsInner.class) +/** + * The Setting. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = SettingsInner.class, visible = true) @JsonTypeName("Settings") @JsonSubTypes({ @JsonSubTypes.Type(name = "Anomalies", value = Anomalies.class), @JsonSubTypes.Type(name = "EyesOn", value = EyesOn.class), @JsonSubTypes.Type(name = "EntityAnalytics", value = EntityAnalytics.class), - @JsonSubTypes.Type(name = "Ueba", value = Ueba.class) -}) + @JsonSubTypes.Type(name = "Ueba", value = Ueba.class) }) @Fluent public class SettingsInner extends ResourceWithEtag { - /** {@inheritDoc} */ + /* + * The kind of the setting + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private SettingKind kind; + + /** + * Creates an instance of SettingsInner class. + */ + public SettingsInner() { + this.kind = SettingKind.fromString("Settings"); + } + + /** + * Get the kind property: The kind of the setting. + * + * @return the kind value. + */ + public SettingKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ @Override public SettingsInner withEtag(String etag) { super.withEtag(etag); @@ -38,7 +63,7 @@ public SettingsInner withEtag(String etag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 3d9c0096e645..404cf7c67a23 100644 --- 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 @@ -5,35 +5,48 @@ package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.securityinsights.models.ContentType; import com.azure.resourcemanager.securityinsights.models.DeploymentInfo; -import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.PullRequest; import com.azure.resourcemanager.securityinsights.models.Repository; import com.azure.resourcemanager.securityinsights.models.RepositoryResourceInfo; +import com.azure.resourcemanager.securityinsights.models.RepoType; import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.ServicePrincipal; import com.azure.resourcemanager.securityinsights.models.Version; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents a SourceControl in Azure Security Insights. */ +/** + * Represents a SourceControl in Azure Security Insights. + */ @Fluent public final class SourceControlInner extends ResourceWithEtag { /* * source control properties */ - @JsonProperty(value = "properties") - private SourceControlProperties innerProperties; + @JsonProperty(value = "properties", required = true) + private SourceControlProperties innerProperties = new SourceControlProperties(); + + /** + * 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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SourceControlInner withEtag(String etag) { super.withEtag(etag); @@ -42,53 +55,25 @@ public SourceControlInner withEtag(String etag) { /** * Get the id property: The id (a Guid) of the source control. - * + * * @return the id value. */ public String idPropertiesId() { return this.innerProperties() == null ? null : this.innerProperties().id(); } - /** - * Set the id property: The id (a Guid) of the source control. - * - * @param id the id value to set. - * @return the SourceControlInner object itself. - */ - public SourceControlInner withIdPropertiesId(String id) { - if (this.innerProperties() == null) { - this.innerProperties = new SourceControlProperties(); - } - this.innerProperties().withId(id); - return this; - } - /** * Get the 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(); } - /** - * Set the version property: The version number associated with the source control. - * - * @param version the version value to set. - * @return the SourceControlInner object itself. - */ - public SourceControlInner withVersion(Version version) { - if (this.innerProperties() == null) { - this.innerProperties = new SourceControlProperties(); - } - this.innerProperties().withVersion(version); - return this; - } - /** * Get the displayName property: The display name of the source control. - * + * * @return the displayName value. */ public String displayName() { @@ -97,7 +82,7 @@ public String displayName() { /** * Set the displayName property: The display name of the source control. - * + * * @param displayName the displayName value to set. * @return the SourceControlInner object itself. */ @@ -111,7 +96,7 @@ public SourceControlInner withDisplayName(String displayName) { /** * Get the description property: A description of the source control. - * + * * @return the description value. */ public String description() { @@ -120,7 +105,7 @@ public String description() { /** * Set the description property: A description of the source control. - * + * * @param description the description value to set. * @return the SourceControlInner object itself. */ @@ -134,7 +119,7 @@ public SourceControlInner withDescription(String description) { /** * Get the repoType property: The repository type of the source control. - * + * * @return the repoType value. */ public RepoType repoType() { @@ -143,7 +128,7 @@ public RepoType repoType() { /** * Set the repoType property: The repository type of the source control. - * + * * @param repoType the repoType value to set. * @return the SourceControlInner object itself. */ @@ -157,7 +142,7 @@ public SourceControlInner withRepoType(RepoType repoType) { /** * Get the contentTypes property: Array of source control content types. - * + * * @return the contentTypes value. */ public List contentTypes() { @@ -166,7 +151,7 @@ public List contentTypes() { /** * Set the contentTypes property: Array of source control content types. - * + * * @param contentTypes the contentTypes value to set. * @return the SourceControlInner object itself. */ @@ -180,7 +165,7 @@ public SourceControlInner withContentTypes(List contentTypes) { /** * Get the repository property: Repository metadata. - * + * * @return the repository value. */ public Repository repository() { @@ -189,7 +174,7 @@ public Repository repository() { /** * Set the repository property: Repository metadata. - * + * * @param repository the repository value to set. * @return the SourceControlInner object itself. */ @@ -201,9 +186,57 @@ public SourceControlInner withRepository(Repository 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 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() { @@ -212,7 +245,7 @@ public RepositoryResourceInfo 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. */ @@ -226,7 +259,7 @@ public SourceControlInner withRepositoryResourceInfo(RepositoryResourceInfo repo /** * Get the lastDeploymentInfo property: Information regarding the latest deployment for the source control. - * + * * @return the lastDeploymentInfo value. */ public DeploymentInfo lastDeploymentInfo() { @@ -234,29 +267,30 @@ public DeploymentInfo lastDeploymentInfo() { } /** - * Set the lastDeploymentInfo property: Information regarding the latest deployment for the source control. - * - * @param lastDeploymentInfo the lastDeploymentInfo value to set. - * @return the SourceControlInner object itself. + * Get the pullRequest property: Information regarding the pull request of the source control. + * + * @return the pullRequest value. */ - public SourceControlInner withLastDeploymentInfo(DeploymentInfo lastDeploymentInfo) { - if (this.innerProperties() == null) { - this.innerProperties = new SourceControlProperties(); - } - this.innerProperties().withLastDeploymentInfo(lastDeploymentInfo); - return this; + public PullRequest pullRequest() { + return this.innerProperties() == null ? null : this.innerProperties().pullRequest(); } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); - if (innerProperties() != null) { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model SourceControlInner")); + } else { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(SourceControlInner.class); } 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 index c7b2417c0cdc..19156d8d1cd1 100644 --- 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 @@ -8,26 +8,30 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.securityinsights.models.ContentType; import com.azure.resourcemanager.securityinsights.models.DeploymentInfo; -import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.PullRequest; import com.azure.resourcemanager.securityinsights.models.Repository; import com.azure.resourcemanager.securityinsights.models.RepositoryResourceInfo; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.ServicePrincipal; import com.azure.resourcemanager.securityinsights.models.Version; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes source control properties. */ +/** + * Describes source control properties. + */ @Fluent public final class SourceControlProperties { /* * The id (a Guid) of the source control */ - @JsonProperty(value = "id") + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The version number associated with the source control */ - @JsonProperty(value = "version") + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private Version version; /* @@ -60,6 +64,18 @@ public final class SourceControlProperties { @JsonProperty(value = "repository", required = true) private Repository repository; + /* + * Service principal metadata. + */ + @JsonProperty(value = "servicePrincipal") + private ServicePrincipal servicePrincipal; + + /* + * Repository access credentials. This is write-only object and it never returns back to a user. + */ + @JsonProperty(value = "repositoryAccess") + private RepositoryAccess repositoryAccess; + /* * Information regarding the resources created in user's repository. */ @@ -69,52 +85,42 @@ public final class SourceControlProperties { /* * Information regarding the latest deployment for the source control. */ - @JsonProperty(value = "lastDeploymentInfo") + @JsonProperty(value = "lastDeploymentInfo", access = JsonProperty.Access.WRITE_ONLY) private DeploymentInfo lastDeploymentInfo; + /* + * Information regarding the pull request of the source control. + */ + @JsonProperty(value = "pullRequest", access = JsonProperty.Access.WRITE_ONLY) + private PullRequest pullRequest; + /** - * Get the id property: The id (a Guid) of the source control. - * - * @return the id value. + * Creates an instance of SourceControlProperties class. */ - public String id() { - return this.id; + public SourceControlProperties() { } /** - * Set the id property: The id (a Guid) of the source control. - * - * @param id the id value to set. - * @return the SourceControlProperties object itself. + * Get the id property: The id (a Guid) of the source control. + * + * @return the id value. */ - public SourceControlProperties withId(String id) { - this.id = id; - return this; + 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; } - /** - * Set the version property: The version number associated with the source control. - * - * @param version the version value to set. - * @return the SourceControlProperties object itself. - */ - public SourceControlProperties withVersion(Version version) { - this.version = version; - return this; - } - /** * Get the displayName property: The display name of the source control. - * + * * @return the displayName value. */ public String displayName() { @@ -123,7 +129,7 @@ public String displayName() { /** * Set the displayName property: The display name of the source control. - * + * * @param displayName the displayName value to set. * @return the SourceControlProperties object itself. */ @@ -134,7 +140,7 @@ public SourceControlProperties withDisplayName(String displayName) { /** * Get the description property: A description of the source control. - * + * * @return the description value. */ public String description() { @@ -143,7 +149,7 @@ public String description() { /** * Set the description property: A description of the source control. - * + * * @param description the description value to set. * @return the SourceControlProperties object itself. */ @@ -154,7 +160,7 @@ public SourceControlProperties withDescription(String description) { /** * Get the repoType property: The repository type of the source control. - * + * * @return the repoType value. */ public RepoType repoType() { @@ -163,7 +169,7 @@ public RepoType repoType() { /** * Set the repoType property: The repository type of the source control. - * + * * @param repoType the repoType value to set. * @return the SourceControlProperties object itself. */ @@ -174,7 +180,7 @@ public SourceControlProperties withRepoType(RepoType repoType) { /** * Get the contentTypes property: Array of source control content types. - * + * * @return the contentTypes value. */ public List contentTypes() { @@ -183,7 +189,7 @@ public List contentTypes() { /** * Set the contentTypes property: Array of source control content types. - * + * * @param contentTypes the contentTypes value to set. * @return the SourceControlProperties object itself. */ @@ -194,7 +200,7 @@ public SourceControlProperties withContentTypes(List contentTypes) /** * Get the repository property: Repository metadata. - * + * * @return the repository value. */ public Repository repository() { @@ -203,7 +209,7 @@ public Repository repository() { /** * Set the repository property: Repository metadata. - * + * * @param repository the repository value to set. * @return the SourceControlProperties object itself. */ @@ -212,9 +218,51 @@ public SourceControlProperties withRepository(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 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() { @@ -223,7 +271,7 @@ public RepositoryResourceInfo 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. */ @@ -234,7 +282,7 @@ public SourceControlProperties withRepositoryResourceInfo(RepositoryResourceInfo /** * Get the lastDeploymentInfo property: Information regarding the latest deployment for the source control. - * + * * @return the lastDeploymentInfo value. */ public DeploymentInfo lastDeploymentInfo() { @@ -242,54 +290,57 @@ public DeploymentInfo lastDeploymentInfo() { } /** - * Set the lastDeploymentInfo property: Information regarding the latest deployment for the source control. - * - * @param lastDeploymentInfo the lastDeploymentInfo value to set. - * @return the SourceControlProperties object itself. + * Get the pullRequest property: Information regarding the pull request of the source control. + * + * @return the pullRequest value. */ - public SourceControlProperties withLastDeploymentInfo(DeploymentInfo lastDeploymentInfo) { - this.lastDeploymentInfo = lastDeploymentInfo; - return this; + public PullRequest pullRequest() { + return this.pullRequest; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model SourceControlProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property displayName in model SourceControlProperties")); } if (repoType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property repoType in model SourceControlProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property repoType in model SourceControlProperties")); } if (contentTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property contentTypes in model SourceControlProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property contentTypes in model SourceControlProperties")); } if (repository() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property repository in model SourceControlProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property repository in model SourceControlProperties")); } else { repository().validate(); } + if (servicePrincipal() != null) { + servicePrincipal().validate(); + } + if (repositoryAccess() != null) { + repositoryAccess().validate(); + } if (repositoryResourceInfo() != null) { repositoryResourceInfo().validate(); } if (lastDeploymentInfo() != null) { lastDeploymentInfo().validate(); } + if (pullRequest() != null) { + pullRequest().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SourceControlProperties.class); 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 b676b6b71061..df8e06c41686 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 @@ -10,7 +10,9 @@ import java.time.OffsetDateTime; import java.util.UUID; -/** Submission mail entity property bag. */ +/** + * Submission mail entity property bag. + */ @Immutable public final class SubmissionMailEntityProperties extends EntityCommonProperties { /* @@ -73,9 +75,15 @@ public final class SubmissionMailEntityProperties extends EntityCommonProperties @JsonProperty(value = "reportType", access = JsonProperty.Access.WRITE_ONLY) private String reportType; + /** + * Creates an instance of SubmissionMailEntityProperties class. + */ + public SubmissionMailEntityProperties() { + } + /** * Get the networkMessageId property: The network message id of email to which submission belongs. - * + * * @return the networkMessageId value. */ public UUID networkMessageId() { @@ -84,7 +92,7 @@ public UUID networkMessageId() { /** * Get the submissionId property: The submission id. - * + * * @return the submissionId value. */ public UUID submissionId() { @@ -93,7 +101,7 @@ public UUID submissionId() { /** * Get the submitter property: The submitter. - * + * * @return the submitter value. */ public String submitter() { @@ -102,7 +110,7 @@ public String submitter() { /** * Get the submissionDate property: The submission date. - * + * * @return the submissionDate value. */ public OffsetDateTime submissionDate() { @@ -111,7 +119,7 @@ public OffsetDateTime submissionDate() { /** * Get the timestamp property: The Time stamp when the message is received (Mail). - * + * * @return the timestamp value. */ public OffsetDateTime timestamp() { @@ -120,7 +128,7 @@ public OffsetDateTime timestamp() { /** * Get the recipient property: The recipient of the mail. - * + * * @return the recipient value. */ public String recipient() { @@ -129,7 +137,7 @@ public String recipient() { /** * Get the sender property: The sender of the mail. - * + * * @return the sender value. */ public String sender() { @@ -138,7 +146,7 @@ public String sender() { /** * Get the senderIp property: The sender's IP. - * + * * @return the senderIp value. */ public String senderIp() { @@ -147,7 +155,7 @@ public String senderIp() { /** * Get the subject property: The subject of submission mail. - * + * * @return the subject value. */ public String subject() { @@ -157,7 +165,7 @@ public String subject() { /** * Get the reportType property: The submission type for the given instance. This maps to Junk, Phish, Malware or * NotJunk. - * + * * @return the reportType value. */ public String reportType() { @@ -166,7 +174,7 @@ public String reportType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SystemProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SystemProperties.java new file mode 100644 index 000000000000..7d4bff36b23a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SystemProperties.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.SystemsConfiguration; +import com.azure.resourcemanager.securityinsights.models.SystemStatusType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * The properties of the system. + */ +@Fluent +public final class SystemProperties { + /* + * The status of the system. + */ + @JsonProperty(value = "status") + private SystemStatusType status; + + /* + * The configuration of the system. + */ + @JsonProperty(value = "configuration", required = true) + private SystemsConfiguration configuration; + + /* + * The displayName property. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * The lastModifiedTimeUtc property. + */ + @JsonProperty(value = "lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTimeUtc; + + /** + * Creates an instance of SystemProperties class. + */ + public SystemProperties() { + } + + /** + * Get the status property: The status of the system. + * + * @return the status value. + */ + public SystemStatusType status() { + return this.status; + } + + /** + * Set the status property: The status of the system. + * + * @param status the status value to set. + * @return the SystemProperties object itself. + */ + public SystemProperties withStatus(SystemStatusType status) { + this.status = status; + return this; + } + + /** + * Get the configuration property: The configuration of the system. + * + * @return the configuration value. + */ + public SystemsConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: The configuration of the system. + * + * @param configuration the configuration value to set. + * @return the SystemProperties object itself. + */ + public SystemProperties withConfiguration(SystemsConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the displayName property: The displayName property. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The displayName property. + * + * @param displayName the displayName value to set. + * @return the SystemProperties object itself. + */ + public SystemProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the lastModifiedTimeUtc property: The lastModifiedTimeUtc property. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property configuration in model SystemProperties")); + } else { + configuration().validate(); + } + if (displayName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property displayName in model SystemProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SystemProperties.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SystemResourceInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SystemResourceInner.java new file mode 100644 index 000000000000..de8544d720c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SystemResourceInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.SystemsConfiguration; +import com.azure.resourcemanager.securityinsights.models.SystemStatusType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Describes the system within the agent. + */ +@Fluent +public final class SystemResourceInner extends ResourceWithEtag { + /* + * The properties of the system. + */ + @JsonProperty(value = "properties", required = true) + private SystemProperties innerProperties = new SystemProperties(); + + /** + * Creates an instance of SystemResourceInner class. + */ + public SystemResourceInner() { + } + + /** + * Get the innerProperties property: The properties of the system. + * + * @return the innerProperties value. + */ + private SystemProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public SystemResourceInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the status property: The status of the system. + * + * @return the status value. + */ + public SystemStatusType status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the system. + * + * @param status the status value to set. + * @return the SystemResourceInner object itself. + */ + public SystemResourceInner withStatus(SystemStatusType status) { + if (this.innerProperties() == null) { + this.innerProperties = new SystemProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the configuration property: The configuration of the system. + * + * @return the configuration value. + */ + public SystemsConfiguration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Set the configuration property: The configuration of the system. + * + * @param configuration the configuration value to set. + * @return the SystemResourceInner object itself. + */ + public SystemResourceInner withConfiguration(SystemsConfiguration configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new SystemProperties(); + } + this.innerProperties().withConfiguration(configuration); + return this; + } + + /** + * Get the displayName property: The displayName property. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The displayName property. + * + * @param displayName the displayName value to set. + * @return the SystemResourceInner object itself. + */ + public SystemResourceInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new SystemProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the lastModifiedTimeUtc property: The lastModifiedTimeUtc property. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model SystemResourceInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SystemResourceInner.class); +} 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 index defd84d01805..ce09ca0c3c68 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** Threat Intelligence Platforms data connector required properties. */ +/** + * Threat Intelligence Platforms data connector required properties. + */ @Fluent public final class TICheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of TICheckRequirementsProperties class. + */ + public TICheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public TICheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public TICheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 62d09af2a1b6..813a4413e443 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 @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** TI (Threat Intelligence) data connector properties. */ +/** + * TI (Threat Intelligence) data connector properties. + */ @Fluent public final class TIDataConnectorProperties extends DataConnectorTenantId { /* @@ -26,9 +28,15 @@ public final class TIDataConnectorProperties extends DataConnectorTenantId { @JsonProperty(value = "dataTypes", required = true) private TIDataConnectorDataTypes dataTypes; + /** + * Creates an instance of TIDataConnectorProperties class. + */ + public TIDataConnectorProperties() { + } + /** * Get the tipLookbackPeriod property: The lookback period for the feed to be imported. - * + * * @return the tipLookbackPeriod value. */ public OffsetDateTime tipLookbackPeriod() { @@ -37,7 +45,7 @@ public OffsetDateTime tipLookbackPeriod() { /** * Set the tipLookbackPeriod property: The lookback period for the feed to be imported. - * + * * @param tipLookbackPeriod the tipLookbackPeriod value to set. * @return the TIDataConnectorProperties object itself. */ @@ -48,7 +56,7 @@ public TIDataConnectorProperties withTipLookbackPeriod(OffsetDateTime tipLookbac /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public TIDataConnectorDataTypes dataTypes() { @@ -57,7 +65,7 @@ public TIDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the TIDataConnectorProperties object itself. */ @@ -66,7 +74,9 @@ public TIDataConnectorProperties withDataTypes(TIDataConnectorDataTypes dataType return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TIDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -75,17 +85,16 @@ public TIDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model TIDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model TIDataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..6d9711c9775d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectCommonProperties.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.securityinsights.models.RelationshipHint; +import com.azure.resourcemanager.securityinsights.models.UserInfoAutoGenerated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * Describes properties common to all threat intelligence objects. + */ +@Immutable +public final class TIObjectCommonProperties { + /* + * The core STIX object that this TI object represents. + */ + @JsonProperty(value = "data", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map data; + + /* + * The UserInfo of the user/entity which originally created this TI object. + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private UserInfoAutoGenerated createdBy; + + /* + * The source name for this TI object. + */ + @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) + private String source; + + /* + * The timestamp for the first time this object was ingested. + */ + @JsonProperty(value = "firstIngestedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime firstIngestedTimeUtc; + + /* + * The timestamp for the last time this object was ingested. + */ + @JsonProperty(value = "lastIngestedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastIngestedTimeUtc; + + /* + * The ID of the rules version that was active when this TI object was last ingested. + */ + @JsonProperty(value = "ingestionRulesVersion", access = JsonProperty.Access.WRITE_ONLY) + private UUID ingestionRulesVersion; + + /* + * The name of the method/application that initiated the last write to this TI object. + */ + @JsonProperty(value = "lastUpdateMethod", access = JsonProperty.Access.WRITE_ONLY) + private String lastUpdateMethod; + + /* + * The UserInfo of the user/entity which last modified this TI object. + */ + @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private UserInfoAutoGenerated lastModifiedBy; + + /* + * The timestamp for the last time this TI object was updated. + */ + @JsonProperty(value = "lastUpdatedDateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "relationshipHints", access = JsonProperty.Access.WRITE_ONLY) + private List relationshipHints; + + /** + * Creates an instance of TIObjectCommonProperties class. + */ + public 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 UserInfoAutoGenerated 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 UUID 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 UserInfoAutoGenerated 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createdBy() != null) { + createdBy().validate(); + } + if (lastModifiedBy() != null) { + lastModifiedBy().validate(); + } + if (relationshipHints() != null) { + relationshipHints().forEach(e -> e.validate()); + } + } +} 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..a6eefdbe5175 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectInner.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +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.ThreatActor; +import com.azure.resourcemanager.securityinsights.models.TIObjectKind; +import com.azure.resourcemanager.securityinsights.models.UserInfoAutoGenerated; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * Represents a threat intelligence object in Azure Security Insights. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = TIObjectInner.class, visible = true) +@JsonTypeName("TIObject") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ThreatActor", value = ThreatActor.class), + @JsonSubTypes.Type(name = "AttackPattern", value = AttackPattern.class), + @JsonSubTypes.Type(name = "Identity", value = Identity.class), + @JsonSubTypes.Type(name = "Relationship", value = Relationship.class), + @JsonSubTypes.Type(name = "Indicator", value = Indicator.class) }) +@Immutable +public class TIObjectInner extends ProxyResource { + /* + * The kind of the TI object + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private TIObjectKind kind; + + /* + * The properties of the TI object + */ + @JsonProperty(value = "properties") + private TIObjectCommonProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of TIObjectInner class. + */ + public TIObjectInner() { + this.kind = TIObjectKind.fromString("TIObject"); + } + + /** + * 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; + } + + /** + * 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 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 UserInfoAutoGenerated 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 UUID 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 UserInfoAutoGenerated 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TeamInformationInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TeamInformationInner.java index 9054e9c2939e..1d0d3b16795b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TeamInformationInner.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TeamInformationInner.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Describes team information. */ +/** + * Describes team information. + */ @Immutable public final class TeamInformationInner { /* @@ -41,9 +43,15 @@ public final class TeamInformationInner { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** + * Creates an instance of TeamInformationInner class. + */ + public TeamInformationInner() { + } + /** * Get the teamId property: Team ID. - * + * * @return the teamId value. */ public String teamId() { @@ -52,7 +60,7 @@ public String teamId() { /** * Get the primaryChannelUrl property: The primary channel URL of the team. - * + * * @return the primaryChannelUrl value. */ public String primaryChannelUrl() { @@ -61,7 +69,7 @@ public String primaryChannelUrl() { /** * Get the teamCreationTimeUtc property: The time the team was created. - * + * * @return the teamCreationTimeUtc value. */ public OffsetDateTime teamCreationTimeUtc() { @@ -70,7 +78,7 @@ public OffsetDateTime teamCreationTimeUtc() { /** * Get the name property: The name of the team. - * + * * @return the name value. */ public String name() { @@ -79,7 +87,7 @@ public String name() { /** * Get the description property: The description of the team. - * + * * @return the description value. */ public String description() { @@ -88,7 +96,7 @@ public String description() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..5e5b036c62bf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateModelInner.java @@ -0,0 +1,685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** + * Template resource definition. + */ +@Fluent +public final class TemplateModelInner extends ResourceWithEtag { + /* + * template properties + */ + @JsonProperty(value = "properties") + private TemplateProperties innerProperties; + + /** + * Creates an instance of TemplateModelInner class. + */ + public TemplateModelInner() { + } + + /** + * Get the innerProperties property: template properties. + * + * @return the innerProperties value. + */ + private TemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateModelInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..5bea45bfb8ea --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateProperties.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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.TemplateBaseProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** + * Template property bag. + */ +@Fluent +public final class TemplateProperties extends TemplateBaseProperties { + /* + * The JSON of the ARM template to deploy active content. Expandable. + */ + @JsonProperty(value = "mainTemplate") + private Object mainTemplate; + + /* + * Dependant templates. Expandable. + */ + @JsonProperty(value = "dependantTemplates", access = JsonProperty.Access.WRITE_ONLY) + private List dependantTemplates; + + /** + * Creates an instance of TemplateProperties class. + */ + public TemplateProperties() { + } + + /** + * 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 TemplateProperties withContentId(String contentId) { + super.withContentId(contentId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withContentProductId(String contentProductId) { + super.withContentProductId(contentProductId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withPackageVersion(String packageVersion) { + super.withPackageVersion(packageVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withContentKind(Kind contentKind) { + super.withContentKind(contentKind); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withSource(MetadataSource source) { + super.withSource(source); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withAuthor(MetadataAuthor author) { + super.withAuthor(author); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withSupport(MetadataSupport support) { + super.withSupport(support); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withDependencies(MetadataDependencies dependencies) { + super.withDependencies(dependencies); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withCategories(MetadataCategories categories) { + super.withCategories(categories); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withProviders(List providers) { + super.withProviders(providers); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withFirstPublishDate(LocalDate firstPublishDate) { + super.withFirstPublishDate(firstPublishDate); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withLastPublishDate(LocalDate lastPublishDate) { + super.withLastPublishDate(lastPublishDate); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withCustomVersion(String customVersion) { + super.withCustomVersion(customVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withContentSchemaVersion(String contentSchemaVersion) { + super.withContentSchemaVersion(contentSchemaVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withIcon(String icon) { + super.withIcon(icon); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withThreatAnalysisTactics(List threatAnalysisTactics) { + super.withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withThreatAnalysisTechniques(List threatAnalysisTechniques) { + super.withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withPreviewImages(List previewImages) { + super.withPreviewImages(previewImages); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withPreviewImagesDark(List previewImagesDark) { + super.withPreviewImagesDark(previewImagesDark); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withPackageId(String packageId) { + super.withPackageId(packageId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withPackageKind(PackageKind packageKind) { + super.withPackageKind(packageKind); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public TemplateProperties withPackageName(String packageName) { + super.withPackageName(packageName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dependantTemplates() != null) { + dependantTemplates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleProperties.java index 3118a288a38b..fd9cbdc24cca 100644 --- 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 @@ -12,7 +12,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Threat Intelligence alert rule base property bag. */ +/** + * Threat Intelligence alert rule base property bag. + */ @Fluent public final class ThreatIntelligenceAlertRuleProperties { /* @@ -63,9 +65,21 @@ public final class ThreatIntelligenceAlertRuleProperties { @JsonProperty(value = "techniques", access = JsonProperty.Access.WRITE_ONLY) private List techniques; + /* + * The sub-techniques of the alert rule + */ + @JsonProperty(value = "subTechniques", access = JsonProperty.Access.WRITE_ONLY) + 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() { @@ -74,7 +88,7 @@ public String 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. */ @@ -85,7 +99,7 @@ public ThreatIntelligenceAlertRuleProperties withAlertRuleTemplateName(String al /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -94,7 +108,7 @@ public String description() { /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -103,7 +117,7 @@ public String displayName() { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public boolean enabled() { @@ -112,7 +126,7 @@ public boolean 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. */ @@ -123,7 +137,7 @@ public ThreatIntelligenceAlertRuleProperties withEnabled(boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this alert has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -132,7 +146,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -141,7 +155,7 @@ public AlertSeverity severity() { /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -150,25 +164,32 @@ public List 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (alertRuleTemplateName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alertRuleTemplateName in model" - + " ThreatIntelligenceAlertRuleProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property alertRuleTemplateName in model ThreatIntelligenceAlertRuleProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleTemplateProperties.java index 2cabad3ea765..60ba7ab37beb 100644 --- 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 @@ -14,7 +14,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Threat Intelligence alert rule template properties. */ +/** + * Threat Intelligence alert rule template properties. + */ @Fluent public final class ThreatIntelligenceAlertRuleTemplateProperties extends AlertRuleTemplateWithMitreProperties { /* @@ -23,9 +25,15 @@ public final class ThreatIntelligenceAlertRuleTemplateProperties extends AlertRu @JsonProperty(value = "severity", required = true) private AlertSeverity severity; + /** + * Creates an instance of ThreatIntelligenceAlertRuleTemplateProperties class. + */ + public ThreatIntelligenceAlertRuleTemplateProperties() { + } + /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -34,7 +42,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity for alerts created by this alert rule. - * + * * @param severity the severity value to set. * @return the ThreatIntelligenceAlertRuleTemplateProperties object itself. */ @@ -43,51 +51,65 @@ public ThreatIntelligenceAlertRuleTemplateProperties withSeverity(AlertSeverity return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ThreatIntelligenceAlertRuleTemplateProperties withTactics(List tactics) { super.withTactics(tactics); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ThreatIntelligenceAlertRuleTemplateProperties withTechniques(List techniques) { super.withTechniques(techniques); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public ThreatIntelligenceAlertRuleTemplateProperties withAlertRulesCreatedByTemplateCount( - Integer alertRulesCreatedByTemplateCount) { + public ThreatIntelligenceAlertRuleTemplateProperties + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ThreatIntelligenceAlertRuleTemplateProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ThreatIntelligenceAlertRuleTemplateProperties withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public ThreatIntelligenceAlertRuleTemplateProperties withRequiredDataConnectors( - List requiredDataConnectors) { + public ThreatIntelligenceAlertRuleTemplateProperties + withRequiredDataConnectors(List requiredDataConnectors) { super.withRequiredDataConnectors(requiredDataConnectors); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ThreatIntelligenceAlertRuleTemplateProperties withStatus(TemplateStatus status) { super.withStatus(status); @@ -96,17 +118,16 @@ public ThreatIntelligenceAlertRuleTemplateProperties withStatus(TemplateStatus s /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (severity() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property severity in model ThreatIntelligenceAlertRuleTemplateProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property severity in model ThreatIntelligenceAlertRuleTemplateProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..ac8cc04904c8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceCountInner.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Count of all the threat intelligence objects on the workspace that match the provided query. + */ +@Immutable +public final class ThreatIntelligenceCountInner { + /* + * Count of all the threat intelligence objects on the workspace that match the provided query. + */ + @JsonProperty(value = "count", required = true, access = JsonProperty.Access.WRITE_ONLY) + private int count; + + /** + * Creates an instance of ThreatIntelligenceCountInner class. + */ + public 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceIndicatorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceIndicatorProperties.java index 94e3ad449679..c3b23d495a89 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 @@ -15,7 +15,9 @@ import java.util.List; import java.util.Map; -/** Describes threat intelligence entity properties. */ +/** + * Describes threat intelligence entity properties. + */ @Fluent public final class ThreatIntelligenceIndicatorProperties extends EntityCommonProperties { /* @@ -187,9 +189,15 @@ public final class ThreatIntelligenceIndicatorProperties extends EntityCommonPro @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map extensions; + /** + * Creates an instance of ThreatIntelligenceIndicatorProperties class. + */ + public ThreatIntelligenceIndicatorProperties() { + } + /** * Get the threatIntelligenceTags property: List of tags. - * + * * @return the threatIntelligenceTags value. */ public List threatIntelligenceTags() { @@ -198,7 +206,7 @@ public List threatIntelligenceTags() { /** * Set the threatIntelligenceTags property: List of tags. - * + * * @param threatIntelligenceTags the threatIntelligenceTags value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -209,7 +217,7 @@ public ThreatIntelligenceIndicatorProperties withThreatIntelligenceTags(List indicatorTypes() { @@ -298,7 +306,7 @@ public List indicatorTypes() { /** * Set the indicatorTypes property: Indicator types of threat intelligence entities. - * + * * @param indicatorTypes the indicatorTypes value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -309,7 +317,7 @@ public ThreatIntelligenceIndicatorProperties withIndicatorTypes(List ind /** * Get the pattern property: Pattern of a threat intelligence entity. - * + * * @return the pattern value. */ public String pattern() { @@ -318,7 +326,7 @@ public String pattern() { /** * Set the pattern property: Pattern of a threat intelligence entity. - * + * * @param pattern the pattern value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -329,7 +337,7 @@ public ThreatIntelligenceIndicatorProperties withPattern(String pattern) { /** * Get the patternType property: Pattern type of a threat intelligence entity. - * + * * @return the patternType value. */ public String patternType() { @@ -338,7 +346,7 @@ public String patternType() { /** * Set the patternType property: Pattern type of a threat intelligence entity. - * + * * @param patternType the patternType value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -349,7 +357,7 @@ public ThreatIntelligenceIndicatorProperties withPatternType(String patternType) /** * Get the patternVersion property: Pattern version of a threat intelligence entity. - * + * * @return the patternVersion value. */ public String patternVersion() { @@ -358,7 +366,7 @@ public String patternVersion() { /** * Set the patternVersion property: Pattern version of a threat intelligence entity. - * + * * @param patternVersion the patternVersion value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -369,7 +377,7 @@ public ThreatIntelligenceIndicatorProperties withPatternVersion(String patternVe /** * Get the killChainPhases property: Kill chain phases. - * + * * @return the killChainPhases value. */ public List killChainPhases() { @@ -378,19 +386,19 @@ public List killChainPhases() { /** * Set the killChainPhases property: Kill chain phases. - * + * * @param killChainPhases the killChainPhases value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ - public ThreatIntelligenceIndicatorProperties withKillChainPhases( - List killChainPhases) { + public ThreatIntelligenceIndicatorProperties + withKillChainPhases(List killChainPhases) { this.killChainPhases = killChainPhases; return this; } /** * Get the parsedPattern property: Parsed patterns. - * + * * @return the parsedPattern value. */ public List parsedPattern() { @@ -399,19 +407,19 @@ public List parsedPattern() { /** * Set the parsedPattern property: Parsed patterns. - * + * * @param parsedPattern the parsedPattern value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ - public ThreatIntelligenceIndicatorProperties withParsedPattern( - List parsedPattern) { + public ThreatIntelligenceIndicatorProperties + withParsedPattern(List parsedPattern) { this.parsedPattern = parsedPattern; return this; } /** * Get the externalId property: External ID of threat intelligence entity. - * + * * @return the externalId value. */ public String externalId() { @@ -420,7 +428,7 @@ public String externalId() { /** * Set the externalId property: External ID of threat intelligence entity. - * + * * @param externalId the externalId value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -431,7 +439,7 @@ public ThreatIntelligenceIndicatorProperties withExternalId(String externalId) { /** * Get the createdByRef property: Created by reference of threat intelligence entity. - * + * * @return the createdByRef value. */ public String createdByRef() { @@ -440,7 +448,7 @@ public String createdByRef() { /** * Set the createdByRef property: Created by reference of threat intelligence entity. - * + * * @param createdByRef the createdByRef value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -451,7 +459,7 @@ public ThreatIntelligenceIndicatorProperties withCreatedByRef(String createdByRe /** * Get the defanged property: Is threat intelligence entity defanged. - * + * * @return the defanged value. */ public Boolean defanged() { @@ -460,7 +468,7 @@ public Boolean defanged() { /** * Set the defanged property: Is threat intelligence entity defanged. - * + * * @param defanged the defanged value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -471,7 +479,7 @@ public ThreatIntelligenceIndicatorProperties withDefanged(Boolean defanged) { /** * Get the externalLastUpdatedTimeUtc property: External last updated time in UTC. - * + * * @return the externalLastUpdatedTimeUtc value. */ public String externalLastUpdatedTimeUtc() { @@ -480,7 +488,7 @@ public String externalLastUpdatedTimeUtc() { /** * Set the externalLastUpdatedTimeUtc property: External last updated time in UTC. - * + * * @param externalLastUpdatedTimeUtc the externalLastUpdatedTimeUtc value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -491,7 +499,7 @@ public ThreatIntelligenceIndicatorProperties withExternalLastUpdatedTimeUtc(Stri /** * Get the externalReferences property: External References. - * + * * @return the externalReferences value. */ public List externalReferences() { @@ -500,19 +508,19 @@ public List externalReferences() { /** * Set the externalReferences property: External References. - * + * * @param externalReferences the externalReferences value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ - public ThreatIntelligenceIndicatorProperties withExternalReferences( - List externalReferences) { + public ThreatIntelligenceIndicatorProperties + withExternalReferences(List externalReferences) { this.externalReferences = externalReferences; return this; } /** * Get the granularMarkings property: Granular Markings. - * + * * @return the granularMarkings value. */ public List granularMarkings() { @@ -521,19 +529,19 @@ public List granularMarkings() { /** * Set the granularMarkings property: Granular Markings. - * + * * @param granularMarkings the granularMarkings value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ - public ThreatIntelligenceIndicatorProperties withGranularMarkings( - List granularMarkings) { + public ThreatIntelligenceIndicatorProperties + withGranularMarkings(List granularMarkings) { this.granularMarkings = granularMarkings; return this; } /** * Get the labels property: Labels of threat intelligence entity. - * + * * @return the labels value. */ public List labels() { @@ -542,7 +550,7 @@ public List labels() { /** * Set the labels property: Labels of threat intelligence entity. - * + * * @param labels the labels value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -553,7 +561,7 @@ public ThreatIntelligenceIndicatorProperties withLabels(List labels) { /** * Get the revoked property: Is threat intelligence entity revoked. - * + * * @return the revoked value. */ public Boolean revoked() { @@ -562,7 +570,7 @@ public Boolean revoked() { /** * Set the revoked property: Is threat intelligence entity revoked. - * + * * @param revoked the revoked value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -573,7 +581,7 @@ public ThreatIntelligenceIndicatorProperties withRevoked(Boolean revoked) { /** * Get the confidence property: Confidence of threat intelligence entity. - * + * * @return the confidence value. */ public Integer confidence() { @@ -582,7 +590,7 @@ public Integer confidence() { /** * Set the confidence property: Confidence of threat intelligence entity. - * + * * @param confidence the confidence value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -593,7 +601,7 @@ public ThreatIntelligenceIndicatorProperties withConfidence(Integer confidence) /** * Get the objectMarkingRefs property: Threat intelligence entity object marking references. - * + * * @return the objectMarkingRefs value. */ public List objectMarkingRefs() { @@ -602,7 +610,7 @@ public List objectMarkingRefs() { /** * Set the objectMarkingRefs property: Threat intelligence entity object marking references. - * + * * @param objectMarkingRefs the objectMarkingRefs value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -613,7 +621,7 @@ public ThreatIntelligenceIndicatorProperties withObjectMarkingRefs(List /** * Get the language property: Language of threat intelligence entity. - * + * * @return the language value. */ public String language() { @@ -622,7 +630,7 @@ public String language() { /** * Set the language property: Language of threat intelligence entity. - * + * * @param language the language value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -633,7 +641,7 @@ public ThreatIntelligenceIndicatorProperties withLanguage(String language) { /** * Get the threatTypes property: Threat types. - * + * * @return the threatTypes value. */ public List threatTypes() { @@ -642,7 +650,7 @@ public List threatTypes() { /** * Set the threatTypes property: Threat types. - * + * * @param threatTypes the threatTypes value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -653,7 +661,7 @@ public ThreatIntelligenceIndicatorProperties withThreatTypes(List threat /** * Get the validFrom property: Valid from. - * + * * @return the validFrom value. */ public String validFrom() { @@ -662,7 +670,7 @@ public String validFrom() { /** * Set the validFrom property: Valid from. - * + * * @param validFrom the validFrom value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -673,7 +681,7 @@ public ThreatIntelligenceIndicatorProperties withValidFrom(String validFrom) { /** * Get the validUntil property: Valid until. - * + * * @return the validUntil value. */ public String validUntil() { @@ -682,7 +690,7 @@ public String validUntil() { /** * Set the validUntil property: Valid until. - * + * * @param validUntil the validUntil value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -693,7 +701,7 @@ public ThreatIntelligenceIndicatorProperties withValidUntil(String validUntil) { /** * Get the created property: Created by. - * + * * @return the created value. */ public String created() { @@ -702,7 +710,7 @@ public String created() { /** * Set the created property: Created by. - * + * * @param created the created value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -713,7 +721,7 @@ public ThreatIntelligenceIndicatorProperties withCreated(String created) { /** * Get the modified property: Modified by. - * + * * @return the modified value. */ public String modified() { @@ -722,7 +730,7 @@ public String modified() { /** * Set the modified property: Modified by. - * + * * @param modified the modified value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -733,7 +741,7 @@ public ThreatIntelligenceIndicatorProperties withModified(String modified) { /** * Get the extensions property: Extensions map. - * + * * @return the extensions value. */ public Map extensions() { @@ -742,7 +750,7 @@ public Map extensions() { /** * Set the extensions property: Extensions map. - * + * * @param extensions the extensions value to set. * @return the ThreatIntelligenceIndicatorProperties object itself. */ @@ -753,7 +761,7 @@ public ThreatIntelligenceIndicatorProperties withExtensions(Map /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 66c6f53009c5..fa0fbec4b33b 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 @@ -7,21 +7,51 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceInnerKind; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Threat intelligence information object. */ +/** + * Threat intelligence information object. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = ThreatIntelligenceInformationInner.class) + defaultImpl = ThreatIntelligenceInformationInner.class, + visible = true) @JsonTypeName("ThreatIntelligenceInformation") -@JsonSubTypes({@JsonSubTypes.Type(name = "indicator", value = ThreatIntelligenceIndicatorModel.class)}) +@JsonSubTypes({ @JsonSubTypes.Type(name = "indicator", value = ThreatIntelligenceIndicatorModel.class) }) @Fluent public class ThreatIntelligenceInformationInner extends ResourceWithEtag { - /** {@inheritDoc} */ + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ThreatIntelligenceResourceInnerKind kind; + + /** + * Creates an instance of ThreatIntelligenceInformationInner class. + */ + public ThreatIntelligenceInformationInner() { + this.kind = ThreatIntelligenceResourceInnerKind.fromString("ThreatIntelligenceInformation"); + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + public ThreatIntelligenceResourceInnerKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ @Override public ThreatIntelligenceInformationInner withEtag(String etag) { super.withEtag(etag); @@ -30,7 +60,7 @@ public ThreatIntelligenceInformationInner withEtag(String etag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 fccc6810b44c..8a09bff34787 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the threat intelligence metric fields (type/threat type/source). */ +/** + * List of all the threat intelligence metric fields (type/threat type/source). + */ @Fluent public final class ThreatIntelligenceMetricsListInner { /* @@ -19,9 +21,15 @@ public final class ThreatIntelligenceMetricsListInner { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of ThreatIntelligenceMetricsListInner class. + */ + public ThreatIntelligenceMetricsListInner() { + } + /** * Get the value property: Array of threat intelligence metric fields (type/threat type/source). - * + * * @return the value value. */ public List value() { @@ -30,7 +38,7 @@ public List 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. */ @@ -41,15 +49,14 @@ public ThreatIntelligenceMetricsListInner withValue(List e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiCheckRequirementsProperties.java index e65e280aade2..b4980d5178a7 100644 --- 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 @@ -7,10 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; -/** Threat Intelligence TAXII data connector required properties. */ +/** + * Threat Intelligence TAXII data connector required properties. + */ @Fluent public final class TiTaxiiCheckRequirementsProperties extends DataConnectorTenantId { - /** {@inheritDoc} */ + /** + * Creates an instance of TiTaxiiCheckRequirementsProperties class. + */ + public TiTaxiiCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ @Override public TiTaxiiCheckRequirementsProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -19,7 +29,7 @@ public TiTaxiiCheckRequirementsProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 2faf94e2db69..34e3eb0d0bfc 100644 --- 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 @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Threat Intelligence TAXII data connector properties. */ +/** + * Threat Intelligence TAXII data connector properties. + */ @Fluent public final class TiTaxiiDataConnectorProperties extends DataConnectorTenantId { /* @@ -69,9 +71,15 @@ public final class TiTaxiiDataConnectorProperties extends DataConnectorTenantId @JsonProperty(value = "dataTypes", required = true) 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() { @@ -80,7 +88,7 @@ public String workspaceId() { /** * Set the workspaceId property: The workspace id. - * + * * @param workspaceId the workspaceId value to set. * @return the TiTaxiiDataConnectorProperties object itself. */ @@ -91,7 +99,7 @@ public TiTaxiiDataConnectorProperties withWorkspaceId(String workspaceId) { /** * Get the friendlyName property: The friendly name for the TAXII server. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -100,7 +108,7 @@ public String friendlyName() { /** * Set the friendlyName property: The friendly name for the TAXII server. - * + * * @param friendlyName the friendlyName value to set. * @return the TiTaxiiDataConnectorProperties object itself. */ @@ -111,7 +119,7 @@ public TiTaxiiDataConnectorProperties withFriendlyName(String friendlyName) { /** * Get the taxiiServer property: The API root for the TAXII server. - * + * * @return the taxiiServer value. */ public String taxiiServer() { @@ -120,7 +128,7 @@ public String taxiiServer() { /** * Set the taxiiServer property: The API root for the TAXII server. - * + * * @param taxiiServer the taxiiServer value to set. * @return the TiTaxiiDataConnectorProperties object itself. */ @@ -131,7 +139,7 @@ public TiTaxiiDataConnectorProperties withTaxiiServer(String taxiiServer) { /** * Get the collectionId property: The collection id of the TAXII server. - * + * * @return the collectionId value. */ public String collectionId() { @@ -140,7 +148,7 @@ public String collectionId() { /** * Set the collectionId property: The collection id of the TAXII server. - * + * * @param collectionId the collectionId value to set. * @return the TiTaxiiDataConnectorProperties object itself. */ @@ -151,7 +159,7 @@ public TiTaxiiDataConnectorProperties withCollectionId(String collectionId) { /** * Get the username property: The userName for the TAXII server. - * + * * @return the username value. */ public String username() { @@ -160,7 +168,7 @@ public String username() { /** * Set the username property: The userName for the TAXII server. - * + * * @param username the username value to set. * @return the TiTaxiiDataConnectorProperties object itself. */ @@ -171,7 +179,7 @@ public TiTaxiiDataConnectorProperties withUsername(String username) { /** * Get the password property: The password for the TAXII server. - * + * * @return the password value. */ public String password() { @@ -180,7 +188,7 @@ public String password() { /** * Set the password property: The password for the TAXII server. - * + * * @param password the password value to set. * @return the TiTaxiiDataConnectorProperties object itself. */ @@ -191,7 +199,7 @@ public TiTaxiiDataConnectorProperties withPassword(String password) { /** * Get the taxiiLookbackPeriod property: The lookback period for the TAXII server. - * + * * @return the taxiiLookbackPeriod value. */ public OffsetDateTime taxiiLookbackPeriod() { @@ -200,7 +208,7 @@ public OffsetDateTime taxiiLookbackPeriod() { /** * Set the taxiiLookbackPeriod property: The lookback period for the TAXII server. - * + * * @param taxiiLookbackPeriod the taxiiLookbackPeriod value to set. * @return the TiTaxiiDataConnectorProperties object itself. */ @@ -211,7 +219,7 @@ public TiTaxiiDataConnectorProperties withTaxiiLookbackPeriod(OffsetDateTime tax /** * Get the pollingFrequency property: The polling frequency for the TAXII server. - * + * * @return the pollingFrequency value. */ public PollingFrequency pollingFrequency() { @@ -220,7 +228,7 @@ public PollingFrequency pollingFrequency() { /** * Set the pollingFrequency property: The polling frequency for the TAXII server. - * + * * @param pollingFrequency the pollingFrequency value to set. * @return the TiTaxiiDataConnectorProperties object itself. */ @@ -231,7 +239,7 @@ public TiTaxiiDataConnectorProperties withPollingFrequency(PollingFrequency poll /** * Get the dataTypes property: The available data types for Threat Intelligence TAXII data connector. - * + * * @return the dataTypes value. */ public TiTaxiiDataConnectorDataTypes dataTypes() { @@ -240,7 +248,7 @@ public TiTaxiiDataConnectorDataTypes 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. */ @@ -249,7 +257,9 @@ public TiTaxiiDataConnectorProperties withDataTypes(TiTaxiiDataConnectorDataType return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TiTaxiiDataConnectorProperties withTenantId(String tenantId) { super.withTenantId(tenantId); @@ -258,23 +268,21 @@ public TiTaxiiDataConnectorProperties withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (pollingFrequency() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property pollingFrequency in model TiTaxiiDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property pollingFrequency in model TiTaxiiDataConnectorProperties")); } if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model TiTaxiiDataConnectorProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model TiTaxiiDataConnectorProperties")); } else { dataTypes().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..bd2da609c8bb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunInner.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * The triggered analytics rule run. + */ +@Fluent +public final class TriggeredAnalyticsRuleRunInner extends ResourceWithEtag { + /* + * The triggered analytics rule run Properties + */ + @JsonProperty(value = "properties", required = true) + private TriggeredAnalyticsRuleRunProperties innerProperties = new TriggeredAnalyticsRuleRunProperties(); + + /** + * Creates an instance of TriggeredAnalyticsRuleRunInner class. + */ + public TriggeredAnalyticsRuleRunInner() { + } + + /** + * Get the innerProperties property: The triggered analytics rule run Properties. + * + * @return the innerProperties value. + */ + private TriggeredAnalyticsRuleRunProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public TriggeredAnalyticsRuleRunInner withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * 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 TriggeredAnalyticsRuleRunInner object itself. + */ + public TriggeredAnalyticsRuleRunInner withExecutionTimeUtc(OffsetDateTime executionTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new TriggeredAnalyticsRuleRunProperties(); + } + this.innerProperties().withExecutionTimeUtc(executionTimeUtc); + return this; + } + + /** + * Get the ruleId property: The ruleId property. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.innerProperties() == null ? null : this.innerProperties().ruleId(); + } + + /** + * Set the ruleId property: The ruleId property. + * + * @param ruleId the ruleId value to set. + * @return the TriggeredAnalyticsRuleRunInner object itself. + */ + public TriggeredAnalyticsRuleRunInner withRuleId(String ruleId) { + if (this.innerProperties() == null) { + this.innerProperties = new TriggeredAnalyticsRuleRunProperties(); + } + this.innerProperties().withRuleId(ruleId); + return this; + } + + /** + * Get the triggeredAnalyticsRuleRunId property: The triggeredAnalyticsRuleRunId property. + * + * @return the triggeredAnalyticsRuleRunId value. + */ + public String triggeredAnalyticsRuleRunId() { + return this.innerProperties() == null ? null : this.innerProperties().triggeredAnalyticsRuleRunId(); + } + + /** + * Set the triggeredAnalyticsRuleRunId property: The triggeredAnalyticsRuleRunId property. + * + * @param triggeredAnalyticsRuleRunId the triggeredAnalyticsRuleRunId value to set. + * @return the TriggeredAnalyticsRuleRunInner object itself. + */ + public TriggeredAnalyticsRuleRunInner withTriggeredAnalyticsRuleRunId(String triggeredAnalyticsRuleRunId) { + if (this.innerProperties() == null) { + this.innerProperties = new TriggeredAnalyticsRuleRunProperties(); + } + this.innerProperties().withTriggeredAnalyticsRuleRunId(triggeredAnalyticsRuleRunId); + return this; + } + + /** + * 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(); + } + + /** + * Set the provisioningState property: The triggered analytics rule run provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the TriggeredAnalyticsRuleRunInner object itself. + */ + public TriggeredAnalyticsRuleRunInner withProvisioningState(ProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new TriggeredAnalyticsRuleRunProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the ruleRunAdditionalData property: Dictionary of <any>. + * + * @return the ruleRunAdditionalData value. + */ + public Map ruleRunAdditionalData() { + return this.innerProperties() == null ? null : this.innerProperties().ruleRunAdditionalData(); + } + + /** + * Set the ruleRunAdditionalData property: Dictionary of <any>. + * + * @param ruleRunAdditionalData the ruleRunAdditionalData value to set. + * @return the TriggeredAnalyticsRuleRunInner object itself. + */ + public TriggeredAnalyticsRuleRunInner withRuleRunAdditionalData(Map ruleRunAdditionalData) { + if (this.innerProperties() == null) { + this.innerProperties = new TriggeredAnalyticsRuleRunProperties(); + } + this.innerProperties().withRuleRunAdditionalData(ruleRunAdditionalData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model TriggeredAnalyticsRuleRunInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TriggeredAnalyticsRuleRunInner.class); +} 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..10ceedf37bef --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunProperties.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * The triggered analytics rule run Properties. + */ +@Fluent +public final class TriggeredAnalyticsRuleRunProperties { + /* + * The executionTimeUtc property. + */ + @JsonProperty(value = "executionTimeUtc", required = true) + private OffsetDateTime executionTimeUtc; + + /* + * The ruleId property. + */ + @JsonProperty(value = "ruleId", required = true) + private String ruleId; + + /* + * The triggeredAnalyticsRuleRunId property. + */ + @JsonProperty(value = "triggeredAnalyticsRuleRunId", required = true) + private String triggeredAnalyticsRuleRunId; + + /* + * The triggered analytics rule run provisioning state + */ + @JsonProperty(value = "provisioningState", required = true) + private ProvisioningState provisioningState; + + /* + * Dictionary of + */ + @JsonProperty(value = "ruleRunAdditionalData") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map ruleRunAdditionalData; + + /** + * Creates an instance of TriggeredAnalyticsRuleRunProperties class. + */ + public TriggeredAnalyticsRuleRunProperties() { + } + + /** + * 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 TriggeredAnalyticsRuleRunProperties object itself. + */ + public TriggeredAnalyticsRuleRunProperties withExecutionTimeUtc(OffsetDateTime executionTimeUtc) { + this.executionTimeUtc = executionTimeUtc; + return this; + } + + /** + * Get the ruleId property: The ruleId property. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: The ruleId property. + * + * @param ruleId the ruleId value to set. + * @return the TriggeredAnalyticsRuleRunProperties object itself. + */ + public TriggeredAnalyticsRuleRunProperties withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the triggeredAnalyticsRuleRunId property: The triggeredAnalyticsRuleRunId property. + * + * @return the triggeredAnalyticsRuleRunId value. + */ + public String triggeredAnalyticsRuleRunId() { + return this.triggeredAnalyticsRuleRunId; + } + + /** + * Set the triggeredAnalyticsRuleRunId property: The triggeredAnalyticsRuleRunId property. + * + * @param triggeredAnalyticsRuleRunId the triggeredAnalyticsRuleRunId value to set. + * @return the TriggeredAnalyticsRuleRunProperties object itself. + */ + public TriggeredAnalyticsRuleRunProperties withTriggeredAnalyticsRuleRunId(String triggeredAnalyticsRuleRunId) { + this.triggeredAnalyticsRuleRunId = triggeredAnalyticsRuleRunId; + return this; + } + + /** + * Get the provisioningState property: The triggered analytics rule run provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The triggered analytics rule run provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the TriggeredAnalyticsRuleRunProperties object itself. + */ + public TriggeredAnalyticsRuleRunProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the ruleRunAdditionalData property: Dictionary of <any>. + * + * @return the ruleRunAdditionalData value. + */ + public Map ruleRunAdditionalData() { + return this.ruleRunAdditionalData; + } + + /** + * Set the ruleRunAdditionalData property: Dictionary of <any>. + * + * @param ruleRunAdditionalData the ruleRunAdditionalData value to set. + * @return the TriggeredAnalyticsRuleRunProperties object itself. + */ + public TriggeredAnalyticsRuleRunProperties withRuleRunAdditionalData(Map ruleRunAdditionalData) { + this.ruleRunAdditionalData = ruleRunAdditionalData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (executionTimeUtc() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property executionTimeUtc in model TriggeredAnalyticsRuleRunProperties")); + } + if (ruleId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleId in model TriggeredAnalyticsRuleRunProperties")); + } + if (triggeredAnalyticsRuleRunId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property triggeredAnalyticsRuleRunId in model TriggeredAnalyticsRuleRunProperties")); + } + if (provisioningState() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property provisioningState in model TriggeredAnalyticsRuleRunProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TriggeredAnalyticsRuleRunProperties.class); +} 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 index 9a9c6252b395..0ebabb1da0f0 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Ueba property bag. */ +/** + * Ueba property bag. + */ @Fluent public final class UebaProperties { /* @@ -18,9 +20,15 @@ public final class UebaProperties { @JsonProperty(value = "dataSources") 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() { @@ -29,7 +37,7 @@ public List 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. */ @@ -40,7 +48,7 @@ public UebaProperties withDataSources(List dataSources) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UrlEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UrlEntityProperties.java index 833855a5cdd7..bf60b17969b4 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** Url entity property bag. */ +/** + * Url entity property bag. + */ @Immutable public final class UrlEntityProperties extends EntityCommonProperties { /* @@ -17,9 +19,15 @@ public final class UrlEntityProperties extends EntityCommonProperties { @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) private String url; + /** + * Creates an instance of UrlEntityProperties class. + */ + public UrlEntityProperties() { + } + /** * Get the url property: A full URL the entity points to. - * + * * @return the url value. */ public String url() { @@ -28,7 +36,7 @@ public String url() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..191e46ded9d8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WarningInner.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.securityinsights.models.WarningBody; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Warning response structure. + */ +@Immutable +public final class WarningInner { + /* + * Warning data. + */ + @JsonProperty(value = "warning", access = JsonProperty.Access.WRITE_ONLY) + private WarningBody warning; + + /** + * Creates an instance of WarningInner class. + */ + public WarningInner() { + } + + /** + * Get the warning property: Warning data. + * + * @return the warning value. + */ + public WarningBody warning() { + return this.warning; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (warning() != null) { + warning().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistInner.java index 14c1ca299bc2..7452aa8d9751 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 @@ -13,7 +13,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Represents a Watchlist in Azure Security Insights. */ +/** + * Represents a Watchlist in Azure Security Insights. + */ @Fluent public final class WatchlistInner extends ResourceWithEtag { /* @@ -22,16 +24,24 @@ public final class WatchlistInner extends ResourceWithEtag { @JsonProperty(value = "properties") private WatchlistProperties innerProperties; + /** + * Creates an instance of WatchlistInner class. + */ + public WatchlistInner() { + } + /** * Get the innerProperties property: Watchlist properties. - * + * * @return the innerProperties value. */ private WatchlistProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public WatchlistInner withEtag(String etag) { super.withEtag(etag); @@ -40,7 +50,7 @@ public WatchlistInner withEtag(String etag) { /** * Get the watchlistId property: The id (a Guid) of the watchlist. - * + * * @return the watchlistId value. */ public String watchlistId() { @@ -49,7 +59,7 @@ public String watchlistId() { /** * Set the watchlistId property: The id (a Guid) of the watchlist. - * + * * @param watchlistId the watchlistId value to set. * @return the WatchlistInner object itself. */ @@ -63,7 +73,7 @@ public WatchlistInner withWatchlistId(String watchlistId) { /** * Get the displayName property: The display name of the watchlist. - * + * * @return the displayName value. */ public String displayName() { @@ -72,7 +82,7 @@ public String displayName() { /** * Set the displayName property: The display name of the watchlist. - * + * * @param displayName the displayName value to set. * @return the WatchlistInner object itself. */ @@ -86,7 +96,7 @@ public WatchlistInner withDisplayName(String displayName) { /** * Get the provider property: The provider of the watchlist. - * + * * @return the provider value. */ public String provider() { @@ -95,7 +105,7 @@ public String provider() { /** * Set the provider property: The provider of the watchlist. - * + * * @param provider the provider value to set. * @return the WatchlistInner object itself. */ @@ -109,7 +119,7 @@ public WatchlistInner withProvider(String provider) { /** * Get the source property: The filename of the watchlist, called 'source'. - * + * * @return the source value. */ public String source() { @@ -118,7 +128,7 @@ public String source() { /** * Set the source property: The filename of the watchlist, called 'source'. - * + * * @param source the source value to set. * @return the WatchlistInner object itself. */ @@ -132,7 +142,7 @@ public WatchlistInner withSource(String source) { /** * Get the sourceType property: The sourceType of the watchlist. - * + * * @return the sourceType value. */ public SourceType sourceType() { @@ -141,7 +151,7 @@ public SourceType sourceType() { /** * Set the sourceType property: The sourceType of the watchlist. - * + * * @param sourceType the sourceType value to set. * @return the WatchlistInner object itself. */ @@ -155,7 +165,7 @@ public WatchlistInner withSourceType(SourceType sourceType) { /** * Get the created property: The time the watchlist was created. - * + * * @return the created value. */ public OffsetDateTime created() { @@ -164,7 +174,7 @@ public OffsetDateTime created() { /** * Set the created property: The time the watchlist was created. - * + * * @param created the created value to set. * @return the WatchlistInner object itself. */ @@ -178,7 +188,7 @@ public WatchlistInner withCreated(OffsetDateTime created) { /** * Get the updated property: The last time the watchlist was updated. - * + * * @return the updated value. */ public OffsetDateTime updated() { @@ -187,7 +197,7 @@ public OffsetDateTime updated() { /** * Set the updated property: The last time the watchlist was updated. - * + * * @param updated the updated value to set. * @return the WatchlistInner object itself. */ @@ -201,7 +211,7 @@ public WatchlistInner withUpdated(OffsetDateTime updated) { /** * Get the createdBy property: Describes a user that created the watchlist. - * + * * @return the createdBy value. */ public UserInfo createdBy() { @@ -210,7 +220,7 @@ public UserInfo createdBy() { /** * Set the createdBy property: Describes a user that created the watchlist. - * + * * @param createdBy the createdBy value to set. * @return the WatchlistInner object itself. */ @@ -224,7 +234,7 @@ public WatchlistInner withCreatedBy(UserInfo createdBy) { /** * Get the updatedBy property: Describes a user that updated the watchlist. - * + * * @return the updatedBy value. */ public UserInfo updatedBy() { @@ -233,7 +243,7 @@ public UserInfo updatedBy() { /** * Set the updatedBy property: Describes a user that updated the watchlist. - * + * * @param updatedBy the updatedBy value to set. * @return the WatchlistInner object itself. */ @@ -247,7 +257,7 @@ public WatchlistInner withUpdatedBy(UserInfo updatedBy) { /** * Get the description property: A description of the watchlist. - * + * * @return the description value. */ public String description() { @@ -256,7 +266,7 @@ public String description() { /** * Set the description property: A description of the watchlist. - * + * * @param description the description value to set. * @return the WatchlistInner object itself. */ @@ -270,7 +280,7 @@ public WatchlistInner withDescription(String description) { /** * Get the watchlistType property: The type of the watchlist. - * + * * @return the watchlistType value. */ public String watchlistType() { @@ -279,7 +289,7 @@ public String watchlistType() { /** * Set the watchlistType property: The type of the watchlist. - * + * * @param watchlistType the watchlistType value to set. * @return the WatchlistInner object itself. */ @@ -293,7 +303,7 @@ public WatchlistInner withWatchlistType(String watchlistType) { /** * Get the watchlistAlias property: The alias of the watchlist. - * + * * @return the watchlistAlias value. */ public String watchlistAlias() { @@ -302,7 +312,7 @@ public String watchlistAlias() { /** * Set the watchlistAlias property: The alias of the watchlist. - * + * * @param watchlistAlias the watchlistAlias value to set. * @return the WatchlistInner object itself. */ @@ -316,7 +326,7 @@ public WatchlistInner withWatchlistAlias(String watchlistAlias) { /** * Get the isDeleted property: A flag that indicates if the watchlist is deleted or not. - * + * * @return the isDeleted value. */ public Boolean isDeleted() { @@ -325,7 +335,7 @@ public Boolean isDeleted() { /** * Set the isDeleted property: A flag that indicates if the watchlist is deleted or not. - * + * * @param isDeleted the isDeleted value to set. * @return the WatchlistInner object itself. */ @@ -339,7 +349,7 @@ public WatchlistInner withIsDeleted(Boolean isDeleted) { /** * Get the labels property: List of labels relevant to this watchlist. - * + * * @return the labels value. */ public List labels() { @@ -348,7 +358,7 @@ public List labels() { /** * Set the labels property: List of labels relevant to this watchlist. - * + * * @param labels the labels value to set. * @return the WatchlistInner object itself. */ @@ -362,7 +372,7 @@ public WatchlistInner withLabels(List labels) { /** * Get the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). - * + * * @return the defaultDuration value. */ public Duration defaultDuration() { @@ -371,7 +381,7 @@ public Duration defaultDuration() { /** * Set the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). - * + * * @param defaultDuration the defaultDuration value to set. * @return the WatchlistInner object itself. */ @@ -385,7 +395,7 @@ public WatchlistInner withDefaultDuration(Duration defaultDuration) { /** * Get the tenantId property: The tenantId where the watchlist belongs to. - * + * * @return the tenantId value. */ public String tenantId() { @@ -394,7 +404,7 @@ public String tenantId() { /** * Set the tenantId property: The tenantId where the watchlist belongs to. - * + * * @param tenantId the tenantId value to set. * @return the WatchlistInner object itself. */ @@ -408,7 +418,7 @@ public WatchlistInner withTenantId(String tenantId) { /** * Get the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. - * + * * @return the numberOfLinesToSkip value. */ public Integer numberOfLinesToSkip() { @@ -417,7 +427,7 @@ public Integer numberOfLinesToSkip() { /** * Set the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. - * + * * @param numberOfLinesToSkip the numberOfLinesToSkip value to set. * @return the WatchlistInner object itself. */ @@ -432,7 +442,7 @@ public WatchlistInner withNumberOfLinesToSkip(Integer numberOfLinesToSkip) { /** * Get the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv * content type, it's the content of the file that will parsed by the endpoint. - * + * * @return the rawContent value. */ public String rawContent() { @@ -442,7 +452,7 @@ public String rawContent() { /** * Set the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv * content type, it's the content of the file that will parsed by the endpoint. - * + * * @param rawContent the rawContent value to set. * @return the WatchlistInner object itself. */ @@ -458,7 +468,7 @@ public WatchlistInner withRawContent(String rawContent) { * Get the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then * use this field as the key field when joining to other event data by IP address. - * + * * @return the itemsSearchKey value. */ public String itemsSearchKey() { @@ -469,7 +479,7 @@ public String itemsSearchKey() { * Set the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then * use this field as the key field when joining to other event data by IP address. - * + * * @param itemsSearchKey the itemsSearchKey value to set. * @return the WatchlistInner object itself. */ @@ -483,7 +493,7 @@ public WatchlistInner withItemsSearchKey(String itemsSearchKey) { /** * Get the contentType property: The content type of the raw content. Example : text/csv or text/tsv. - * + * * @return the contentType value. */ public String contentType() { @@ -492,7 +502,7 @@ public String contentType() { /** * Set the contentType property: The content type of the raw content. Example : text/csv or text/tsv. - * + * * @param contentType the contentType value to set. * @return the WatchlistInner object itself. */ @@ -507,7 +517,7 @@ public WatchlistInner withContentType(String contentType) { /** * Get the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. - * + * * @return the uploadStatus value. */ public String uploadStatus() { @@ -517,7 +527,7 @@ public String uploadStatus() { /** * Set the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. - * + * * @param uploadStatus the uploadStatus value to set. * @return the WatchlistInner object itself. */ @@ -531,7 +541,7 @@ public WatchlistInner withUploadStatus(String uploadStatus) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 e7424ae99545..907c3ead2eb2 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 @@ -11,7 +11,9 @@ import java.time.OffsetDateTime; import java.util.Map; -/** Represents a Watchlist item in Azure Security Insights. */ +/** + * Represents a Watchlist item in Azure Security Insights. + */ @Fluent public final class WatchlistItemInner extends ResourceWithEtag { /* @@ -20,16 +22,24 @@ public final class WatchlistItemInner extends ResourceWithEtag { @JsonProperty(value = "properties") private WatchlistItemProperties innerProperties; + /** + * Creates an instance of WatchlistItemInner class. + */ + public WatchlistItemInner() { + } + /** * Get the innerProperties property: Watchlist Item properties. - * + * * @return the innerProperties value. */ private WatchlistItemProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public WatchlistItemInner withEtag(String etag) { super.withEtag(etag); @@ -38,7 +48,7 @@ public WatchlistItemInner withEtag(String etag) { /** * Get the watchlistItemType property: The type of the watchlist item. - * + * * @return the watchlistItemType value. */ public String watchlistItemType() { @@ -47,7 +57,7 @@ public String watchlistItemType() { /** * Set the watchlistItemType property: The type of the watchlist item. - * + * * @param watchlistItemType the watchlistItemType value to set. * @return the WatchlistItemInner object itself. */ @@ -61,7 +71,7 @@ public WatchlistItemInner withWatchlistItemType(String watchlistItemType) { /** * Get the watchlistItemId property: The id (a Guid) of the watchlist item. - * + * * @return the watchlistItemId value. */ public String watchlistItemId() { @@ -70,7 +80,7 @@ public String watchlistItemId() { /** * Set the watchlistItemId property: The id (a Guid) of the watchlist item. - * + * * @param watchlistItemId the watchlistItemId value to set. * @return the WatchlistItemInner object itself. */ @@ -84,7 +94,7 @@ public WatchlistItemInner withWatchlistItemId(String watchlistItemId) { /** * Get the tenantId property: The tenantId to which the watchlist item belongs to. - * + * * @return the tenantId value. */ public String tenantId() { @@ -93,7 +103,7 @@ public String tenantId() { /** * Set the tenantId property: The tenantId to which the watchlist item belongs to. - * + * * @param tenantId the tenantId value to set. * @return the WatchlistItemInner object itself. */ @@ -107,7 +117,7 @@ public WatchlistItemInner withTenantId(String tenantId) { /** * Get the isDeleted property: A flag that indicates if the watchlist item is deleted or not. - * + * * @return the isDeleted value. */ public Boolean isDeleted() { @@ -116,7 +126,7 @@ public Boolean isDeleted() { /** * Set the isDeleted property: A flag that indicates if the watchlist item is deleted or not. - * + * * @param isDeleted the isDeleted value to set. * @return the WatchlistItemInner object itself. */ @@ -130,7 +140,7 @@ public WatchlistItemInner withIsDeleted(Boolean isDeleted) { /** * Get the created property: The time the watchlist item was created. - * + * * @return the created value. */ public OffsetDateTime created() { @@ -139,7 +149,7 @@ public OffsetDateTime created() { /** * Set the created property: The time the watchlist item was created. - * + * * @param created the created value to set. * @return the WatchlistItemInner object itself. */ @@ -153,7 +163,7 @@ public WatchlistItemInner withCreated(OffsetDateTime created) { /** * Get the updated property: The last time the watchlist item was updated. - * + * * @return the updated value. */ public OffsetDateTime updated() { @@ -162,7 +172,7 @@ public OffsetDateTime updated() { /** * Set the updated property: The last time the watchlist item was updated. - * + * * @param updated the updated value to set. * @return the WatchlistItemInner object itself. */ @@ -176,7 +186,7 @@ public WatchlistItemInner withUpdated(OffsetDateTime updated) { /** * Get the createdBy property: Describes a user that created the watchlist item. - * + * * @return the createdBy value. */ public UserInfo createdBy() { @@ -185,7 +195,7 @@ public UserInfo createdBy() { /** * Set the createdBy property: Describes a user that created the watchlist item. - * + * * @param createdBy the createdBy value to set. * @return the WatchlistItemInner object itself. */ @@ -199,7 +209,7 @@ public WatchlistItemInner withCreatedBy(UserInfo createdBy) { /** * Get the updatedBy property: Describes a user that updated the watchlist item. - * + * * @return the updatedBy value. */ public UserInfo updatedBy() { @@ -208,7 +218,7 @@ public UserInfo updatedBy() { /** * Set the updatedBy property: Describes a user that updated the watchlist item. - * + * * @param updatedBy the updatedBy value to set. * @return the WatchlistItemInner object itself. */ @@ -222,7 +232,7 @@ public WatchlistItemInner withUpdatedBy(UserInfo updatedBy) { /** * Get the itemsKeyValue property: key-value pairs for a watchlist item. - * + * * @return the itemsKeyValue value. */ public Map itemsKeyValue() { @@ -231,7 +241,7 @@ public Map itemsKeyValue() { /** * Set the itemsKeyValue property: key-value pairs for a watchlist item. - * + * * @param itemsKeyValue the itemsKeyValue value to set. * @return the WatchlistItemInner object itself. */ @@ -245,7 +255,7 @@ public WatchlistItemInner withItemsKeyValue(Map itemsKeyValue) { /** * Get the entityMapping property: key-value pairs for a watchlist item entity mapping. - * + * * @return the entityMapping value. */ public Map entityMapping() { @@ -254,7 +264,7 @@ public Map entityMapping() { /** * Set the entityMapping property: key-value pairs for a watchlist item entity mapping. - * + * * @param entityMapping the entityMapping value to set. * @return the WatchlistItemInner object itself. */ @@ -268,7 +278,7 @@ public WatchlistItemInner withEntityMapping(Map entityMapping) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 b33026a9990e..3c4d124dc04e 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 @@ -12,7 +12,9 @@ import java.time.OffsetDateTime; import java.util.Map; -/** Describes watchlist item properties. */ +/** + * Describes watchlist item properties. + */ @Fluent public final class WatchlistItemProperties { /* @@ -77,9 +79,15 @@ public final class WatchlistItemProperties { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map entityMapping; + /** + * Creates an instance of WatchlistItemProperties class. + */ + public WatchlistItemProperties() { + } + /** * Get the watchlistItemType property: The type of the watchlist item. - * + * * @return the watchlistItemType value. */ public String watchlistItemType() { @@ -88,7 +96,7 @@ public String watchlistItemType() { /** * Set the watchlistItemType property: The type of the watchlist item. - * + * * @param watchlistItemType the watchlistItemType value to set. * @return the WatchlistItemProperties object itself. */ @@ -99,7 +107,7 @@ public WatchlistItemProperties withWatchlistItemType(String watchlistItemType) { /** * Get the watchlistItemId property: The id (a Guid) of the watchlist item. - * + * * @return the watchlistItemId value. */ public String watchlistItemId() { @@ -108,7 +116,7 @@ public String watchlistItemId() { /** * Set the watchlistItemId property: The id (a Guid) of the watchlist item. - * + * * @param watchlistItemId the watchlistItemId value to set. * @return the WatchlistItemProperties object itself. */ @@ -119,7 +127,7 @@ public WatchlistItemProperties withWatchlistItemId(String watchlistItemId) { /** * Get the tenantId property: The tenantId to which the watchlist item belongs to. - * + * * @return the tenantId value. */ public String tenantId() { @@ -128,7 +136,7 @@ public String tenantId() { /** * Set the tenantId property: The tenantId to which the watchlist item belongs to. - * + * * @param tenantId the tenantId value to set. * @return the WatchlistItemProperties object itself. */ @@ -139,7 +147,7 @@ public WatchlistItemProperties withTenantId(String tenantId) { /** * Get the isDeleted property: A flag that indicates if the watchlist item is deleted or not. - * + * * @return the isDeleted value. */ public Boolean isDeleted() { @@ -148,7 +156,7 @@ public Boolean isDeleted() { /** * Set the isDeleted property: A flag that indicates if the watchlist item is deleted or not. - * + * * @param isDeleted the isDeleted value to set. * @return the WatchlistItemProperties object itself. */ @@ -159,7 +167,7 @@ public WatchlistItemProperties withIsDeleted(Boolean isDeleted) { /** * Get the created property: The time the watchlist item was created. - * + * * @return the created value. */ public OffsetDateTime created() { @@ -168,7 +176,7 @@ public OffsetDateTime created() { /** * Set the created property: The time the watchlist item was created. - * + * * @param created the created value to set. * @return the WatchlistItemProperties object itself. */ @@ -179,7 +187,7 @@ public WatchlistItemProperties withCreated(OffsetDateTime created) { /** * Get the updated property: The last time the watchlist item was updated. - * + * * @return the updated value. */ public OffsetDateTime updated() { @@ -188,7 +196,7 @@ public OffsetDateTime updated() { /** * Set the updated property: The last time the watchlist item was updated. - * + * * @param updated the updated value to set. * @return the WatchlistItemProperties object itself. */ @@ -199,7 +207,7 @@ public WatchlistItemProperties withUpdated(OffsetDateTime updated) { /** * Get the createdBy property: Describes a user that created the watchlist item. - * + * * @return the createdBy value. */ public UserInfo createdBy() { @@ -208,7 +216,7 @@ public UserInfo createdBy() { /** * Set the createdBy property: Describes a user that created the watchlist item. - * + * * @param createdBy the createdBy value to set. * @return the WatchlistItemProperties object itself. */ @@ -219,7 +227,7 @@ public WatchlistItemProperties withCreatedBy(UserInfo createdBy) { /** * Get the updatedBy property: Describes a user that updated the watchlist item. - * + * * @return the updatedBy value. */ public UserInfo updatedBy() { @@ -228,7 +236,7 @@ public UserInfo updatedBy() { /** * Set the updatedBy property: Describes a user that updated the watchlist item. - * + * * @param updatedBy the updatedBy value to set. * @return the WatchlistItemProperties object itself. */ @@ -239,7 +247,7 @@ public WatchlistItemProperties withUpdatedBy(UserInfo updatedBy) { /** * Get the itemsKeyValue property: key-value pairs for a watchlist item. - * + * * @return the itemsKeyValue value. */ public Map itemsKeyValue() { @@ -248,7 +256,7 @@ public Map itemsKeyValue() { /** * Set the itemsKeyValue property: key-value pairs for a watchlist item. - * + * * @param itemsKeyValue the itemsKeyValue value to set. * @return the WatchlistItemProperties object itself. */ @@ -259,7 +267,7 @@ public WatchlistItemProperties withItemsKeyValue(Map itemsKeyVal /** * Get the entityMapping property: key-value pairs for a watchlist item entity mapping. - * + * * @return the entityMapping value. */ public Map entityMapping() { @@ -268,7 +276,7 @@ public Map entityMapping() { /** * Set the entityMapping property: key-value pairs for a watchlist item entity mapping. - * + * * @param entityMapping the entityMapping value to set. * @return the WatchlistItemProperties object itself. */ @@ -279,7 +287,7 @@ public WatchlistItemProperties withEntityMapping(Map entityMappi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -290,10 +298,9 @@ public void validate() { updatedBy().validate(); } if (itemsKeyValue() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property itemsKeyValue in model WatchlistItemProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property itemsKeyValue in model WatchlistItemProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistProperties.java index 97fa95571482..078a2538f2e3 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 @@ -13,7 +13,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Describes watchlist properties. */ +/** + * Describes watchlist properties. + */ @Fluent public final class WatchlistProperties { /* @@ -119,36 +121,38 @@ public final class WatchlistProperties { private Integer numberOfLinesToSkip; /* - * The raw content that represents to watchlist items to create. In case of csv/tsv content type, it's the content - * of the file that will parsed by the endpoint + * The raw content that represents to watchlist items to create. In case of csv/tsv content type, it's the content of the file that will parsed by the endpoint */ @JsonProperty(value = "rawContent") private String rawContent; /* - * The search key is used to optimize query performance when using watchlists for joins with other data. For - * example, enable a column with IP addresses to be the designated SearchKey field, then use this field as the key - * field when joining to other event data by IP address. + * The search key is used to optimize query performance when using watchlists for joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then use this field as the key field when joining to other event data by IP address. */ @JsonProperty(value = "itemsSearchKey", required = true) private String itemsSearchKey; /* - * The content type of the raw content. Example : text/csv or text/tsv + * The content type of the raw content. Example : text/csv or text/tsv */ @JsonProperty(value = "contentType") private String contentType; /* - * The status of the Watchlist upload : New, InProgress or Complete. Pls note : When a Watchlist upload status is - * equal to InProgress, the Watchlist cannot be deleted + * The status of the Watchlist upload : New, InProgress or Complete. Pls note : When a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted */ @JsonProperty(value = "uploadStatus") private String uploadStatus; + /** + * Creates an instance of WatchlistProperties class. + */ + public WatchlistProperties() { + } + /** * Get the watchlistId property: The id (a Guid) of the watchlist. - * + * * @return the watchlistId value. */ public String watchlistId() { @@ -157,7 +161,7 @@ public String watchlistId() { /** * Set the watchlistId property: The id (a Guid) of the watchlist. - * + * * @param watchlistId the watchlistId value to set. * @return the WatchlistProperties object itself. */ @@ -168,7 +172,7 @@ public WatchlistProperties withWatchlistId(String watchlistId) { /** * Get the displayName property: The display name of the watchlist. - * + * * @return the displayName value. */ public String displayName() { @@ -177,7 +181,7 @@ public String displayName() { /** * Set the displayName property: The display name of the watchlist. - * + * * @param displayName the displayName value to set. * @return the WatchlistProperties object itself. */ @@ -188,7 +192,7 @@ public WatchlistProperties withDisplayName(String displayName) { /** * Get the provider property: The provider of the watchlist. - * + * * @return the provider value. */ public String provider() { @@ -197,7 +201,7 @@ public String provider() { /** * Set the provider property: The provider of the watchlist. - * + * * @param provider the provider value to set. * @return the WatchlistProperties object itself. */ @@ -208,7 +212,7 @@ public WatchlistProperties withProvider(String provider) { /** * Get the source property: The filename of the watchlist, called 'source'. - * + * * @return the source value. */ public String source() { @@ -217,7 +221,7 @@ public String source() { /** * Set the source property: The filename of the watchlist, called 'source'. - * + * * @param source the source value to set. * @return the WatchlistProperties object itself. */ @@ -228,7 +232,7 @@ public WatchlistProperties withSource(String source) { /** * Get the sourceType property: The sourceType of the watchlist. - * + * * @return the sourceType value. */ public SourceType sourceType() { @@ -237,7 +241,7 @@ public SourceType sourceType() { /** * Set the sourceType property: The sourceType of the watchlist. - * + * * @param sourceType the sourceType value to set. * @return the WatchlistProperties object itself. */ @@ -248,7 +252,7 @@ public WatchlistProperties withSourceType(SourceType sourceType) { /** * Get the created property: The time the watchlist was created. - * + * * @return the created value. */ public OffsetDateTime created() { @@ -257,7 +261,7 @@ public OffsetDateTime created() { /** * Set the created property: The time the watchlist was created. - * + * * @param created the created value to set. * @return the WatchlistProperties object itself. */ @@ -268,7 +272,7 @@ public WatchlistProperties withCreated(OffsetDateTime created) { /** * Get the updated property: The last time the watchlist was updated. - * + * * @return the updated value. */ public OffsetDateTime updated() { @@ -277,7 +281,7 @@ public OffsetDateTime updated() { /** * Set the updated property: The last time the watchlist was updated. - * + * * @param updated the updated value to set. * @return the WatchlistProperties object itself. */ @@ -288,7 +292,7 @@ public WatchlistProperties withUpdated(OffsetDateTime updated) { /** * Get the createdBy property: Describes a user that created the watchlist. - * + * * @return the createdBy value. */ public UserInfo createdBy() { @@ -297,7 +301,7 @@ public UserInfo createdBy() { /** * Set the createdBy property: Describes a user that created the watchlist. - * + * * @param createdBy the createdBy value to set. * @return the WatchlistProperties object itself. */ @@ -308,7 +312,7 @@ public WatchlistProperties withCreatedBy(UserInfo createdBy) { /** * Get the updatedBy property: Describes a user that updated the watchlist. - * + * * @return the updatedBy value. */ public UserInfo updatedBy() { @@ -317,7 +321,7 @@ public UserInfo updatedBy() { /** * Set the updatedBy property: Describes a user that updated the watchlist. - * + * * @param updatedBy the updatedBy value to set. * @return the WatchlistProperties object itself. */ @@ -328,7 +332,7 @@ public WatchlistProperties withUpdatedBy(UserInfo updatedBy) { /** * Get the description property: A description of the watchlist. - * + * * @return the description value. */ public String description() { @@ -337,7 +341,7 @@ public String description() { /** * Set the description property: A description of the watchlist. - * + * * @param description the description value to set. * @return the WatchlistProperties object itself. */ @@ -348,7 +352,7 @@ public WatchlistProperties withDescription(String description) { /** * Get the watchlistType property: The type of the watchlist. - * + * * @return the watchlistType value. */ public String watchlistType() { @@ -357,7 +361,7 @@ public String watchlistType() { /** * Set the watchlistType property: The type of the watchlist. - * + * * @param watchlistType the watchlistType value to set. * @return the WatchlistProperties object itself. */ @@ -368,7 +372,7 @@ public WatchlistProperties withWatchlistType(String watchlistType) { /** * Get the watchlistAlias property: The alias of the watchlist. - * + * * @return the watchlistAlias value. */ public String watchlistAlias() { @@ -377,7 +381,7 @@ public String watchlistAlias() { /** * Set the watchlistAlias property: The alias of the watchlist. - * + * * @param watchlistAlias the watchlistAlias value to set. * @return the WatchlistProperties object itself. */ @@ -388,7 +392,7 @@ public WatchlistProperties withWatchlistAlias(String watchlistAlias) { /** * Get the isDeleted property: A flag that indicates if the watchlist is deleted or not. - * + * * @return the isDeleted value. */ public Boolean isDeleted() { @@ -397,7 +401,7 @@ public Boolean isDeleted() { /** * Set the isDeleted property: A flag that indicates if the watchlist is deleted or not. - * + * * @param isDeleted the isDeleted value to set. * @return the WatchlistProperties object itself. */ @@ -408,7 +412,7 @@ public WatchlistProperties withIsDeleted(Boolean isDeleted) { /** * Get the labels property: List of labels relevant to this watchlist. - * + * * @return the labels value. */ public List labels() { @@ -417,7 +421,7 @@ public List labels() { /** * Set the labels property: List of labels relevant to this watchlist. - * + * * @param labels the labels value to set. * @return the WatchlistProperties object itself. */ @@ -428,7 +432,7 @@ public WatchlistProperties withLabels(List labels) { /** * Get the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). - * + * * @return the defaultDuration value. */ public Duration defaultDuration() { @@ -437,7 +441,7 @@ public Duration defaultDuration() { /** * Set the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). - * + * * @param defaultDuration the defaultDuration value to set. * @return the WatchlistProperties object itself. */ @@ -448,7 +452,7 @@ public WatchlistProperties withDefaultDuration(Duration defaultDuration) { /** * Get the tenantId property: The tenantId where the watchlist belongs to. - * + * * @return the tenantId value. */ public String tenantId() { @@ -457,7 +461,7 @@ public String tenantId() { /** * Set the tenantId property: The tenantId where the watchlist belongs to. - * + * * @param tenantId the tenantId value to set. * @return the WatchlistProperties object itself. */ @@ -468,7 +472,7 @@ public WatchlistProperties withTenantId(String tenantId) { /** * Get the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. - * + * * @return the numberOfLinesToSkip value. */ public Integer numberOfLinesToSkip() { @@ -477,7 +481,7 @@ public Integer numberOfLinesToSkip() { /** * Set the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. - * + * * @param numberOfLinesToSkip the numberOfLinesToSkip value to set. * @return the WatchlistProperties object itself. */ @@ -489,7 +493,7 @@ public WatchlistProperties withNumberOfLinesToSkip(Integer numberOfLinesToSkip) /** * Get the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv * content type, it's the content of the file that will parsed by the endpoint. - * + * * @return the rawContent value. */ public String rawContent() { @@ -499,7 +503,7 @@ public String rawContent() { /** * Set the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv * content type, it's the content of the file that will parsed by the endpoint. - * + * * @param rawContent the rawContent value to set. * @return the WatchlistProperties object itself. */ @@ -512,7 +516,7 @@ public WatchlistProperties withRawContent(String rawContent) { * Get the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then * use this field as the key field when joining to other event data by IP address. - * + * * @return the itemsSearchKey value. */ public String itemsSearchKey() { @@ -523,7 +527,7 @@ public String itemsSearchKey() { * Set the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then * use this field as the key field when joining to other event data by IP address. - * + * * @param itemsSearchKey the itemsSearchKey value to set. * @return the WatchlistProperties object itself. */ @@ -534,7 +538,7 @@ public WatchlistProperties withItemsSearchKey(String itemsSearchKey) { /** * Get the contentType property: The content type of the raw content. Example : text/csv or text/tsv. - * + * * @return the contentType value. */ public String contentType() { @@ -543,7 +547,7 @@ public String contentType() { /** * Set the contentType property: The content type of the raw content. Example : text/csv or text/tsv. - * + * * @param contentType the contentType value to set. * @return the WatchlistProperties object itself. */ @@ -555,7 +559,7 @@ public WatchlistProperties withContentType(String contentType) { /** * Get the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. - * + * * @return the uploadStatus value. */ public String uploadStatus() { @@ -565,7 +569,7 @@ public String uploadStatus() { /** * Set the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. - * + * * @param uploadStatus the uploadStatus value to set. * @return the WatchlistProperties object itself. */ @@ -576,19 +580,18 @@ public WatchlistProperties withUploadStatus(String uploadStatus) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (displayName() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property displayName in model WatchlistProperties")); } if (provider() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property provider in model WatchlistProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property provider in model WatchlistProperties")); } if (createdBy() != null) { createdBy().validate(); @@ -597,10 +600,9 @@ public void validate() { updatedBy().validate(); } if (itemsSearchKey() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property itemsSearchKey in model WatchlistProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property itemsSearchKey in model WatchlistProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..846aeba03549 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentInner.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import com.azure.resourcemanager.securityinsights.models.AzureEntityResource; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The workspace manager assignment. + */ +@Fluent +public final class WorkspaceManagerAssignmentInner extends AzureEntityResource { + /* + * The workspace manager assignment object + */ + @JsonProperty(value = "properties") + private WorkspaceManagerAssignmentProperties innerProperties; + + /** + * 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 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 ProvisioningState 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..cad1167e4922 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The workspace manager assignment properties. + */ +@Fluent +public final class WorkspaceManagerAssignmentProperties { + /* + * The resource name of the workspace manager group targeted by the workspace manager assignment + */ + @JsonProperty(value = "targetResourceName", required = true) + private String targetResourceName; + + /* + * The time the last job associated to this assignment ended at + */ + @JsonProperty(value = "lastJobEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastJobEndTime; + + /* + * State of the last job associated to this assignment + */ + @JsonProperty(value = "lastJobProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState lastJobProvisioningState; + + /* + * List of resources included in this workspace manager assignment + */ + @JsonProperty(value = "items", required = true) + 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 ProvisioningState 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceName in model WorkspaceManagerAssignmentProperties")); + } + if (items() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property items in model WorkspaceManagerAssignmentProperties")); + } else { + items().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerAssignmentProperties.class); +} 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..298f8aef9843 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationInner.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.AzureEntityResource; +import com.azure.resourcemanager.securityinsights.models.Mode; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The workspace manager configuration. + */ +@Fluent +public final class WorkspaceManagerConfigurationInner extends AzureEntityResource { + /* + * The workspace manager configuration object + */ + @JsonProperty(value = "properties") + private WorkspaceManagerConfigurationProperties innerProperties; + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..c38479abafa5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationProperties.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.models.Mode; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The workspace manager configuration properties. + */ +@Fluent +public final class WorkspaceManagerConfigurationProperties { + /* + * The current mode of the workspace manager configuration + */ + @JsonProperty(value = "mode", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mode() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property mode in model WorkspaceManagerConfigurationProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerConfigurationProperties.class); +} 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..5508b598504d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupInner.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.AzureEntityResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The workspace manager group. + */ +@Fluent +public final class WorkspaceManagerGroupInner extends AzureEntityResource { + /* + * The workspace manager group object + */ + @JsonProperty(value = "properties") + private WorkspaceManagerGroupProperties innerProperties; + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..1898096b1834 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The workspace manager group properties. + */ +@Fluent +public final class WorkspaceManagerGroupProperties { + /* + * The description of the workspace manager group + */ + @JsonProperty(value = "description") + private String description; + + /* + * The display name of the workspace manager group + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * The names of the workspace manager members participating in this group. + */ + @JsonProperty(value = "memberResourceNames", required = true) + 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; + } + + /** + * 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 WorkspaceManagerGroupProperties")); + } + if (memberResourceNames() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property memberResourceNames in model WorkspaceManagerGroupProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerGroupProperties.class); +} 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..a5bfef4a28c6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.models.AzureEntityResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The workspace manager member. + */ +@Fluent +public final class WorkspaceManagerMemberInner extends AzureEntityResource { + /* + * The workspace manager member object + */ + @JsonProperty(value = "properties") + private WorkspaceManagerMemberProperties innerProperties; + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/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..3b23a56721f5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The workspace manager member properties. + */ +@Fluent +public final class WorkspaceManagerMemberProperties { + /* + * Fully qualified resource ID of the target Sentinel workspace joining the given Sentinel workspace manager + */ + @JsonProperty(value = "targetWorkspaceResourceId", required = true) + private String targetWorkspaceResourceId; + + /* + * Tenant id of the target Sentinel workspace joining the given Sentinel workspace manager + */ + @JsonProperty(value = "targetWorkspaceTenantId", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetWorkspaceResourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetWorkspaceResourceId in model WorkspaceManagerMemberProperties")); + } + if (targetWorkspaceTenantId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetWorkspaceTenantId in model WorkspaceManagerMemberProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerMemberProperties.class); +} 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 d62af6071724..3a995c02679e 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure - * Security Insights) resource provider. + * Package containing the inner data models for SecurityInsights. + * API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. */ package com.azure.resourcemanager.securityinsights.fluent.models; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/package-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/package-info.java index 99716aa0d737..6a2422a27ae4 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure Security - * Insights) resource provider. + * Package containing the service clients for SecurityInsights. + * API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. */ package com.azure.resourcemanager.securityinsights.fluent; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionImpl.java new file mode 100644 index 000000000000..be2b9313dff8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.ActionInner; +import com.azure.resourcemanager.securityinsights.models.Action; +import com.azure.resourcemanager.securityinsights.models.ListActionKind; + +public final class ActionImpl implements Action { + private ActionInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + ActionImpl(ActionInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ListActionKind kind() { + return this.innerModel().kind(); + } + + public ActionInner 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/ActionResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionResponseImpl.java index 72b52d5050ea..c905955280fb 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 @@ -75,23 +75,18 @@ public ActionResponseImpl withExistingAlertRule(String resourceGroupName, String } public ActionResponse create() { - this.innerObject = - serviceManager - .serviceClient() - .getActions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, ruleId, actionId, createAction, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getActions() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, actionId, createAction, Context.NONE) + .getValue(); return this; } public ActionResponse create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getActions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, actionId, createAction, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getActions() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, actionId, createAction, context) + .getValue(); return this; } @@ -108,54 +103,44 @@ public ActionResponseImpl update() { } public ActionResponse apply() { - this.innerObject = - serviceManager - .serviceClient() - .getActions() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, ruleId, actionId, updateAction, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getActions() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, actionId, updateAction, Context.NONE) + .getValue(); return this; } public ActionResponse apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getActions() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, actionId, updateAction, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getActions() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, actionId, updateAction, context) + .getValue(); return this; } - ActionResponseImpl( - ActionResponseInner innerObject, + ActionResponseImpl(ActionResponseInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.ruleId = Utils.getValueFromIdByName(innerObject.id(), "alertRules"); - this.actionId = Utils.getValueFromIdByName(innerObject.id(), "actions"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.ruleId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "alertRules"); + this.actionId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "actions"); } public ActionResponse refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getActions() - .getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getActions() + .getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE) + .getValue(); return this; } public ActionResponse refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getActions() - .getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getActions() + .getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context) + .getValue(); return this; } 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 7b08804507b7..3ef53d1a68c1 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 @@ -34,17 +34,23 @@ import com.azure.resourcemanager.securityinsights.models.ActionsList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ActionsClient. */ +/** + * An instance of this class provides access to all the operations defined in ActionsClient. + */ public final class ActionsClientImpl implements ActionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ActionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of ActionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ActionsClientImpl(SecurityInsightsImpl client) { @@ -58,92 +64,57 @@ public final class ActionsClientImpl implements ActionsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsActi") - private interface ActionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions") - @ExpectedResponses({200}) + public interface ActionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAlertRule( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("ruleId") String ruleId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions" - + "/{actionId}") - @ExpectedResponses({200}) + Mono> listByAlertRule(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("ruleId") String ruleId, - @PathParam("actionId") String actionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions" - + "/{actionId}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @PathParam("actionId") String actionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("ruleId") String ruleId, - @PathParam("actionId") String actionId, - @BodyParam("application/json") ActionRequest action, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions" - + "/{actionId}") - @ExpectedResponses({200, 204}) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @PathParam("actionId") String actionId, + @BodyParam("application/json") ActionRequest action, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("ruleId") String ruleId, - @PathParam("actionId") String actionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @PathParam("actionId") String actionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAlertRuleNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + 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. @@ -153,19 +124,15 @@ Mono> listByAlertRuleNext( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -179,33 +146,16 @@ private Mono> listByAlertRuleSinglePageAsync( } 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)) + .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. @@ -216,19 +166,15 @@ private Mono> listByAlertRuleSinglePageAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -243,29 +189,15 @@ private Mono> listByAlertRuleSinglePageAsync( 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)); + .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. @@ -275,16 +207,15 @@ private Mono> listByAlertRuleSinglePageAsync( * @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), + private PagedFlux listByAlertRuleAsync(String resourceGroupName, String workspaceName, + String ruleId) { + return new PagedFlux<>(() -> listByAlertRuleSinglePageAsync(resourceGroupName, workspaceName, ruleId), nextLink -> listByAlertRuleNextSinglePageAsync(nextLink)); } /** * Gets all actions of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -295,16 +226,15 @@ private PagedFlux listByAlertRuleAsync( * @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), + private PagedFlux listByAlertRuleAsync(String resourceGroupName, String workspaceName, + String ruleId, Context context) { + return new PagedFlux<>(() -> listByAlertRuleSinglePageAsync(resourceGroupName, workspaceName, ruleId, context), nextLink -> listByAlertRuleNextSinglePageAsync(nextLink, context)); } /** * Gets all actions of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -314,14 +244,14 @@ private PagedFlux listByAlertRuleAsync( * @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) { + public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, + String ruleId) { return new PagedIterable<>(listByAlertRuleAsync(resourceGroupName, workspaceName, ruleId)); } /** * Gets all actions of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -332,14 +262,14 @@ public PagedIterable listByAlertRule( * @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) { + public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, + String ruleId, Context context) { return new PagedIterable<>(listByAlertRuleAsync(resourceGroupName, workspaceName, ruleId, context)); } /** * Gets the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -350,19 +280,15 @@ public PagedIterable listByAlertRule( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -379,25 +305,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - ruleId, - actionId, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, actionId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -409,19 +324,15 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -438,22 +349,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, ruleId, actionId, accept, context); } /** * Gets the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -464,51 +366,51 @@ private Mono> getWithResponseAsync( * @return the action of alert rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String ruleId, String actionId) { + private Mono getAsync(String resourceGroupName, String workspaceName, String ruleId, + String actionId) { return getWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return the action of alert rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ActionResponseInner get(String resourceGroupName, String workspaceName, String ruleId, String actionId) { - return getAsync(resourceGroupName, workspaceName, ruleId, actionId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, + String actionId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, context).block(); } /** * Gets the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the action of alert rule along with {@link Response}. + * @return the action of alert rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, context).block(); + public ActionResponseInner get(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + return getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE).getValue(); } /** * 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. @@ -520,19 +422,15 @@ public Response getWithResponse( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -554,26 +452,15 @@ private Mono> createOrUpdateWithResponseAsync( } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, actionId, action, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -586,24 +473,15 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -625,23 +503,14 @@ private Mono> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, actionId, action, accept, + context); } /** * Creates or updates the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -653,60 +522,56 @@ private Mono> createOrUpdateWithResponseAsync( * @return action for alert rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String ruleId, String actionId, ActionRequest action) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String ruleId, + String actionId, ActionRequest action) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, action) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return action for alert rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ActionResponseInner createOrUpdate( - String resourceGroupName, String workspaceName, String ruleId, String actionId, ActionRequest action) { - return createOrUpdateAsync(resourceGroupName, workspaceName, ruleId, actionId, action).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String ruleId, String actionId, ActionRequest action, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, action, context) + .block(); } /** * Creates or updates the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param action The action. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return action for alert rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String ruleId, - String actionId, - ActionRequest action, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, action, context) - .block(); + public ActionResponseInner createOrUpdate(String resourceGroupName, String workspaceName, String ruleId, + String actionId, ActionRequest action) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, actionId, action, Context.NONE) + .getValue(); } /** * Delete the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -717,19 +582,15 @@ public Response createOrUpdateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String ruleId, String actionId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -746,25 +607,14 @@ private Mono> deleteWithResponseAsync( } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, actionId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -776,19 +626,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -805,22 +651,13 @@ private Mono> deleteWithResponseAsync( } 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, ruleId, actionId, accept, context); } /** * Delete the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -838,44 +675,45 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, 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 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 void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId) { - deleteAsync(resourceGroupName, workspaceName, ruleId, actionId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, + String actionId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId, context).block(); } /** * Delete the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -887,31 +725,23 @@ private Mono> listByAlertRuleNextSinglePageAs 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByAlertRuleNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -919,29 +749,19 @@ private Mono> listByAlertRuleNextSinglePageAs * @return list all the actions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAlertRuleNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByAlertRuleNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByAlertRuleNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsImpl.java index 09f8ea57b333..4def627c6079 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 @@ -21,187 +21,148 @@ public final class ActionsImpl implements Actions { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public ActionsImpl( - ActionsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + public ActionsImpl(ActionsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listByAlertRule( - String resourceGroupName, String workspaceName, String ruleId) { - PagedIterable inner = - this.serviceClient().listByAlertRule(resourceGroupName, workspaceName, ruleId); - return Utils.mapPage(inner, inner1 -> new ActionResponseImpl(inner1, this.manager())); + public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, + String ruleId) { + 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 Utils.mapPage(inner, inner1 -> new ActionResponseImpl(inner1, this.manager())); + public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId, + Context context) { + PagedIterable inner + = this.serviceClient().listByAlertRule(resourceGroupName, workspaceName, ruleId, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ActionResponseImpl(inner1, this.manager())); } - public ActionResponse get(String resourceGroupName, String workspaceName, String ruleId, String actionId) { - ActionResponseInner inner = this.serviceClient().get(resourceGroupName, workspaceName, ruleId, actionId); + 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 ActionResponseImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ActionResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context); + public ActionResponse get(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + ActionResponseInner inner = this.serviceClient().get(resourceGroupName, workspaceName, ruleId, actionId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ActionResponseImpl(inner.getValue(), this.manager())); + return new ActionResponseImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId) { - this.serviceClient().delete(resourceGroupName, workspaceName, ruleId, actionId); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, + String actionId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context); + public void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + this.serviceClient().delete(resourceGroupName, workspaceName, ruleId, actionId); } public ActionResponse getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String ruleId = Utils.getValueFromIdByName(id, "alertRules"); + String ruleId = ResourceManagerUtils.getValueFromIdByName(id, "alertRules"); if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); } - String actionId = Utils.getValueFromIdByName(id, "actions"); + String actionId = ResourceManagerUtils.getValueFromIdByName(id, "actions"); if (actionId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String ruleId = Utils.getValueFromIdByName(id, "alertRules"); + String ruleId = ResourceManagerUtils.getValueFromIdByName(id, "alertRules"); if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); } - String actionId = Utils.getValueFromIdByName(id, "actions"); + String actionId = ResourceManagerUtils.getValueFromIdByName(id, "actions"); if (actionId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String ruleId = Utils.getValueFromIdByName(id, "alertRules"); + String ruleId = ResourceManagerUtils.getValueFromIdByName(id, "alertRules"); if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); } - String actionId = Utils.getValueFromIdByName(id, "actions"); + String actionId = ResourceManagerUtils.getValueFromIdByName(id, "actions"); if (actionId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String ruleId = Utils.getValueFromIdByName(id, "alertRules"); + String ruleId = ResourceManagerUtils.getValueFromIdByName(id, "alertRules"); if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'alertRules'.", id))); } - String actionId = Utils.getValueFromIdByName(id, "actions"); + String actionId = ResourceManagerUtils.getValueFromIdByName(id, "actions"); if (actionId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'actions'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, ruleId, actionId, context); } 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 48823696c23b..8661ffc31d4b 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 @@ -7,14 +7,15 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; import com.azure.resourcemanager.securityinsights.models.AlertRule; +import com.azure.resourcemanager.securityinsights.models.AlertRuleKind; public final class AlertRuleImpl implements AlertRule { private AlertRuleInner innerObject; private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - AlertRuleImpl( - AlertRuleInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + AlertRuleImpl(AlertRuleInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -39,6 +40,10 @@ 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..0d1c4c240e04 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsClientImpl.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +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 SecurityInsightsImpl client; + + /** + * Initializes an instance of AlertRuleOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertRuleOperationsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(AlertRuleOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsAlertRuleOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsAler") + public interface AlertRuleOperationsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/triggerRuleRun") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> triggerRuleRun(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, + @BodyParam("application/json") AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, + @HeaderParam("Accept") String accept, 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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerRuleRunWithResponseAsync(String resourceGroupName, + String workspaceName, String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter 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 (analyticsRuleRunTriggerParameter == null) { + return Mono.error(new IllegalArgumentException( + "Parameter analyticsRuleRunTriggerParameter is required and cannot be null.")); + } else { + analyticsRuleRunTriggerParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.triggerRuleRun(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, + analyticsRuleRunTriggerParameter, accept, 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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerRuleRunWithResponseAsync(String resourceGroupName, + String workspaceName, String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, + 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 (analyticsRuleRunTriggerParameter == null) { + return Mono.error(new IllegalArgumentException( + "Parameter analyticsRuleRunTriggerParameter is required and cannot be null.")); + } else { + analyticsRuleRunTriggerParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.triggerRuleRun(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter, + accept, context); + } + + /** + * triggers analytics rule run. + * + * @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 analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger 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 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, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = triggerRuleRunWithResponseAsync(resourceGroupName, workspaceName, + ruleId, analyticsRuleRunTriggerParameter, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), 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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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) { + return this.beginTriggerRuleRunAsync(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter) + .getSyncPoller(); + } + + /** + * triggers analytics rule run. + * + * @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 analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger 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 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) { + return this + .beginTriggerRuleRunAsync(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter, + context) + .getSyncPoller(); + } + + /** + * triggers analytics rule run. + * + * @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 analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger 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 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, Context context) { + return beginTriggerRuleRunAsync(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter, + context).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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter) { + triggerRuleRunAsync(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter).block(); + } + + /** + * triggers analytics rule run. + * + * @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 analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, Context context) { + triggerRuleRunAsync(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter, context) + .block(); + } +} 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..d7a9b1b098a7 --- /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) AutoRest 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 3ceab1ccfa28..2b080a9bbca4 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 @@ -6,6 +6,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.models.AlertRuleKind; import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplate; public final class AlertRuleTemplateImpl implements AlertRuleTemplate { @@ -13,8 +14,7 @@ public final class AlertRuleTemplateImpl implements AlertRuleTemplate { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - AlertRuleTemplateImpl( - AlertRuleTemplateInner innerObject, + AlertRuleTemplateImpl(AlertRuleTemplateInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -32,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public AlertRuleKind kind() { + return this.innerModel().kind(); + } + public SystemData systemData() { return this.innerModel().systemData(); } 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 d017573675b9..6c8e62bc84c4 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatesList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AlertRuleTemplatesClient. */ +/** + * An instance of this class provides access to all the operations defined in AlertRuleTemplatesClient. + */ public final class AlertRuleTemplatesClientImpl implements AlertRuleTemplatesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final AlertRuleTemplatesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of AlertRuleTemplatesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AlertRuleTemplatesClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(AlertRuleTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(AlertRuleTemplatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -55,53 +61,37 @@ public final class AlertRuleTemplatesClientImpl implements AlertRuleTemplatesCli */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsAler") - private interface AlertRuleTemplatesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates") - @ExpectedResponses({200}) + public interface AlertRuleTemplatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates" - + "/{alertRuleTemplateId}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates/{alertRuleTemplateId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("alertRuleTemplateId") String alertRuleTemplateId, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("alertRuleTemplateId") String alertRuleTemplateId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all alert rule templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -110,19 +100,15 @@ Mono> listNext( * @return all alert rule templates along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -133,32 +119,16 @@ private Mono> listSinglePageAsync( } 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.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. @@ -168,19 +138,15 @@ private Mono> listSinglePageAsync( * @return all alert rule templates along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -192,28 +158,15 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all alert rule templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -223,13 +176,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all alert rule templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -239,16 +192,15 @@ private PagedFlux listAsync(String resourceGroupName, St * @return all alert rule templates 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), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all alert rule templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -263,7 +215,7 @@ public PagedIterable list(String resourceGroupName, Stri /** * 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. @@ -279,7 +231,7 @@ public PagedIterable list(String resourceGroupName, Stri /** * Gets the alert rule template. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param alertRuleTemplateId Alert rule template ID. @@ -289,19 +241,15 @@ public PagedIterable list(String resourceGroupName, Stri * @return the alert rule template along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String alertRuleTemplateId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -315,25 +263,14 @@ private Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter alertRuleTemplateId is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - alertRuleTemplateId, - accept, - context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, alertRuleTemplateId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the alert rule template. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param alertRuleTemplateId Alert rule template ID. @@ -344,19 +281,15 @@ private Mono> getWithResponseAsync( * @return the alert rule template along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -371,21 +304,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, alertRuleTemplateId, accept, context); } /** * Gets the alert rule template. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param alertRuleTemplateId Alert rule template ID. @@ -395,56 +320,57 @@ private Mono> getWithResponseAsync( * @return the alert rule template on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String alertRuleTemplateId) { + private Mono getAsync(String resourceGroupName, String workspaceName, + String alertRuleTemplateId) { return getWithResponseAsync(resourceGroupName, workspaceName, alertRuleTemplateId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the alert rule template. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param alertRuleTemplateId Alert rule template ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule template. + * @return the alert rule template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) { - return getAsync(resourceGroupName, workspaceName, alertRuleTemplateId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String alertRuleTemplateId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, alertRuleTemplateId, context).block(); } /** * Gets the alert rule template. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param alertRuleTemplateId Alert rule template ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule template along with {@link Response}. + * @return the alert rule template. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, alertRuleTemplateId, context).block(); + public AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) { + return getWithResponse(resourceGroupName, workspaceName, alertRuleTemplateId, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list all the alert rule templates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list all the alert rule templates along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -452,37 +378,28 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list all the alert rule templates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list all the alert rule templates along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -490,23 +407,13 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesImpl.java index e5bdc4bc9ffc..16fc67c7120e 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 @@ -21,8 +21,7 @@ public final class AlertRuleTemplatesImpl implements AlertRuleTemplates { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public AlertRuleTemplatesImpl( - AlertRuleTemplatesClient innerClient, + public AlertRuleTemplatesImpl(AlertRuleTemplatesClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,34 +29,31 @@ public AlertRuleTemplatesImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new AlertRuleTemplateImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new AlertRuleTemplateImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertRuleTemplateImpl(inner1, this.manager())); } - public AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) { - AlertRuleTemplateInner inner = this.serviceClient().get(resourceGroupName, workspaceName, alertRuleTemplateId); + 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 AlertRuleTemplateImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AlertRuleTemplateImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, alertRuleTemplateId, context); + public AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) { + AlertRuleTemplateInner inner = this.serviceClient().get(resourceGroupName, workspaceName, alertRuleTemplateId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AlertRuleTemplateImpl(inner.getValue(), this.manager())); + return new AlertRuleTemplateImpl(inner, this.manager()); } else { return null; } 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 e092a7beec6d..ebd4058eccc0 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 @@ -33,22 +33,28 @@ import com.azure.resourcemanager.securityinsights.models.AlertRulesList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AlertRulesClient. */ +/** + * An instance of this class provides access to all the operations defined in AlertRulesClient. + */ public final class AlertRulesClientImpl implements AlertRulesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final AlertRulesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of AlertRulesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AlertRulesClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(AlertRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(AlertRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,85 +64,55 @@ public final class AlertRulesClientImpl implements AlertRulesClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsAler") - private interface AlertRulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules") - @ExpectedResponses({200}) + public interface AlertRulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("ruleId") String ruleId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") AlertRuleInner alertRule, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") - @ExpectedResponses({200, 204}) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @BodyParam("application/json") AlertRuleInner alertRule, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("ruleId") String ruleId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + 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. @@ -147,16 +123,12 @@ Mono> listNext( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -167,32 +139,16 @@ private Mono> listSinglePageAsync(String resourceG } 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.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. @@ -202,19 +158,15 @@ private Mono> listSinglePageAsync(String resourceG * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -226,28 +178,15 @@ private Mono> listSinglePageAsync( 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)); + .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. @@ -257,13 +196,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all alert rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -274,14 +213,13 @@ private PagedFlux listAsync(String resourceGroupName, String wor */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all alert rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -296,7 +234,7 @@ public PagedIterable list(String resourceGroupName, String works /** * 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. @@ -312,7 +250,7 @@ public PagedIterable list(String resourceGroupName, String works /** * 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. @@ -322,19 +260,15 @@ public PagedIterable list(String resourceGroupName, String works * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -348,24 +282,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - ruleId, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -376,19 +300,15 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -402,21 +322,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, ruleId, accept, context); } /** * Gets the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -433,41 +345,41 @@ 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 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. + * @return the alert rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AlertRuleInner get(String resourceGroupName, String workspaceName, String ruleId) { - return getAsync(resourceGroupName, workspaceName, ruleId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleId, context).block(); } /** * Gets the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule along with {@link Response}. + * @return the alert rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String ruleId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, ruleId, context).block(); + public AlertRuleInner get(String resourceGroupName, String workspaceName, String ruleId) { + return getWithResponse(resourceGroupName, workspaceName, ruleId, Context.NONE).getValue(); } /** * 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. @@ -478,19 +390,15 @@ public Response getWithResponse( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -509,25 +417,14 @@ private Mono> createOrUpdateWithResponseAsync( } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, alertRule, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -539,19 +436,15 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -570,22 +463,13 @@ private Mono> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, alertRule, accept, context); } /** * Creates or updates the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -596,52 +480,52 @@ private Mono> createOrUpdateWithResponseAsync( * @return alert rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String ruleId, + AlertRuleInner alertRule) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, alertRule) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return alert rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AlertRuleInner createOrUpdate( - String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule) { - return createOrUpdateAsync(resourceGroupName, workspaceName, ruleId, alertRule).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String ruleId, AlertRuleInner alertRule, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, alertRule, context).block(); } /** * Creates or updates the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return alert rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleId, alertRule, context).block(); + public AlertRuleInner createOrUpdate(String resourceGroupName, String workspaceName, String ruleId, + AlertRuleInner alertRule) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, alertRule, Context.NONE).getValue(); } /** * Delete the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -651,19 +535,15 @@ public Response createOrUpdateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String ruleId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -677,24 +557,14 @@ private Mono> deleteWithResponseAsync( } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -705,19 +575,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String ruleId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -731,21 +597,13 @@ private Mono> deleteWithResponseAsync( } 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, ruleId, accept, context); } /** * Delete the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -761,42 +619,43 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, 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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String ruleId) { - deleteAsync(resourceGroupName, workspaceName, ruleId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId, context).block(); } /** * Delete the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId, context).block(); + public void delete(String resourceGroupName, String workspaceName, String ruleId) { + deleteWithResponse(resourceGroupName, workspaceName, ruleId, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -808,31 +667,22 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -845,23 +695,13 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesImpl.java index 4f4d06aa4fa9..eb6aa3964151 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 @@ -21,8 +21,7 @@ public final class AlertRulesImpl implements AlertRules { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public AlertRulesImpl( - AlertRulesClient innerClient, + public AlertRulesImpl(AlertRulesClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,12 +29,24 @@ public AlertRulesImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new AlertRuleImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new AlertRuleImpl(inner1, this.manager())); + 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; + } } public AlertRule get(String resourceGroupName, String workspaceName, String ruleId) { @@ -47,23 +58,20 @@ public AlertRule get(String resourceGroupName, String workspaceName, String rule } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String ruleId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, ruleId, context); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String ruleId, + AlertRuleInner alertRule, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, alertRule, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AlertRuleImpl(inner.getValue(), this.manager())); } else { return null; } } - public AlertRule createOrUpdate( - String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule) { + public AlertRule createOrUpdate(String resourceGroupName, String workspaceName, String ruleId, + AlertRuleInner alertRule) { AlertRuleInner inner = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, ruleId, alertRule); if (inner != null) { return new AlertRuleImpl(inner, this.manager()); @@ -72,32 +80,15 @@ public AlertRule createOrUpdate( } } - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule, Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, ruleId, alertRule, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AlertRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, ruleId, context); } public void delete(String resourceGroupName, String workspaceName, String ruleId) { this.serviceClient().delete(resourceGroupName, workspaceName, ruleId); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String ruleId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, ruleId, context); - } - private AlertRulesClient serviceClient() { return this.innerClient; } 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 f0425bbe6038..4ab5d524456a 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 @@ -102,24 +102,19 @@ public AutomationRuleImpl withExistingWorkspace(String resourceGroupName, String } public AutomationRule create() { - this.innerObject = - serviceManager - .serviceClient() - .getAutomationRules() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, automationRuleId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getAutomationRules() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, automationRuleId, this.innerModel(), + Context.NONE) + .getValue(); return this; } public AutomationRule create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAutomationRules() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, automationRuleId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getAutomationRules() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, automationRuleId, this.innerModel(), context) + .getValue(); return this; } @@ -134,54 +129,44 @@ public AutomationRuleImpl update() { } public AutomationRule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getAutomationRules() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, automationRuleId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getAutomationRules() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, automationRuleId, this.innerModel(), + Context.NONE) + .getValue(); return this; } public AutomationRule apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAutomationRules() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, automationRuleId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getAutomationRules() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, automationRuleId, this.innerModel(), context) + .getValue(); return this; } - AutomationRuleImpl( - AutomationRuleInner innerObject, + AutomationRuleImpl(AutomationRuleInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.automationRuleId = Utils.getValueFromIdByName(innerObject.id(), "automationRules"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.automationRuleId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "automationRules"); } public AutomationRule refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAutomationRules() - .getWithResponse(resourceGroupName, workspaceName, automationRuleId, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getAutomationRules() + .getWithResponse(resourceGroupName, workspaceName, automationRuleId, Context.NONE) + .getValue(); return this; } public AutomationRule refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAutomationRules() - .getWithResponse(resourceGroupName, workspaceName, automationRuleId, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getAutomationRules() + .getWithResponse(resourceGroupName, workspaceName, automationRuleId, context) + .getValue(); return this; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesClientImpl.java index 68b5fbf01089..86973b59800b 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 @@ -33,22 +33,28 @@ import com.azure.resourcemanager.securityinsights.models.AutomationRulesList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AutomationRulesClient. */ +/** + * An instance of this class provides access to all the operations defined in AutomationRulesClient. + */ public final class AutomationRulesClientImpl implements AutomationRulesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final AutomationRulesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of AutomationRulesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AutomationRulesClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(AutomationRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(AutomationRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,85 +64,58 @@ public final class AutomationRulesClientImpl implements AutomationRulesClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsAuto") - private interface AutomationRulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}") - @ExpectedResponses({200}) + 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, - @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, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("automationRuleId") String automationRuleId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("automationRuleId") String automationRuleId, @BodyParam("application/json") AutomationRuleInner automationRuleToUpsert, - @HeaderParam("Accept") String accept, - Context context); + @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}) + @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, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("automationRuleId") String automationRuleId, - @HeaderParam("Accept") String accept, + @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") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") 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 automationRuleId Automation rule ID. @@ -146,19 +125,15 @@ Mono> listNext( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -173,24 +148,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - automationRuleId, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, automationRuleId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. @@ -201,19 +166,15 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -228,21 +189,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, automationRuleId, accept, context); } /** * Gets the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. @@ -252,49 +205,49 @@ private Mono> getWithResponseAsync( * @return the automation rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String automationRuleId) { + private Mono getAsync(String resourceGroupName, String workspaceName, + String automationRuleId) { return getWithResponseAsync(resourceGroupName, workspaceName, automationRuleId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return the automation rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationRuleInner get(String resourceGroupName, String workspaceName, String automationRuleId) { - return getAsync(resourceGroupName, workspaceName, automationRuleId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String automationRuleId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, context).block(); } /** * Gets the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the automation rule along with {@link Response}. + * @return the automation rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String automationRuleId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, context).block(); + public AutomationRuleInner get(String resourceGroupName, String workspaceName, String automationRuleId) { + return getWithResponse(resourceGroupName, workspaceName, automationRuleId, Context.NONE).getValue(); } /** * 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. @@ -305,22 +258,15 @@ public Response getWithResponse( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -338,25 +284,15 @@ private Mono> createOrUpdateWithResponseAsync( } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, automationRuleId, + automationRuleToUpsert, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. @@ -368,23 +304,15 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -402,65 +330,53 @@ private Mono> createOrUpdateWithResponseAsync( } 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); + 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 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String automationRuleId, - AutomationRuleInner automationRuleToUpsert) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, automationRuleId, automationRuleToUpsert) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String automationRuleId) { + final AutomationRuleInner automationRuleToUpsert = null; + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, + automationRuleToUpsert).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 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 on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String automationRuleId) { - final AutomationRuleInner automationRuleToUpsert = null; - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, automationRuleId, automationRuleToUpsert) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String automationRuleId, AutomationRuleInner automationRuleToUpsert, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, + automationRuleToUpsert, context).block(); } /** * Creates or updates the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. @@ -472,37 +388,13 @@ private Mono createOrUpdateAsync( @ServiceMethod(returns = ReturnType.SINGLE) public AutomationRuleInner createOrUpdate(String resourceGroupName, String workspaceName, String automationRuleId) { final AutomationRuleInner automationRuleToUpsert = null; - return createOrUpdateAsync(resourceGroupName, workspaceName, automationRuleId, automationRuleToUpsert).block(); - } - - /** - * Creates or updates the automation rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param automationRuleId Automation rule ID. - * @param 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}. - */ - @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(); + return createOrUpdateWithResponse(resourceGroupName, workspaceName, automationRuleId, automationRuleToUpsert, + Context.NONE).getValue(); } /** * 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. @@ -512,19 +404,15 @@ public Response createOrUpdateWithResponse( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -539,24 +427,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - automationRuleId, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, automationRuleId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. @@ -567,19 +445,15 @@ private Mono> deleteWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -594,21 +468,13 @@ private Mono> deleteWithResponseAsync( } 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); + 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. @@ -625,41 +491,41 @@ 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 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. + * @return any object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Object delete(String resourceGroupName, String workspaceName, String automationRuleId) { - return deleteAsync(resourceGroupName, workspaceName, automationRuleId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, context).block(); } /** * Delete the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 any object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String automationRuleId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, context).block(); + public Object delete(String resourceGroupName, String workspaceName, String automationRuleId) { + return deleteWithResponse(resourceGroupName, workspaceName, automationRuleId, Context.NONE).getValue(); } /** * Gets all automation rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -668,19 +534,15 @@ public Response deleteWithResponse( * @return all automation rules along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -691,32 +553,16 @@ private Mono> listSinglePageAsync( } 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all automation rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -726,19 +572,15 @@ private Mono> listSinglePageAsync( * @return all automation rules along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -750,28 +592,15 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all automation rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -781,13 +610,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all automation rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -798,14 +627,13 @@ private PagedFlux listAsync(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all automation rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -820,7 +648,7 @@ public PagedIterable list(String resourceGroupName, String /** * 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. @@ -836,9 +664,10 @@ public PagedIterable list(String resourceGroupName, String /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -850,31 +679,22 @@ private Mono> listNextSinglePageAsync(String 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -887,23 +707,13 @@ private Mono> listNextSinglePageAsync(String 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesImpl.java index 90cf494caf3d..9af46719e080 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 @@ -21,160 +21,124 @@ public final class AutomationRulesImpl implements AutomationRules { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public AutomationRulesImpl( - AutomationRulesClient innerClient, + public AutomationRulesImpl(AutomationRulesClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public AutomationRule get(String resourceGroupName, String workspaceName, String automationRuleId) { - AutomationRuleInner inner = this.serviceClient().get(resourceGroupName, workspaceName, automationRuleId); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String automationRuleId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, automationRuleId, context); if (inner != null) { - return new AutomationRuleImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AutomationRuleImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String automationRuleId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, automationRuleId, context); + public AutomationRule get(String resourceGroupName, String workspaceName, String automationRuleId) { + AutomationRuleInner inner = this.serviceClient().get(resourceGroupName, workspaceName, automationRuleId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AutomationRuleImpl(inner.getValue(), this.manager())); + return new AutomationRuleImpl(inner, this.manager()); } else { return null; } } - public Object delete(String resourceGroupName, String workspaceName, String automationRuleId) { - return this.serviceClient().delete(resourceGroupName, workspaceName, automationRuleId); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, automationRuleId, context); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String automationRuleId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, automationRuleId, context); + public Object delete(String resourceGroupName, String workspaceName, String automationRuleId) { + return this.serviceClient().delete(resourceGroupName, workspaceName, automationRuleId); } public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new AutomationRuleImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationRuleImpl(inner1, this.manager())); } public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); - return Utils.mapPage(inner, inner1 -> new AutomationRuleImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationRuleImpl(inner1, this.manager())); } public AutomationRule getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String automationRuleId = Utils.getValueFromIdByName(id, "automationRules"); + String automationRuleId = ResourceManagerUtils.getValueFromIdByName(id, "automationRules"); if (automationRuleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, automationRuleId, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String automationRuleId = Utils.getValueFromIdByName(id, "automationRules"); + String automationRuleId = ResourceManagerUtils.getValueFromIdByName(id, "automationRules"); if (automationRuleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, automationRuleId, context); } public Object deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String automationRuleId = Utils.getValueFromIdByName(id, "automationRules"); + String automationRuleId = ResourceManagerUtils.getValueFromIdByName(id, "automationRules"); if (automationRuleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, automationRuleId, Context.NONE).getValue(); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String automationRuleId = Utils.getValueFromIdByName(id, "automationRules"); + String automationRuleId = ResourceManagerUtils.getValueFromIdByName(id, "automationRules"); if (automationRuleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'automationRules'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, automationRuleId, context); } 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..bf7bf86a6390 --- /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) AutoRest 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 String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BillingStatisticKind kind() { + return this.innerModel().kind(); + } + + 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..145da94fbb88 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsClientImpl.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.BillingStatisticsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of BillingStatisticsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BillingStatisticsClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(BillingStatisticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsBillingStatistics to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsBill") + public interface BillingStatisticsService { + @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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/billingStatistics/{billingStatisticName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("billingStatisticName") String billingStatisticName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("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 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} 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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<>(listAsync(resourceGroupName, 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 ManagementException 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<>(listAsync(resourceGroupName, workspaceName, 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (billingStatisticName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingStatisticName 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (billingStatisticName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingStatisticName 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, billingStatisticName, context).block(); + } + + /** + * 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all Microsoft Sentinel billing statistics 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all Microsoft Sentinel billing statistics along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsImpl.java new file mode 100644 index 000000000000..0d7b9ec4ca0c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.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 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())); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String billingStatisticName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, billingStatisticName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BillingStatisticImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; + } + } + + 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 index b42e787c9a3f..f9ff52a7db60 100644 --- 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 @@ -14,8 +14,7 @@ public final class BookmarkExpandResponseImpl implements BookmarkExpandResponse private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - BookmarkExpandResponseImpl( - BookmarkExpandResponseInner innerObject, + BookmarkExpandResponseImpl(BookmarkExpandResponseInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 58081823ee60..535dc6db01e7 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 @@ -150,23 +150,18 @@ public BookmarkImpl withExistingWorkspace(String resourceGroupName, String works } public Bookmark create() { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarks() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, bookmarkId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, this.innerModel(), Context.NONE) + .getValue(); return this; } public Bookmark create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarks() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, this.innerModel(), context) + .getValue(); return this; } @@ -181,52 +176,43 @@ public BookmarkImpl update() { } public Bookmark apply() { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarks() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, bookmarkId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, this.innerModel(), Context.NONE) + .getValue(); return this; } public Bookmark apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarks() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, this.innerModel(), context) + .getValue(); return this; } - BookmarkImpl( - BookmarkInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + BookmarkImpl(BookmarkInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.bookmarkId = Utils.getValueFromIdByName(innerObject.id(), "bookmarks"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.bookmarkId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "bookmarks"); } public Bookmark refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarks() - .getWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarks() + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE) + .getValue(); return this; } public Bookmark refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarks() - .getWithResponse(resourceGroupName, workspaceName, bookmarkId, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarks() + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, context) + .getValue(); 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 index 0e1ed907707d..35a3701edbee 100644 --- 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 @@ -27,22 +27,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final BookmarkOperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of BookmarkOperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ BookmarkOperationsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(BookmarkOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(BookmarkOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -52,28 +58,22 @@ public final class BookmarkOperationsClientImpl implements BookmarkOperationsCli */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsBook") - private interface BookmarkOperationsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand") - @ExpectedResponses({200}) + public interface BookmarkOperationsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> expand( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> expand(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("bookmarkId") String bookmarkId, - @BodyParam("application/json") BookmarkExpandParameters parameters, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") BookmarkExpandParameters parameters, @HeaderParam("Accept") String accept, Context context); } /** * Expand an bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -82,22 +82,18 @@ Mono> expand( * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> expandWithResponseAsync( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters) { + private Mono> expandWithResponseAsync(String resourceGroupName, + String workspaceName, String bookmarkId, BookmarkExpandParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -115,26 +111,14 @@ private Mono> expandWithResponseAsync( parameters.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .expand( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - bookmarkId, - parameters, - accept, - context)) + return FluxUtil.withContext(context -> service.expand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Expand an bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -144,26 +128,18 @@ private Mono> expandWithResponseAsync( * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> expandWithResponseAsync( - String resourceGroupName, - String workspaceName, - String bookmarkId, - BookmarkExpandParameters parameters, - Context context) { + private Mono> expandWithResponseAsync(String resourceGroupName, + String workspaceName, String bookmarkId, BookmarkExpandParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -182,22 +158,13 @@ private Mono> expandWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .expand( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - bookmarkId, - parameters, - accept, - context); + return service.expand(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, bookmarkId, parameters, accept, context); } /** * Expand an bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -208,50 +175,46 @@ private Mono> expandWithResponseAsync( * @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) { + 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 workspace. * @param bookmarkId Bookmark ID. * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entity expansion result operation response. + * @return the entity expansion result operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BookmarkExpandResponseInner expand( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters) { - return expandAsync(resourceGroupName, workspaceName, bookmarkId, parameters).block(); + public Response expandWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, BookmarkExpandParameters parameters, Context context) { + return expandWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, parameters, context).block(); } /** * Expand an bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param parameters The parameters required to execute an expand operation on the given bookmark. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entity expansion result operation response along with {@link Response}. + * @return the entity expansion result operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response expandWithResponse( - String resourceGroupName, - String workspaceName, - String bookmarkId, - BookmarkExpandParameters parameters, - Context context) { - return expandWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, parameters, context).block(); + 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 index 40b134363e7c..c3984c182c44 100644 --- 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 @@ -21,38 +21,30 @@ public final class BookmarkOperationsImpl implements BookmarkOperations { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public BookmarkOperationsImpl( - BookmarkOperationsClient innerClient, + public BookmarkOperationsImpl(BookmarkOperationsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public BookmarkExpandResponse expand( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters) { - BookmarkExpandResponseInner inner = - this.serviceClient().expand(resourceGroupName, workspaceName, bookmarkId, parameters); + public Response expandWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, BookmarkExpandParameters parameters, Context context) { + Response inner = this.serviceClient() + .expandWithResponse(resourceGroupName, workspaceName, bookmarkId, parameters, context); if (inner != null) { - return new BookmarkExpandResponseImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BookmarkExpandResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response expandWithResponse( - String resourceGroupName, - String workspaceName, - String bookmarkId, - BookmarkExpandParameters parameters, - Context context) { - Response inner = - this.serviceClient().expandWithResponse(resourceGroupName, workspaceName, bookmarkId, parameters, context); + 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 SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BookmarkExpandResponseImpl(inner.getValue(), this.manager())); + return new BookmarkExpandResponseImpl(inner, this.manager()); } else { return null; } 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 index f2f214d54a93..71412d0d6bb1 100644 --- 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 @@ -33,22 +33,28 @@ import com.azure.resourcemanager.securityinsights.models.RelationList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in BookmarkRelationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final BookmarkRelationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of BookmarkRelationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ BookmarkRelationsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(BookmarkRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(BookmarkRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,96 +64,60 @@ public final class BookmarkRelationsClientImpl implements BookmarkRelationsClien */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsBook") - private interface BookmarkRelationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations") - @ExpectedResponses({200}) + public interface BookmarkRelationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("bookmarkId") String bookmarkId, - @QueryParam("$filter") String filter, - @QueryParam("$orderby") String orderby, - @QueryParam("$top") Integer top, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations" - + "/{relationName}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("bookmarkId") String bookmarkId, - @PathParam("relationName") String relationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations" - + "/{relationName}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, @PathParam("relationName") String relationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("bookmarkId") String bookmarkId, - @PathParam("relationName") String relationName, - @BodyParam("application/json") RelationInner relation, - @HeaderParam("Accept") String accept, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, @PathParam("relationName") String relationName, + @BodyParam("application/json") RelationInner relation, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations" - + "/{relationName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("bookmarkId") String bookmarkId, - @PathParam("relationName") String relationName, - @HeaderParam("Accept") String accept, - Context context); + @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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all bookmark relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -155,33 +125,23 @@ Mono> listNext( * @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. + * 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) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String bookmarkId, String filter, String orderby, Integer top, String skipToken) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -195,37 +155,17 @@ private Mono> listSinglePageAsync( } 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)) + .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. @@ -233,8 +173,8 @@ private Mono> listSinglePageAsync( * @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. + * 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. @@ -242,26 +182,15 @@ private Mono> listSinglePageAsync( * @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, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String bookmarkId, String filter, String orderby, Integer top, String skipToken, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -276,33 +205,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - bookmarkId, - filter, - orderby, - top, - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all bookmark relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -310,22 +221,16 @@ private Mono> listSinglePageAsync( * @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. + * 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) { + 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)); @@ -333,7 +238,7 @@ private PagedFlux listAsync( /** * 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. @@ -355,7 +260,7 @@ private PagedFlux listAsync(String resourceGroupName, String work /** * 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. @@ -363,8 +268,8 @@ private PagedFlux listAsync(String resourceGroupName, String work * @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. + * 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. @@ -372,25 +277,15 @@ private PagedFlux listAsync(String resourceGroupName, String work * @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, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String bookmarkId, + String filter, String orderby, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, bookmarkId, filter, orderby, + top, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all bookmark relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -411,7 +306,7 @@ public PagedIterable list(String resourceGroupName, String worksp /** * 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. @@ -419,8 +314,8 @@ public PagedIterable list(String resourceGroupName, String worksp * @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. + * 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. @@ -428,22 +323,15 @@ public PagedIterable list(String resourceGroupName, String worksp * @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) { + public PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId, + String filter, String orderby, Integer top, String skipToken, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken, context)); } /** * Gets a bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -454,19 +342,15 @@ public PagedIterable list( * @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) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -483,25 +367,15 @@ private Mono> getWithResponseAsync( } 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)) + .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. @@ -513,19 +387,15 @@ private Mono> getWithResponseAsync( * @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, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -542,22 +412,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - bookmarkId, - relationName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, bookmarkId, relationName, accept, context); } /** * Gets a bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -568,51 +429,51 @@ private Mono> getWithResponseAsync( * @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) { + 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. + * @return a bookmark relation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelationInner get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { - return getAsync(resourceGroupName, workspaceName, bookmarkId, relationName).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName, context).block(); } /** * Gets a bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param relationName Relation Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a bookmark relation along with {@link Response}. + * @return a bookmark relation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName, context).block(); + 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. @@ -622,26 +483,18 @@ public Response getWithResponse( * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String bookmarkId, - String relationName, - RelationInner relation) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String bookmarkId, String relationName, RelationInner relation) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -663,26 +516,15 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - bookmarkId, - relationName, - relation, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, relationName, relation, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates the bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -693,27 +535,18 @@ private Mono> createOrUpdateWithResponseAsync( * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String bookmarkId, - String relationName, - RelationInner relation, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String bookmarkId, String relationName, RelationInner relation, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -735,23 +568,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - bookmarkId, - relationName, - relation, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, relationName, relation, + accept, context); } /** * Creates the bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -763,69 +587,56 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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 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. + * @return represents a relation between two resources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelationInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String bookmarkId, - String relationName, - RelationInner relation) { - return createOrUpdateAsync(resourceGroupName, workspaceName, bookmarkId, relationName, relation).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName, RelationInner relation, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName, relation, + context).block(); } /** * Creates the bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param relationName Relation Name. * @param relation The relation model. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 represents a relation between two resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String bookmarkId, - String relationName, - RelationInner relation, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, bookmarkId, relationName, relation, context) - .block(); + 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. @@ -836,19 +647,15 @@ public Response createOrUpdateWithResponse( * @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) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -865,25 +672,15 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - bookmarkId, - relationName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, relationName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -895,19 +692,15 @@ private Mono> deleteWithResponseAsync( * @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, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -924,22 +717,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - bookmarkId, - relationName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, bookmarkId, relationName, accept, context); } /** * Delete the bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -950,52 +734,53 @@ private Mono> deleteWithResponseAsync( * @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) { + 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 void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { - deleteAsync(resourceGroupName, workspaceName, bookmarkId, relationName).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName, context).block(); } /** * Delete the bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param relationName Relation Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName, context).block(); + public void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1007,31 +792,22 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1044,23 +820,13 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsImpl.java index 0c90dbec0292..759609fbdb16 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 @@ -21,8 +21,7 @@ public final class BookmarkRelationsImpl implements BookmarkRelations { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public BookmarkRelationsImpl( - BookmarkRelationsClient innerClient, + public BookmarkRelationsImpl(BookmarkRelationsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,190 +29,140 @@ public BookmarkRelationsImpl( public PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, bookmarkId); - return Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId, + String filter, String orderby, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); } - public Relation get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { - RelationInner inner = this.serviceClient().get(resourceGroupName, workspaceName, bookmarkId, relationName); + public Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); if (inner != null) { - return new RelationImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); + 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 SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RelationImpl(inner.getValue(), this.manager())); + return new RelationImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { - this.serviceClient().delete(resourceGroupName, workspaceName, bookmarkId, relationName); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); } - public 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 Relation getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); } - String relationName = Utils.getValueFromIdByName(id, "relations"); + 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))); + 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) + return this.getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); } - String relationName = Utils.getValueFromIdByName(id, "relations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'relations'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); } - String relationName = Utils.getValueFromIdByName(id, "relations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'relations'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); } - String relationName = Utils.getValueFromIdByName(id, "relations"); + 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))); + 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); } 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 4dc36ed754b4..6b5082dd107a 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 @@ -33,22 +33,28 @@ import com.azure.resourcemanager.securityinsights.models.BookmarkList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in BookmarksClient. */ +/** + * An instance of this class provides access to all the operations defined in BookmarksClient. + */ public final class BookmarksClientImpl implements BookmarksClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final BookmarksService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of BookmarksClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ BookmarksClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(BookmarksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(BookmarksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,85 +64,55 @@ public final class BookmarksClientImpl implements BookmarksClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsBook") - private interface BookmarksService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks") - @ExpectedResponses({200}) + public interface BookmarksService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("bookmarkId") String bookmarkId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("bookmarkId") String bookmarkId, - @BodyParam("application/json") BookmarkInner bookmark, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") - @ExpectedResponses({200, 204}) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, @BodyParam("application/json") BookmarkInner bookmark, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("bookmarkId") String bookmarkId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + 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. @@ -147,16 +123,12 @@ Mono> listNext( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -167,32 +139,16 @@ private Mono> listSinglePageAsync(String resourceGr } 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.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. @@ -202,19 +158,15 @@ private Mono> listSinglePageAsync(String resourceGr * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -226,28 +178,15 @@ private Mono> listSinglePageAsync( 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)); + .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. @@ -257,13 +196,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -274,14 +213,13 @@ private PagedFlux listAsync(String resourceGroupName, String work */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -296,7 +234,7 @@ public PagedIterable list(String resourceGroupName, String worksp /** * 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. @@ -312,7 +250,7 @@ public PagedIterable list(String resourceGroupName, String worksp /** * 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. @@ -322,19 +260,15 @@ public PagedIterable list(String resourceGroupName, String worksp * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -348,24 +282,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - bookmarkId, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -376,19 +300,15 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -402,21 +322,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, bookmarkId, accept, context); } /** * Gets a bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -433,41 +345,41 @@ 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 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. + * @return a bookmark along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BookmarkInner get(String resourceGroupName, String workspaceName, String bookmarkId) { - return getAsync(resourceGroupName, workspaceName, bookmarkId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, context).block(); } /** * Gets a bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a bookmark along with {@link Response}. + * @return a bookmark. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, context).block(); + public BookmarkInner get(String resourceGroupName, String workspaceName, String bookmarkId) { + return getWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE).getValue(); } /** * 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. @@ -476,22 +388,18 @@ public Response getWithResponse( * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -510,25 +418,15 @@ private Mono> createOrUpdateWithResponseAsync( } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, bookmark, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -538,22 +436,18 @@ private Mono> createOrUpdateWithResponseAsync( * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -572,22 +466,13 @@ private Mono> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, bookmark, accept, context); } /** * Creates or updates the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -598,52 +483,53 @@ private Mono> createOrUpdateWithResponseAsync( * @return represents a bookmark in Azure Security Insights on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String bookmarkId, + BookmarkInner bookmark) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, bookmark) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return represents a bookmark in Azure Security Insights along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BookmarkInner createOrUpdate( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark) { - return createOrUpdateAsync(resourceGroupName, workspaceName, bookmarkId, bookmark).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, BookmarkInner bookmark, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, bookmark, context).block(); } /** * Creates or updates the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param bookmark The bookmark. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return represents a bookmark in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkInner bookmark, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, bookmark, context).block(); + public BookmarkInner createOrUpdate(String resourceGroupName, String workspaceName, String bookmarkId, + BookmarkInner bookmark) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, bookmark, Context.NONE) + .getValue(); } /** * Delete the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -653,19 +539,15 @@ public Response createOrUpdateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String bookmarkId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -679,24 +561,14 @@ private Mono> deleteWithResponseAsync( } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -707,19 +579,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String bookmarkId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -733,21 +601,13 @@ private Mono> deleteWithResponseAsync( } 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, bookmarkId, accept, context); } /** * Delete the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -763,42 +623,43 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, 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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String bookmarkId) { - deleteAsync(resourceGroupName, workspaceName, bookmarkId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, context).block(); } /** * Delete the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, context).block(); + public void delete(String resourceGroupName, String workspaceName, String bookmarkId) { + deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -810,31 +671,22 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -847,23 +699,13 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksImpl.java index e87053fd5814..e1cd3e1fae8b 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 @@ -21,8 +21,7 @@ public final class BookmarksImpl implements Bookmarks { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public BookmarksImpl( - BookmarksClient innerClient, + public BookmarksImpl(BookmarksClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,147 +29,116 @@ public BookmarksImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new BookmarkImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new BookmarkImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BookmarkImpl(inner1, this.manager())); } - public Bookmark get(String resourceGroupName, String workspaceName, String bookmarkId) { - BookmarkInner inner = this.serviceClient().get(resourceGroupName, workspaceName, bookmarkId); + 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 BookmarkImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BookmarkImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, bookmarkId, context); + public Bookmark get(String resourceGroupName, String workspaceName, String bookmarkId) { + BookmarkInner inner = this.serviceClient().get(resourceGroupName, workspaceName, bookmarkId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BookmarkImpl(inner.getValue(), this.manager())); + return new BookmarkImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String bookmarkId) { - this.serviceClient().delete(resourceGroupName, workspaceName, bookmarkId); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, context); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, context); + public void delete(String resourceGroupName, String workspaceName, String bookmarkId) { + this.serviceClient().delete(resourceGroupName, workspaceName, bookmarkId); } public Bookmark getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, bookmarkId, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String bookmarkId = Utils.getValueFromIdByName(id, "bookmarks"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bookmarks'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, context); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentOperationsClientImpl.java new file mode 100644 index 000000000000..96b9c5953e46 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentOperationsClientImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.BusinessApplicationAgentOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BusinessApplicationAgentResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BusinessApplicationAgentOperationsClient. + */ +public final class BusinessApplicationAgentOperationsClientImpl implements BusinessApplicationAgentOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BusinessApplicationAgentOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of BusinessApplicationAgentOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BusinessApplicationAgentOperationsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(BusinessApplicationAgentOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsBusinessApplicationAgentOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsBusi") + public interface BusinessApplicationAgentOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents/{agentResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("agentResourceName") String agentResourceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 business Application Agent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String agentResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, agentResourceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 business Application Agent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String agentResourceName, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + agentResourceName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 business Application Agent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String agentResourceName) { + return getWithResponseAsync(resourceGroupName, workspaceName, agentResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 business Application Agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String workspaceName, String agentResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, context).block(); + } + + /** + * Gets Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 business Application Agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BusinessApplicationAgentResourceInner get(String resourceGroupName, String workspaceName, + String agentResourceName) { + return getWithResponse(resourceGroupName, workspaceName, agentResourceName, Context.NONE).getValue(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentOperationsImpl.java new file mode 100644 index 000000000000..cf775f22c977 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentOperationsImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.BusinessApplicationAgentOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BusinessApplicationAgentResourceInner; +import com.azure.resourcemanager.securityinsights.models.BusinessApplicationAgentOperations; +import com.azure.resourcemanager.securityinsights.models.BusinessApplicationAgentResource; + +public final class BusinessApplicationAgentOperationsImpl implements BusinessApplicationAgentOperations { + private static final ClientLogger LOGGER = new ClientLogger(BusinessApplicationAgentOperationsImpl.class); + + private final BusinessApplicationAgentOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public BusinessApplicationAgentOperationsImpl(BusinessApplicationAgentOperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, agentResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BusinessApplicationAgentResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BusinessApplicationAgentResource get(String resourceGroupName, String workspaceName, + String agentResourceName) { + BusinessApplicationAgentResourceInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, agentResourceName); + if (inner != null) { + return new BusinessApplicationAgentResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private BusinessApplicationAgentOperationsClient 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/BusinessApplicationAgentResourceImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentResourceImpl.java new file mode 100644 index 000000000000..3e04d96bfdf8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentResourceImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.BusinessApplicationAgentResourceInner; +import com.azure.resourcemanager.securityinsights.models.AgentConfiguration; +import com.azure.resourcemanager.securityinsights.models.AgentSystem; +import com.azure.resourcemanager.securityinsights.models.BusinessApplicationAgentResource; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class BusinessApplicationAgentResourceImpl implements BusinessApplicationAgentResource, + BusinessApplicationAgentResource.Definition, BusinessApplicationAgentResource.Update { + private BusinessApplicationAgentResourceInner 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 AgentConfiguration configuration() { + return this.innerModel().configuration(); + } + + public List agentSystems() { + List inner = this.innerModel().agentSystems(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerModel().lastModifiedTimeUtc(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BusinessApplicationAgentResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String agentResourceName; + + public BusinessApplicationAgentResourceImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public BusinessApplicationAgentResource create() { + this.innerObject = serviceManager.serviceClient() + .getBusinessApplicationAgents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public BusinessApplicationAgentResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBusinessApplicationAgents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, this.innerModel(), context) + .getValue(); + return this; + } + + BusinessApplicationAgentResourceImpl(String name, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new BusinessApplicationAgentResourceInner(); + this.serviceManager = serviceManager; + this.agentResourceName = name; + } + + public BusinessApplicationAgentResourceImpl update() { + return this; + } + + public BusinessApplicationAgentResource apply() { + this.innerObject = serviceManager.serviceClient() + .getBusinessApplicationAgents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public BusinessApplicationAgentResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBusinessApplicationAgents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, this.innerModel(), context) + .getValue(); + return this; + } + + BusinessApplicationAgentResourceImpl(BusinessApplicationAgentResourceInner 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.agentResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "businessApplicationAgents"); + } + + public BusinessApplicationAgentResourceImpl withConfiguration(AgentConfiguration configuration) { + this.innerModel().withConfiguration(configuration); + return this; + } + + public BusinessApplicationAgentResourceImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public BusinessApplicationAgentResourceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentsClientImpl.java new file mode 100644 index 000000000000..986fade2fca1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentsClientImpl.java @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.BusinessApplicationAgentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BusinessApplicationAgentResourceInner; +import com.azure.resourcemanager.securityinsights.models.BusinessApplicationAgentsList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BusinessApplicationAgentsClient. + */ +public final class BusinessApplicationAgentsClientImpl implements BusinessApplicationAgentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BusinessApplicationAgentsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of BusinessApplicationAgentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BusinessApplicationAgentsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(BusinessApplicationAgentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsBusinessApplicationAgents to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsBusi") + public interface BusinessApplicationAgentsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents/{agentResourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("agentResourceName") String agentResourceName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BusinessApplicationAgentResourceInner agentToUpsert, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents/{agentResourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("agentResourceName") String agentResourceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @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); + } + + /** + * Creates or updates the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param agentToUpsert The Business Application Agent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the configuration of a Business Application Agent along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String agentResourceName, + BusinessApplicationAgentResourceInner agentToUpsert) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (agentToUpsert != null) { + agentToUpsert.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, agentResourceName, this.client.getApiVersion(), agentToUpsert, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param agentToUpsert The Business Application Agent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the configuration of a Business Application Agent along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String agentResourceName, + BusinessApplicationAgentResourceInner agentToUpsert, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (agentToUpsert != null) { + agentToUpsert.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, agentResourceName, this.client.getApiVersion(), agentToUpsert, accept, context); + } + + /** + * Creates or updates the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 describes the configuration of a Business Application Agent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String workspaceName, String agentResourceName) { + final BusinessApplicationAgentResourceInner agentToUpsert = null; + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, agentToUpsert) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param agentToUpsert The Business Application Agent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the configuration of a Business Application Agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String agentResourceName, BusinessApplicationAgentResourceInner agentToUpsert, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, agentToUpsert, + context).block(); + } + + /** + * Creates or updates the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 describes the configuration of a Business Application Agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BusinessApplicationAgentResourceInner createOrUpdate(String resourceGroupName, String workspaceName, + String agentResourceName) { + final BusinessApplicationAgentResourceInner agentToUpsert = null; + return createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, agentToUpsert, + Context.NONE).getValue(); + } + + /** + * Delete the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 agentResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, agentResourceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 agentResourceName, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, agentResourceName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 agentResourceName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, agentResourceName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 agentResourceName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, context).block(); + } + + /** + * Delete the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 agentResourceName) { + deleteWithResponse(resourceGroupName, workspaceName, agentResourceName, Context.NONE); + } + + /** + * Gets all Business Application Agents under the workspace. + * + * @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 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 Business Application Agents under the workspace along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), filter, 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 Business Application Agents under the workspace. + * + * @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 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 Business Application Agents under the workspace along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String filter, 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.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), filter, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets all Business Application Agents under the workspace. + * + * @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 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 Business Application Agents under the workspace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String filter, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Business Application Agents under the 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 Business Application Agents under the workspace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Business Application Agents under the workspace. + * + * @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 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 Business Application Agents under the workspace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String filter, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Business Application Agents under the 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 Business Application Agents under the workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, filter, skipToken)); + } + + /** + * Gets all Business Application Agents under the workspace. + * + * @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 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 Business Application Agents under the workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, filter, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of agents 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of agents along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentsImpl.java new file mode 100644 index 000000000000..a9e08700a1d0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BusinessApplicationAgentsImpl.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +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.BusinessApplicationAgentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BusinessApplicationAgentResourceInner; +import com.azure.resourcemanager.securityinsights.models.BusinessApplicationAgentResource; +import com.azure.resourcemanager.securityinsights.models.BusinessApplicationAgents; + +public final class BusinessApplicationAgentsImpl implements BusinessApplicationAgents { + private static final ClientLogger LOGGER = new ClientLogger(BusinessApplicationAgentsImpl.class); + + private final BusinessApplicationAgentsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public BusinessApplicationAgentsImpl(BusinessApplicationAgentsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String agentResourceName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, agentResourceName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String agentResourceName) { + this.serviceClient().delete(resourceGroupName, workspaceName, agentResourceName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new BusinessApplicationAgentResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + String filter, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, filter, skipToken, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new BusinessApplicationAgentResourceImpl(inner1, this.manager())); + } + + 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 agentResourceName = ResourceManagerUtils.getValueFromIdByName(id, "businessApplicationAgents"); + if (agentResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'businessApplicationAgents'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, agentResourceName, 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 agentResourceName = ResourceManagerUtils.getValueFromIdByName(id, "businessApplicationAgents"); + if (agentResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'businessApplicationAgents'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, agentResourceName, context); + } + + private BusinessApplicationAgentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public BusinessApplicationAgentResourceImpl define(String name) { + return new BusinessApplicationAgentResourceImpl(name, this.manager()); + } +} 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..0a651e26f83c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsClientImpl.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of ContentPackageOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentPackageOperationsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(ContentPackageOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsContentPackageOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsCont") + public interface ContentPackageOperationsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> install(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, + @BodyParam("application/json") PackageModelInner packageInstallationProperties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") 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); + } + + /** + * 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (packageId == null) { + return Mono.error(new IllegalArgumentException("Parameter packageId is required and cannot be null.")); + } + if (packageInstallationProperties == null) { + return Mono.error(new IllegalArgumentException( + "Parameter packageInstallationProperties is required and cannot be null.")); + } else { + packageInstallationProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.install(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, packageId, + packageInstallationProperties, accept, 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 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} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> installWithResponseAsync(String resourceGroupName, String workspaceName, + String packageId, PackageModelInner packageInstallationProperties, 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 (packageId == null) { + return Mono.error(new IllegalArgumentException("Parameter packageId is required and cannot be null.")); + } + if (packageInstallationProperties == null) { + return Mono.error(new IllegalArgumentException( + "Parameter packageInstallationProperties is required and cannot be null.")); + } else { + packageInstallationProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.install(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, packageId, packageInstallationProperties, accept, 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 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 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) { + return installWithResponseAsync(resourceGroupName, workspaceName, packageId, packageInstallationProperties, + context).block(); + } + + /** + * 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 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (packageId == null) { + return Mono.error(new IllegalArgumentException("Parameter packageId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.uninstall(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, packageId, accept, 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> uninstallWithResponseAsync(String resourceGroupName, String workspaceName, + String packageId, 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 (packageId == null) { + return Mono.error(new IllegalArgumentException("Parameter packageId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.uninstall(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, packageId, accept, 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 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 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 uninstallWithResponseAsync(resourceGroupName, workspaceName, packageId, context).block(); + } + + /** + * 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 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..85bcb4a8e98e --- /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) AutoRest 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..f5f9bacfcaa0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesClientImpl.java @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.ContentPackagesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of ContentPackagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentPackagesClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(ContentPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsContentPackages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsCont") + public interface ContentPackagesService { + @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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, + @QueryParam("$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/{packageId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all installed packages. + * + * @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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, 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 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} 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, + 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, search, count, top, skip, skipToken, accept, context) + .map(res -> 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 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 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 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 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, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all installed packages. + * + * @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 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<>( + listAsync(resourceGroupName, workspaceName, filter, orderby, search, count, top, skip, skipToken)); + } + + /** + * Gets all installed packages. + * + * @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 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<>( + listAsync(resourceGroupName, workspaceName, filter, orderby, search, count, top, skip, skipToken, 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (packageId == null) { + return Mono.error(new IllegalArgumentException("Parameter packageId 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, 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String packageId, 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 (packageId == null) { + return Mono.error(new IllegalArgumentException("Parameter packageId 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, 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 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, packageId, context).block(); + } + + /** + * 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 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list available packages 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(), + 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list available packages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesImpl.java new file mode 100644 index 000000000000..a014c69ba470 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 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())); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, packageId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PackageModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; + } + } + + 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/ContentTemplateOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplateOperationsClientImpl.java new file mode 100644 index 000000000000..c62e4368c2af --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplateOperationsClientImpl.java @@ -0,0 +1,529 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.ContentTemplateOperationsClient; +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 ContentTemplateOperationsClient. + */ +public final class ContentTemplateOperationsClientImpl implements ContentTemplateOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContentTemplateOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of ContentTemplateOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentTemplateOperationsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(ContentTemplateOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsContentTemplateOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsCont") + public interface ContentTemplateOperationsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> install(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, + @BodyParam("application/json") TemplateModelInner templateInstallationProperties, + @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) + Mono> get(@HostParam("$host") 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" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Install a template. + * + * @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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (templateId == null) { + return Mono.error(new IllegalArgumentException("Parameter templateId is required and cannot be null.")); + } + if (templateInstallationProperties == null) { + return Mono.error(new IllegalArgumentException( + "Parameter templateInstallationProperties is required and cannot be null.")); + } else { + templateInstallationProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.install(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, templateId, + templateInstallationProperties, accept, 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> installWithResponseAsync(String resourceGroupName, String workspaceName, + String templateId, TemplateModelInner templateInstallationProperties, 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 (templateId == null) { + return Mono.error(new IllegalArgumentException("Parameter templateId is required and cannot be null.")); + } + if (templateInstallationProperties == null) { + return Mono.error(new IllegalArgumentException( + "Parameter templateInstallationProperties is required and cannot be null.")); + } else { + templateInstallationProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.install(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, templateId, templateInstallationProperties, accept, context); + } + + /** + * Install a template. + * + * @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 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 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) { + return installWithResponseAsync(resourceGroupName, workspaceName, templateId, templateInstallationProperties, + context).block(); + } + + /** + * Install a template. + * + * @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 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(); + } + + /** + * 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (templateId == null) { + return Mono.error(new IllegalArgumentException("Parameter templateId 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, 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String templateId, 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 (templateId == null) { + return Mono.error(new IllegalArgumentException("Parameter templateId 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, 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 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, templateId, context).block(); + } + + /** + * 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 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(); + } + + /** + * Delete an installed template. + * + * @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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String templateId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (templateId == null) { + return Mono.error(new IllegalArgumentException("Parameter templateId 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, templateId, accept, 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String templateId, 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 (templateId == null) { + return Mono.error(new IllegalArgumentException("Parameter templateId 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, templateId, accept, context); + } + + /** + * Delete an installed template. + * + * @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 {@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 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 deleteWithResponseAsync(resourceGroupName, workspaceName, templateId, context).block(); + } + + /** + * Delete an installed template. + * + * @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. + */ + @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/ContentTemplateOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplateOperationsImpl.java new file mode 100644 index 000000000000..108e709caf09 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplateOperationsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.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.ContentTemplateOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.ContentTemplateOperations; +import com.azure.resourcemanager.securityinsights.models.TemplateModel; + +public final class ContentTemplateOperationsImpl implements ContentTemplateOperations { + private static final ClientLogger LOGGER = new ClientLogger(ContentTemplateOperationsImpl.class); + + private final ContentTemplateOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ContentTemplateOperationsImpl(ContentTemplateOperationsClient 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TemplateModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 ContentTemplateOperationsClient 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/ContentTemplatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesClientImpl.java new file mode 100644 index 000000000000..72c91aa1e5e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesClientImpl.java @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.TemplateList; +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 SecurityInsightsImpl client; + + /** + * Initializes an instance of ContentTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentTemplatesClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(ContentTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsContentTemplates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsCont") + public interface ContentTemplatesService { + @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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, + @QueryParam("$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("$host") 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, 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 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} 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, 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, 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)); + } + + /** + * 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 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 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 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 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, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, expand, + search, count, top, skip, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, 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 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<>( + listAsync(resourceGroupName, workspaceName, filter, orderby, expand, search, count, top, skip, skipToken)); + } + + /** + * 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 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<>(listAsync(resourceGroupName, workspaceName, filter, orderby, expand, search, count, + top, skip, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the template 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the template along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesImpl.java new file mode 100644 index 000000000000..92e325332649 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +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 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 ContentTemplatesClient 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..e2aeaf126475 --- /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) AutoRest 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 String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DataConnectorDefinitionKind kind() { + return this.innerModel().kind(); + } + + 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..7304fa6b92a0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsClientImpl.java @@ -0,0 +1,750 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of DataConnectorDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataConnectorDefinitionsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(DataConnectorDefinitionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsDataConnectorDefinitions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsData") + public interface DataConnectorDefinitionsService { + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @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) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorDefinitionName") String dataConnectorDefinitionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorDefinitionName") String dataConnectorDefinitionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataConnectorDefinitionInner connectorDefinitionInput, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorDefinitionName") String dataConnectorDefinitionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connector definitions 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.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connector definitions 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.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context) + .map(res -> 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 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 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 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)); + } + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all data connector definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, 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 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<>(listAsync(resourceGroupName, workspaceName, 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter dataConnectorDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataConnectorDefinitionName, this.client.getApiVersion(), 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String dataConnectorDefinitionName, 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 (dataConnectorDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter dataConnectorDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + dataConnectorDefinitionName, this.client.getApiVersion(), 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 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, dataConnectorDefinitionName, context).block(); + } + + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter dataConnectorDefinitionName is required and cannot be null.")); + } + if (connectorDefinitionInput == null) { + return Mono.error( + new IllegalArgumentException("Parameter connectorDefinitionInput is required and cannot be null.")); + } else { + connectorDefinitionInput.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, dataConnectorDefinitionName, this.client.getApiVersion(), + connectorDefinitionInput, accept, 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 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} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput, + 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 (dataConnectorDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter dataConnectorDefinitionName is required and cannot be null.")); + } + if (connectorDefinitionInput == null) { + return Mono.error( + new IllegalArgumentException("Parameter connectorDefinitionInput is required and cannot be null.")); + } else { + connectorDefinitionInput.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataConnectorDefinitionName, this.client.getApiVersion(), connectorDefinitionInput, accept, + 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 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 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) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataConnectorDefinitionName, + connectorDefinitionInput, context).block(); + } + + /** + * 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 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataConnectorDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter dataConnectorDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataConnectorDefinitionName, this.client.getApiVersion(), accept, 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, 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 (dataConnectorDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter dataConnectorDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataConnectorDefinitionName, this.client.getApiVersion(), accept, 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 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 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 deleteWithResponseAsync(resourceGroupName, workspaceName, dataConnectorDefinitionName, context).block(); + } + + /** + * Delete the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the 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); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return encapsulate the data connector definition object 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return encapsulate the data connector definition object along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsImpl.java new file mode 100644 index 000000000000..dc9aa2992b9f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 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())); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, dataConnectorDefinitionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataConnectorDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataConnectorDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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); + } + + 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 b07fffa9b2f0..c4e003ea8cd5 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 @@ -7,14 +7,14 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.models.DataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorKind; public final class DataConnectorImpl implements DataConnector { private DataConnectorInner innerObject; private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - DataConnectorImpl( - DataConnectorInner innerObject, + DataConnectorImpl(DataConnectorInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -40,6 +40,10 @@ 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 index 2543bc68e69c..9ca4fcb90867 100644 --- 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 @@ -14,8 +14,7 @@ public final class DataConnectorRequirementsStateImpl implements DataConnectorRe private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - DataConnectorRequirementsStateImpl( - DataConnectorRequirementsStateInner innerObject, + DataConnectorRequirementsStateImpl(DataConnectorRequirementsStateInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index b19d22164e89..964724015afe 100644 --- 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 @@ -33,24 +33,24 @@ */ public final class DataConnectorsCheckRequirementsOperationsClientImpl implements DataConnectorsCheckRequirementsOperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DataConnectorsCheckRequirementsOperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of DataConnectorsCheckRequirementsOperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ DataConnectorsCheckRequirementsOperationsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy - .create( - DataConnectorsCheckRequirementsOperationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); + this.service = RestProxy.create(DataConnectorsCheckRequirementsOperationsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -60,27 +60,21 @@ public final class DataConnectorsCheckRequirementsOperationsClientImpl */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsData") - private interface DataConnectorsCheckRequirementsOperationsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements") - @ExpectedResponses({200}) + public interface DataConnectorsCheckRequirementsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> post( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> post(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @BodyParam("application/json") DataConnectorsCheckRequirements dataConnectorsCheckRequirements, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); } /** * Get requirements state for a data connector type. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorsCheckRequirements The parameters for requirements check message. @@ -88,24 +82,18 @@ Mono> post( * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> postWithResponseAsync( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { + private Mono> postWithResponseAsync(String resourceGroupName, + String workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -115,33 +103,22 @@ private Mono> postWithResponseAsyn return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (dataConnectorsCheckRequirements == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataConnectorsCheckRequirements is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter dataConnectorsCheckRequirements is required and cannot be null.")); } else { dataConnectorsCheckRequirements.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .post( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - dataConnectorsCheckRequirements, - accept, - context)) + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorsCheckRequirements, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get requirements state for a data connector type. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorsCheckRequirements The parameters for requirements check message. @@ -150,25 +127,18 @@ private Mono> postWithResponseAsyn * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> postWithResponseAsync( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements, - Context context) { + private Mono> postWithResponseAsync(String resourceGroupName, + String workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -178,30 +148,20 @@ private Mono> postWithResponseAsyn return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (dataConnectorsCheckRequirements == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter dataConnectorsCheckRequirements is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter dataConnectorsCheckRequirements is required and cannot be null.")); } else { dataConnectorsCheckRequirements.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .post( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - dataConnectorsCheckRequirements, - accept, - context); + return service.post(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, dataConnectorsCheckRequirements, accept, context); } /** * Get requirements state for a data connector type. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorsCheckRequirements The parameters for requirements check message. @@ -211,9 +171,7 @@ private Mono> postWithResponseAsyn * @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, + private Mono postAsync(String resourceGroupName, String workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { return postWithResponseAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -221,42 +179,38 @@ private Mono postAsync( /** * 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. + * @return requirements state for a data connector type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataConnectorRequirementsStateInner post( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { - return postAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements).block(); + public Response postWithResponse(String resourceGroupName, + String workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements, Context context) { + return postWithResponseAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements, context) + .block(); } /** * Get requirements state for a data connector type. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorsCheckRequirements The parameters for requirements check message. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return requirements state for a data connector type along with {@link Response}. + * @return requirements state for a data connector type. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response postWithResponse( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements, - Context context) { - return postWithResponseAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements, context) - .block(); + 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 index 1c97eca6aff9..a9e0a2f411a8 100644 --- 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 @@ -21,41 +21,30 @@ public final class DataConnectorsCheckRequirementsOperationsImpl implements Data private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public DataConnectorsCheckRequirementsOperationsImpl( - DataConnectorsCheckRequirementsOperationsClient innerClient, + public DataConnectorsCheckRequirementsOperationsImpl(DataConnectorsCheckRequirementsOperationsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public DataConnectorRequirementsState post( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { - DataConnectorRequirementsStateInner inner = - this.serviceClient().post(resourceGroupName, workspaceName, dataConnectorsCheckRequirements); + public Response postWithResponse(String resourceGroupName, String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements, Context context) { + Response inner = this.serviceClient() + .postWithResponse(resourceGroupName, workspaceName, dataConnectorsCheckRequirements, context); if (inner != null) { - return new DataConnectorRequirementsStateImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataConnectorRequirementsStateImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response postWithResponse( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements, - Context context) { - Response inner = - this - .serviceClient() - .postWithResponse(resourceGroupName, workspaceName, dataConnectorsCheckRequirements, context); + public DataConnectorRequirementsState post(String resourceGroupName, String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { + DataConnectorRequirementsStateInner inner + = this.serviceClient().post(resourceGroupName, workspaceName, dataConnectorsCheckRequirements); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new DataConnectorRequirementsStateImpl(inner.getValue(), this.manager())); + return new DataConnectorRequirementsStateImpl(inner, this.manager()); } else { return null; } 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 1a58d841aa80..9b81fb92f2f3 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 @@ -35,22 +35,28 @@ import com.azure.resourcemanager.securityinsights.models.DataConnectorList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DataConnectorsClient. */ +/** + * An instance of this class provides access to all the operations defined in DataConnectorsClient. + */ public final class DataConnectorsClientImpl implements DataConnectorsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DataConnectorsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of DataConnectorsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ DataConnectorsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(DataConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(DataConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -60,120 +66,79 @@ public final class DataConnectorsClientImpl implements DataConnectorsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsData") - private interface DataConnectorsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors") - @ExpectedResponses({200}) + public interface DataConnectorsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("dataConnectorId") String dataConnectorId, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("dataConnectorId") String dataConnectorId, - @BodyParam("application/json") DataConnectorInner dataConnector, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataConnectorInner dataConnector, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("dataConnectorId") String dataConnectorId, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}" - + "/connect") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/connect") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> connect( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> connect(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("dataConnectorId") String dataConnectorId, - @BodyParam("application/json") DataConnectorConnectBody connectBody, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataConnectorConnectBody connectBody, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}" - + "/disconnect") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/disconnect") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> disconnect( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("dataConnectorId") String dataConnectorId, - @HeaderParam("Accept") String accept, + Mono> disconnect(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all data connectors. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -182,19 +147,15 @@ Mono> listNext( * @return all data connectors along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -205,32 +166,16 @@ private Mono> listSinglePageAsync( } 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all data connectors. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -240,19 +185,15 @@ private Mono> listSinglePageAsync( * @return all data connectors along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -264,28 +205,15 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all data connectors. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -295,13 +223,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all data connectors. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -312,14 +240,13 @@ private PagedFlux listAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all data connectors. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -334,7 +261,7 @@ public PagedIterable list(String resourceGroupName, String w /** * 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. @@ -350,7 +277,7 @@ public PagedIterable list(String resourceGroupName, String w /** * Gets a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -360,19 +287,15 @@ public PagedIterable list(String resourceGroupName, String w * @return a data connector along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String dataConnectorId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -387,24 +310,14 @@ private Mono> getWithResponseAsync( } 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -415,19 +328,15 @@ private Mono> getWithResponseAsync( * @return a data connector along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -442,21 +351,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, dataConnectorId, accept, context); } /** * Gets a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -473,41 +374,41 @@ private Mono getAsync(String resourceGroupName, String works /** * Gets a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data connector. + * @return a data connector along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataConnectorInner get(String resourceGroupName, String workspaceName, String dataConnectorId) { - return getAsync(resourceGroupName, workspaceName, dataConnectorId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); } /** * Gets a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data connector along with {@link Response}. + * @return a data connector. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); + public DataConnectorInner get(String resourceGroupName, String workspaceName, String dataConnectorId) { + return getWithResponse(resourceGroupName, workspaceName, dataConnectorId, Context.NONE).getValue(); } /** * Creates or updates the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -518,19 +419,15 @@ public Response getWithResponse( * @return data connector along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -550,25 +447,15 @@ private Mono> createOrUpdateWithResponseAsync( } 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.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, dataConnector, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -580,23 +467,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return data connector along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorInner dataConnector, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -616,22 +495,14 @@ private Mono> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, dataConnector, accept, + context); } /** * Creates or updates the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -642,58 +513,54 @@ private Mono> createOrUpdateWithResponseAsync( * @return data connector on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorInner dataConnector) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, dataConnector) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates or updates the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data connector. + * @return data connector along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataConnectorInner createOrUpdate( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector) { - return createOrUpdateAsync(resourceGroupName, workspaceName, dataConnectorId, dataConnector).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorInner dataConnector, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, dataConnector, + context).block(); } /** * Creates or updates the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 data connector. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorInner dataConnector, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, dataConnectorId, dataConnector, context) - .block(); + public DataConnectorInner createOrUpdate(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorInner dataConnector) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, dataConnectorId, dataConnector, + Context.NONE).getValue(); } /** * Delete the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -703,19 +570,15 @@ public Response createOrUpdateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String dataConnectorId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -730,24 +593,14 @@ private Mono> deleteWithResponseAsync( } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -758,19 +611,15 @@ private Mono> deleteWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -785,21 +634,13 @@ private Mono> deleteWithResponseAsync( } 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, dataConnectorId, accept, context); } /** * Delete the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -816,40 +657,40 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String dataConnectorId) { - deleteAsync(resourceGroupName, workspaceName, dataConnectorId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); } /** * Delete the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 dataConnectorId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); + public void delete(String resourceGroupName, String workspaceName, String dataConnectorId) { + deleteWithResponse(resourceGroupName, workspaceName, dataConnectorId, Context.NONE); } /** * Connects a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -860,19 +701,15 @@ public Response deleteWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> connectWithResponseAsync( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody) { + private Mono> connectWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorConnectBody connectBody) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -892,25 +729,15 @@ private Mono> connectWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .connect( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - dataConnectorId, - connectBody, - accept, - context)) + .withContext(context -> service.connect(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, connectBody, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Connects a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -922,23 +749,15 @@ private Mono> connectWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> connectWithResponseAsync( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorConnectBody connectBody, - Context context) { + private Mono> connectWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorConnectBody connectBody, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -958,22 +777,13 @@ private Mono> connectWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .connect( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - dataConnectorId, - connectBody, - accept, - context); + return service.connect(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, dataConnectorId, connectBody, accept, context); } /** * Connects a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -984,56 +794,52 @@ private Mono> connectWithResponseAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono connectAsync( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody) { + private Mono connectAsync(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody) { return connectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody) .flatMap(ignored -> Mono.empty()); } /** * Connects a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param connectBody The data connector. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 void connect( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody) { - connectAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody).block(); + public Response connectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody, Context context) { + return connectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody, context) + .block(); } /** * Connects a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param connectBody The data connector. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 connectWithResponse( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorConnectBody connectBody, - Context context) { - return connectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody, context) - .block(); + public void connect(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody) { + connectWithResponse(resourceGroupName, workspaceName, dataConnectorId, connectBody, Context.NONE); } /** * Disconnect a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -1043,19 +849,15 @@ public Response connectWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disconnectWithResponseAsync( - String resourceGroupName, String workspaceName, String dataConnectorId) { + private Mono> disconnectWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1070,24 +872,14 @@ private Mono> disconnectWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .disconnect( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - dataConnectorId, - accept, - context)) + .withContext(context -> service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Disconnect a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -1098,19 +890,15 @@ private Mono> disconnectWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disconnectWithResponseAsync( - String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { + private Mono> disconnectWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1125,21 +913,13 @@ private Mono> disconnectWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .disconnect( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - dataConnectorId, - accept, - context); + return service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, accept, context); } /** * Disconnect a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. @@ -1156,42 +936,43 @@ private Mono disconnectAsync(String resourceGroupName, String workspaceNam /** * Disconnect a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId) { - disconnectAsync(resourceGroupName, workspaceName, dataConnectorId).block(); + public Response disconnectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + Context context) { + return disconnectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); } /** * Disconnect a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 disconnectWithResponse( - String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { - return disconnectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); + public void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId) { + disconnectWithResponse(resourceGroupName, workspaceName, dataConnectorId, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1203,31 +984,22 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1240,23 +1012,13 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsImpl.java index 33b8c30d1247..bc886b58adb7 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 @@ -22,8 +22,7 @@ public final class DataConnectorsImpl implements DataConnectors { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public DataConnectorsImpl( - DataConnectorsClient innerClient, + public DataConnectorsImpl(DataConnectorsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,12 +30,24 @@ public DataConnectorsImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager())); + 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; + } } public DataConnector get(String resourceGroupName, String workspaceName, String dataConnectorId) { @@ -48,25 +59,22 @@ public DataConnector get(String resourceGroupName, String workspaceName, String } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, dataConnectorId, context); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorInner dataConnector, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, dataConnectorId, dataConnector, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DataConnectorImpl(inner.getValue(), this.manager())); } else { return null; } } - public DataConnector createOrUpdate( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector) { - DataConnectorInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, dataConnectorId, dataConnector); + public DataConnector createOrUpdate(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorInner dataConnector) { + DataConnectorInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, dataConnectorId, dataConnector); if (inner != null) { return new DataConnectorImpl(inner, this.manager()); } else { @@ -74,61 +82,35 @@ public DataConnector createOrUpdate( } } - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorInner dataConnector, + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, 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 this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, dataConnectorId, context); } public void delete(String resourceGroupName, String workspaceName, String dataConnectorId) { this.serviceClient().delete(resourceGroupName, workspaceName, dataConnectorId); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, dataConnectorId, context); + public 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) { + public void connect(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody) { this.serviceClient().connect(resourceGroupName, workspaceName, dataConnectorId, connectBody); } - public Response connectWithResponse( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorConnectBody connectBody, + public Response disconnectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { - return this - .serviceClient() - .connectWithResponse(resourceGroupName, workspaceName, dataConnectorId, connectBody, context); + return this.serviceClient().disconnectWithResponse(resourceGroupName, workspaceName, dataConnectorId, context); } public void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId) { this.serviceClient().disconnect(resourceGroupName, workspaceName, dataConnectorId); } - public Response disconnectWithResponse( - String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { - return this.serviceClient().disconnectWithResponse(resourceGroupName, workspaceName, dataConnectorId, context); - } - private DataConnectorsClient serviceClient() { return this.innerClient; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisClientImpl.java deleted file mode 100644 index 918c289e473c..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisClientImpl.java +++ /dev/null @@ -1,211 +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.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.DomainWhoisClient; -import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DomainWhoisClient. */ -public final class DomainWhoisClientImpl implements DomainWhoisClient { - /** The proxy service used to perform REST calls. */ - private final DomainWhoisService service; - - /** The service client containing this operation class. */ - private final SecurityInsightsImpl client; - - /** - * Initializes an instance of DomainWhoisClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DomainWhoisClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(DomainWhoisService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityInsightsDomainWhois to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsDoma") - private interface DomainWhoisService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights" - + "/enrichment/domain/whois/") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("domain") String domain, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get whois information for a single domain name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param domain Domain name to be enriched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whois information for a single domain name along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String domain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - domain, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get whois information for a single domain name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param domain Domain name to be enriched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whois information for a single domain name along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String domain, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - domain, - accept, - context); - } - - /** - * Get whois information for a single domain name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param domain Domain name to be enriched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whois information for a single domain name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String domain) { - return getWithResponseAsync(resourceGroupName, domain).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 domain Domain name to be enriched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whois information for a single domain name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnrichmentDomainWhoisInner get(String resourceGroupName, String domain) { - return getAsync(resourceGroupName, domain).block(); - } - - /** - * Get whois information for a single domain name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param domain Domain name to be enriched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whois information for a single domain name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String domain, Context context) { - return getWithResponseAsync(resourceGroupName, domain, context).block(); - } -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisImpl.java deleted file mode 100644 index be9939f6abc0..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DomainWhoisImpl.java +++ /dev/null @@ -1,60 +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.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.securityinsights.fluent.DomainWhoisClient; -import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; -import com.azure.resourcemanager.securityinsights.models.DomainWhois; -import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhois; - -public final class DomainWhoisImpl implements DomainWhois { - private static final ClientLogger LOGGER = new ClientLogger(DomainWhoisImpl.class); - - private final DomainWhoisClient innerClient; - - private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - - public DomainWhoisImpl( - DomainWhoisClient innerClient, - com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public EnrichmentDomainWhois get(String resourceGroupName, String domain) { - EnrichmentDomainWhoisInner inner = this.serviceClient().get(resourceGroupName, domain); - if (inner != null) { - return new EnrichmentDomainWhoisImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String resourceGroupName, String domain, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, domain, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EnrichmentDomainWhoisImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private DomainWhoisClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentDomainWhoisImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentDomainWhoisImpl.java index 4f643ea4b717..497dcf8a481e 100644 --- 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 @@ -14,8 +14,7 @@ public final class EnrichmentDomainWhoisImpl implements EnrichmentDomainWhois { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - EnrichmentDomainWhoisImpl( - EnrichmentDomainWhoisInner innerObject, + EnrichmentDomainWhoisImpl(EnrichmentDomainWhoisInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 75885149ad4d..4f6122434a44 100644 --- 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 @@ -12,8 +12,7 @@ public final class EnrichmentIpGeodataImpl implements EnrichmentIpGeodata { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - EnrichmentIpGeodataImpl( - EnrichmentIpGeodataInner innerObject, + EnrichmentIpGeodataImpl(EnrichmentIpGeodataInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -31,8 +30,8 @@ public String city() { return this.innerModel().city(); } - public Integer cityCf() { - return this.innerModel().cityCf(); + public Integer cityConfidenceFactor() { + return this.innerModel().cityConfidenceFactor(); } public String continent() { @@ -43,8 +42,8 @@ public String country() { return this.innerModel().country(); } - public Integer countryCf() { - return this.innerModel().countryCf(); + public Integer countryConfidenceFactor() { + return this.innerModel().countryConfidenceFactor(); } public String ipAddr() { @@ -79,8 +78,8 @@ public String state() { return this.innerModel().state(); } - public Integer stateCf() { - return this.innerModel().stateCf(); + public Integer stateConfidenceFactor() { + return this.innerModel().stateConfidenceFactor(); } public String stateCode() { 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 index f9c1c922a5b4..1861c341ddb7 100644 --- 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 @@ -36,19 +36,26 @@ import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; import com.azure.resourcemanager.securityinsights.models.EntityList; +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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final EntitiesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of EntitiesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ EntitiesClientImpl(SecurityInsightsImpl client) { @@ -62,103 +69,222 @@ public final class EntitiesClientImpl implements EntitiesClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsEnti") - private interface EntitiesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities") - @ExpectedResponses({200}) + public interface EntitiesService { + @Headers({ "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> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> runPlaybook(@HostParam("$host") 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, + @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}) + @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> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("entityId") String entityId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand") - @ExpectedResponses({200}) + @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> expand( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("entityId") String entityId, - @BodyParam("application/json") EntityExpandParameters parameters, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/queries") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> queries( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("entityId") String entityId, - @QueryParam("kind") EntityItemQueryKind kind, - @HeaderParam("Accept") String accept, - Context context); + Mono> expand(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @BodyParam("application/json") EntityExpandParameters parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights") - @ExpectedResponses({200}) + @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> getInsights( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> queries(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @QueryParam("kind") EntityItemQueryKind kind, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getInsights(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("entityId") String entityId, - @BodyParam("application/json") EntityGetInsightsParameters parameters, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") EntityGetInsightsParameters parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, 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 identifier. + * @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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (entityIdentifier == null) { + return Mono + .error(new IllegalArgumentException("Parameter entityIdentifier is required and cannot be null.")); + } + if (requestBody != null) { + requestBody.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.runPlaybook(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityIdentifier, requestBody, + accept, 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 identifier. + * @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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> runPlaybookWithResponseAsync(String resourceGroupName, String workspaceName, + String entityIdentifier, EntityManualTriggerRequestBody requestBody, 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 (entityIdentifier == null) { + return Mono + .error(new IllegalArgumentException("Parameter entityIdentifier is required and cannot be null.")); + } + if (requestBody != null) { + requestBody.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.runPlaybook(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityIdentifier, requestBody, accept, + 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 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 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 identifier. + * @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 runPlaybookWithResponseAsync(resourceGroupName, workspaceName, entityIdentifier, requestBody, context) + .block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void runPlaybook(String resourceGroupName, String workspaceName, String entityIdentifier) { + final EntityManualTriggerRequestBody requestBody = null; + runPlaybookWithResponse(resourceGroupName, workspaceName, entityIdentifier, requestBody, Context.NONE); } /** * 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. @@ -169,16 +295,12 @@ Mono> listNext( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -189,32 +311,16 @@ private Mono> listSinglePageAsync(String resourceGrou } 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -224,19 +330,15 @@ private Mono> listSinglePageAsync(String resourceGrou * @return all entities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -248,28 +350,15 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -279,13 +368,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -296,14 +385,13 @@ private PagedFlux listAsync(String resourceGroupName, String worksp */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -318,7 +406,7 @@ public PagedIterable list(String resourceGroupName, String workspac /** * 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. @@ -334,7 +422,7 @@ public PagedIterable list(String resourceGroupName, String workspac /** * 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. @@ -344,19 +432,15 @@ public PagedIterable list(String resourceGroupName, String workspac * @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) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String entityId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -370,24 +454,14 @@ private Mono> getWithResponseAsync( } 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)) + .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. @@ -398,19 +472,15 @@ private Mono> getWithResponseAsync( * @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, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String entityId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -424,21 +494,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityId, accept, context); } /** * Gets an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -455,41 +517,41 @@ private Mono getAsync(String resourceGroupName, String workspaceNam /** * 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. + * @return an entity along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EntityInner get(String resourceGroupName, String workspaceName, String entityId) { - return getAsync(resourceGroupName, workspaceName, entityId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, String entityId, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityId, context).block(); } /** * Gets an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an entity along with {@link Response}. + * @return an entity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String entityId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, entityId, context).block(); + public EntityInner get(String resourceGroupName, String workspaceName, String entityId) { + return getWithResponse(resourceGroupName, workspaceName, entityId, Context.NONE).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. @@ -498,22 +560,18 @@ public Response getWithResponse( * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> expandWithResponseAsync( - String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters) { + private Mono> expandWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityExpandParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -531,26 +589,14 @@ private Mono> expandWithResponseAsync( parameters.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .expand( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - parameters, - accept, - context)) + return FluxUtil.withContext(context -> service.expand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Expands an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -560,26 +606,18 @@ private Mono> expandWithResponseAsync( * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> expandWithResponseAsync( - String resourceGroupName, - String workspaceName, - String entityId, - EntityExpandParameters parameters, - Context context) { + private Mono> expandWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityExpandParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -598,22 +636,13 @@ private Mono> expandWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .expand( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - parameters, - accept, - context); + return service.expand(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityId, parameters, accept, context); } /** * Expands an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -624,56 +653,52 @@ private Mono> expandWithResponseAsync( * @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) { + 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. + * @return the entity expansion result operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EntityExpandResponseInner expand( - String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters) { - return expandAsync(resourceGroupName, workspaceName, entityId, parameters).block(); + public Response expandWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityExpandParameters parameters, Context context) { + return expandWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters, context).block(); } /** * Expands an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. * @param parameters The parameters required to execute an expand operation on the given entity. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return the entity expansion result operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response expandWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityExpandParameters parameters, - Context context) { - return expandWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters, context).block(); + 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. @@ -681,23 +706,19 @@ public Response expandWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Response} on successful completion of {@link - * Mono}. + * @return insights and Activities for an entity along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> queriesWithResponseAsync( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind) { + private Mono> queriesWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityItemQueryKind kind) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -714,25 +735,14 @@ private Mono> queriesWithResponseAsync( } 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)) + .withContext(context -> service.queries(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, kind, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get Insights and Activities for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -741,23 +751,19 @@ private Mono> queriesWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Response} on successful completion of {@link - * Mono}. + * @return insights and Activities for an entity along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> queriesWithResponseAsync( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context) { + private Mono> queriesWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityItemQueryKind kind, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -774,22 +780,13 @@ private Mono> queriesWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .queries( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - kind, - accept, - context); + return service.queries(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityId, kind, accept, context); } /** * Get Insights and Activities for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -800,52 +797,52 @@ private Mono> queriesWithResponseAsync( * @return insights and Activities for an entity on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono queriesAsync( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind) { + private Mono queriesAsync(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind) { return queriesWithResponseAsync(resourceGroupName, workspaceName, entityId, kind) .flatMap(res -> Mono.justOrEmpty(res.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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return insights and Activities for an entity along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GetQueriesResponseInner queries( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind) { - return queriesAsync(resourceGroupName, workspaceName, entityId, kind).block(); + public Response queriesWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityItemQueryKind kind, Context context) { + return queriesWithResponseAsync(resourceGroupName, workspaceName, entityId, kind, context).block(); } /** * Get Insights and Activities for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. * @param kind The Kind parameter for queries. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Response}. + * @return insights and Activities for an entity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response queriesWithResponse( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context) { - return queriesWithResponseAsync(resourceGroupName, workspaceName, entityId, kind, context).block(); + public GetQueriesResponseInner queries(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind) { + return queriesWithResponse(resourceGroupName, workspaceName, entityId, kind, Context.NONE).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. @@ -853,23 +850,19 @@ public Response queriesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @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) { + private Mono> getInsightsWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityGetInsightsParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -888,25 +881,15 @@ private Mono> getInsightsWithResponseAs } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getInsights( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - parameters, - accept, - context)) + .withContext(context -> service.getInsights(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Execute Insights for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -915,27 +898,19 @@ private Mono> getInsightsWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @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, - Context context) { + private Mono> getInsightsWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityGetInsightsParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -954,22 +929,13 @@ private Mono> getInsightsWithResponseAs } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getInsights( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - parameters, - accept, - context); + return service.getInsights(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, parameters, accept, context); } /** * Execute Insights for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -980,58 +946,55 @@ private Mono> getInsightsWithResponseAs * @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) { + 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. + * @return the Get Insights result operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EntityGetInsightsResponseInner getInsights( - String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters) { - return getInsightsAsync(resourceGroupName, workspaceName, entityId, parameters).block(); + public Response getInsightsWithResponse(String resourceGroupName, + String workspaceName, String entityId, EntityGetInsightsParameters parameters, Context context) { + return getInsightsWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters, context).block(); } /** * Execute Insights for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. * @param parameters The parameters required to execute insights on the given entity. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return the Get Insights result operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInsightsWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityGetInsightsParameters parameters, - Context context) { - return getInsightsWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters, context).block(); + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1043,31 +1006,22 @@ private Mono> listNextSinglePageAsync(String nextLink 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1080,23 +1034,13 @@ private Mono> listNextSinglePageAsync(String nextLink 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesClientImpl.java index f2cffddbe566..b8568c73e1e7 100644 --- 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 @@ -27,23 +27,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final EntitiesGetTimelinesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of EntitiesGetTimelinesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ EntitiesGetTimelinesClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy - .create(EntitiesGetTimelinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(EntitiesGetTimelinesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -53,28 +58,21 @@ public final class EntitiesGetTimelinesClientImpl implements EntitiesGetTimeline */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsEnti") - private interface EntitiesGetTimelinesService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getTimeline") - @ExpectedResponses({200}) + public interface EntitiesGetTimelinesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getTimeline") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("entityId") String entityId, - @BodyParam("application/json") EntityTimelineParameters parameters, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @BodyParam("application/json") EntityTimelineParameters parameters, + @HeaderParam("Accept") String accept, Context context); } /** * Timeline for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -83,22 +81,18 @@ Mono> list( * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters) { + private Mono> listWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityTimelineParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -116,26 +110,14 @@ private Mono> listWithResponseAsync( parameters.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - parameters, - accept, - context)) + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Timeline for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -145,26 +127,18 @@ private Mono> listWithResponseAsync( * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, - String workspaceName, - String entityId, - EntityTimelineParameters parameters, - Context context) { + private Mono> listWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityTimelineParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -183,22 +157,13 @@ private Mono> listWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - parameters, - accept, - context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityId, parameters, accept, context); } /** * Timeline for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -209,50 +174,46 @@ private Mono> listWithResponseAsync( * @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) { + 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. + * @return the entity timeline result operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EntityTimelineResponseInner list( - String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters) { - return listAsync(resourceGroupName, workspaceName, entityId, parameters).block(); + public Response listWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityTimelineParameters parameters, Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters, context).block(); } /** * Timeline for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. * @param parameters The parameters required to execute an timeline operation on the given entity. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entity timeline result operation response along with {@link Response}. + * @return the entity timeline result operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityTimelineParameters parameters, - Context context) { - return listWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters, context).block(); + 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 index 79b119a109c9..eebaf982ff43 100644 --- 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 @@ -21,38 +21,30 @@ public final class EntitiesGetTimelinesImpl implements EntitiesGetTimelines { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public EntitiesGetTimelinesImpl( - EntitiesGetTimelinesClient innerClient, + public EntitiesGetTimelinesImpl(EntitiesGetTimelinesClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public EntityTimelineResponse list( - String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters) { - EntityTimelineResponseInner inner = - this.serviceClient().list(resourceGroupName, workspaceName, entityId, parameters); + public Response listWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityTimelineParameters parameters, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); if (inner != null) { - return new EntityTimelineResponseImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityTimelineResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response listWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityTimelineParameters parameters, - Context context) { - Response inner = - this.serviceClient().listWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); + 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 SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EntityTimelineResponseImpl(inner.getValue(), this.manager())); + return new EntityTimelineResponseImpl(inner, this.manager()); } else { return null; } 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 index 6ce063fd52fe..152a53e3a24d 100644 --- 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 @@ -21,6 +21,7 @@ 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.GetQueriesResponse; public final class EntitiesImpl implements Entities { @@ -30,20 +31,42 @@ public final class EntitiesImpl implements Entities { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public EntitiesImpl( - EntitiesClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + public EntitiesImpl(EntitiesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } + 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 PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new EntityImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityImpl(inner1, this.manager())); } public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); - return Utils.mapPage(inner, inner1 -> new EntityImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String entityId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityImpl(inner.getValue(), this.manager())); + } else { + return null; + } } public Entity get(String resourceGroupName, String workspaceName, String entityId) { @@ -55,25 +78,22 @@ public Entity get(String resourceGroupName, String workspaceName, String entityI } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String entityId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityId, context); + public Response expandWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityExpandParameters parameters, Context context) { + Response inner + = this.serviceClient().expandWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EntityImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityExpandResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public EntityExpandResponse expand( - String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters) { - EntityExpandResponseInner inner = - this.serviceClient().expand(resourceGroupName, workspaceName, entityId, parameters); + 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 { @@ -81,27 +101,20 @@ public EntityExpandResponse expand( } } - public Response expandWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityExpandParameters parameters, - Context context) { - Response inner = - this.serviceClient().expandWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); + public Response queriesWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityItemQueryKind kind, Context context) { + Response inner + = this.serviceClient().queriesWithResponse(resourceGroupName, workspaceName, entityId, kind, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EntityExpandResponseImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetQueriesResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public GetQueriesResponse queries( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind) { + public GetQueriesResponse queries(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind) { GetQueriesResponseInner inner = this.serviceClient().queries(resourceGroupName, workspaceName, entityId, kind); if (inner != null) { return new GetQueriesResponseImpl(inner, this.manager()); @@ -110,25 +123,22 @@ public GetQueriesResponse queries( } } - public Response queriesWithResponse( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context) { - Response inner = - this.serviceClient().queriesWithResponse(resourceGroupName, workspaceName, entityId, kind, context); + public Response getInsightsWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityGetInsightsParameters parameters, Context context) { + Response inner = this.serviceClient() + .getInsightsWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GetQueriesResponseImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityGetInsightsResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public EntityGetInsightsResponse getInsights( - String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters) { - EntityGetInsightsResponseInner inner = - this.serviceClient().getInsights(resourceGroupName, workspaceName, entityId, parameters); + 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 { @@ -136,27 +146,6 @@ public EntityGetInsightsResponse getInsights( } } - public Response getInsightsWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityGetInsightsParameters parameters, - Context context) { - Response inner = - this - .serviceClient() - .getInsightsWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EntityGetInsightsResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - private EntitiesClient serviceClient() { return this.innerClient; } 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 index d1fbb7073274..5c0080cad9dc 100644 --- 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.securityinsights.models.RelationList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in EntitiesRelationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final EntitiesRelationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of EntitiesRelationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ EntitiesRelationsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(EntitiesRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(EntitiesRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -55,41 +61,29 @@ public final class EntitiesRelationsClientImpl implements EntitiesRelationsClien */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsEnti") - private interface EntitiesRelationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations") - @ExpectedResponses({200}) + 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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("entityId") String entityId, - @QueryParam("$filter") String filter, - @QueryParam("$orderby") String orderby, - @QueryParam("$top") Integer top, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all relations of an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -97,33 +91,23 @@ Mono> listNext( * @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. + * 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) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String entityId, String filter, String orderby, Integer top, String skipToken) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -137,37 +121,17 @@ private Mono> listSinglePageAsync( } 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)) + .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. @@ -175,8 +139,8 @@ private Mono> listSinglePageAsync( * @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. + * 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. @@ -184,26 +148,15 @@ private Mono> listSinglePageAsync( * @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, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String entityId, String filter, String orderby, Integer top, String skipToken, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -218,33 +171,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - filter, - orderby, - top, - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all relations of an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -252,22 +187,16 @@ private Mono> listSinglePageAsync( * @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. + * 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) { + 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)); @@ -275,7 +204,7 @@ private PagedFlux listAsync( /** * 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. @@ -297,7 +226,7 @@ private PagedFlux listAsync(String resourceGroupName, String work /** * 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. @@ -305,8 +234,8 @@ private PagedFlux listAsync(String resourceGroupName, String work * @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. + * 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. @@ -314,25 +243,15 @@ private PagedFlux listAsync(String resourceGroupName, String work * @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, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String entityId, + String filter, String orderby, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, entityId, filter, orderby, + top, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all relations of an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -353,7 +272,7 @@ public PagedIterable list(String resourceGroupName, String worksp /** * 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. @@ -361,8 +280,8 @@ public PagedIterable list(String resourceGroupName, String worksp * @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. + * 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. @@ -370,24 +289,18 @@ public PagedIterable list(String resourceGroupName, String worksp * @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) { + public PagedIterable list(String resourceGroupName, String workspaceName, String entityId, + String filter, String orderby, Integer top, String skipToken, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, context)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -399,31 +312,22 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -436,23 +340,13 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsImpl.java index 328b7929d8aa..d9af690ad635 100644 --- 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 @@ -19,8 +19,7 @@ public final class EntitiesRelationsImpl implements EntitiesRelations { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public EntitiesRelationsImpl( - EntitiesRelationsClient innerClient, + public EntitiesRelationsImpl(EntitiesRelationsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,23 +27,14 @@ public EntitiesRelationsImpl( public PagedIterable list(String resourceGroupName, String workspaceName, String entityId) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, entityId); - return Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String entityId, String filter, + String orderby, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); } private EntitiesRelationsClient serviceClient() { 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 index bebd12d78d76..6b7f4403b51b 100644 --- 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 @@ -14,8 +14,7 @@ public final class EntityExpandResponseImpl implements EntityExpandResponse { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - EntityExpandResponseImpl( - EntityExpandResponseInner innerObject, + EntityExpandResponseImpl(EntityExpandResponseInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index ebe0040b31fc..3ef9ba9c501e 100644 --- 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 @@ -16,8 +16,7 @@ public final class EntityGetInsightsResponseImpl implements EntityGetInsightsRes private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - EntityGetInsightsResponseImpl( - EntityGetInsightsResponseInner innerObject, + EntityGetInsightsResponseImpl(EntityGetInsightsResponseInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityImpl.java index 419788334c11..bcc1c8b2335a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityImpl.java @@ -7,14 +7,15 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.models.Entity; +import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; public final class EntityImpl implements Entity { private EntityInner innerObject; private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - EntityImpl( - EntityInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + EntityImpl(EntityInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -31,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public EntityKindEnum kind() { + return this.innerModel().kind(); + } + public SystemData systemData() { return this.innerModel().systemData(); } 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 index cff5f927a832..02b1be4635c8 100644 --- 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 @@ -35,22 +35,28 @@ import com.azure.resourcemanager.securityinsights.models.EntityQueryList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in EntityQueriesClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final EntityQueriesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of EntityQueriesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ EntityQueriesClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(EntityQueriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(EntityQueriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -60,86 +66,57 @@ public final class EntityQueriesClientImpl implements EntityQueriesClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsEnti") - private interface EntityQueriesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries") - @ExpectedResponses({200}) + public interface EntityQueriesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("kind") EntityQueriesKind kind, - @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("kind") EntityQueriesKind kind, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("entityQueryId") String entityQueryId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryId") String entityQueryId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("entityQueryId") String entityQueryId, - @BodyParam("application/json") CustomEntityQuery entityQuery, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") CustomEntityQuery entityQuery, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("entityQueryId") String entityQueryId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryId") String entityQueryId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all entity queries. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity query kind we want to fetch. @@ -149,19 +126,15 @@ Mono> listNext( * @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, EntityQueriesKind kind) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + EntityQueriesKind kind) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -172,33 +145,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - kind, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), kind, this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all entity queries. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity query kind we want to fetch. @@ -209,19 +165,15 @@ private Mono> listSinglePageAsync( * @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, EntityQueriesKind kind, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + EntityQueriesKind kind, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -233,29 +185,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - kind, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), kind, this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all entity queries. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity query kind we want to fetch. @@ -265,16 +203,15 @@ private Mono> listSinglePageAsync( * @return all entity queries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, EntityQueriesKind kind) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, kind), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + EntityQueriesKind kind) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, kind), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all entity queries. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -285,14 +222,13 @@ private PagedFlux listAsync( @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { final EntityQueriesKind kind = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, 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. * @param kind The entity query kind we want to fetch. @@ -303,16 +239,15 @@ private PagedFlux listAsync(String resourceGroupName, String w * @return all entity queries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, kind, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + EntityQueriesKind kind, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, kind, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all entity queries. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -328,7 +263,7 @@ public PagedIterable list(String resourceGroupName, String wor /** * 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. @@ -339,14 +274,14 @@ public PagedIterable list(String resourceGroupName, String wor * @return all entity queries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, EntityQueriesKind kind, + Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, kind, context)); } /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. @@ -356,19 +291,15 @@ public PagedIterable list( * @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) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String entityQueryId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -382,24 +313,14 @@ private Mono> getWithResponseAsync( } 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)) + .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. @@ -410,19 +331,15 @@ private Mono> getWithResponseAsync( * @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, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String entityQueryId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -436,21 +353,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityQueryId, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityQueryId, accept, context); } /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. @@ -467,41 +376,41 @@ private Mono getAsync(String resourceGroupName, String workspa /** * 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. + * @return an entity query along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EntityQueryInner get(String resourceGroupName, String workspaceName, String entityQueryId) { - return getAsync(resourceGroupName, workspaceName, entityQueryId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String entityQueryId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, context).block(); } /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an entity query along with {@link Response}. + * @return an entity query. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String entityQueryId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, context).block(); + 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. @@ -512,19 +421,15 @@ public Response getWithResponse( * @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) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String entityQueryId, CustomEntityQuery entityQuery) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -543,25 +448,15 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityQueryId, - entityQuery, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityQueryId, entityQuery, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. @@ -573,23 +468,15 @@ private Mono> createOrUpdateWithResponseAsync( * @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, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String entityQueryId, CustomEntityQuery entityQuery, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -608,22 +495,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityQueryId, - entityQuery, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityQueryId, entityQuery, accept, + context); } /** * Creates or updates the entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. @@ -634,57 +513,54 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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. + * @return specific entity query along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EntityQueryInner createOrUpdate( - String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery) { - return createOrUpdateAsync(resourceGroupName, workspaceName, entityQueryId, entityQuery).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String entityQueryId, CustomEntityQuery entityQuery, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, entityQuery, context) + .block(); } /** * Creates or updates the entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. * @param entityQuery The entity query we want to create or update. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return specific entity query. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String entityQueryId, - CustomEntityQuery entityQuery, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, entityQuery, context) - .block(); + 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. @@ -694,19 +570,15 @@ public Response createOrUpdateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String entityQueryId) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String entityQueryId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -720,24 +592,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityQueryId, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityQueryId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. @@ -748,19 +610,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String entityQueryId, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String entityQueryId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -774,21 +632,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityQueryId, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityQueryId, accept, context); } /** * Delete the entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. @@ -805,42 +655,43 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * 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 void delete(String resourceGroupName, String workspaceName, String entityQueryId) { - deleteAsync(resourceGroupName, workspaceName, entityQueryId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, context).block(); } /** * Delete the entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 deleteWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, context).block(); + public void delete(String resourceGroupName, String workspaceName, String entityQueryId) { + deleteWithResponse(resourceGroupName, workspaceName, entityQueryId, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -852,31 +703,22 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -889,23 +731,13 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesImpl.java index 66f6d4fb5322..f3ea20819d50 100644 --- 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 @@ -23,8 +23,7 @@ public final class EntityQueriesImpl implements EntityQueries { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public EntityQueriesImpl( - EntityQueriesClient innerClient, + public EntityQueriesImpl(EntityQueriesClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -32,14 +31,26 @@ public EntityQueriesImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new EntityQueryImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, EntityQueriesKind kind, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, kind, context); - return Utils.mapPage(inner, inner1 -> new EntityQueryImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, EntityQueriesKind kind, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, kind, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityQueryId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityQueryImpl(inner.getValue(), this.manager())); + } else { + return null; + } } public EntityQuery get(String resourceGroupName, String workspaceName, String entityQueryId) { @@ -51,25 +62,22 @@ public EntityQuery get(String resourceGroupName, String workspaceName, String en } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String entityQueryId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityQueryId, context); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String entityQueryId, CustomEntityQuery entityQuery, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, entityQueryId, entityQuery, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new EntityQueryImpl(inner.getValue(), this.manager())); } else { return null; } } - public EntityQuery createOrUpdate( - String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery) { - EntityQueryInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, entityQueryId, entityQuery); + 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 { @@ -77,36 +85,15 @@ public EntityQuery createOrUpdate( } } - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String entityQueryId, - CustomEntityQuery entityQuery, + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, entityQueryId, entityQuery, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EntityQueryImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, entityQueryId, context); } public void delete(String resourceGroupName, String workspaceName, String entityQueryId) { this.serviceClient().delete(resourceGroupName, workspaceName, entityQueryId); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String entityQueryId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, entityQueryId, context); - } - private EntityQueriesClient serviceClient() { return this.innerClient; } 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 index aed9918b1c34..03fb5b702d5d 100644 --- 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 @@ -7,14 +7,14 @@ 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, + EntityQueryImpl(EntityQueryInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -40,6 +40,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public EntityQueryKind kind() { + return this.innerModel().kind(); + } + public EntityQueryInner innerModel() { return this.innerObject; } 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 index 36db8654b8da..5df75661b3a4 100644 --- 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 @@ -7,14 +7,14 @@ 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, + EntityQueryTemplateImpl(EntityQueryTemplateInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -32,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public EntityQueryTemplateKind kind() { + return this.innerModel().kind(); + } + public SystemData systemData() { return this.innerModel().systemData(); } 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 index e60bfb3413bf..030c610e1421 100644 --- 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 @@ -27,27 +27,32 @@ 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.models.Constant88; +import com.azure.resourcemanager.securityinsights.models.Constant124; import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in EntityQueryTemplatesClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final EntityQueryTemplatesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of EntityQueryTemplatesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ EntityQueryTemplatesClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy - .create(EntityQueryTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(EntityQueryTemplatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -57,54 +62,38 @@ public final class EntityQueryTemplatesClientImpl implements EntityQueryTemplate */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsEnti") - private interface EntityQueryTemplatesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates") - @ExpectedResponses({200}) + public interface EntityQueryTemplatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("kind") Constant88 kind, - @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("kind") Constant124 kind, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates" - + "/{entityQueryTemplateId}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{entityQueryTemplateId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("entityQueryTemplateId") String entityQueryTemplateId, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryTemplateId") String entityQueryTemplateId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all entity query templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity template query kind we want to fetch. @@ -114,19 +103,15 @@ Mono> listNext( * @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, Constant88 kind) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, Constant124 kind) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -137,33 +122,16 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - kind, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), kind, this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all entity query templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity template query kind we want to fetch. @@ -174,19 +142,15 @@ private Mono> listSinglePageAsync( * @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, Constant88 kind, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, Constant124 kind, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -198,29 +162,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - kind, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), kind, this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all entity query templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity template query kind we want to fetch. @@ -230,16 +180,15 @@ private Mono> listSinglePageAsync( * @return all entity query templates as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, Constant88 kind) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, kind), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + Constant124 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. @@ -249,15 +198,14 @@ private PagedFlux listAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - final Constant88 kind = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, kind), + final Constant124 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. @@ -268,16 +216,15 @@ private PagedFlux listAsync(String resourceGroupName, * @return all entity query templates as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, Constant88 kind, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, kind, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + Constant124 kind, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, kind, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all entity query templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -287,13 +234,13 @@ private PagedFlux listAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName) { - final Constant88 kind = null; + final Constant124 kind = null; return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, kind)); } /** * Gets all entity query templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity template query kind we want to fetch. @@ -304,14 +251,14 @@ public PagedIterable list(String resourceGroupName, St * @return all entity query templates as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, Constant88 kind, Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, + Constant124 kind, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, kind, context)); } /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryTemplateId entity query template ID. @@ -321,19 +268,15 @@ public PagedIterable list( * @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) { + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String entityQueryTemplateId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -347,25 +290,14 @@ private Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter entityQueryTemplateId is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityQueryTemplateId, - accept, - context)) + 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. @@ -376,19 +308,15 @@ private Mono> getWithResponseAsync( * @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, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String entityQueryTemplateId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -403,21 +331,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityQueryTemplateId, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityQueryTemplateId, accept, context); } /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryTemplateId entity query template ID. @@ -427,56 +347,57 @@ private Mono> getWithResponseAsync( * @return an entity query on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String entityQueryTemplateId) { + 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. + * @return an entity query along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EntityQueryTemplateInner get(String resourceGroupName, String workspaceName, String entityQueryTemplateId) { - return getAsync(resourceGroupName, workspaceName, entityQueryTemplateId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String entityQueryTemplateId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryTemplateId, context).block(); } /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryTemplateId entity query template ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an entity query along with {@link Response}. + * @return an entity query. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String entityQueryTemplateId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryTemplateId, context).block(); + public EntityQueryTemplateInner get(String resourceGroupName, String workspaceName, String entityQueryTemplateId) { + return getWithResponse(resourceGroupName, workspaceName, entityQueryTemplateId, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the entity query templates along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -484,37 +405,28 @@ private Mono> listNextSinglePageAsync(St 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the entity query templates along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -522,23 +434,13 @@ private Mono> listNextSinglePageAsync(St 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesImpl.java index 040dcb3be9b1..084fbd35888b 100644 --- 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 @@ -11,7 +11,7 @@ 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.Constant88; +import com.azure.resourcemanager.securityinsights.models.Constant124; import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplate; import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplates; @@ -22,8 +22,7 @@ public final class EntityQueryTemplatesImpl implements EntityQueryTemplates { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public EntityQueryTemplatesImpl( - EntityQueryTemplatesClient innerClient, + public EntityQueryTemplatesImpl(EntityQueryTemplatesClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,36 +30,33 @@ public EntityQueryTemplatesImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new EntityQueryTemplateImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryTemplateImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String workspaceName, Constant88 kind, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, kind, context); - return Utils.mapPage(inner, inner1 -> new EntityQueryTemplateImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, Constant124 kind, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, kind, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryTemplateImpl(inner1, this.manager())); } - public EntityQueryTemplate get(String resourceGroupName, String workspaceName, String entityQueryTemplateId) { - EntityQueryTemplateInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, entityQueryTemplateId); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String entityQueryTemplateId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityQueryTemplateId, context); if (inner != null) { - return new EntityQueryTemplateImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityQueryTemplateImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String entityQueryTemplateId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityQueryTemplateId, context); + public EntityQueryTemplate get(String resourceGroupName, String workspaceName, String entityQueryTemplateId) { + EntityQueryTemplateInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, entityQueryTemplateId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EntityQueryTemplateImpl(inner.getValue(), this.manager())); + return new EntityQueryTemplateImpl(inner, this.manager()); } else { return null; } 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 index a30ef2467eab..5560c4462fb7 100644 --- 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 @@ -25,22 +25,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final EntityRelationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of EntityRelationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ EntityRelationsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(EntityRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(EntityRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -50,29 +56,21 @@ public final class EntityRelationsClientImpl implements EntityRelationsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsEnti") - private interface EntityRelationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations" - + "/{relationName}") - @ExpectedResponses({200}) + 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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("entityId") String entityId, - @PathParam("relationName") String relationName, - @HeaderParam("Accept") String accept, - Context context); + Mono> getRelation(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @PathParam("relationName") String relationName, + @HeaderParam("Accept") String accept, Context context); } /** * Gets an entity relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -83,19 +81,15 @@ Mono> getRelation( * @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) { + private Mono> getRelationWithResponseAsync(String resourceGroupName, String workspaceName, + String entityId, String relationName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -112,25 +106,15 @@ private Mono> getRelationWithResponseAsync( } 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)) + .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. @@ -142,19 +126,15 @@ private Mono> getRelationWithResponseAsync( * @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, Context context) { + private Mono> getRelationWithResponseAsync(String resourceGroupName, String workspaceName, + String entityId, String relationName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -171,22 +151,13 @@ private Mono> getRelationWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getRelation( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - entityId, - relationName, - accept, - context); + return service.getRelation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, relationName, accept, context); } /** * Gets an entity relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. @@ -197,46 +168,47 @@ private Mono> getRelationWithResponseAsync( * @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) { + 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. + * @return an entity relation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelationInner getRelation( - String resourceGroupName, String workspaceName, String entityId, String relationName) { - return getRelationAsync(resourceGroupName, workspaceName, entityId, relationName).block(); + public Response getRelationWithResponse(String resourceGroupName, String workspaceName, + String entityId, String relationName, Context context) { + return getRelationWithResponseAsync(resourceGroupName, workspaceName, entityId, relationName, context).block(); } /** * Gets an entity relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. * @param relationName Relation Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an entity relation along with {@link Response}. + * @return an entity relation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRelationWithResponse( - String resourceGroupName, String workspaceName, String entityId, String relationName, Context context) { - return getRelationWithResponseAsync(resourceGroupName, workspaceName, entityId, relationName, context).block(); + 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 index 6521f11e7b25..f6cd3e1d1fd4 100644 --- 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 @@ -20,35 +20,29 @@ public final class EntityRelationsImpl implements EntityRelations { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public EntityRelationsImpl( - EntityRelationsClient innerClient, + public EntityRelationsImpl(EntityRelationsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Relation getRelation(String resourceGroupName, String workspaceName, String entityId, String relationName) { - RelationInner inner = - this.serviceClient().getRelation(resourceGroupName, workspaceName, entityId, relationName); + public Response getRelationWithResponse(String resourceGroupName, String workspaceName, String entityId, + String relationName, Context context) { + Response inner = this.serviceClient() + .getRelationWithResponse(resourceGroupName, workspaceName, entityId, relationName, context); if (inner != null) { - return new RelationImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getRelationWithResponse( - String resourceGroupName, String workspaceName, String entityId, String relationName, Context context) { - Response inner = - this - .serviceClient() - .getRelationWithResponse(resourceGroupName, workspaceName, entityId, relationName, context); + 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 SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RelationImpl(inner.getValue(), this.manager())); + return new RelationImpl(inner, this.manager()); } else { return null; } 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 index a6c772737410..44393366ce73 100644 --- 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 @@ -16,8 +16,7 @@ public final class EntityTimelineResponseImpl implements EntityTimelineResponse private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - EntityTimelineResponseImpl( - EntityTimelineResponseInner innerObject, + EntityTimelineResponseImpl(EntityTimelineResponseInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 370082d59375..c819a8220a26 100644 --- 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 @@ -22,8 +22,7 @@ public final class FileImportImpl implements FileImport, FileImport.Definition { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - FileImportImpl( - FileImportInner innerObject, + FileImportImpl(FileImportInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -123,22 +122,18 @@ public FileImportImpl withExistingWorkspace(String resourceGroupName, String wor } public FileImport create() { - this.innerObject = - serviceManager - .serviceClient() - .getFileImports() - .createWithResponse(resourceGroupName, workspaceName, fileImportId, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getFileImports() + .createWithResponse(resourceGroupName, workspaceName, fileImportId, this.innerModel(), context) + .getValue(); return this; } @@ -149,22 +144,18 @@ public FileImport create(Context context) { } public FileImport refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getFileImports() - .getWithResponse(resourceGroupName, workspaceName, fileImportId, Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getFileImports() + .getWithResponse(resourceGroupName, workspaceName, fileImportId, context) + .getValue(); 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 index 4b6a38958664..b5daddefb4b1 100644 --- 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 @@ -38,22 +38,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in FileImportsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final FileImportsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of FileImportsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ FileImportsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(FileImportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(FileImportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -63,116 +69,80 @@ public final class FileImportsClientImpl implements FileImportsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsFile") - private interface FileImportsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports") - @ExpectedResponses({200}) + public interface FileImportsService { + @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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("$filter") String filter, - @QueryParam("$orderby") String orderby, - @QueryParam("$top") Integer top, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("fileImportId") String fileImportId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") - @ExpectedResponses({201}) + Mono> get(@HostParam("$host") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") + @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("fileImportId") String fileImportId, - @BodyParam("application/json") FileImportInner fileImport, - @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}) + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("fileImportId") String fileImportId, @BodyParam("application/json") FileImportInner fileImport, + @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) - Mono>> delete( - @HostParam("$host") 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); + Mono>> delete(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, 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. * @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. + * 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -183,44 +153,25 @@ private Mono> listSinglePageAsync( } 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.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. + * 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. @@ -228,25 +179,15 @@ private Mono> listSinglePageAsync( * @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, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -258,48 +199,31 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all 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. + * 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) { + 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)); @@ -307,7 +231,7 @@ private PagedFlux listAsync( /** * 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. @@ -328,15 +252,15 @@ private PagedFlux listAsync(String resourceGroupName, String wo /** * 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. + * 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. @@ -344,14 +268,8 @@ private PagedFlux listAsync(String resourceGroupName, String wo * @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, - Context context) { + 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)); @@ -359,7 +277,7 @@ private PagedFlux listAsync( /** * 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. @@ -378,15 +296,15 @@ public PagedIterable list(String resourceGroupName, String work /** * 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. + * 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. @@ -394,21 +312,15 @@ public PagedIterable list(String resourceGroupName, String work * @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) { + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context)); } /** * Gets 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. @@ -418,19 +330,15 @@ public PagedIterable list( * @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) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String fileImportId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -444,24 +352,14 @@ private Mono> getWithResponseAsync( } 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)) + .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. @@ -472,19 +370,15 @@ private Mono> getWithResponseAsync( * @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, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String fileImportId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -498,21 +392,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - fileImportId, - accept, - context); + return service.get(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. @@ -529,41 +415,41 @@ private Mono getAsync(String resourceGroupName, String workspac /** * 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. + * @return a file import along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FileImportInner get(String resourceGroupName, String workspaceName, String fileImportId) { - return getAsync(resourceGroupName, workspaceName, fileImportId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String fileImportId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, fileImportId, context).block(); } /** * 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}. + * @return a file import. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String fileImportId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, fileImportId, context).block(); + 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. @@ -572,22 +458,18 @@ public Response getWithResponse( * @throws 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String workspaceName, String fileImportId, FileImportInner fileImport) { + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String fileImportId, FileImportInner fileImport) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -606,25 +488,15 @@ private Mono> createWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - fileImportId, - fileImport, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, fileImportId, fileImport, accept, + 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. @@ -634,26 +506,18 @@ private Mono> createWithResponseAsync( * @throws 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String workspaceName, - String fileImportId, - FileImportInner fileImport, - Context context) { + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String fileImportId, FileImportInner fileImport, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -672,22 +536,13 @@ private Mono> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - fileImportId, - fileImport, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, fileImportId, fileImport, accept, 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. @@ -698,56 +553,52 @@ private Mono> createWithResponseAsync( * @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) { + 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. + * @return represents a file import in Azure Security Insights along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FileImportInner create( - String resourceGroupName, String workspaceName, String fileImportId, FileImportInner fileImport) { - return createAsync(resourceGroupName, workspaceName, fileImportId, fileImport).block(); + public Response createWithResponse(String resourceGroupName, String workspaceName, + String fileImportId, FileImportInner fileImport, Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, fileImportId, fileImport, context).block(); } /** * 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}. + * @return represents a file import in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String workspaceName, - String fileImportId, - FileImportInner fileImport, - Context context) { - return createWithResponseAsync(resourceGroupName, workspaceName, fileImportId, fileImport, context).block(); + 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. @@ -755,22 +606,18 @@ public Response createWithResponse( * @throws 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String fileImportId) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String fileImportId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -784,24 +631,14 @@ private Mono>> deleteWithResponseAsync( } 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)) + .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. @@ -810,22 +647,18 @@ private Mono>> deleteWithResponseAsync( * @throws 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String fileImportId, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String fileImportId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -839,21 +672,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - fileImportId, - accept, - context); + return service.delete(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. @@ -863,22 +688,16 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of represents a file import in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, FileImportInner> beginDeleteAsync( - String resourceGroupName, String workspaceName, String fileImportId) { + private PollerFlux, FileImportInner> beginDeleteAsync(String resourceGroupName, + String workspaceName, String fileImportId) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, fileImportId); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - FileImportInner.class, - FileImportInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + FileImportInner.class, FileImportInner.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. @@ -889,20 +708,18 @@ private PollerFlux, FileImportInner> beginDeleteAsyn * @return the {@link PollerFlux} for polling of represents a file import in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, FileImportInner> beginDeleteAsync( - String resourceGroupName, String workspaceName, String fileImportId, Context context) { + private PollerFlux, FileImportInner> beginDeleteAsync(String resourceGroupName, + String workspaceName, String fileImportId, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, workspaceName, fileImportId, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), FileImportInner.class, FileImportInner.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, fileImportId, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + FileImportInner.class, FileImportInner.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. @@ -912,14 +729,14 @@ private PollerFlux, FileImportInner> beginDeleteAsyn * @return the {@link SyncPoller} for polling of represents a file import in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, FileImportInner> beginDelete( - String resourceGroupName, String workspaceName, String fileImportId) { - return beginDeleteAsync(resourceGroupName, workspaceName, fileImportId).getSyncPoller(); + public SyncPoller, FileImportInner> beginDelete(String resourceGroupName, + String workspaceName, String fileImportId) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, fileImportId).getSyncPoller(); } /** * 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. @@ -930,14 +747,14 @@ public SyncPoller, FileImportInner> beginDelete( * @return the {@link SyncPoller} for polling of represents a file import in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, FileImportInner> beginDelete( - String resourceGroupName, String workspaceName, String fileImportId, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, fileImportId, context).getSyncPoller(); + public SyncPoller, FileImportInner> beginDelete(String resourceGroupName, + String workspaceName, String fileImportId, Context context) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, fileImportId, context).getSyncPoller(); } /** * 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. @@ -948,14 +765,13 @@ public SyncPoller, FileImportInner> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String workspaceName, String fileImportId) { - return beginDeleteAsync(resourceGroupName, workspaceName, fileImportId) - .last() + 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. @@ -966,16 +782,15 @@ private Mono deleteAsync(String resourceGroupName, String works * @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, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, fileImportId, context) - .last() + private Mono deleteAsync(String resourceGroupName, String workspaceName, String fileImportId, + Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, fileImportId, context).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. @@ -991,7 +806,7 @@ public FileImportInner delete(String resourceGroupName, String workspaceName, St /** * 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. @@ -1002,16 +817,17 @@ public FileImportInner delete(String resourceGroupName, String workspaceName, St * @return represents a file import in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FileImportInner delete( - String resourceGroupName, String workspaceName, String fileImportId, Context context) { + public FileImportInner delete(String resourceGroupName, String workspaceName, String fileImportId, + Context context) { return deleteAsync(resourceGroupName, workspaceName, fileImportId, context).block(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1023,31 +839,22 @@ private Mono> listNextSinglePageAsync(String next 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1060,23 +867,13 @@ private Mono> listNextSinglePageAsync(String next 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsImpl.java index 05175bc230d3..1081453b2f4b 100644 --- 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 @@ -21,8 +21,7 @@ public final class FileImportsImpl implements FileImports { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public FileImportsImpl( - FileImportsClient innerClient, + public FileImportsImpl(FileImportsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,41 +29,32 @@ public FileImportsImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new FileImportImpl(inner1, this.manager())); + 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 Utils.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 get(String resourceGroupName, String workspaceName, String fileImportId) { - FileImportInner inner = this.serviceClient().get(resourceGroupName, workspaceName, fileImportId); + public Response getWithResponse(String resourceGroupName, String workspaceName, String fileImportId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, fileImportId, context); if (inner != null) { - return new FileImportImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileImportImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String fileImportId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, fileImportId, context); + public FileImport get(String resourceGroupName, String workspaceName, String fileImportId) { + FileImportInner inner = this.serviceClient().get(resourceGroupName, workspaceName, fileImportId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new FileImportImpl(inner.getValue(), this.manager())); + return new FileImportImpl(inner, this.manager()); } else { return null; } @@ -89,105 +79,77 @@ public FileImport delete(String resourceGroupName, String workspaceName, String } public FileImport getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String fileImportId = Utils.getValueFromIdByName(id, "fileImports"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String fileImportId = Utils.getValueFromIdByName(id, "fileImports"); + 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))); + 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 FileImport deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String fileImportId = Utils.getValueFromIdByName(id, "fileImports"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileImports'.", id))); } return this.delete(resourceGroupName, workspaceName, fileImportId, Context.NONE); } public FileImport deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String fileImportId = Utils.getValueFromIdByName(id, "fileImports"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileImports'.", id))); } return this.delete(resourceGroupName, workspaceName, fileImportId, context); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetQueriesResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetQueriesResponseImpl.java index b1fdfd6e3742..4cee8beb6a29 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetQueriesResponseImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetQueriesResponseImpl.java @@ -15,8 +15,7 @@ public final class GetQueriesResponseImpl implements GetQueriesResponse { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - GetQueriesResponseImpl( - GetQueriesResponseInner innerObject, + GetQueriesResponseImpl(GetQueriesResponseInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; 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..63c10812f82e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsClientImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.GetRecommendationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationListInner; +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 SecurityInsightsImpl client; + + /** + * Initializes an instance of GetRecommendationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GetRecommendationsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(GetRecommendationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsGetRecommendations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsGetR") + 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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets 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 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String workspaceName) { + return listWithResponseAsync(resourceGroupName, workspaceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String workspaceName, + Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecommendationListInner list(String resourceGroupName, String workspaceName) { + return listWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + } +} 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..a8425cf0e209 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.GetRecommendationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationListInner; +import com.azure.resourcemanager.securityinsights.models.GetRecommendations; +import com.azure.resourcemanager.securityinsights.models.RecommendationList; + +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 Response listWithResponse(String resourceGroupName, String workspaceName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecommendationListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RecommendationList list(String resourceGroupName, String workspaceName) { + RecommendationListInner inner = this.serviceClient().list(resourceGroupName, workspaceName); + if (inner != null) { + return new RecommendationListImpl(inner, this.manager()); + } else { + return null; + } + } + + 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..1d6f42ecd94f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsClientImpl.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of GetTriggeredAnalyticsRuleRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GetTriggeredAnalyticsRuleRunsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(GetTriggeredAnalyticsRuleRunsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsGetTriggeredAnalyticsRuleRuns to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsGetT") + 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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("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.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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} 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.getSubscriptionId(), resourceGroupName, workspaceName, + this.client.getApiVersion(), accept, context) + .map(res -> 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, 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 ManagementException 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<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the triggered analytics rule run array 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the triggered analytics rule run array along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsImpl.java new file mode 100644 index 000000000000..47ee84555be9 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.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..d8a847648b49 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsClientImpl.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.GetsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import java.util.UUID; +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 SecurityInsightsImpl client; + + /** + * Initializes an instance of GetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GetsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(GetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsGets to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsGets") + 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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("recommendationId") UUID 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, UUID recommendationId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (recommendationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recommendationId is required and cannot be null.")); + } + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, UUID recommendationId, 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 (recommendationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recommendationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.singleRecommendation(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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono singleRecommendationAsync(String resourceGroupName, String workspaceName, + UUID 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, UUID recommendationId, Context context) { + return singleRecommendationWithResponseAsync(resourceGroupName, workspaceName, recommendationId, context) + .block(); + } + + /** + * 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, + UUID 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..ea90b74ef8db --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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; +import java.util.UUID; + +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, + UUID recommendationId, Context context) { + Response inner = this.serviceClient() + .singleRecommendationWithResponse(resourceGroupName, workspaceName, recommendationId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecommendationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Recommendation singleRecommendation(String resourceGroupName, String workspaceName, UUID 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..5fbd6df41148 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..5c07a744d8bc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsClientImpl.java @@ -0,0 +1,828 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of HuntCommentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HuntCommentsClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(HuntCommentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsHuntComments to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsHunt") + public interface HuntCommentsService { + @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("$host") 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/{huntCommentId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntCommentId") String huntCommentId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") 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" }) + @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("$host") 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, + @BodyParam("application/json") HuntCommentInner huntComment, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId 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, huntId, 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, + skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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<>( + listAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken)); + } + + /** + * 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<>( + listAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntCommentId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntCommentId 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, 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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntCommentId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntCommentId 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, huntId, huntCommentId, context).block(); + } + + /** + * 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(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntCommentId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntCommentId 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, huntId, huntCommentId, accept, 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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntCommentId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntCommentId 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, huntId, huntCommentId, accept, 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. + * @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 deleteWithResponseAsync(resourceGroupName, workspaceName, huntId, huntCommentId, context).block(); + } + + /** + * 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); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntCommentId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntCommentId is required and cannot be null.")); + } + if (huntComment == null) { + return Mono.error(new IllegalArgumentException("Parameter huntComment is required and cannot be null.")); + } else { + huntComment.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntCommentId, huntComment, + accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntCommentId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntCommentId is required and cannot be null.")); + } + if (huntComment == null) { + return Mono.error(new IllegalArgumentException("Parameter huntComment is required and cannot be null.")); + } else { + huntComment.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, huntId, huntCommentId, huntComment, + accept, 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 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) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, huntId, huntCommentId, huntComment, + context).block(); + } + + /** + * 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all hunt comments 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(), + 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all hunt comments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsImpl.java new file mode 100644 index 000000000000..e40c62126cf7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 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 Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HuntCommentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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..273cdc730f18 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..a516b1002253 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String relatedResourceId() { + return this.innerModel().relatedResourceId(); + } + + public String relatedResourceName() { + return this.innerModel().relatedResourceName(); + } + + public String 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 withEtag(String etag) { + this.innerModel().withEtag(etag); + 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..1d8130dd593d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsClientImpl.java @@ -0,0 +1,828 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of HuntRelationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HuntRelationsClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(HuntRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsHuntRelations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsHunt") + public interface HuntRelationsService { + @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("$host") 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/{huntRelationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntRelationId") String huntRelationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") 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" }) + @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("$host") 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, + @BodyParam("application/json") HuntRelationInner huntRelation, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId 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, huntId, 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, + skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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<>( + listAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken)); + } + + /** + * 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<>( + listAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntRelationId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntRelationId 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, 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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntRelationId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntRelationId 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, huntId, huntRelationId, context).block(); + } + + /** + * 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(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntRelationId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntRelationId 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, huntId, huntRelationId, accept, 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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntRelationId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntRelationId 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, huntId, huntRelationId, accept, 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. + * @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 deleteWithResponseAsync(resourceGroupName, workspaceName, huntId, huntRelationId, context).block(); + } + + /** + * 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); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntRelationId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntRelationId is required and cannot be null.")); + } + if (huntRelation == null) { + return Mono.error(new IllegalArgumentException("Parameter huntRelation is required and cannot be null.")); + } else { + huntRelation.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntRelationId, huntRelation, + accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (huntRelationId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntRelationId is required and cannot be null.")); + } + if (huntRelation == null) { + return Mono.error(new IllegalArgumentException("Parameter huntRelation is required and cannot be null.")); + } else { + huntRelation.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, huntId, huntRelationId, huntRelation, + accept, 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 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) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, huntId, huntRelationId, huntRelation, + context).block(); + } + + /** + * 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the hunt relations 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(), + 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the hunt relations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsImpl.java new file mode 100644 index 000000000000..98cab5b510c3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 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 Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HuntRelationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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..864e3dfb35e7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsClientImpl.java @@ -0,0 +1,776 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.HuntsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of HuntsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HuntsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(HuntsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsHunts to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsHunt") + public interface HuntsService { + @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("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @BodyParam("application/json") HuntInner hunt, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, top, skipToken, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all 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} 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)); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken)); + } + + /** + * 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<>( + listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId 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, 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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, huntId, context).block(); + } + + /** + * 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(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId 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, huntId, accept, 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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId 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, huntId, accept, 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. + * @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 deleteWithResponseAsync(resourceGroupName, workspaceName, huntId, context).block(); + } + + /** + * 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); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (hunt == null) { + return Mono.error(new IllegalArgumentException("Parameter hunt is required and cannot be null.")); + } else { + hunt.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, hunt, accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, 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 (huntId == null) { + return Mono.error(new IllegalArgumentException("Parameter huntId is required and cannot be null.")); + } + if (hunt == null) { + return Mono.error(new IllegalArgumentException("Parameter hunt is required and cannot be null.")); + } else { + hunt.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, huntId, hunt, accept, 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 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) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, huntId, hunt, context).block(); + } + + /** + * 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the hunts 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(), + 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the hunts along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsImpl.java new file mode 100644 index 000000000000..e5b931d19f31 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 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 Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, huntId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HuntImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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 62a7373bdd1b..da24c3229fd5 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 @@ -15,8 +15,7 @@ public final class IncidentAlertListImpl implements IncidentAlertList { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - IncidentAlertListImpl( - IncidentAlertListInner innerObject, + IncidentAlertListImpl(IncidentAlertListInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentBookmarkListImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentBookmarkListImpl.java index 1b8b558e3983..3fcfb2f4876a 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 @@ -15,8 +15,7 @@ public final class IncidentBookmarkListImpl implements IncidentBookmarkList { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - IncidentBookmarkListImpl( - IncidentBookmarkListInner innerObject, + IncidentBookmarkListImpl(IncidentBookmarkListInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentImpl.java index 1cb3b8ebe779..e20c119412a4 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 @@ -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(); } @@ -80,29 +80,25 @@ public IncidentCommentImpl withExistingIncident(String resourceGroupName, String } public IncidentComment create() { - this.innerObject = - serviceManager - .serviceClient() - .getIncidentComments() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, incidentId, incidentCommentId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidentComments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, + this.innerModel(), Context.NONE) + .getValue(); return this; } public IncidentComment create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIncidentComments() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, incidentId, incidentCommentId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidentComments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, + this.innerModel(), context) + .getValue(); return this; } - IncidentCommentImpl( - String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + IncidentCommentImpl(String name, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = new IncidentCommentInner(); this.serviceManager = serviceManager; this.incidentCommentId = name; @@ -113,55 +109,46 @@ public IncidentCommentImpl update() { } public IncidentComment apply() { - this.innerObject = - serviceManager - .serviceClient() - .getIncidentComments() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, incidentId, incidentCommentId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidentComments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, + this.innerModel(), Context.NONE) + .getValue(); return this; } public IncidentComment apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIncidentComments() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, incidentId, incidentCommentId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidentComments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, + this.innerModel(), context) + .getValue(); return this; } - IncidentCommentImpl( - IncidentCommentInner innerObject, + IncidentCommentImpl(IncidentCommentInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.incidentId = Utils.getValueFromIdByName(innerObject.id(), "incidents"); - this.incidentCommentId = Utils.getValueFromIdByName(innerObject.id(), "comments"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.incidentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "incidents"); + this.incidentCommentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "comments"); } public IncidentComment refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getIncidentComments() - .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidentComments() + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE) + .getValue(); return this; } public IncidentComment refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIncidentComments() - .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidentComments() + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context) + .getValue(); return this; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsClientImpl.java index 5c20f86fb992..0d68553be996 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 @@ -33,22 +33,28 @@ import com.azure.resourcemanager.securityinsights.models.IncidentCommentList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in IncidentCommentsClient. */ +/** + * An instance of this class provides access to all the operations defined in IncidentCommentsClient. + */ public final class IncidentCommentsClientImpl implements IncidentCommentsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final IncidentCommentsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of IncidentCommentsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ IncidentCommentsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(IncidentCommentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(IncidentCommentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,96 +64,60 @@ public final class IncidentCommentsClientImpl implements IncidentCommentsClient */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsInci") - private interface IncidentCommentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments") - @ExpectedResponses({200}) + public interface IncidentCommentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @QueryParam("$filter") String filter, - @QueryParam("$orderby") String orderby, - @QueryParam("$top") Integer top, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments" - + "/{incidentCommentId}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @PathParam("incidentCommentId") String incidentCommentId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments" - + "/{incidentCommentId}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentCommentId") String incidentCommentId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @PathParam("incidentCommentId") String incidentCommentId, - @BodyParam("application/json") IncidentCommentInner incidentComment, - @HeaderParam("Accept") String accept, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentCommentId") String incidentCommentId, + @BodyParam("application/json") IncidentCommentInner incidentComment, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments" - + "/{incidentCommentId}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @PathParam("incidentCommentId") String incidentCommentId, - @HeaderParam("Accept") String accept, - Context context); + @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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -155,33 +125,23 @@ Mono> listNext( * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all incident comments along with {@link PagedResponse} 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -195,37 +155,17 @@ private Mono> listSinglePageAsync( } 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, filter, orderby, top, + skipToken, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -233,8 +173,8 @@ private Mono> listSinglePageAsync( * @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. + * 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. @@ -242,26 +182,16 @@ private Mono> listSinglePageAsync( * @return all incident comments along with {@link PagedResponse} 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, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -276,33 +206,15 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -310,22 +222,16 @@ private Mono> listSinglePageAsync( * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all incident comments 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) { + 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)); @@ -333,7 +239,7 @@ private PagedFlux listAsync( /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -343,8 +249,8 @@ private PagedFlux listAsync( * @return all incident comments as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String incidentId) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String incidentId) { final String filter = null; final String orderby = null; final Integer top = null; @@ -356,7 +262,7 @@ private PagedFlux listAsync( /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -364,8 +270,8 @@ private PagedFlux listAsync( * @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. + * 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. @@ -373,25 +279,15 @@ private PagedFlux listAsync( * @return all incident comments 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, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String incidentId, + String filter, String orderby, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, + top, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -412,7 +308,7 @@ public PagedIterable list(String resourceGroupName, String /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -420,8 +316,8 @@ public PagedIterable list(String resourceGroupName, String * @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. + * 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. @@ -429,22 +325,15 @@ public PagedIterable list(String resourceGroupName, String * @return all incident comments as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String incidentId, - String filter, - String orderby, - Integer top, - String skipToken, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + String filter, String orderby, Integer top, String skipToken, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context)); } /** * Gets an incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -455,19 +344,15 @@ public PagedIterable list( * @return an incident comment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -485,25 +370,15 @@ private Mono> getWithResponseAsync( } 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentCommentId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets an incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -515,19 +390,15 @@ private Mono> getWithResponseAsync( * @return an incident comment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -545,22 +416,13 @@ private Mono> getWithResponseAsync( } 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.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, incidentCommentId, accept, context); } /** * Gets an incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -571,52 +433,53 @@ private Mono> getWithResponseAsync( * @return an incident comment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + private Mono getAsync(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId) { return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets an incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident comment. + * @return an incident comment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentCommentInner get( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { - return getAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String incidentCommentId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, context).block(); } /** * Gets an incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident comment along with {@link Response}. + * @return an incident comment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, context).block(); + public IncidentCommentInner get(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId) { + return getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE) + .getValue(); } /** * Creates or updates the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -628,23 +491,15 @@ public Response getWithResponse( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -668,26 +523,15 @@ private Mono> createOrUpdateWithResponseAsync( } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentCommentId, + incidentComment, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -700,24 +544,16 @@ private Mono> createOrUpdateWithResponseAsync( * @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, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -741,23 +577,14 @@ private Mono> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentCommentId, + incidentComment, accept, context); } /** * Creates or updates the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -769,71 +596,56 @@ private Mono> createOrUpdateWithResponseAsync( * @return represents an incident comment 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 createOrUpdateAsync(String resourceGroupName, String workspaceName, + String incidentId, String incidentCommentId, IncidentCommentInner incidentComment) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, + incidentComment).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates or updates the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. * @param incidentComment The incident comment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an incident comment. + * @return represents an incident comment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentCommentInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String incidentId, - String incidentCommentId, - IncidentCommentInner incidentComment) { - return createOrUpdateAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, incidentComment) - .block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String incidentCommentId, IncidentCommentInner incidentComment, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, + incidentComment, context).block(); } /** * Creates or updates the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. * @param incidentComment The incident comment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 represents an incident comment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - String incidentCommentId, - IncidentCommentInner incidentComment, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, incidentId, incidentCommentId, incidentComment, context) - .block(); + public IncidentCommentInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, IncidentCommentInner incidentComment) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, + incidentComment, Context.NONE).getValue(); } /** * Delete the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -844,19 +656,15 @@ public Response createOrUpdateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -874,25 +682,15 @@ private Mono> deleteWithResponseAsync( } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentCommentId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -904,19 +702,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -934,22 +728,13 @@ private Mono> deleteWithResponseAsync( } 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, incidentCommentId, accept, context); } /** * Delete the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -960,57 +745,58 @@ private Mono> deleteWithResponseAsync( * @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 incidentCommentId) { + private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId) { return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId) .flatMap(ignored -> Mono.empty()); } /** * Delete the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { - deleteAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, context) + .block(); } /** * Delete the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 incidentCommentId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, context) - .block(); + public void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of incident comments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1018,36 +804,27 @@ private Mono> listNextSinglePageAsync(String 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of incident comments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1055,23 +832,13 @@ private Mono> listNextSinglePageAsync(String 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsImpl.java index 8092ca8833a5..15c93eaa6c5e 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 @@ -21,204 +21,151 @@ public final class IncidentCommentsImpl implements IncidentComments { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public IncidentCommentsImpl( - IncidentCommentsClient innerClient, + public IncidentCommentsImpl(IncidentCommentsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, incidentId); - return Utils.mapPage(inner, inner1 -> new IncidentCommentImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new IncidentCommentImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + String filter, String orderby, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IncidentCommentImpl(inner1, this.manager())); } - public IncidentComment get( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { - IncidentCommentInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, incidentId, incidentCommentId); + 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 IncidentCommentImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentCommentImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context); + public IncidentComment get(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId) { + IncidentCommentInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, incidentId, incidentCommentId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IncidentCommentImpl(inner.getValue(), this.manager())); + return new IncidentCommentImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { - this.serviceClient().delete(resourceGroupName, workspaceName, incidentId, incidentCommentId); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context) { - return this - .serviceClient() - .deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context); + public void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + this.serviceClient().delete(resourceGroupName, workspaceName, incidentId, incidentCommentId); } public IncidentComment getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String incidentId = Utils.getValueFromIdByName(id, "incidents"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); } - String incidentCommentId = Utils.getValueFromIdByName(id, "comments"); + String incidentCommentId = ResourceManagerUtils.getValueFromIdByName(id, "comments"); if (incidentCommentId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); } - return this - .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE) + return this.getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String incidentId = Utils.getValueFromIdByName(id, "incidents"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); } - String incidentCommentId = Utils.getValueFromIdByName(id, "comments"); + String incidentCommentId = ResourceManagerUtils.getValueFromIdByName(id, "comments"); if (incidentCommentId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String incidentId = Utils.getValueFromIdByName(id, "incidents"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); } - String incidentCommentId = Utils.getValueFromIdByName(id, "comments"); + String incidentCommentId = ResourceManagerUtils.getValueFromIdByName(id, "comments"); if (incidentCommentId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String incidentId = Utils.getValueFromIdByName(id, "incidents"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); } - String incidentCommentId = Utils.getValueFromIdByName(id, "comments"); + String incidentCommentId = ResourceManagerUtils.getValueFromIdByName(id, "comments"); if (incidentCommentId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, context); } 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 317c6b5ed21f..5d5a5679cacd 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 @@ -18,8 +18,7 @@ public final class IncidentEntitiesResponseImpl implements IncidentEntitiesRespo private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - IncidentEntitiesResponseImpl( - IncidentEntitiesResponseInner innerObject, + IncidentEntitiesResponseImpl(IncidentEntitiesResponseInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -28,9 +27,8 @@ public final class IncidentEntitiesResponseImpl implements IncidentEntitiesRespo public List entities() { List inner = this.innerModel().entities(); if (inner != null) { - return Collections - .unmodifiableList( - inner.stream().map(inner1 -> new EntityImpl(inner1, this.manager())).collect(Collectors.toList())); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new EntityImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } 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 d9c394639227..770a18b3d168 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 @@ -21,7 +21,6 @@ import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import com.azure.resourcemanager.securityinsights.models.IncidentStatus; import com.azure.resourcemanager.securityinsights.models.TeamInformation; -import com.azure.resourcemanager.securityinsights.models.TeamProperties; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -51,40 +50,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() { @@ -96,12 +91,8 @@ public List labels() { } } - public String providerName() { - return this.innerModel().providerName(); - } - - public String providerIncidentId() { - return this.innerModel().providerIncidentId(); + public OffsetDateTime firstActivityTimeUtc() { + return this.innerModel().firstActivityTimeUtc(); } public OffsetDateTime lastActivityTimeUtc() { @@ -112,8 +103,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() { @@ -125,12 +124,16 @@ 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 providerIncidentId() { + return this.innerModel().providerIncidentId(); } public TeamInformation teamInformation() { @@ -142,10 +145,6 @@ public TeamInformation teamInformation() { } } - public String title() { - return this.innerModel().title(); - } - public String resourceGroupName() { return resourceGroupName; } @@ -171,23 +170,18 @@ public IncidentImpl withExistingWorkspace(String resourceGroupName, String works } public Incident create() { - this.innerObject = - serviceManager - .serviceClient() - .getIncidents() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, incidentId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, this.innerModel(), Context.NONE) + .getValue(); return this; } public Incident create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIncidents() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, this.innerModel(), context) + .getValue(); return this; } @@ -202,110 +196,88 @@ public IncidentImpl update() { } public Incident apply() { - this.innerObject = - serviceManager - .serviceClient() - .getIncidents() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, incidentId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, this.innerModel(), Context.NONE) + .getValue(); return this; } public Incident apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIncidents() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidents() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, this.innerModel(), context) + .getValue(); return this; } - IncidentImpl( - IncidentInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + IncidentImpl(IncidentInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.incidentId = Utils.getValueFromIdByName(innerObject.id(), "incidents"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.incidentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "incidents"); } public Incident refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getIncidents() - .getWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidents() + .getWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE) + .getValue(); return this; } public Incident refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIncidents() - .getWithResponse(resourceGroupName, workspaceName, incidentId, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getIncidents() + .getWithResponse(resourceGroupName, workspaceName, incidentId, context) + .getValue(); return this; } - public TeamInformation createTeam(TeamProperties teamProperties) { - return serviceManager.incidents().createTeam(resourceGroupName, workspaceName, incidentId, teamProperties); - } - - public Response createTeamWithResponse(TeamProperties teamProperties, Context context) { - return serviceManager - .incidents() + public Response createTeamWithResponse(TeamInformationInner teamProperties, Context context) { + return serviceManager.incidents() .createTeamWithResponse(resourceGroupName, workspaceName, incidentId, teamProperties, context); } - public IncidentAlertList listAlerts() { - return serviceManager.incidents().listAlerts(resourceGroupName, workspaceName, incidentId); + public TeamInformation createTeam(TeamInformationInner teamProperties) { + return serviceManager.incidents().createTeam(resourceGroupName, workspaceName, incidentId, teamProperties); } public Response listAlertsWithResponse(Context context) { return serviceManager.incidents().listAlertsWithResponse(resourceGroupName, workspaceName, incidentId, context); } - public IncidentBookmarkList listBookmarks() { - return serviceManager.incidents().listBookmarks(resourceGroupName, workspaceName, incidentId); + public IncidentAlertList listAlerts() { + return serviceManager.incidents().listAlerts(resourceGroupName, workspaceName, incidentId); } public Response listBookmarksWithResponse(Context context) { - return serviceManager - .incidents() + return serviceManager.incidents() .listBookmarksWithResponse(resourceGroupName, workspaceName, incidentId, context); } - public IncidentEntitiesResponse listEntities() { - return serviceManager.incidents().listEntities(resourceGroupName, workspaceName, incidentId); + public IncidentBookmarkList listBookmarks() { + return serviceManager.incidents().listBookmarks(resourceGroupName, workspaceName, incidentId); } public Response listEntitiesWithResponse(Context context) { - return serviceManager - .incidents() + return serviceManager.incidents() .listEntitiesWithResponse(resourceGroupName, workspaceName, incidentId, context); } - public IncidentImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } - - public IncidentImpl withClassification(IncidentClassification classification) { - this.innerModel().withClassification(classification); - return this; + public IncidentEntitiesResponse listEntities() { + return serviceManager.incidents().listEntities(resourceGroupName, workspaceName, incidentId); } - public IncidentImpl withClassificationComment(String classificationComment) { - this.innerModel().withClassificationComment(classificationComment); + public IncidentImpl withEtag(String etag) { + this.innerModel().withEtag(etag); return this; } - public IncidentImpl withClassificationReason(IncidentClassificationReason classificationReason) { - this.innerModel().withClassificationReason(classificationReason); + public IncidentImpl withTitle(String title) { + this.innerModel().withTitle(title); return this; } @@ -314,28 +286,28 @@ public IncidentImpl withDescription(String description) { return this; } - public IncidentImpl withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { - this.innerModel().withFirstActivityTimeUtc(firstActivityTimeUtc); + public IncidentImpl withSeverity(IncidentSeverity severity) { + this.innerModel().withSeverity(severity); return this; } - public IncidentImpl withLabels(List labels) { - this.innerModel().withLabels(labels); + public IncidentImpl withStatus(IncidentStatus status) { + this.innerModel().withStatus(status); return this; } - public IncidentImpl withProviderName(String providerName) { - this.innerModel().withProviderName(providerName); + public IncidentImpl withClassification(IncidentClassification classification) { + this.innerModel().withClassification(classification); return this; } - public IncidentImpl withProviderIncidentId(String providerIncidentId) { - this.innerModel().withProviderIncidentId(providerIncidentId); + 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; } @@ -344,23 +316,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 withTeamInformation(TeamInformationInner teamInformation) { - this.innerModel().withTeamInformation(teamInformation); + public IncidentImpl withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc) { + this.innerModel().withLastActivityTimeUtc(lastActivityTimeUtc); return this; } - public IncidentImpl withTitle(String title) { - this.innerModel().withTitle(title); + public IncidentImpl withTeamInformation(TeamInformationInner teamInformation) { + this.innerModel().withTeamInformation(teamInformation); return this; } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentPropertiesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentPropertiesImpl.java index 408f9e893f0f..1d40ff866b1d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentPropertiesImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentPropertiesImpl.java @@ -24,47 +24,42 @@ public final class IncidentPropertiesImpl implements IncidentProperties { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - IncidentPropertiesImpl( - IncidentPropertiesInner innerObject, + IncidentPropertiesImpl(IncidentPropertiesInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public IncidentAdditionalData additionalData() { - return this.innerModel().additionalData(); - } - - public IncidentClassification classification() { - return this.innerModel().classification(); + public String 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() { @@ -76,12 +71,8 @@ public List labels() { } } - public String providerName() { - return this.innerModel().providerName(); - } - - public String providerIncidentId() { - return this.innerModel().providerIncidentId(); + public OffsetDateTime firstActivityTimeUtc() { + return this.innerModel().firstActivityTimeUtc(); } public OffsetDateTime lastActivityTimeUtc() { @@ -92,8 +83,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() { @@ -105,12 +104,16 @@ 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 providerIncidentId() { + return this.innerModel().providerIncidentId(); } public TeamInformation teamInformation() { @@ -122,10 +125,6 @@ public TeamInformation teamInformation() { } } - public String title() { - return this.innerModel().title(); - } - public IncidentPropertiesInner innerModel() { return this.innerObject; } 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 2087692a0fbf..81e54884c996 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 @@ -33,22 +33,28 @@ import com.azure.resourcemanager.securityinsights.models.RelationList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in IncidentRelationsClient. */ +/** + * An instance of this class provides access to all the operations defined in IncidentRelationsClient. + */ public final class IncidentRelationsClientImpl implements IncidentRelationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final IncidentRelationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of IncidentRelationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ IncidentRelationsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(IncidentRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(IncidentRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,96 +64,60 @@ public final class IncidentRelationsClientImpl implements IncidentRelationsClien */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsInci") - private interface IncidentRelationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations") - @ExpectedResponses({200}) + public interface IncidentRelationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @QueryParam("$filter") String filter, - @QueryParam("$orderby") String orderby, - @QueryParam("$top") Integer top, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations" - + "/{relationName}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @PathParam("relationName") String relationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations" - + "/{relationName}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("relationName") String relationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @PathParam("relationName") String relationName, - @BodyParam("application/json") RelationInner relation, - @HeaderParam("Accept") String accept, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("relationName") String relationName, + @BodyParam("application/json") RelationInner relation, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations" - + "/{relationName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @PathParam("relationName") String relationName, - @HeaderParam("Accept") String accept, - Context context); + @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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -155,33 +125,23 @@ Mono> listNext( * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all incident relations along with {@link PagedResponse} 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -195,37 +155,17 @@ private Mono> listSinglePageAsync( } 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, filter, orderby, top, + skipToken, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -233,8 +173,8 @@ private Mono> listSinglePageAsync( * @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. + * 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. @@ -242,26 +182,15 @@ private Mono> listSinglePageAsync( * @return all incident relations along with {@link PagedResponse} 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -276,33 +205,15 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -310,22 +221,16 @@ private Mono> listSinglePageAsync( * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all incident relations 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) { + 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)); @@ -333,7 +238,7 @@ private PagedFlux listAsync( /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -355,7 +260,7 @@ private PagedFlux listAsync(String resourceGroupName, String work /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -363,8 +268,8 @@ private PagedFlux listAsync(String resourceGroupName, String work * @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. + * 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. @@ -372,25 +277,15 @@ private PagedFlux listAsync(String resourceGroupName, String work * @return all incident relations 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, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String incidentId, + String filter, String orderby, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, + top, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -411,7 +306,7 @@ public PagedIterable list(String resourceGroupName, String worksp /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -419,8 +314,8 @@ public PagedIterable list(String resourceGroupName, String worksp * @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. + * 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. @@ -428,22 +323,15 @@ public PagedIterable list(String resourceGroupName, String worksp * @return all incident relations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String incidentId, - String filter, - String orderby, - Integer top, - String skipToken, - Context context) { + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + String filter, String orderby, Integer top, String skipToken, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context)); } /** * Gets an incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -454,19 +342,15 @@ public PagedIterable list( * @return an incident relation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, String relationName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -483,25 +367,15 @@ private Mono> getWithResponseAsync( } 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, relationName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets an incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -513,19 +387,15 @@ private Mono> getWithResponseAsync( * @return an incident relation along with {@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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -542,22 +412,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, relationName, accept, context); } /** * Gets an incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -568,51 +429,51 @@ private Mono> getWithResponseAsync( * @return an incident relation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String incidentId, String relationName) { + private Mono getAsync(String resourceGroupName, String workspaceName, String incidentId, + String relationName) { return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets an incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident relation. + * @return an incident relation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelationInner get(String resourceGroupName, String workspaceName, String incidentId, String relationName) { - return getAsync(resourceGroupName, workspaceName, incidentId, relationName).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName, context).block(); } /** * Gets an incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident relation along with {@link Response}. + * @return an incident relation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName, context).block(); + public RelationInner get(String resourceGroupName, String workspaceName, String incidentId, String relationName) { + return getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, Context.NONE).getValue(); } /** * Creates or updates the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -622,26 +483,18 @@ public Response getWithResponse( * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String incidentId, - String relationName, - RelationInner relation) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -663,26 +516,15 @@ private Mono> createOrUpdateWithResponseAsync( } 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.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, relationName, relation, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -693,27 +535,18 @@ private Mono> createOrUpdateWithResponseAsync( * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String incidentId, - String relationName, - RelationInner relation, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -735,23 +568,14 @@ private Mono> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, relationName, relation, + accept, context); } /** * Creates or updates the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -763,69 +587,56 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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 the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @param relation The relation model. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a relation between two resources. + * @return represents a relation between two resources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelationInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String incidentId, - String relationName, - RelationInner relation) { - return createOrUpdateAsync(resourceGroupName, workspaceName, incidentId, relationName, relation).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String relationName, RelationInner relation, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName, relation, + context).block(); } /** * Creates or updates the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @param relation The relation model. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 represents a relation between two resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - String relationName, - RelationInner relation, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, incidentId, relationName, relation, context) - .block(); + public RelationInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + String relationName, RelationInner relation) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, relation, + Context.NONE).getValue(); } /** * Delete the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -836,19 +647,15 @@ public Response createOrUpdateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, String relationName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -865,25 +672,15 @@ private Mono> deleteWithResponseAsync( } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, relationName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -895,19 +692,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -924,22 +717,13 @@ private Mono> deleteWithResponseAsync( } 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, relationName, accept, context); } /** * Delete the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -950,52 +734,53 @@ private Mono> deleteWithResponseAsync( * @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 relationName) { + private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId, + String relationName) { return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName) .flatMap(ignored -> Mono.empty()); } /** * Delete the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName) { - deleteAsync(resourceGroupName, workspaceName, incidentId, relationName).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName, context).block(); } /** * Delete the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 relationName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName, context).block(); + public void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName) { + deleteWithResponse(resourceGroupName, workspaceName, incidentId, relationName, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1007,31 +792,22 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1044,23 +820,13 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsImpl.java index ae14e641b851..3958a775cf78 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 @@ -21,8 +21,7 @@ public final class IncidentRelationsImpl implements IncidentRelations { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public IncidentRelationsImpl( - IncidentRelationsClient innerClient, + public IncidentRelationsImpl(IncidentRelationsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,23 +29,26 @@ public IncidentRelationsImpl( public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, incidentId); - return Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + String filter, String orderby, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, context); + return 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); + } else { + return null; + } } public Relation get(String resourceGroupName, String workspaceName, String incidentId, String relationName) { @@ -58,29 +60,22 @@ public Relation get(String resourceGroupName, String workspaceName, String incid } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, context); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String relationName, RelationInner relation, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, relation, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new RelationImpl(inner.getValue(), this.manager())); } else { return null; } } - public Relation createOrUpdate( - String resourceGroupName, - String workspaceName, - String incidentId, - String relationName, - RelationInner relation) { - RelationInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, incidentId, relationName, relation); + 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 { @@ -88,40 +83,16 @@ public Relation createOrUpdate( } } - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - String relationName, - RelationInner relation, - Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, incidentId, relationName, relation, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RelationImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, incidentId, relationName, context); } public void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName) { this.serviceClient().delete(resourceGroupName, workspaceName, incidentId, relationName); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { - return this - .serviceClient() - .deleteWithResponse(resourceGroupName, workspaceName, incidentId, relationName, context); - } - private IncidentRelationsClient serviceClient() { return this.innerClient; } 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..13d3eeb5ea51 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..85cdbbd891d3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksClientImpl.java @@ -0,0 +1,769 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of IncidentTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IncidentTasksClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(IncidentTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsIncidentTasks to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsInci") + public interface IncidentTasksService { + @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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentTaskId") String incidentTaskId, + @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}/tasks/{incidentTaskId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentTaskId") String incidentTaskId, + @BodyParam("application/json") IncidentTaskInner incidentTask, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentTaskId") String incidentTaskId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 + .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)); + } + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident 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 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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String incidentId, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, incidentId, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, incidentId)); + } + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident 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<>(listAsync(resourceGroupName, workspaceName, incidentId, context)); + } + + /** + * Gets an incident task. + * + * @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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter 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 (incidentTaskId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentTaskId 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, 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId, String incidentTaskId, 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 (incidentTaskId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentTaskId 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, 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 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentTaskId, context).block(); + } + + /** + * Gets an incident task. + * + * @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 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 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 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 incidentId, String incidentTaskId, IncidentTaskInner incidentTask) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter 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 (incidentTaskId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentTaskId is required and cannot be null.")); + } + if (incidentTask == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentTask is required and cannot be null.")); + } else { + incidentTask.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentTaskId, + incidentTask, accept, 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 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 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 incidentId, String incidentTaskId, IncidentTaskInner incidentTask, + 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 (incidentTaskId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentTaskId is required and cannot be null.")); + } + if (incidentTask == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentTask is required and cannot be null.")); + } else { + incidentTask.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, incidentTaskId, incidentTask, + accept, 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 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 the response body 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 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 the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String incidentTaskId, IncidentTaskInner incidentTask, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentTaskId, + incidentTask, context).block(); + } + + /** + * 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 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 the response. + */ + @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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter 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 (incidentTaskId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentTaskId 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, incidentTaskId, accept, + 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 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId, String incidentTaskId, 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 (incidentTaskId == null) { + return Mono.error(new IllegalArgumentException("Parameter incidentTaskId 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, incidentTaskId, accept, context); + } + + /** + * Delete the incident task. + * + * @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 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 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 deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentTaskId, context).block(); + } + + /** + * Delete the incident task. + * + * @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 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); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body 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(), + 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksImpl.java new file mode 100644 index 000000000000..aae16b461221 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 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 Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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 a07638efa778..30a1e0675206 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 @@ -37,25 +37,30 @@ import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; import com.azure.resourcemanager.securityinsights.models.IncidentList; import com.azure.resourcemanager.securityinsights.models.ManualTriggerRequestBody; -import com.azure.resourcemanager.securityinsights.models.TeamProperties; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in IncidentsClient. */ +/** + * An instance of this class provides access to all the operations defined in IncidentsClient. + */ public final class IncidentsClientImpl implements IncidentsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final IncidentsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of IncidentsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ IncidentsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(IncidentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(IncidentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -65,172 +70,106 @@ public final class IncidentsClientImpl implements IncidentsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsInci") - private interface IncidentsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}" - + "/runPlaybook") - @ExpectedResponses({204}) + public interface IncidentsService { + @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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> runPlaybook(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("incidentIdentifier") String incidentIdentifier, - @BodyParam("application/json") ManualTriggerRequestBody requestBody, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManualTriggerRequestBody requestBody, @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}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("$filter") String filter, - @QueryParam("$orderby") String orderby, - @QueryParam("$top") Integer top, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @BodyParam("application/json") IncidentInner incident, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") - @ExpectedResponses({200, 204}) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @BodyParam("application/json") IncidentInner incident, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/createTeam") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/createTeam") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createTeam( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> createTeam(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("incidentId") String incidentId, - @BodyParam("application/json") TeamProperties teamProperties, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") TeamInformationInner teamProperties, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/alerts") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/alerts") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAlerts( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/bookmarks") - @ExpectedResponses({200}) + Mono> listAlerts(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/bookmarks") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBookmarks( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/entities") - @ExpectedResponses({200}) + Mono> listBookmarks(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/entities") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listEntities( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("incidentId") String incidentId, - @HeaderParam("Accept") String accept, - Context context); + Mono> listEntities(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, 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 incidentIdentifier parameter. @@ -241,22 +180,15 @@ Mono> listNext( * @return any object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> runPlaybookWithResponseAsync( - String resourceGroupName, - String workspaceName, - String incidentIdentifier, - ManualTriggerRequestBody requestBody) { + private Mono> runPlaybookWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentIdentifier, ManualTriggerRequestBody requestBody) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -274,25 +206,15 @@ private Mono> runPlaybookWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .runPlaybook( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - incidentIdentifier, - requestBody, - accept, - context)) + .withContext(context -> service.runPlaybook(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentIdentifier, requestBody, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 incidentIdentifier parameter. @@ -304,23 +226,15 @@ private Mono> runPlaybookWithResponseAsync( * @return any object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> runPlaybookWithResponseAsync( - String resourceGroupName, - String workspaceName, - String incidentIdentifier, - ManualTriggerRequestBody requestBody, - Context context) { + private Mono> runPlaybookWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentIdentifier, ManualTriggerRequestBody requestBody, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -338,62 +252,52 @@ private Mono> runPlaybookWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .runPlaybook( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - incidentIdentifier, - requestBody, - accept, - context); + return service.runPlaybook(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentIdentifier, requestBody, accept, + 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 incidentIdentifier parameter. - * @param requestBody The requestBody parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return any object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono runPlaybookAsync( - String resourceGroupName, - String workspaceName, - String incidentIdentifier, - ManualTriggerRequestBody requestBody) { + 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())); } /** * 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 incidentIdentifier parameter. + * @param requestBody The requestBody 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 any object on successful completion of {@link Mono}. + * @return any object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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())); + public Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, + String incidentIdentifier, ManualTriggerRequestBody requestBody, Context context) { + return runPlaybookWithResponseAsync(resourceGroupName, workspaceName, incidentIdentifier, requestBody, context) + .block(); } /** * 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 incidentIdentifier parameter. @@ -405,63 +309,36 @@ private Mono runPlaybookAsync(String resourceGroupName, String workspace @ServiceMethod(returns = ReturnType.SINGLE) public Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier) { final ManualTriggerRequestBody requestBody = null; - return runPlaybookAsync(resourceGroupName, workspaceName, incidentIdentifier, requestBody).block(); - } - - /** - * 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 incidentIdentifier parameter. - * @param requestBody The requestBody 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 any object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response runPlaybookWithResponse( - String resourceGroupName, - String workspaceName, - String incidentIdentifier, - ManualTriggerRequestBody requestBody, - Context context) { - return runPlaybookWithResponseAsync(resourceGroupName, workspaceName, incidentIdentifier, requestBody, context) - .block(); + return runPlaybookWithResponse(resourceGroupName, workspaceName, incidentIdentifier, requestBody, Context.NONE) + .getValue(); } /** * 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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all incidents 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -472,44 +349,25 @@ private Mono> listSinglePageAsync( } 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, top, skipToken, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all incidents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. Optional. + * 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. @@ -517,25 +375,15 @@ private Mono> listSinglePageAsync( * @return all incidents 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, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -547,48 +395,31 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all incidents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. Optional. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all incidents 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) { + 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)); @@ -596,7 +427,7 @@ private PagedFlux listAsync( /** * 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. @@ -617,15 +448,15 @@ private PagedFlux listAsync(String resourceGroupName, String work /** * 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. + * 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. @@ -633,14 +464,8 @@ private PagedFlux listAsync(String resourceGroupName, String work * @return all incidents 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, - Context context) { + 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)); @@ -648,7 +473,7 @@ private PagedFlux listAsync( /** * 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. @@ -667,15 +492,15 @@ public PagedIterable list(String resourceGroupName, String worksp /** * 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. + * 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. @@ -683,21 +508,15 @@ public PagedIterable list(String resourceGroupName, String worksp * @return all incidents 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) { + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context)); } /** * Gets an incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -707,19 +526,15 @@ public PagedIterable list( * @return an incident along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -733,24 +548,14 @@ private Mono> getWithResponseAsync( } 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets an incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -761,19 +566,15 @@ private Mono> getWithResponseAsync( * @return an incident along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -787,21 +588,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, accept, context); } /** * Gets an incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -818,41 +611,41 @@ private Mono getAsync(String resourceGroupName, String workspaceN /** * Gets an incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident. + * @return an incident along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentInner get(String resourceGroupName, String workspaceName, String incidentId) { - return getAsync(resourceGroupName, workspaceName, incidentId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); } /** * Gets an incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident along with {@link Response}. + * @return an incident. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + public IncidentInner get(String resourceGroupName, String workspaceName, String incidentId) { + return getWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE).getValue(); } /** * Creates or updates the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -860,23 +653,18 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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 incidentId, IncidentInner incident) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -895,25 +683,15 @@ private Mono> createOrUpdateWithResponseAsync( } 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.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incident, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -922,23 +700,18 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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 incidentId, IncidentInner incident, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -957,22 +730,13 @@ private Mono> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incident, accept, context); } /** * Creates or updates the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -980,55 +744,56 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String incidentId, + IncidentInner incident) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incident) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates or updates the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incident The incident. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an incident in Azure Security Insights. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentInner createOrUpdate( - String resourceGroupName, String workspaceName, String incidentId, IncidentInner incident) { - return createOrUpdateAsync(resourceGroupName, workspaceName, incidentId, incident).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, IncidentInner incident, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incident, context).block(); } /** * Creates or updates the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incident The incident. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the response. */ @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(); + public IncidentInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + IncidentInner incident) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incident, Context.NONE) + .getValue(); } /** * Delete the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1038,19 +803,15 @@ public Response createOrUpdateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1064,24 +825,14 @@ private Mono> deleteWithResponseAsync( } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1092,19 +843,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1118,21 +865,13 @@ private Mono> deleteWithResponseAsync( } 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, accept, context); } /** * Delete the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1148,40 +887,40 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String incidentId) { - deleteAsync(resourceGroupName, workspaceName, incidentId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); } /** * Delete the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + public void delete(String resourceGroupName, String workspaceName, String incidentId) { + deleteWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE); } /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1192,19 +931,15 @@ public Response deleteWithResponse( * @return describes team information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createTeamWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties) { + private Mono> createTeamWithResponseAsync(String resourceGroupName, + String workspaceName, String incidentId, TeamInformationInner teamProperties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1223,25 +958,15 @@ private Mono> createTeamWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createTeam( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - incidentId, - teamProperties, - accept, - context)) + .withContext(context -> service.createTeam(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, teamProperties, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1253,23 +978,15 @@ private Mono> createTeamWithResponseAsync( * @return describes team information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createTeamWithResponseAsync( - String resourceGroupName, - String workspaceName, - String incidentId, - TeamProperties teamProperties, - Context context) { + private Mono> createTeamWithResponseAsync(String resourceGroupName, + String workspaceName, String incidentId, TeamInformationInner teamProperties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1288,22 +1005,14 @@ private Mono> createTeamWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createTeam( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - incidentId, - teamProperties, - accept, - context); + return service.createTeam(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, teamProperties, accept, + context); } /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1314,57 +1023,54 @@ private Mono> createTeamWithResponseAsync( * @return describes team information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createTeamAsync( - String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties) { + private Mono createTeamAsync(String resourceGroupName, String workspaceName, + String incidentId, TeamInformationInner teamProperties) { return createTeamWithResponseAsync(resourceGroupName, workspaceName, incidentId, teamProperties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param teamProperties Team properties. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes team information. + * @return describes team information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TeamInformationInner createTeam( - String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties) { - return createTeamAsync(resourceGroupName, workspaceName, incidentId, teamProperties).block(); + public Response createTeamWithResponse(String resourceGroupName, String workspaceName, + String incidentId, TeamInformationInner teamProperties, Context context) { + return createTeamWithResponseAsync(resourceGroupName, workspaceName, incidentId, teamProperties, context) + .block(); } /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param teamProperties Team properties. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes team information along with {@link Response}. + * @return describes team information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createTeamWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - TeamProperties teamProperties, - Context context) { - return createTeamWithResponseAsync(resourceGroupName, workspaceName, incidentId, teamProperties, context) - .block(); + public TeamInformationInner createTeam(String resourceGroupName, String workspaceName, String incidentId, + TeamInformationInner teamProperties) { + return createTeamWithResponse(resourceGroupName, workspaceName, incidentId, teamProperties, Context.NONE) + .getValue(); } /** * Gets all incident alerts. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1374,19 +1080,15 @@ public Response createTeamWithResponse( * @return all incident alerts along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAlertsWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1400,24 +1102,14 @@ private Mono> listAlertsWithResponseAsync( } 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)) + .withContext(context -> service.listAlerts(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all incident alerts. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1428,19 +1120,15 @@ private Mono> listAlertsWithResponseAsync( * @return all incident alerts along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAlertsWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1454,21 +1142,13 @@ private Mono> listAlertsWithResponseAsync( } 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 service.listAlerts(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context); } /** * Gets all incident alerts. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1478,49 +1158,49 @@ private Mono> listAlertsWithResponseAsync( * @return all incident alerts on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAlertsAsync( - String resourceGroupName, String workspaceName, String incidentId) { + private Mono listAlertsAsync(String resourceGroupName, String workspaceName, + String incidentId) { return listAlertsWithResponseAsync(resourceGroupName, workspaceName, incidentId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets all incident alerts. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident alerts. + * @return all incident alerts along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentAlertListInner listAlerts(String resourceGroupName, String workspaceName, String incidentId) { - return listAlertsAsync(resourceGroupName, workspaceName, incidentId).block(); + public Response listAlertsWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context) { + return listAlertsWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); } /** * Gets all incident alerts. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident alerts along with {@link Response}. + * @return all incident alerts. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAlertsWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context) { - return listAlertsWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + public IncidentAlertListInner listAlerts(String resourceGroupName, String workspaceName, String incidentId) { + return listAlertsWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE).getValue(); } /** * Gets all incident bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1530,19 +1210,15 @@ public Response listAlertsWithResponse( * @return all incident bookmarks along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBookmarksWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1556,24 +1232,14 @@ private Mono> listBookmarksWithResponseAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listBookmarks( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - incidentId, - accept, - context)) + .withContext(context -> service.listBookmarks(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all incident bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1584,19 +1250,15 @@ private Mono> listBookmarksWithResponseAsync * @return all incident bookmarks 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1610,21 +1272,13 @@ private Mono> listBookmarksWithResponseAsync } 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); + return service.listBookmarks(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context); } /** * Gets all incident bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1634,49 +1288,49 @@ private Mono> listBookmarksWithResponseAsync * @return all incident bookmarks on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listBookmarksAsync( - String resourceGroupName, String workspaceName, String incidentId) { + private Mono listBookmarksAsync(String resourceGroupName, String workspaceName, + String incidentId) { return listBookmarksWithResponseAsync(resourceGroupName, workspaceName, incidentId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets all incident bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident bookmarks. + * @return all incident bookmarks along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentBookmarkListInner listBookmarks(String resourceGroupName, String workspaceName, String incidentId) { - return listBookmarksAsync(resourceGroupName, workspaceName, incidentId).block(); + public Response listBookmarksWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context) { + return listBookmarksWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); } /** * Gets all incident bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident bookmarks along with {@link Response}. + * @return all incident bookmarks. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listBookmarksWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context) { - return listBookmarksWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + public IncidentBookmarkListInner listBookmarks(String resourceGroupName, String workspaceName, String incidentId) { + return listBookmarksWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE).getValue(); } /** * Gets all incident related entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1686,19 +1340,15 @@ public Response listBookmarksWithResponse( * @return all incident related entities along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listEntitiesWithResponseAsync( - String resourceGroupName, String workspaceName, String incidentId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1712,24 +1362,14 @@ private Mono> listEntitiesWithResponseAs } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listEntities( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - incidentId, - accept, - context)) + .withContext(context -> service.listEntities(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all incident related entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1740,19 +1380,15 @@ private Mono> listEntitiesWithResponseAs * @return all incident related entities 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1766,21 +1402,13 @@ private Mono> listEntitiesWithResponseAs } 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); + return service.listEntities(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context); } /** * Gets all incident related entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -1790,52 +1418,53 @@ private Mono> listEntitiesWithResponseAs * @return all incident related entities on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listEntitiesAsync( - String resourceGroupName, String workspaceName, String incidentId) { + private Mono listEntitiesAsync(String resourceGroupName, String workspaceName, + String incidentId) { return listEntitiesWithResponseAsync(resourceGroupName, workspaceName, incidentId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets all incident related entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident related entities. + * @return all incident related entities along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentEntitiesResponseInner listEntities( - String resourceGroupName, String workspaceName, String incidentId) { - return listEntitiesAsync(resourceGroupName, workspaceName, incidentId).block(); + public Response listEntitiesWithResponse(String resourceGroupName, + String workspaceName, String incidentId, Context context) { + return listEntitiesWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); } /** * Gets all incident related entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident related entities along with {@link Response}. + * @return all incident related entities. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listEntitiesWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context) { - return listEntitiesWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + public IncidentEntitiesResponseInner listEntities(String resourceGroupName, String workspaceName, + String incidentId) { + return listEntitiesWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1847,31 +1476,22 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1884,23 +1504,13 @@ private Mono> listNextSinglePageAsync(String nextLi 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsImpl.java index a49e1a802a76..eea68c0e3dbf 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 @@ -22,7 +22,6 @@ import com.azure.resourcemanager.securityinsights.models.Incidents; import com.azure.resourcemanager.securityinsights.models.ManualTriggerRequestBody; import com.azure.resourcemanager.securityinsights.models.TeamInformation; -import com.azure.resourcemanager.securityinsights.models.TeamProperties; public final class IncidentsImpl implements Incidents { private static final ClientLogger LOGGER = new ClientLogger(IncidentsImpl.class); @@ -31,83 +30,80 @@ public final class IncidentsImpl implements Incidents { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public IncidentsImpl( - IncidentsClient innerClient, + public IncidentsImpl(IncidentsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier) { - return this.serviceClient().runPlaybook(resourceGroupName, workspaceName, incidentIdentifier); + public Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, + String incidentIdentifier, ManualTriggerRequestBody requestBody, Context context) { + return this.serviceClient() + .runPlaybookWithResponse(resourceGroupName, workspaceName, incidentIdentifier, requestBody, context); } - 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 PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new IncidentImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new IncidentImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IncidentImpl(inner1, this.manager())); } - public Incident get(String resourceGroupName, String workspaceName, String incidentId) { - IncidentInner inner = this.serviceClient().get(resourceGroupName, workspaceName, incidentId); + 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 IncidentImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, incidentId, context); + public Incident get(String resourceGroupName, String workspaceName, String incidentId) { + IncidentInner inner = this.serviceClient().get(resourceGroupName, workspaceName, incidentId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IncidentImpl(inner.getValue(), this.manager())); + return new IncidentImpl(inner, this.manager()); } else { return null; } } + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, incidentId, context); + } + public void delete(String resourceGroupName, String workspaceName, String incidentId) { this.serviceClient().delete(resourceGroupName, workspaceName, incidentId); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, incidentId, context); + public Response createTeamWithResponse(String resourceGroupName, String workspaceName, + String incidentId, TeamInformationInner teamProperties, Context context) { + Response inner = this.serviceClient() + .createTeamWithResponse(resourceGroupName, workspaceName, incidentId, teamProperties, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TeamInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public TeamInformation createTeam( - String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties) { - TeamInformationInner inner = - this.serviceClient().createTeam(resourceGroupName, workspaceName, incidentId, teamProperties); + public TeamInformation createTeam(String resourceGroupName, String workspaceName, String incidentId, + TeamInformationInner teamProperties) { + TeamInformationInner inner + = this.serviceClient().createTeam(resourceGroupName, workspaceName, incidentId, teamProperties); if (inner != null) { return new TeamInformationImpl(inner, this.manager()); } else { @@ -115,22 +111,13 @@ public TeamInformation createTeam( } } - public Response createTeamWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - TeamProperties teamProperties, - Context context) { - Response inner = - this - .serviceClient() - .createTeamWithResponse(resourceGroupName, workspaceName, incidentId, teamProperties, context); + 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 TeamInformationImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentAlertListImpl(inner.getValue(), this.manager())); } else { return null; } @@ -145,24 +132,21 @@ public IncidentAlertList listAlerts(String resourceGroupName, String workspaceNa } } - public Response listAlertsWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context) { - Response inner = - this.serviceClient().listAlertsWithResponse(resourceGroupName, workspaceName, incidentId, context); + public Response listBookmarksWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context) { + Response inner + = this.serviceClient().listBookmarksWithResponse(resourceGroupName, workspaceName, incidentId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IncidentAlertListImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentBookmarkListImpl(inner.getValue(), this.manager())); } else { return null; } } public IncidentBookmarkList listBookmarks(String resourceGroupName, String workspaceName, String incidentId) { - IncidentBookmarkListInner inner = - this.serviceClient().listBookmarks(resourceGroupName, workspaceName, incidentId); + IncidentBookmarkListInner inner + = this.serviceClient().listBookmarks(resourceGroupName, workspaceName, incidentId); if (inner != null) { return new IncidentBookmarkListImpl(inner, this.manager()); } else { @@ -170,24 +154,21 @@ public IncidentBookmarkList listBookmarks(String resourceGroupName, String works } } - public Response listBookmarksWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context) { - Response inner = - this.serviceClient().listBookmarksWithResponse(resourceGroupName, workspaceName, incidentId, context); + public Response listEntitiesWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context) { + Response inner + = this.serviceClient().listEntitiesWithResponse(resourceGroupName, workspaceName, incidentId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IncidentBookmarkListImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentEntitiesResponseImpl(inner.getValue(), this.manager())); } else { return null; } } public IncidentEntitiesResponse listEntities(String resourceGroupName, String workspaceName, String incidentId) { - IncidentEntitiesResponseInner inner = - this.serviceClient().listEntities(resourceGroupName, workspaceName, incidentId); + IncidentEntitiesResponseInner inner + = this.serviceClient().listEntities(resourceGroupName, workspaceName, incidentId); if (inner != null) { return new IncidentEntitiesResponseImpl(inner, this.manager()); } else { @@ -195,121 +176,78 @@ public IncidentEntitiesResponse listEntities(String resourceGroupName, String wo } } - public Response listEntitiesWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context) { - Response inner = - this.serviceClient().listEntitiesWithResponse(resourceGroupName, workspaceName, incidentId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IncidentEntitiesResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - public Incident getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String incidentId = Utils.getValueFromIdByName(id, "incidents"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String incidentId = Utils.getValueFromIdByName(id, "incidents"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, incidentId, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String incidentId = Utils.getValueFromIdByName(id, "incidents"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String incidentId = Utils.getValueFromIdByName(id, "incidents"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'incidents'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, context); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasClientImpl.java deleted file mode 100644 index cfcbc8e039f6..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasClientImpl.java +++ /dev/null @@ -1,209 +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.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.IpGeodatasClient; -import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IpGeodatasClient. */ -public final class IpGeodatasClientImpl implements IpGeodatasClient { - /** The proxy service used to perform REST calls. */ - private final IpGeodatasService service; - - /** The service client containing this operation class. */ - private final SecurityInsightsImpl client; - - /** - * Initializes an instance of IpGeodatasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IpGeodatasClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(IpGeodatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityInsightsIpGeodatas to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsIpGe") - private interface IpGeodatasService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights" - + "/enrichment/ip/geodata/") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("ipAddress") String ipAddress, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get geodata for a single IP address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ipAddress IP address (v4 or v6) to be enriched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return geodata for a single IP address along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String ipAddress) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ipAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter ipAddress is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ipAddress, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get geodata for a single IP address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ipAddress IP address (v4 or v6) to be enriched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return geodata for a single IP address along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ipAddress, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ipAddress == null) { - return Mono.error(new IllegalArgumentException("Parameter ipAddress is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ipAddress, - accept, - context); - } - - /** - * Get geodata for a single IP address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ipAddress IP address (v4 or v6) to be enriched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return geodata for a single IP address on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String ipAddress) { - return getWithResponseAsync(resourceGroupName, ipAddress).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 ipAddress IP address (v4 or v6) to be enriched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return geodata for a single IP address. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnrichmentIpGeodataInner get(String resourceGroupName, String ipAddress) { - return getAsync(resourceGroupName, ipAddress).block(); - } - - /** - * Get geodata for a single IP address. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ipAddress IP address (v4 or v6) to be enriched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return geodata for a single IP address along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ipAddress, Context context) { - return getWithResponseAsync(resourceGroupName, ipAddress, context).block(); - } -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasImpl.java deleted file mode 100644 index 7afbd00545ef..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IpGeodatasImpl.java +++ /dev/null @@ -1,60 +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.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.securityinsights.fluent.IpGeodatasClient; -import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; -import com.azure.resourcemanager.securityinsights.models.EnrichmentIpGeodata; -import com.azure.resourcemanager.securityinsights.models.IpGeodatas; - -public final class IpGeodatasImpl implements IpGeodatas { - private static final ClientLogger LOGGER = new ClientLogger(IpGeodatasImpl.class); - - private final IpGeodatasClient innerClient; - - private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - - public IpGeodatasImpl( - IpGeodatasClient innerClient, - com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public EnrichmentIpGeodata get(String resourceGroupName, String ipAddress) { - EnrichmentIpGeodataInner inner = this.serviceClient().get(resourceGroupName, ipAddress); - if (inner != null) { - return new EnrichmentIpGeodataImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String resourceGroupName, String ipAddress, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, ipAddress, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EnrichmentIpGeodataImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private IpGeodatasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/JobImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/JobImpl.java new file mode 100644 index 000000000000..b05ed8bde6d6 --- /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) AutoRest 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.ProvisioningState; +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 ProvisioningState 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 index 268664bb18db..d0a45a5ae837 100644 --- 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 @@ -7,7 +7,6 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner; -import com.azure.resourcemanager.securityinsights.models.Kind; import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; import com.azure.resourcemanager.securityinsights.models.MetadataCategories; import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; @@ -56,7 +55,7 @@ public String version() { return this.innerModel().version(); } - public Kind kind() { + public String kind() { return this.innerModel().kind(); } @@ -172,22 +171,18 @@ public MetadataModelImpl withExistingWorkspace(String resourceGroupName, String } public MetadataModel create() { - this.innerObject = - serviceManager - .serviceClient() - .getMetadatas() - .createWithResponse(resourceGroupName, workspaceName, metadataName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getMetadatas() + .createWithResponse(resourceGroupName, workspaceName, metadataName, this.innerModel(), context) + .getValue(); return this; } @@ -203,52 +198,43 @@ public MetadataModelImpl update() { } public MetadataModel apply() { - this.innerObject = - serviceManager - .serviceClient() - .getMetadatas() - .updateWithResponse(resourceGroupName, workspaceName, metadataName, updateMetadataPatch, Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getMetadatas() + .updateWithResponse(resourceGroupName, workspaceName, metadataName, updateMetadataPatch, context) + .getValue(); return this; } - MetadataModelImpl( - MetadataModelInner innerObject, + MetadataModelImpl(MetadataModelInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.metadataName = Utils.getValueFromIdByName(innerObject.id(), "metadata"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getMetadatas() + .getWithResponse(resourceGroupName, workspaceName, metadataName, context) + .getValue(); return this; } @@ -292,7 +278,7 @@ public MetadataModelImpl withVersion(String version) { } } - public MetadataModelImpl withKind(Kind kind) { + public MetadataModelImpl withKind(String kind) { if (isInCreateMode()) { this.innerModel().withKind(kind); return this; 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 index c99b2cc76eaf..236fe245596a 100644 --- 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 @@ -35,22 +35,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final MetadatasService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of MetadatasClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MetadatasClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(MetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(MetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -60,132 +66,89 @@ public final class MetadatasClientImpl implements MetadatasClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsMeta") - private interface MetadatasService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata") - @ExpectedResponses({200}) + public interface MetadatasService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("$filter") String filter, - @QueryParam("$orderby") String orderby, - @QueryParam("$top") Integer top, - @QueryParam("$skip") Integer skip, - @HeaderParam("Accept") String accept, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("metadataName") String metadataName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") - @ExpectedResponses({200, 204}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("metadataName") String metadataName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("metadataName") String metadataName, - @BodyParam("application/json") MetadataModelInner metadata, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") - @ExpectedResponses({200}) + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, @BodyParam("application/json") MetadataModelInner metadata, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("metadataName") String metadataName, - @BodyParam("application/json") MetadataPatch metadataPatch, - @HeaderParam("Accept") String accept, - Context context); + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, @BodyParam("application/json") MetadataPatch metadataPatch, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results - * if there are any left. + * 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) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, Integer skip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -196,43 +159,24 @@ private Mono> listSinglePageAsync( } 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)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, top, skip, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results - * if there are any left. + * 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. @@ -240,25 +184,15 @@ private Mono> listSinglePageAsync( * @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, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, Integer skip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -270,55 +204,37 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - filter, - orderby, - top, - skip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results - * if there are any left. + * 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), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, Integer skip) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -332,21 +248,20 @@ private PagedFlux listAsync(String resourceGroupName, String final String orderby = null; final Integer top = null; final Integer skip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skip), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @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. + * 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. @@ -354,14 +269,8 @@ private PagedFlux listAsync(String resourceGroupName, String * @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, - Context context) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, Integer skip, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -369,7 +278,7 @@ private PagedFlux listAsync( /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -388,14 +297,14 @@ public PagedIterable list(String resourceGroupName, String w /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skip Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results - * if there are any left. + * 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. @@ -403,20 +312,14 @@ public PagedIterable list(String resourceGroupName, String w * @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) { + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, Integer skip, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, filter, orderby, top, skip, context)); } /** * Get a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -426,19 +329,15 @@ public PagedIterable list( * @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) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -452,24 +351,14 @@ private Mono> getWithResponseAsync( } 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -480,19 +369,15 @@ private Mono> getWithResponseAsync( * @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, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -506,21 +391,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - metadataName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, metadataName, accept, context); } /** * Get a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -537,41 +414,41 @@ private Mono getAsync(String resourceGroupName, String works /** * Get a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Metadata. + * @return a Metadata along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MetadataModelInner get(String resourceGroupName, String workspaceName, String metadataName) { - return getAsync(resourceGroupName, workspaceName, metadataName).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String metadataName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, metadataName, context).block(); } /** * Get a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Metadata along with {@link Response}. + * @return a Metadata. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String metadataName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, metadataName, context).block(); + public MetadataModelInner get(String resourceGroupName, String workspaceName, String metadataName) { + return getWithResponse(resourceGroupName, workspaceName, metadataName, 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 workspace. * @param metadataName The Metadata name. @@ -581,19 +458,15 @@ public Response getWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String metadataName) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -607,24 +480,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - metadataName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -635,19 +498,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String metadataName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -661,21 +520,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - metadataName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, metadataName, accept, context); } /** * Delete a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -691,40 +542,40 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * Delete a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String metadataName) { - deleteAsync(resourceGroupName, workspaceName, metadataName).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String metadataName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, metadataName, context).block(); } /** * Delete a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 deleteWithResponseAsync(resourceGroupName, workspaceName, metadataName, context).block(); + public void delete(String resourceGroupName, String workspaceName, String metadataName) { + deleteWithResponse(resourceGroupName, workspaceName, metadataName, Context.NONE); } /** * Create a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -735,19 +586,15 @@ public Response deleteWithResponse( * @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) { + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName, MetadataModelInner metadata) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -765,26 +612,14 @@ private Mono> createWithResponseAsync( metadata.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - metadataName, - metadata, - accept, - context)) + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, metadata, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -796,23 +631,15 @@ private Mono> createWithResponseAsync( * @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, - Context context) { + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName, MetadataModelInner metadata, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -831,22 +658,13 @@ private Mono> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - metadataName, - metadata, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, metadataName, metadata, accept, context); } /** * Create a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -857,56 +675,52 @@ private Mono> createWithResponseAsync( * @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) { + 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 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. + * @return metadata resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MetadataModelInner create( - String resourceGroupName, String workspaceName, String metadataName, MetadataModelInner metadata) { - return createAsync(resourceGroupName, workspaceName, metadataName, metadata).block(); + public Response createWithResponse(String resourceGroupName, String workspaceName, + String metadataName, MetadataModelInner metadata, Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadata, context).block(); } /** * Create a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. * @param metadata Metadata resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return metadata resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String workspaceName, - String metadataName, - MetadataModelInner metadata, - Context context) { - return createWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadata, context).block(); + 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 workspace. * @param metadataName The Metadata name. @@ -917,19 +731,15 @@ public Response createWithResponse( * @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) { + private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName, MetadataPatch metadataPatch) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -948,25 +758,15 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - metadataName, - metadataPatch, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, metadataPatch, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update an existing Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -978,23 +778,15 @@ private Mono> updateWithResponseAsync( * @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, - Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName, MetadataPatch metadataPatch, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1013,22 +805,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - metadataName, - metadataPatch, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, metadataName, metadataPatch, accept, context); } /** * Update an existing Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. @@ -1039,58 +822,56 @@ private Mono> updateWithResponseAsync( * @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) { + 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 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. + * @return metadata resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MetadataModelInner update( - String resourceGroupName, String workspaceName, String metadataName, MetadataPatch metadataPatch) { - return updateAsync(resourceGroupName, workspaceName, metadataName, metadataPatch).block(); + public Response updateWithResponse(String resourceGroupName, String workspaceName, + String metadataName, MetadataPatch metadataPatch, Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadataPatch, context).block(); } /** * Update an existing Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. * @param metadataPatch Partial metadata request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return metadata resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String workspaceName, - String metadataName, - MetadataPatch metadataPatch, - Context context) { - return updateWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadataPatch, context).block(); + public MetadataModelInner update(String resourceGroupName, String workspaceName, String metadataName, + MetadataPatch metadataPatch) { + return updateWithResponse(resourceGroupName, workspaceName, metadataName, metadataPatch, Context.NONE) + .getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1102,31 +883,22 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1139,23 +911,13 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasImpl.java index fb795703dad2..3c9abf4b4645 100644 --- 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 @@ -21,8 +21,7 @@ public final class MetadatasImpl implements Metadatas { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public MetadatasImpl( - MetadatasClient innerClient, + public MetadatasImpl(MetadatasClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,155 +29,118 @@ public MetadatasImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new MetadataModelImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new MetadataModelImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, Integer skip, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, filter, orderby, top, skip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MetadataModelImpl(inner1, this.manager())); } - public MetadataModel get(String resourceGroupName, String workspaceName, String metadataName) { - MetadataModelInner inner = this.serviceClient().get(resourceGroupName, workspaceName, metadataName); + public Response getWithResponse(String resourceGroupName, String workspaceName, String metadataName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, metadataName, context); if (inner != null) { - return new MetadataModelImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MetadataModelImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String metadataName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, metadataName, context); + public MetadataModel get(String resourceGroupName, String workspaceName, String metadataName) { + MetadataModelInner inner = this.serviceClient().get(resourceGroupName, workspaceName, metadataName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new MetadataModelImpl(inner.getValue(), this.manager())); + return new MetadataModelImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String metadataName) { - this.serviceClient().delete(resourceGroupName, workspaceName, metadataName); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String metadataName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, metadataName, context); } - public 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 MetadataModel getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String metadataName = Utils.getValueFromIdByName(id, "metadata"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'metadata'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, metadataName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String metadataName = Utils.getValueFromIdByName(id, "metadata"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'metadata'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, metadataName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String metadataName = Utils.getValueFromIdByName(id, "metadata"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'metadata'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, metadataName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String metadataName = Utils.getValueFromIdByName(id, "metadata"); + 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))); + 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); } 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 index 3ea1193ca8e6..6531ecb84593 100644 --- 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 @@ -13,8 +13,7 @@ public final class OfficeConsentImpl implements OfficeConsent { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - OfficeConsentImpl( - OfficeConsentInner innerObject, + OfficeConsentImpl(OfficeConsentInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index fd9d8a21ca81..438d05d10f2e 100644 --- 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 @@ -31,22 +31,28 @@ import com.azure.resourcemanager.securityinsights.models.OfficeConsentList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OfficeConsentsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final OfficeConsentsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of OfficeConsentsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OfficeConsentsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(OfficeConsentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OfficeConsentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,68 +62,45 @@ public final class OfficeConsentsClientImpl implements OfficeConsentsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsOffi") - private interface OfficeConsentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents") - @ExpectedResponses({200}) + public interface OfficeConsentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("consentId") String consentId, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("consentId") String consentId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("consentId") String consentId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("consentId") String consentId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all office365 consents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -126,19 +109,15 @@ Mono> listNext( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -149,32 +128,16 @@ private Mono> listSinglePageAsync( } 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all office365 consents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -184,19 +147,15 @@ private Mono> listSinglePageAsync( * @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, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -208,28 +167,15 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all office365 consents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -239,13 +185,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all office365 consents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -256,14 +202,13 @@ private PagedFlux listAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all office365 consents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -278,7 +223,7 @@ public PagedIterable list(String resourceGroupName, String w /** * 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. @@ -294,7 +239,7 @@ public PagedIterable list(String resourceGroupName, String w /** * 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. @@ -304,19 +249,15 @@ public PagedIterable list(String resourceGroupName, String w * @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) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String consentId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -330,24 +271,14 @@ private Mono> getWithResponseAsync( } 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)) + .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. @@ -358,19 +289,15 @@ private Mono> getWithResponseAsync( * @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, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String consentId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -384,21 +311,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - consentId, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, consentId, accept, context); } /** * Gets an office365 consent. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param consentId consent ID. @@ -415,41 +334,41 @@ private Mono getAsync(String resourceGroupName, String works /** * 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. + * @return an office365 consent along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OfficeConsentInner get(String resourceGroupName, String workspaceName, String consentId) { - return getAsync(resourceGroupName, workspaceName, consentId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String consentId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, consentId, context).block(); } /** * Gets an office365 consent. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param consentId consent ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an office365 consent along with {@link Response}. + * @return an office365 consent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String consentId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, consentId, context).block(); + 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. @@ -459,19 +378,15 @@ public Response getWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String consentId) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String consentId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -485,24 +400,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - consentId, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, consentId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the office365 consent. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param consentId consent ID. @@ -513,19 +418,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String consentId, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String consentId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -539,21 +440,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - consentId, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, consentId, accept, context); } /** * Delete the office365 consent. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param consentId consent ID. @@ -569,47 +462,48 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * 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 void delete(String resourceGroupName, String workspaceName, String consentId) { - deleteAsync(resourceGroupName, workspaceName, consentId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String consentId, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, consentId, context).block(); } /** * Delete the office365 consent. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param consentId consent ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 deleteWithResponseAsync(resourceGroupName, workspaceName, consentId, context).block(); + public void delete(String resourceGroupName, String workspaceName, String consentId) { + deleteWithResponse(resourceGroupName, workspaceName, consentId, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the office365 consents along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of all the office365 consents along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -617,37 +511,28 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the office365 consents along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of all the office365 consents along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -655,23 +540,13 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsImpl.java index 3f6213360a58..800f6c607000 100644 --- 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 @@ -21,8 +21,7 @@ public final class OfficeConsentsImpl implements OfficeConsents { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public OfficeConsentsImpl( - OfficeConsentsClient innerClient, + public OfficeConsentsImpl(OfficeConsentsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,45 +29,42 @@ public OfficeConsentsImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new OfficeConsentImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new OfficeConsentImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OfficeConsentImpl(inner1, this.manager())); } - public OfficeConsent get(String resourceGroupName, String workspaceName, String consentId) { - OfficeConsentInner inner = this.serviceClient().get(resourceGroupName, workspaceName, consentId); + public Response getWithResponse(String resourceGroupName, String workspaceName, String consentId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, consentId, context); if (inner != null) { - return new OfficeConsentImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OfficeConsentImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String consentId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, consentId, context); + public OfficeConsent get(String resourceGroupName, String workspaceName, String consentId) { + OfficeConsentInner inner = this.serviceClient().get(resourceGroupName, workspaceName, consentId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OfficeConsentImpl(inner.getValue(), this.manager())); + return new OfficeConsentImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String consentId) { - this.serviceClient().delete(resourceGroupName, workspaceName, consentId); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String consentId, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, consentId, context); } - 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); } private OfficeConsentsClient serviceClient() { 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 ca2867a1bf43..4c8c3f86a760 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 @@ -13,8 +13,8 @@ public final class OperationImpl implements Operation { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - OperationImpl( - OperationInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsClientImpl.java index 42c9980bb42d..cac30c6d9ec3 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.securityinsights.models.OperationsList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -55,96 +61,71 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsOper") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.SecurityInsights/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return lists the operations available in the SecurityInsights RP along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return lists the operations available in the SecurityInsights RP along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @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.")); + 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)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return lists the operations available in the SecurityInsights RP as paginated response with {@link PagedFlux}. @@ -156,7 +137,7 @@ private PagedFlux listAsync() { /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -165,17 +146,17 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available in the SecurityInsights RP as paginated response with {@link - * PagedIterable}. + * @return lists the operations available in the SecurityInsights RP as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -184,13 +165,13 @@ public PagedIterable list() { /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 - * PagedIterable}. + * @return lists the operations available in the SecurityInsights RP as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -199,14 +180,15 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return lists the operations available in the SecurityInsights RP along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -214,37 +196,28 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return lists the operations available in the SecurityInsights RP along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -252,23 +225,13 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsImpl.java index 6e11ec19acdb..c00010c45fc5 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 @@ -19,8 +19,7 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public OperationsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { 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..13d58bd796e0 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..27614dca3f2c --- /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) AutoRest 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 installedVersion() { + return this.innerModel().installedVersion(); + } + + public String metadataResourceId() { + return this.innerModel().metadataResourceId(); + } + + public Object packagedContent() { + return this.innerModel().packagedContent(); + } + + 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 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/ProductPackageOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackageOperationsClientImpl.java new file mode 100644 index 000000000000..a23d8ccaeaac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackageOperationsClientImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.ProductPackageOperationsClient; +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 ProductPackageOperationsClient. + */ +public final class ProductPackageOperationsClientImpl implements ProductPackageOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProductPackageOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of ProductPackageOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductPackageOperationsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(ProductPackageOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsProductPackageOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsProd") + public interface ProductPackageOperationsService { + @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("$host") 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (packageId == null) { + return Mono.error(new IllegalArgumentException("Parameter packageId 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, 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 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} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String packageId, 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 (packageId == null) { + return Mono.error(new IllegalArgumentException("Parameter packageId 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, 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 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, packageId, context).block(); + } + + /** + * 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 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/ProductPackageOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackageOperationsImpl.java new file mode 100644 index 000000000000..9b78072ee89e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackageOperationsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.ProductPackageOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import com.azure.resourcemanager.securityinsights.models.ProductPackageModel; +import com.azure.resourcemanager.securityinsights.models.ProductPackageOperations; + +public final class ProductPackageOperationsImpl implements ProductPackageOperations { + private static final ClientLogger LOGGER = new ClientLogger(ProductPackageOperationsImpl.class); + + private final ProductPackageOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ProductPackageOperationsImpl(ProductPackageOperationsClient 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProductPackageModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 ProductPackageOperationsClient 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/ProductPackagesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesClientImpl.java new file mode 100644 index 000000000000..a03c29d36027 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesClientImpl.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.ProductPackagesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import com.azure.resourcemanager.securityinsights.models.ProductPackageList; +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 SecurityInsightsImpl client; + + /** + * Initializes an instance of ProductPackagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductPackagesClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(ProductPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsProductPackages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsProd") + public interface ProductPackagesService { + @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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, top, skipToken, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all 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 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 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, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets all 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 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 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) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken), + 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 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; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken), + 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 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 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, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, 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 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; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken)); + } + + /** + * 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 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 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, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list available packages 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list available packages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesImpl.java new file mode 100644 index 000000000000..b9f0186913bd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.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 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, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductPackageModelImpl(inner1, this.manager())); + } + + 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/ProductSettingsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsClientImpl.java index 5a8f6c3d0f22..0c7de558ac72 100644 --- 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 @@ -29,22 +29,28 @@ import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ProductSettingsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ProductSettingsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of ProductSettingsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ProductSettingsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(ProductSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ProductSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -54,75 +60,48 @@ public final class ProductSettingsClientImpl implements ProductSettingsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsProd") - private interface ProductSettingsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings") - @ExpectedResponses({200}) + public interface ProductSettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("settingsName") String settingsName, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("settingsName") String settingsName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("settingsName") String settingsName, - @BodyParam("application/json") SettingsInner settings, - @HeaderParam("Accept") String accept, - Context context); + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, @BodyParam("application/json") SettingsInner settings, + @HeaderParam("Accept") String accept, Context context); } /** * List of all the settings. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -133,16 +112,12 @@ Mono> update( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -153,23 +128,14 @@ private Mono> listWithResponseAsync(String resourceGr } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List of all the settings. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -179,19 +145,15 @@ private Mono> listWithResponseAsync(String resourceGr * @return list of all the settings along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -202,20 +164,13 @@ private Mono> listWithResponseAsync( } 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); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); } /** * List of all the settings. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -230,39 +185,39 @@ private Mono listAsync(String resourceGroupName, String worksp /** * 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. + * @return list of all the settings along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SettingListInner list(String resourceGroupName, String workspaceName) { - return listAsync(resourceGroupName, workspaceName).block(); + public Response listWithResponse(String resourceGroupName, String workspaceName, + Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * List of all the settings. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the settings along with {@link Response}. + * @return list of all the settings. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String workspaceName, Context context) { - return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + public SettingListInner list(String resourceGroupName, String workspaceName) { + return listWithResponse(resourceGroupName, workspaceName, Context.NONE).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. @@ -272,19 +227,15 @@ public Response listWithResponse( * @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) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String settingsName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -298,24 +249,14 @@ private Mono> getWithResponseAsync( } 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)) + .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. @@ -326,19 +267,15 @@ private Mono> getWithResponseAsync( * @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, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String settingsName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -352,21 +289,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - settingsName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, settingsName, accept, context); } /** * Gets a setting. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. @@ -383,41 +312,41 @@ private Mono getAsync(String resourceGroupName, String workspaceN /** * 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. + * @return a setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SettingsInner get(String resourceGroupName, String workspaceName, String settingsName) { - return getAsync(resourceGroupName, workspaceName, settingsName).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, String settingsName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, settingsName, context).block(); } /** * Gets a setting. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return a setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String settingsName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, settingsName, context).block(); + public SettingsInner get(String resourceGroupName, String workspaceName, String settingsName) { + return getWithResponse(resourceGroupName, workspaceName, settingsName, 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. @@ -427,19 +356,15 @@ public Response getWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String settingsName) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String settingsName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -453,24 +378,14 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - settingsName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete setting of the product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. @@ -481,19 +396,15 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String settingsName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String settingsName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -507,21 +418,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - settingsName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, settingsName, accept, context); } /** * Delete setting of the product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. @@ -537,40 +440,40 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S /** * 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 void delete(String resourceGroupName, String workspaceName, String settingsName) { - deleteAsync(resourceGroupName, workspaceName, settingsName).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String settingsName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, settingsName, context).block(); } /** * Delete setting of the product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 deleteWithResponseAsync(resourceGroupName, workspaceName, settingsName, context).block(); + public void delete(String resourceGroupName, String workspaceName, String settingsName) { + deleteWithResponse(resourceGroupName, workspaceName, settingsName, Context.NONE); } /** * 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. @@ -581,19 +484,15 @@ public Response deleteWithResponse( * @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) { + private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String settingsName, SettingsInner settings) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -611,26 +510,14 @@ private Mono> updateWithResponseAsync( settings.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - settingsName, - settings, - accept, - context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsName, settings, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates setting. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. @@ -642,19 +529,15 @@ private Mono> updateWithResponseAsync( * @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, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String settingsName, SettingsInner settings, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -673,22 +556,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - settingsName, - settings, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, settingsName, settings, accept, context); } /** * Updates setting. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. @@ -699,46 +573,46 @@ private Mono> updateWithResponseAsync( * @return the Setting on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings) { + 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. + * @return the Setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SettingsInner update( - String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings) { - return updateAsync(resourceGroupName, workspaceName, settingsName, settings).block(); + public Response updateWithResponse(String resourceGroupName, String workspaceName, + String settingsName, SettingsInner settings, Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, settingsName, settings, context).block(); } /** * Updates setting. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. * @param settings The setting. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return the Setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings, Context context) { - return updateWithResponseAsync(resourceGroupName, workspaceName, settingsName, settings, context).block(); + public SettingsInner update(String resourceGroupName, String workspaceName, String settingsName, + SettingsInner settings) { + return updateWithResponse(resourceGroupName, workspaceName, settingsName, settings, Context.NONE).getValue(); } } 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 index 5596bd0f4aa9..d1d38f624e46 100644 --- 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 @@ -22,13 +22,23 @@ public final class ProductSettingsImpl implements ProductSettings { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public ProductSettingsImpl( - ProductSettingsClient innerClient, + public ProductSettingsImpl(ProductSettingsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } + public Response listWithResponse(String resourceGroupName, String workspaceName, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SettingListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public SettingList list(String resourceGroupName, String workspaceName) { SettingListInner inner = this.serviceClient().list(resourceGroupName, workspaceName); if (inner != null) { @@ -38,15 +48,13 @@ public SettingList list(String resourceGroupName, String workspaceName) { } } - public Response listWithResponse(String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); + public Response getWithResponse(String resourceGroupName, String workspaceName, String settingsName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, settingsName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SettingListImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SettingsImpl(inner.getValue(), this.manager())); } else { return null; } @@ -61,50 +69,32 @@ public Settings get(String resourceGroupName, String workspaceName, String setti } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String settingsName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, settingsName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SettingsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public 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 Response deleteWithResponse( - String resourceGroupName, String workspaceName, String settingsName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, settingsName, context); - } - - public Settings update( - String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings) { - SettingsInner inner = this.serviceClient().update(resourceGroupName, workspaceName, settingsName, settings); + public Response updateWithResponse(String resourceGroupName, String workspaceName, String settingsName, + SettingsInner settings, Context context) { + Response inner = this.serviceClient() + .updateWithResponse(resourceGroupName, workspaceName, settingsName, settings, context); if (inner != null) { - return new SettingsImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SettingsImpl(inner.getValue(), 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); + 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 SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SettingsImpl(inner.getValue(), this.manager())); + return new SettingsImpl(inner, this.manager()); } else { return null; } 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..6d3888e767c4 --- /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) AutoRest 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 Object packagedContent() { + return this.innerModel().packagedContent(); + } + + 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 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/ProductTemplateOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplateOperationsClientImpl.java new file mode 100644 index 000000000000..13b8f8edd848 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplateOperationsClientImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.ProductTemplateOperationsClient; +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 ProductTemplateOperationsClient. + */ +public final class ProductTemplateOperationsClientImpl implements ProductTemplateOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProductTemplateOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of ProductTemplateOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductTemplateOperationsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(ProductTemplateOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsProductTemplateOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsProd") + public interface ProductTemplateOperationsService { + @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("$host") 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (templateId == null) { + return Mono.error(new IllegalArgumentException("Parameter templateId 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (templateId == null) { + return Mono.error(new IllegalArgumentException("Parameter templateId 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, templateId, context).block(); + } + + /** + * 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/ProductTemplateOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplateOperationsImpl.java new file mode 100644 index 000000000000..d4e394101606 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplateOperationsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.ProductTemplateOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.ProductTemplateModel; +import com.azure.resourcemanager.securityinsights.models.ProductTemplateOperations; + +public final class ProductTemplateOperationsImpl implements ProductTemplateOperations { + private static final ClientLogger LOGGER = new ClientLogger(ProductTemplateOperationsImpl.class); + + private final ProductTemplateOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ProductTemplateOperationsImpl(ProductTemplateOperationsClient 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProductTemplateModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 ProductTemplateOperationsClient 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/ProductTemplatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesClientImpl.java new file mode 100644 index 000000000000..f378a2f39c96 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesClientImpl.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.ProductTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.ProductTemplateList; +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 SecurityInsightsImpl client; + + /** + * Initializes an instance of ProductTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductTemplatesClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(ProductTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsProductTemplates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsProd") + public interface ProductTemplatesService { + @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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, + @QueryParam("$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("$host") 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 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, 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 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} 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, 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, search, count, top, skip, skipToken, accept, context) + .map(res -> 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 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 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 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 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, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, 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 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<>( + listAsync(resourceGroupName, workspaceName, filter, orderby, search, count, top, skip, skipToken)); + } + + /** + * 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 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<>( + listAsync(resourceGroupName, workspaceName, filter, orderby, search, count, top, skip, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the template 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the template along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesImpl.java new file mode 100644 index 000000000000..6cc74029fae6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.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 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 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/RecommendationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RecommendationImpl.java new file mode 100644 index 000000000000..12913b5f3d55 --- /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) AutoRest 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/RecommendationListImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RecommendationListImpl.java new file mode 100644 index 000000000000..d537ab252f36 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RecommendationListImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationListInner; +import com.azure.resourcemanager.securityinsights.models.Recommendation; +import com.azure.resourcemanager.securityinsights.models.RecommendationList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class RecommendationListImpl implements RecommendationList { + private RecommendationListInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + RecommendationListImpl(RecommendationListInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new RecommendationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public RecommendationListInner 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..aebca6c4ab3f --- /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) AutoRest 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..56510d7eedb0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesClientImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.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 java.util.UUID; +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 SecurityInsightsImpl client; + + /** + * Initializes an instance of ReevaluatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReevaluatesClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(ReevaluatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsReevaluates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsReev") + 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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("recommendationId") UUID 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, UUID recommendationId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (recommendationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recommendationId is required and cannot be null.")); + } + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, UUID recommendationId, 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 (recommendationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recommendationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.recommendation(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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono recommendationAsync(String resourceGroupName, String workspaceName, + UUID 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, + UUID recommendationId, Context context) { + return recommendationWithResponseAsync(resourceGroupName, workspaceName, recommendationId, context).block(); + } + + /** + * 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, + UUID 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..e5c65d760d61 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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; +import java.util.UUID; + +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, + UUID recommendationId, Context context) { + Response inner = this.serviceClient() + .recommendationWithResponse(resourceGroupName, workspaceName, recommendationId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ReevaluateResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ReevaluateResponse recommendation(String resourceGroupName, String workspaceName, UUID 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 16262d97eb12..938b55d507bb 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 @@ -78,24 +78,20 @@ public RelationImpl withExistingBookmark(String resourceGroupName, String worksp } public Relation create() { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarkRelations() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarkRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public Relation create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarkRelations() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarkRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), + context) + .getValue(); return this; } @@ -110,54 +106,46 @@ public RelationImpl update() { } public Relation apply() { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarkRelations() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarkRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public Relation apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarkRelations() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarkRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), + context) + .getValue(); return this; } - RelationImpl( - RelationInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + RelationImpl(RelationInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.bookmarkId = Utils.getValueFromIdByName(innerObject.id(), "bookmarks"); - this.relationName = Utils.getValueFromIdByName(innerObject.id(), "relations"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.bookmarkId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "bookmarks"); + this.relationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "relations"); } public Relation refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarkRelations() - .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBookmarkRelations() + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE) + .getValue(); return this; } public Relation refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBookmarkRelations() - .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .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 index fc0358a24f1d..808c23a845e9 100644 --- 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 @@ -27,6 +27,10 @@ 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) { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/Utils.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceManagerUtils.java similarity index 80% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/Utils.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceManagerUtils.java index cdc16e4cf245..53ba99bb2a06 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/Utils.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +87,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +127,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +189,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } 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..cc5d26f554f2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(SecurityInsightsImpl client) { + this.service + = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsResourceProviders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsReso") + public interface ResourceProvidersService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/enrichment/{enrichmentType}/listGeodataByIp") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGeodataByIp(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("enrichmentType") EnrichmentType enrichmentType, + @BodyParam("application/json") EnrichmentIpAddressBody ipAddressBody, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/enrichment/{enrichmentType}/listWhoisByDomain") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listWhoisByDomain(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("enrichmentType") EnrichmentType enrichmentType, + @BodyParam("application/json") EnrichmentDomainBody domainBody, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (enrichmentType == null) { + return Mono.error(new IllegalArgumentException("Parameter enrichmentType is required and cannot be null.")); + } + if (ipAddressBody == null) { + return Mono.error(new IllegalArgumentException("Parameter ipAddressBody is required and cannot be null.")); + } else { + ipAddressBody.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGeodataByIp(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, enrichmentType, ipAddressBody, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGeodataByIpWithResponseAsync(String resourceGroupName, + String workspaceName, EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody, 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 (enrichmentType == null) { + return Mono.error(new IllegalArgumentException("Parameter enrichmentType is required and cannot be null.")); + } + if (ipAddressBody == null) { + return Mono.error(new IllegalArgumentException("Parameter ipAddressBody is required and cannot be null.")); + } else { + ipAddressBody.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listGeodataByIp(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, enrichmentType, ipAddressBody, accept, + 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 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) { + return listGeodataByIpWithResponseAsync(resourceGroupName, workspaceName, enrichmentType, ipAddressBody, + context).block(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (enrichmentType == null) { + return Mono.error(new IllegalArgumentException("Parameter enrichmentType is required and cannot be null.")); + } + if (domainBody == null) { + return Mono.error(new IllegalArgumentException("Parameter domainBody is required and cannot be null.")); + } else { + domainBody.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listWhoisByDomain(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, enrichmentType, domainBody, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param 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} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWhoisByDomainWithResponseAsync(String resourceGroupName, + String workspaceName, EnrichmentType enrichmentType, EnrichmentDomainBody domainBody, 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 (enrichmentType == null) { + return Mono.error(new IllegalArgumentException("Parameter enrichmentType is required and cannot be null.")); + } + if (domainBody == null) { + return Mono.error(new IllegalArgumentException("Parameter domainBody is required and cannot be null.")); + } else { + domainBody.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listWhoisByDomain(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, enrichmentType, domainBody, accept, + 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 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) { + return listWhoisByDomainWithResponseAsync(resourceGroupName, workspaceName, enrichmentType, domainBody, context) + .block(); + } + + /** + * 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..2a701d01f411 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersImpl.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnrichmentIpGeodataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnrichmentDomainWhoisImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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/SecurityInsightsBuilder.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsBuilder.java index 51ba4f3403a4..4fa4da61617c 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/SecurityInsightsBuilder.java @@ -14,8 +14,10 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the SecurityInsightsImpl type. */ -@ServiceClientBuilder(serviceClients = {SecurityInsightsImpl.class}) +/** + * A builder for creating a new instance of the SecurityInsightsImpl type. + */ +@ServiceClientBuilder(serviceClients = { SecurityInsightsImpl.class }) public final class SecurityInsightsBuilder { /* * The ID of the target subscription. @@ -24,7 +26,7 @@ public final class SecurityInsightsBuilder { /** * Sets The ID of the target subscription. - * + * * @param subscriptionId the subscriptionId value. * @return the SecurityInsightsBuilder. */ @@ -40,7 +42,7 @@ public SecurityInsightsBuilder subscriptionId(String subscriptionId) { /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the SecurityInsightsBuilder. */ @@ -56,7 +58,7 @@ public SecurityInsightsBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the SecurityInsightsBuilder. */ @@ -72,7 +74,7 @@ public SecurityInsightsBuilder environment(AzureEnvironment environment) { /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the SecurityInsightsBuilder. */ @@ -88,7 +90,7 @@ public SecurityInsightsBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the SecurityInsightsBuilder. */ @@ -104,7 +106,7 @@ public SecurityInsightsBuilder defaultPollInterval(Duration defaultPollInterval) /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the SecurityInsightsBuilder. */ @@ -115,30 +117,22 @@ public SecurityInsightsBuilder serializerAdapter(SerializerAdapter serializerAda /** * Builds an instance of SecurityInsightsImpl with the provided parameters. - * + * * @return an instance of SecurityInsightsImpl. */ public SecurityInsightsImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - SecurityInsightsImpl client = - new SecurityInsightsImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + SecurityInsightsImpl client = new SecurityInsightsImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsImpl.java index 86963e3bc62a..549ddf231275 100644 --- 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 @@ -5,6 +5,7 @@ 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; @@ -12,8 +13,8 @@ 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.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -23,15 +24,23 @@ 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.AlertRuleOperationsClient; import com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient; +import com.azure.resourcemanager.securityinsights.fluent.AlertRuleTemplatesClient; 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.BusinessApplicationAgentOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.BusinessApplicationAgentsClient; +import com.azure.resourcemanager.securityinsights.fluent.ContentPackageOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.ContentPackagesClient; +import com.azure.resourcemanager.securityinsights.fluent.ContentTemplateOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient; +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.DomainWhoisClient; import com.azure.resourcemanager.securityinsights.fluent.EntitiesClient; import com.azure.resourcemanager.securityinsights.fluent.EntitiesGetTimelinesClient; import com.azure.resourcemanager.securityinsights.fluent.EntitiesRelationsClient; @@ -39,24 +48,45 @@ 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.GetsClient; +import com.azure.resourcemanager.securityinsights.fluent.GetTriggeredAnalyticsRuleRunsClient; +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.IncidentsClient; -import com.azure.resourcemanager.securityinsights.fluent.IpGeodatasClient; +import com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient; 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.ProductPackageOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.ProductPackagesClient; import com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient; +import com.azure.resourcemanager.securityinsights.fluent.ProductTemplateOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.ProductTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.ReevaluatesClient; +import com.azure.resourcemanager.securityinsights.fluent.ResourceProvidersClient; 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.SourceControlsClient; import com.azure.resourcemanager.securityinsights.fluent.SourceControlsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.SystemsClient; 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; @@ -66,483 +96,971 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the SecurityInsightsImpl type. */ +/** + * Initializes a new instance of the SecurityInsightsImpl type. + */ @ServiceClient(builder = SecurityInsightsBuilder.class) public final class SecurityInsightsImpl implements SecurityInsights { - /** The ID of the target subscription. */ + /** + * 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. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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 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. */ + /** + * 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 BookmarksClient object to access its operations. + */ private final BookmarksClient bookmarks; /** * Gets the BookmarksClient object to access its operations. - * + * * @return the BookmarksClient object. */ public BookmarksClient getBookmarks() { return this.bookmarks; } - /** The BookmarkRelationsClient object to access its operations. */ + /** + * The BookmarkRelationsClient object to access its operations. + */ private final BookmarkRelationsClient bookmarkRelations; /** * Gets the BookmarkRelationsClient object to access its operations. - * + * * @return the BookmarkRelationsClient object. */ public BookmarkRelationsClient getBookmarkRelations() { return this.bookmarkRelations; } - /** The BookmarkOperationsClient object to access its operations. */ + /** + * The BookmarkOperationsClient object to access its operations. + */ private final BookmarkOperationsClient bookmarkOperations; /** * Gets the BookmarkOperationsClient object to access its operations. - * + * * @return the BookmarkOperationsClient object. */ public BookmarkOperationsClient getBookmarkOperations() { return this.bookmarkOperations; } - /** The IpGeodatasClient object to access its operations. */ - private final IpGeodatasClient ipGeodatas; + /** + * The BusinessApplicationAgentsClient object to access its operations. + */ + private final BusinessApplicationAgentsClient businessApplicationAgents; /** - * Gets the IpGeodatasClient object to access its operations. - * - * @return the IpGeodatasClient object. + * Gets the BusinessApplicationAgentsClient object to access its operations. + * + * @return the BusinessApplicationAgentsClient object. */ - public IpGeodatasClient getIpGeodatas() { - return this.ipGeodatas; + public BusinessApplicationAgentsClient getBusinessApplicationAgents() { + return this.businessApplicationAgents; } - /** The DomainWhoisClient object to access its operations. */ - private final DomainWhoisClient domainWhois; + /** + * The BusinessApplicationAgentOperationsClient object to access its operations. + */ + private final BusinessApplicationAgentOperationsClient businessApplicationAgentOperations; /** - * Gets the DomainWhoisClient object to access its operations. - * - * @return the DomainWhoisClient object. + * Gets the BusinessApplicationAgentOperationsClient object to access its operations. + * + * @return the BusinessApplicationAgentOperationsClient object. */ - public DomainWhoisClient getDomainWhois() { - return this.domainWhois; + public BusinessApplicationAgentOperationsClient getBusinessApplicationAgentOperations() { + return this.businessApplicationAgentOperations; } - /** The EntitiesClient object to access its operations. */ - private final EntitiesClient entities; + /** + * The SystemsClient object to access its operations. + */ + private final SystemsClient systems; /** - * Gets the EntitiesClient object to access its operations. - * - * @return the EntitiesClient object. + * Gets the SystemsClient object to access its operations. + * + * @return the SystemsClient object. */ - public EntitiesClient getEntities() { - return this.entities; + public SystemsClient getSystems() { + return this.systems; + } + + /** + * 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 ProductPackageOperationsClient object to access its operations. + */ + private final ProductPackageOperationsClient productPackageOperations; + + /** + * Gets the ProductPackageOperationsClient object to access its operations. + * + * @return the ProductPackageOperationsClient object. + */ + public ProductPackageOperationsClient getProductPackageOperations() { + return this.productPackageOperations; + } + + /** + * 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 ProductTemplateOperationsClient object to access its operations. + */ + private final ProductTemplateOperationsClient productTemplateOperations; + + /** + * Gets the ProductTemplateOperationsClient object to access its operations. + * + * @return the ProductTemplateOperationsClient object. + */ + public ProductTemplateOperationsClient getProductTemplateOperations() { + return this.productTemplateOperations; } - /** The EntitiesGetTimelinesClient object to access its operations. */ + /** + * 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 ContentTemplateOperationsClient object to access its operations. + */ + private final ContentTemplateOperationsClient contentTemplateOperations; + + /** + * Gets the ContentTemplateOperationsClient object to access its operations. + * + * @return the ContentTemplateOperationsClient object. + */ + public ContentTemplateOperationsClient getContentTemplateOperations() { + return this.contentTemplateOperations; + } + + /** + * 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 EntitiesGetTimelinesClient object to access its operations. + */ private final EntitiesGetTimelinesClient entitiesGetTimelines; /** * Gets the EntitiesGetTimelinesClient object to access its operations. - * + * * @return the EntitiesGetTimelinesClient object. */ public EntitiesGetTimelinesClient getEntitiesGetTimelines() { return this.entitiesGetTimelines; } - /** The EntitiesRelationsClient object to access its operations. */ + /** + * The EntitiesRelationsClient object to access its operations. + */ private final EntitiesRelationsClient entitiesRelations; /** * Gets the EntitiesRelationsClient object to access its operations. - * + * * @return the EntitiesRelationsClient object. */ public EntitiesRelationsClient getEntitiesRelations() { return this.entitiesRelations; } - /** The EntityRelationsClient object to access its operations. */ + /** + * 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 EntityQueriesClient object to access its operations. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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 IncidentCommentsClient object to access its operations. */ + /** + * 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 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 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 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. */ + /** + * The IncidentRelationsClient object to access its operations. + */ private final IncidentRelationsClient incidentRelations; /** * Gets the IncidentRelationsClient object to access its operations. - * + * * @return the IncidentRelationsClient object. */ public IncidentRelationsClient getIncidentRelations() { return this.incidentRelations; } - /** The MetadatasClient object to access its operations. */ + /** + * 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 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 OfficeConsentsClient object to access its operations. */ + /** + * The OfficeConsentsClient object to access its operations. + */ private final OfficeConsentsClient officeConsents; /** * Gets the OfficeConsentsClient object to access its operations. - * + * * @return the OfficeConsentsClient object. */ public OfficeConsentsClient getOfficeConsents() { return this.officeConsents; } - /** The SentinelOnboardingStatesClient object to access its operations. */ + /** + * 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. */ + /** + * 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 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 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 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 ProductSettingsClient object to access its operations. */ + /** + * The ProductSettingsClient object to access its operations. + */ private final ProductSettingsClient productSettings; /** * Gets the ProductSettingsClient object to access its operations. - * + * * @return the ProductSettingsClient object. */ public ProductSettingsClient getProductSettings() { return this.productSettings; } - /** The SourceControlsClient object to access its operations. */ + /** + * The SourceControlsClient object to access its operations. + */ private final SourceControlsClient sourceControls; /** * Gets the SourceControlsClient object to access its operations. - * + * * @return the SourceControlsClient object. */ public SourceControlsClient getSourceControls() { return this.sourceControls; } - /** The SourceControlsOperationsClient object to access its operations. */ + /** + * The SourceControlsOperationsClient object to access its operations. + */ private final SourceControlsOperationsClient sourceControlsOperations; /** * Gets the SourceControlsOperationsClient object to access its operations. - * + * * @return the SourceControlsOperationsClient object. */ public SourceControlsOperationsClient getSourceControlsOperations() { return this.sourceControlsOperations; } - /** The ThreatIntelligenceIndicatorsClient object to access its operations. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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 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 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 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 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. */ + /** + * The WatchlistItemsClient object to access its operations. + */ private final WatchlistItemsClient watchlistItems; /** * Gets the WatchlistItemsClient object to access its operations. - * + * * @return the WatchlistItemsClient object. */ public WatchlistItemsClient getWatchlistItems() { return this.watchlistItems; } - /** The DataConnectorsClient object to access its operations. */ + /** + * 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 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; + } + + /** + * 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 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 DataConnectorsCheckRequirementsOperationsClient object to access its operations. */ + /** + * 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 OperationsClient object to access its operations. */ + /** + * 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() { @@ -551,7 +1069,7 @@ public OperationsClient getOperations() { /** * 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. @@ -559,41 +1077,55 @@ public OperationsClient getOperations() { * @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) { + 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-09-01-preview"; + this.apiVersion = "2024-04-01-preview"; this.alertRules = new AlertRulesClientImpl(this); this.actions = new ActionsClientImpl(this); this.alertRuleTemplates = new AlertRuleTemplatesClientImpl(this); this.automationRules = new AutomationRulesClientImpl(this); + this.entities = new EntitiesClientImpl(this); this.incidents = new IncidentsClientImpl(this); + this.billingStatistics = new BillingStatisticsClientImpl(this); this.bookmarks = new BookmarksClientImpl(this); this.bookmarkRelations = new BookmarkRelationsClientImpl(this); this.bookmarkOperations = new BookmarkOperationsClientImpl(this); - this.ipGeodatas = new IpGeodatasClientImpl(this); - this.domainWhois = new DomainWhoisClientImpl(this); - this.entities = new EntitiesClientImpl(this); + this.businessApplicationAgents = new BusinessApplicationAgentsClientImpl(this); + this.businessApplicationAgentOperations = new BusinessApplicationAgentOperationsClientImpl(this); + this.systems = new SystemsClientImpl(this); + this.contentPackages = new ContentPackagesClientImpl(this); + this.contentPackageOperations = new ContentPackageOperationsClientImpl(this); + this.productPackages = new ProductPackagesClientImpl(this); + this.productPackageOperations = new ProductPackageOperationsClientImpl(this); + this.productTemplates = new ProductTemplatesClientImpl(this); + this.productTemplateOperations = new ProductTemplateOperationsClientImpl(this); + this.contentTemplates = new ContentTemplatesClientImpl(this); + this.contentTemplateOperations = new ContentTemplateOperationsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); this.entitiesGetTimelines = new EntitiesGetTimelinesClientImpl(this); this.entitiesRelations = new EntitiesRelationsClientImpl(this); this.entityRelations = new EntityRelationsClientImpl(this); this.entityQueries = new EntityQueriesClientImpl(this); this.entityQueryTemplates = new EntityQueryTemplatesClientImpl(this); this.fileImports = new FileImportsClientImpl(this); + this.hunts = new HuntsClientImpl(this); + this.huntRelations = new HuntRelationsClientImpl(this); + this.huntComments = new HuntCommentsClientImpl(this); this.incidentComments = new IncidentCommentsClientImpl(this); this.incidentRelations = new IncidentRelationsClientImpl(this); + this.incidentTasks = new IncidentTasksClientImpl(this); this.metadatas = new MetadatasClientImpl(this); this.officeConsents = new OfficeConsentsClientImpl(this); this.sentinelOnboardingStates = new SentinelOnboardingStatesClientImpl(this); + this.getRecommendations = new GetRecommendationsClientImpl(this); + this.gets = new GetsClientImpl(this); + this.updates = new UpdatesClientImpl(this); + this.reevaluates = new ReevaluatesClientImpl(this); this.securityMLAnalyticsSettings = new SecurityMLAnalyticsSettingsClientImpl(this); this.productSettings = new ProductSettingsClientImpl(this); this.sourceControls = new SourceControlsClientImpl(this); @@ -601,8 +1133,18 @@ public OperationsClient getOperations() { this.threatIntelligenceIndicators = new ThreatIntelligenceIndicatorsClientImpl(this); this.threatIntelligenceIndicatorsOperations = new ThreatIntelligenceIndicatorsOperationsClientImpl(this); this.threatIntelligenceIndicatorMetrics = new ThreatIntelligenceIndicatorMetricsClientImpl(this); + this.threatIntelligences = new ThreatIntelligencesClientImpl(this); + this.triggeredAnalyticsRuleRunOperations = new TriggeredAnalyticsRuleRunOperationsClientImpl(this); + this.getTriggeredAnalyticsRuleRuns = new GetTriggeredAnalyticsRuleRunsClientImpl(this); + this.alertRuleOperations = new AlertRuleOperationsClientImpl(this); this.watchlists = new WatchlistsClientImpl(this); this.watchlistItems = new WatchlistItemsClientImpl(this); + this.workspaceManagerAssignments = new WorkspaceManagerAssignmentsClientImpl(this); + this.workspaceManagerAssignmentJobs = new WorkspaceManagerAssignmentJobsClientImpl(this); + this.workspaceManagerConfigurations = new WorkspaceManagerConfigurationsClientImpl(this); + this.workspaceManagerGroups = new WorkspaceManagerGroupsClientImpl(this); + this.workspaceManagerMembers = new WorkspaceManagerMembersClientImpl(this); + this.dataConnectorDefinitions = new DataConnectorDefinitionsClientImpl(this); this.dataConnectors = new DataConnectorsClientImpl(this); this.dataConnectorsCheckRequirementsOperations = new DataConnectorsCheckRequirementsOperationsClientImpl(this); this.operations = new OperationsClientImpl(this); @@ -610,7 +1152,7 @@ public OperationsClient getOperations() { /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -619,7 +1161,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -629,7 +1171,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -639,26 +1181,15 @@ public Context mergeContext(Context context) { * @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); + 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. @@ -671,19 +1202,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + 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); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -724,7 +1252,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { 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 57be54dbc3bf..73e9d09a5962 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 @@ -7,14 +7,14 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner; import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSetting; +import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsKind; public final class SecurityMLAnalyticsSettingImpl implements SecurityMLAnalyticsSetting { private SecurityMLAnalyticsSettingInner innerObject; private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - SecurityMLAnalyticsSettingImpl( - SecurityMLAnalyticsSettingInner innerObject, + SecurityMLAnalyticsSettingImpl(SecurityMLAnalyticsSettingInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -40,6 +40,10 @@ 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 2cd597054440..aa3a850505d7 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 @@ -33,24 +33,28 @@ import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SecurityMLAnalyticsSettingsClient. */ +/** + * An instance of this class provides access to all the operations defined in SecurityMLAnalyticsSettingsClient. + */ public final class SecurityMLAnalyticsSettingsClientImpl implements SecurityMLAnalyticsSettingsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SecurityMLAnalyticsSettingsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of SecurityMLAnalyticsSettingsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SecurityMLAnalyticsSettingsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy - .create( - SecurityMLAnalyticsSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(SecurityMLAnalyticsSettingsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -60,110 +64,77 @@ public final class SecurityMLAnalyticsSettingsClientImpl implements SecurityMLAn */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsSecu") - private interface SecurityMLAnalyticsSettingsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings") - @ExpectedResponses({200}) + public interface SecurityMLAnalyticsSettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings" - + "/{settingsResourceName}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("settingsResourceName") String settingsResourceName, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") 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}) + @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, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> createOrUpdate(@HostParam("$host") 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("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings" - + "/{settingsResourceName}") - @ExpectedResponses({200, 204}) + @Headers({ "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("$host") 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, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsResourceName") String settingsResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -174,55 +145,35 @@ private Mono> listSinglePageAsync } 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.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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -234,28 +185,15 @@ private Mono> listSinglePageAsync 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)); + .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. @@ -265,13 +203,13 @@ private Mono> listSinglePageAsync */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + 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. @@ -281,16 +219,15 @@ private PagedFlux listAsync(String resourceGrou * @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), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, 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. @@ -305,7 +242,7 @@ public PagedIterable list(String resourceGroupN /** * 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. @@ -315,14 +252,14 @@ public PagedIterable list(String resourceGroupN * @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) { + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, 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 settingsResourceName Security ML Analytics Settings resource name. @@ -332,19 +269,15 @@ public PagedIterable list( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -358,25 +291,14 @@ private Mono> getWithResponseAsync( .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)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -387,19 +309,15 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -414,21 +332,13 @@ private Mono> getWithResponseAsync( } 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); + 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 settingsResourceName Security ML Analytics Settings resource name. @@ -438,50 +348,50 @@ private Mono> getWithResponseAsync( * @return the Security ML Analytics Settings on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String settingsResourceName) { + private Mono getAsync(String resourceGroupName, String workspaceName, + String settingsResourceName) { return getWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return the Security ML Analytics Settings along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityMLAnalyticsSettingInner get( - String resourceGroupName, String workspaceName, String settingsResourceName) { - return getAsync(resourceGroupName, workspaceName, settingsResourceName).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String settingsResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName, context).block(); } /** * 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}. + * @return the Security ML Analytics Settings. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String settingsResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName, context).block(); + public SecurityMLAnalyticsSettingInner get(String resourceGroupName, String workspaceName, + String settingsResourceName) { + return getWithResponse(resourceGroupName, workspaceName, settingsResourceName, Context.NONE).getValue(); } /** * 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. @@ -492,22 +402,15 @@ public Response getWithResponse( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -521,34 +424,22 @@ private Mono> createOrUpdateWithRespon .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.")); + return Mono.error( + new IllegalArgumentException("Parameter securityMLAnalyticsSetting is required and cannot be null.")); } else { securityMLAnalyticsSetting.validate(); } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsResourceName, + securityMLAnalyticsSetting, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -560,23 +451,16 @@ private Mono> createOrUpdateWithRespon * @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, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -590,31 +474,21 @@ private Mono> createOrUpdateWithRespon .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.")); + 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); + 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 settingsResourceName Security ML Analytics Settings resource name. @@ -625,66 +499,55 @@ private Mono> createOrUpdateWithRespon * @return security ML Analytics Setting on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String workspaceName, - String settingsResourceName, - SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName, + securityMLAnalyticsSetting).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return security ML Analytics Setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityMLAnalyticsSettingInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String settingsResourceName, - SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting) { - return createOrUpdateAsync(resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting) - .block(); + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName, + securityMLAnalyticsSetting, context).block(); } /** * 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}. + * @return security ML Analytics Setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String settingsResourceName, - SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting, context) - .block(); + public SecurityMLAnalyticsSettingInner createOrUpdate(String resourceGroupName, String workspaceName, + String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, settingsResourceName, + securityMLAnalyticsSetting, Context.NONE).getValue(); } /** * 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. @@ -694,19 +557,15 @@ public Response createOrUpdateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String settingsResourceName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -720,25 +579,14 @@ private Mono> deleteWithResponseAsync( .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, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -749,19 +597,15 @@ private Mono> deleteWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -776,21 +620,13 @@ private Mono> deleteWithResponseAsync( } 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); + 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 settingsResourceName Security ML Analytics Settings resource name. @@ -807,47 +643,48 @@ 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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String settingsResourceName) { - deleteAsync(resourceGroupName, workspaceName, settingsResourceName).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String settingsResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName, context).block(); } /** * 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String settingsResourceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName, context).block(); + public void delete(String resourceGroupName, String workspaceName, String settingsResourceName) { + deleteWithResponse(resourceGroupName, workspaceName, settingsResourceName, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list all the SecurityMLAnalyticsSettings along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -855,62 +692,43 @@ private Mono> listNextSinglePageA 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list all the SecurityMLAnalyticsSettings along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsImpl.java index f0d4218f31a3..ac8c9cba1d72 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 @@ -21,96 +21,81 @@ public final class SecurityMLAnalyticsSettingsImpl implements SecurityMLAnalytic private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public SecurityMLAnalyticsSettingsImpl( - SecurityMLAnalyticsSettingsClient innerClient, + public SecurityMLAnalyticsSettingsImpl(SecurityMLAnalyticsSettingsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new SecurityMLAnalyticsSettingImpl(inner1, this.manager())); + 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 Utils.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 SecurityMLAnalyticsSetting get(String resourceGroupName, String workspaceName, String settingsResourceName) { - SecurityMLAnalyticsSettingInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, settingsResourceName); + 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 SecurityMLAnalyticsSettingImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecurityMLAnalyticsSettingImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String settingsResourceName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, settingsResourceName, context); + public SecurityMLAnalyticsSetting get(String resourceGroupName, String workspaceName, String settingsResourceName) { + SecurityMLAnalyticsSettingInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, settingsResourceName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityMLAnalyticsSettingImpl(inner.getValue(), this.manager())); + return new SecurityMLAnalyticsSettingImpl(inner, this.manager()); } else { return null; } } - public SecurityMLAnalyticsSetting createOrUpdate( - String resourceGroupName, - String workspaceName, - String settingsResourceName, - SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting) { - SecurityMLAnalyticsSettingInner inner = - this - .serviceClient() - .createOrUpdate(resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting); + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, + Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, settingsResourceName, + securityMLAnalyticsSetting, context); if (inner != null) { - return new SecurityMLAnalyticsSettingImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecurityMLAnalyticsSettingImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String settingsResourceName, - SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, - Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting, context); + public SecurityMLAnalyticsSetting createOrUpdate(String resourceGroupName, String workspaceName, + String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting) { + SecurityMLAnalyticsSettingInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityMLAnalyticsSettingImpl(inner.getValue(), this.manager())); + return new SecurityMLAnalyticsSettingImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String settingsResourceName) { - this.serviceClient().delete(resourceGroupName, workspaceName, settingsResourceName); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String settingsResourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, settingsResourceName, context); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String settingsResourceName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, settingsResourceName, context); + public void delete(String resourceGroupName, String workspaceName, String settingsResourceName) { + this.serviceClient().delete(resourceGroupName, workspaceName, settingsResourceName); } private SecurityMLAnalyticsSettingsClient serviceClient() { 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 ae6794185e73..4b51b08a0064 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 @@ -14,8 +14,7 @@ public final class SentinelOnboardingStateImpl implements SentinelOnboardingStat private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - SentinelOnboardingStateImpl( - SentinelOnboardingStateInner innerObject, + SentinelOnboardingStateImpl(SentinelOnboardingStateInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -66,51 +65,43 @@ public SentinelOnboardingStateImpl withExistingWorkspace(String resourceGroupNam } public SentinelOnboardingState create() { - this.innerObject = - serviceManager - .serviceClient() - .getSentinelOnboardingStates() - .createWithResponse( - resourceGroupName, workspaceName, sentinelOnboardingStateName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSentinelOnboardingStates() + .createWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public SentinelOnboardingState create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSentinelOnboardingStates() - .createWithResponse( - resourceGroupName, workspaceName, sentinelOnboardingStateName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSentinelOnboardingStates() + .createWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, this.innerModel(), + context) + .getValue(); return this; } - SentinelOnboardingStateImpl( - String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + SentinelOnboardingStateImpl(String name, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = new SentinelOnboardingStateInner(); this.serviceManager = serviceManager; this.sentinelOnboardingStateName = name; } public SentinelOnboardingState refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSentinelOnboardingStates() - .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSentinelOnboardingStates() + .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE) + .getValue(); return this; } public SentinelOnboardingState refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSentinelOnboardingStates() - .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSentinelOnboardingStates() + .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context) + .getValue(); return this; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesClientImpl.java index 9035d0d85eef..2790a7726d8f 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 @@ -29,23 +29,28 @@ import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SentinelOnboardingStatesClient. */ +/** + * An instance of this class provides access to all the operations defined in SentinelOnboardingStatesClient. + */ public final class SentinelOnboardingStatesClientImpl implements SentinelOnboardingStatesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SentinelOnboardingStatesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of SentinelOnboardingStatesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SentinelOnboardingStatesClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy - .create(SentinelOnboardingStatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(SentinelOnboardingStatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -55,78 +60,51 @@ public final class SentinelOnboardingStatesClientImpl implements SentinelOnboard */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsSent") - private interface SentinelOnboardingStatesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates" - + "/{sentinelOnboardingStateName}") - @ExpectedResponses({200}) + 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, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates" - + "/{sentinelOnboardingStateName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, @BodyParam("application/json") SentinelOnboardingStateInner sentinelOnboardingStateParameter, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates" - + "/{sentinelOnboardingStateName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, - @HeaderParam("Accept") String accept, - Context context); + @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}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); } /** * Get Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. @@ -136,19 +114,15 @@ Mono> list( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -158,31 +132,20 @@ private Mono> getWithResponseAsync( 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.")); + return Mono.error( + new IllegalArgumentException("Parameter sentinelOnboardingStateName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - sentinelOnboardingStateName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sentinelOnboardingStateName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. @@ -193,19 +156,15 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -215,28 +174,18 @@ private Mono> getWithResponseAsync( 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.")); + 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, sentinelOnboardingStateName, accept, context); } /** * Get Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. @@ -246,50 +195,50 @@ private Mono> getWithResponseAsync( * @return sentinel onboarding state on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + private Mono getAsync(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName) { return getWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return sentinel onboarding state along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SentinelOnboardingStateInner get( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { - return getAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, context).block(); } /** * Get Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sentinel onboarding state along with {@link Response}. + * @return sentinel onboarding state. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, context).block(); + public SentinelOnboardingStateInner get(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName) { + return getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE).getValue(); } /** * 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. @@ -300,22 +249,16 @@ public Response getWithResponse( * @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, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -325,35 +268,23 @@ private Mono> createWithResponseAsync( 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.")); + 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)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sentinelOnboardingStateName, + sentinelOnboardingStateParameter, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. @@ -365,23 +296,16 @@ private Mono> createWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -391,75 +315,62 @@ private Mono> createWithResponseAsync( 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.")); + 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); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, sentinelOnboardingStateName, sentinelOnboardingStateParameter, accept, + context); } /** * Create Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. - * @param sentinelOnboardingStateParameter The Sentinel onboarding state parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sentinel onboarding state on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String workspaceName, - String sentinelOnboardingStateName, - SentinelOnboardingStateInner sentinelOnboardingStateParameter) { - return createWithResponseAsync( - resourceGroupName, workspaceName, sentinelOnboardingStateName, sentinelOnboardingStateParameter) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createAsync(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName) { + final SentinelOnboardingStateInner sentinelOnboardingStateParameter = null; + return createWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, + sentinelOnboardingStateParameter).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 on successful completion of {@link Mono}. + * @return sentinel onboarding state along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { - final SentinelOnboardingStateInner sentinelOnboardingStateParameter = null; - return createWithResponseAsync( - resourceGroupName, workspaceName, sentinelOnboardingStateName, sentinelOnboardingStateParameter) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response createWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, SentinelOnboardingStateInner sentinelOnboardingStateParameter, + Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, + sentinelOnboardingStateParameter, context).block(); } /** * Create Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. @@ -469,46 +380,16 @@ private Mono createAsync( * @return sentinel onboarding state. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SentinelOnboardingStateInner create( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + public SentinelOnboardingStateInner create(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName) { final SentinelOnboardingStateInner sentinelOnboardingStateParameter = null; - return createAsync( - resourceGroupName, workspaceName, sentinelOnboardingStateName, sentinelOnboardingStateParameter) - .block(); - } - - /** - * Create Sentinel onboarding state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. - * @param sentinelOnboardingStateParameter The Sentinel onboarding state parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sentinel onboarding state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String workspaceName, - String sentinelOnboardingStateName, - SentinelOnboardingStateInner sentinelOnboardingStateParameter, - Context context) { - return createWithResponseAsync( - resourceGroupName, - workspaceName, - sentinelOnboardingStateName, - sentinelOnboardingStateParameter, - context) - .block(); + return createWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, + sentinelOnboardingStateParameter, Context.NONE).getValue(); } /** * 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. @@ -518,19 +399,15 @@ public Response createWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -540,31 +417,20 @@ private Mono> deleteWithResponseAsync( 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.")); + 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sentinelOnboardingStateName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. @@ -575,19 +441,15 @@ private Mono> deleteWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -597,28 +459,18 @@ private Mono> deleteWithResponseAsync( 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.")); + 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, sentinelOnboardingStateName, accept, context); } /** * Delete Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. @@ -635,40 +487,40 @@ 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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { - deleteAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, context).block(); } /** * Delete Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 sentinelOnboardingStateName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, context).block(); + public void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + deleteWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE); } /** * Gets all Sentinel onboarding states. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -677,19 +529,15 @@ public Response deleteWithResponse( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -700,23 +548,14 @@ private Mono> listWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all Sentinel onboarding states. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -726,19 +565,15 @@ private Mono> listWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -749,20 +584,13 @@ private Mono> listWithResponseAsync( } 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); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); } /** * Gets all Sentinel onboarding states. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -777,33 +605,33 @@ private Mono listAsync(String resourceGroupNa /** * 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. + * @return all Sentinel onboarding states along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SentinelOnboardingStatesListInner list(String resourceGroupName, String workspaceName) { - return listAsync(resourceGroupName, workspaceName).block(); + public Response listWithResponse(String resourceGroupName, String workspaceName, + Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * Gets all Sentinel onboarding states. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return all Sentinel onboarding states. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String workspaceName, Context context) { - return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + public SentinelOnboardingStatesListInner list(String resourceGroupName, String workspaceName) { + return listWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } } 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 805ce3714bf1..c8a8091e886c 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 @@ -22,186 +22,139 @@ public final class SentinelOnboardingStatesImpl implements SentinelOnboardingSta private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public SentinelOnboardingStatesImpl( - SentinelOnboardingStatesClient innerClient, + public SentinelOnboardingStatesImpl(SentinelOnboardingStatesClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public SentinelOnboardingState get( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { - SentinelOnboardingStateInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, sentinelOnboardingStateName); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); if (inner != null) { - return new SentinelOnboardingStateImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SentinelOnboardingStateImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); + public SentinelOnboardingState get(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName) { + SentinelOnboardingStateInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, sentinelOnboardingStateName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SentinelOnboardingStateImpl(inner.getValue(), this.manager())); + return new SentinelOnboardingStateImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { - this.serviceClient().delete(resourceGroupName, workspaceName, sentinelOnboardingStateName); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { - return this - .serviceClient() - .deleteWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); + public void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName) { + this.serviceClient().delete(resourceGroupName, workspaceName, sentinelOnboardingStateName); } - public SentinelOnboardingStatesList list(String resourceGroupName, String workspaceName) { - SentinelOnboardingStatesListInner inner = this.serviceClient().list(resourceGroupName, workspaceName); + public Response listWithResponse(String resourceGroupName, String workspaceName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new SentinelOnboardingStatesListImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SentinelOnboardingStatesListImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response listWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); + public SentinelOnboardingStatesList list(String resourceGroupName, String workspaceName) { + SentinelOnboardingStatesListInner inner = this.serviceClient().list(resourceGroupName, workspaceName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SentinelOnboardingStatesListImpl(inner.getValue(), this.manager())); + return new SentinelOnboardingStatesListImpl(inner, this.manager()); } else { return null; } } public SentinelOnboardingState getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String sentinelOnboardingStateName = Utils.getValueFromIdByName(id, "onboardingStates"); + String sentinelOnboardingStateName = ResourceManagerUtils.getValueFromIdByName(id, "onboardingStates"); if (sentinelOnboardingStateName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); - } - return this - .getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE) + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String sentinelOnboardingStateName = Utils.getValueFromIdByName(id, "onboardingStates"); + String sentinelOnboardingStateName = ResourceManagerUtils.getValueFromIdByName(id, "onboardingStates"); if (sentinelOnboardingStateName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String sentinelOnboardingStateName = Utils.getValueFromIdByName(id, "onboardingStates"); + String sentinelOnboardingStateName = ResourceManagerUtils.getValueFromIdByName(id, "onboardingStates"); if (sentinelOnboardingStateName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String sentinelOnboardingStateName = Utils.getValueFromIdByName(id, "onboardingStates"); + String sentinelOnboardingStateName = ResourceManagerUtils.getValueFromIdByName(id, "onboardingStates"); if (sentinelOnboardingStateName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'onboardingStates'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, sentinelOnboardingStateName, context); } 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 203b82f16d59..4b169ba8f761 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 @@ -17,8 +17,7 @@ public final class SentinelOnboardingStatesListImpl implements SentinelOnboardin private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - SentinelOnboardingStatesListImpl( - SentinelOnboardingStatesListInner innerObject, + SentinelOnboardingStatesListImpl(SentinelOnboardingStatesListInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -27,12 +26,9 @@ public final class SentinelOnboardingStatesListImpl implements SentinelOnboardin public List value() { List inner = this.innerModel().value(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new SentinelOnboardingStateImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new SentinelOnboardingStateImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingListImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingListImpl.java index d42aef74defe..c03ea1fc8d9e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingListImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingListImpl.java @@ -17,8 +17,7 @@ public final class SettingListImpl implements SettingList { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - SettingListImpl( - SettingListInner innerObject, + SettingListImpl(SettingListInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -27,12 +26,8 @@ public final class SettingListImpl implements SettingList { public List value() { List inner = this.innerModel().value(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new SettingsImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new SettingsImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } 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 index e54bfa38cc02..bc4fd3cc973f 100644 --- 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 @@ -6,6 +6,7 @@ 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 { @@ -13,8 +14,8 @@ public final class SettingsImpl implements Settings { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - SettingsImpl( - SettingsInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + SettingsImpl(SettingsInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -39,6 +40,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public SettingKind kind() { + return this.innerModel().kind(); + } + public SettingsInner innerModel() { return this.innerObject; } 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 index 8923bdc0d8b3..5f91db1320ae 100644 --- 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 @@ -4,16 +4,22 @@ 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.RepoType; +import com.azure.resourcemanager.securityinsights.models.PullRequest; 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.RepoType; +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 java.util.Collections; import java.util.List; @@ -22,8 +28,7 @@ public final class SourceControlImpl implements SourceControl, SourceControl.Def private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - SourceControlImpl( - SourceControlInner innerObject, + SourceControlImpl(SourceControlInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -82,6 +87,14 @@ public Repository repository() { return this.innerModel().repository(); } + public ServicePrincipal servicePrincipal() { + return this.innerModel().servicePrincipal(); + } + + public RepositoryAccess repositoryAccess() { + return this.innerModel().repositoryAccess(); + } + public RepositoryResourceInfo repositoryResourceInfo() { return this.innerModel().repositoryResourceInfo(); } @@ -90,6 +103,10 @@ public DeploymentInfo lastDeploymentInfo() { return this.innerModel().lastDeploymentInfo(); } + public PullRequest pullRequest() { + return this.innerModel().pullRequest(); + } + public SourceControlInner innerModel() { return this.innerObject; } @@ -111,22 +128,18 @@ public SourceControlImpl withExistingWorkspace(String resourceGroupName, String } public SourceControl create() { - this.innerObject = - serviceManager - .serviceClient() - .getSourceControlsOperations() - .createWithResponse(resourceGroupName, workspaceName, sourceControlId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSourceControlsOperations() + .createWithResponse(resourceGroupName, workspaceName, sourceControlId, this.innerModel(), Context.NONE) + .getValue(); return this; } public SourceControl create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSourceControlsOperations() - .createWithResponse(resourceGroupName, workspaceName, sourceControlId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSourceControlsOperations() + .createWithResponse(resourceGroupName, workspaceName, sourceControlId, this.innerModel(), context) + .getValue(); return this; } @@ -137,38 +150,29 @@ public SourceControl create(Context context) { } public SourceControl refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSourceControlsOperations() - .getWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSourceControlsOperations() + .getWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE) + .getValue(); return this; } public SourceControl refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSourceControlsOperations() - .getWithResponse(resourceGroupName, workspaceName, sourceControlId, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSourceControlsOperations() + .getWithResponse(resourceGroupName, workspaceName, sourceControlId, context) + .getValue(); return this; } - public SourceControlImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; + public Response deleteWithResponse(RepositoryAccessProperties repositoryAccess, Context context) { + return serviceManager.sourceControlsOperations() + .deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, repositoryAccess, context); } - public SourceControlImpl withIdPropertiesId(String idPropertiesId) { - this.innerModel().withIdPropertiesId(idPropertiesId); - return this; - } - - public SourceControlImpl withVersion(Version version) { - this.innerModel().withVersion(version); - return this; + public Warning delete(RepositoryAccessProperties repositoryAccess) { + return serviceManager.sourceControlsOperations() + .delete(resourceGroupName, workspaceName, sourceControlId, repositoryAccess); } public SourceControlImpl withDisplayName(String displayName) { @@ -176,11 +180,6 @@ public SourceControlImpl withDisplayName(String displayName) { return this; } - public SourceControlImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - public SourceControlImpl withRepoType(RepoType repoType) { this.innerModel().withRepoType(repoType); return this; @@ -196,13 +195,28 @@ public SourceControlImpl withRepository(Repository repository) { return this; } - public SourceControlImpl withRepositoryResourceInfo(RepositoryResourceInfo repositoryResourceInfo) { - this.innerModel().withRepositoryResourceInfo(repositoryResourceInfo); + public SourceControlImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public SourceControlImpl withDescription(String description) { + this.innerModel().withDescription(description); return this; } - public SourceControlImpl withLastDeploymentInfo(DeploymentInfo lastDeploymentInfo) { - this.innerModel().withLastDeploymentInfo(lastDeploymentInfo); + 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/SourceControlsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsClientImpl.java index 7d0d20b95466..89139562d277 100644 --- 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 @@ -30,25 +30,31 @@ import com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient; import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; import com.azure.resourcemanager.securityinsights.models.RepoList; -import com.azure.resourcemanager.securityinsights.models.RepoType; +import 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SourceControlsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of SourceControlsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SourceControlsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(SourceControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(SourceControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,60 +64,47 @@ public final class SourceControlsClientImpl implements SourceControlsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsSour") - private interface SourceControlsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/listRepositories") - @ExpectedResponses({200}) + public interface SourceControlsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/listRepositories") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listRepositories( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") RepoType repoType, - @HeaderParam("Accept") String accept, - Context context); + Mono> listRepositories(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") RepositoryAccessProperties repositoryAccess, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listRepositoriesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listRepositoriesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets a list of repositories metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param repoType The repo type. + * @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 a list of repositories metadata along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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, RepoType repoType) { + private Mono> listRepositoriesSinglePageAsync(String resourceGroupName, + String workspaceName, RepositoryAccessProperties repositoryAccess) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -120,62 +113,44 @@ private Mono> listRepositoriesSinglePageAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (repoType == null) { - return Mono.error(new IllegalArgumentException("Parameter repoType is required and cannot be null.")); + if (repositoryAccess == null) { + return Mono + .error(new IllegalArgumentException("Parameter repositoryAccess is required and cannot be null.")); + } else { + repositoryAccess.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listRepositories( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - repoType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listRepositories(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, repositoryAccess, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a list of repositories metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param repoType The repo type. + * @param 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 a list of repositories metadata along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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, RepoType repoType, Context context) { + private Mono> listRepositoriesSinglePageAsync(String resourceGroupName, + String workspaceName, RepositoryAccessProperties repositoryAccess, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -184,57 +159,46 @@ private Mono> listRepositoriesSinglePageAsync( if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - if (repoType == null) { - return Mono.error(new IllegalArgumentException("Parameter repoType is required and cannot be null.")); + if (repositoryAccess == null) { + return Mono + .error(new IllegalArgumentException("Parameter repositoryAccess is required and cannot be null.")); + } else { + repositoryAccess.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listRepositories( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - repoType, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listRepositories(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, repositoryAccess, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets a list of repositories metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param repoType The repo type. + * @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 a list of repositories metadata as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listRepositoriesAsync( - String resourceGroupName, String workspaceName, RepoType repoType) { + private PagedFlux listRepositoriesAsync(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess) { return new PagedFlux<>( - () -> listRepositoriesSinglePageAsync(resourceGroupName, workspaceName, repoType), + () -> 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 repoType The repo type. + * @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. @@ -242,36 +206,36 @@ private PagedFlux listRepositoriesAsync( * @return a list of repositories metadata as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listRepositoriesAsync( - String resourceGroupName, String workspaceName, RepoType repoType, Context context) { + private PagedFlux listRepositoriesAsync(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess, Context context) { return new PagedFlux<>( - () -> listRepositoriesSinglePageAsync(resourceGroupName, workspaceName, repoType, context), + () -> listRepositoriesSinglePageAsync(resourceGroupName, workspaceName, repositoryAccess, context), nextLink -> listRepositoriesNextSinglePageAsync(nextLink, context)); } /** * Gets a list of repositories metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param repoType The repo type. + * @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 a list of repositories metadata as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRepositories( - String resourceGroupName, String workspaceName, RepoType repoType) { - return new PagedIterable<>(listRepositoriesAsync(resourceGroupName, workspaceName, repoType)); + public PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess) { + return new PagedIterable<>(listRepositoriesAsync(resourceGroupName, workspaceName, 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 repoType The repo type. + * @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. @@ -279,16 +243,17 @@ public PagedIterable listRepositories( * @return a list of repositories metadata as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRepositories( - String resourceGroupName, String workspaceName, RepoType repoType, Context context) { - return new PagedIterable<>(listRepositoriesAsync(resourceGroupName, workspaceName, repoType, context)); + public PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess, Context context) { + return new PagedIterable<>(listRepositoriesAsync(resourceGroupName, workspaceName, repositoryAccess, context)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -300,31 +265,23 @@ private Mono> listRepositoriesNextSinglePageAsync(Strin 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listRepositoriesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -337,23 +294,13 @@ private Mono> listRepositoriesNextSinglePageAsync(Strin 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listRepositoriesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listRepositoriesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsImpl.java index bb8376e2af85..61ac2a70ec3f 100644 --- 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 @@ -10,7 +10,7 @@ import com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient; import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; import com.azure.resourcemanager.securityinsights.models.Repo; -import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; import com.azure.resourcemanager.securityinsights.models.SourceControls; public final class SourceControlsImpl implements SourceControls { @@ -20,24 +20,24 @@ public final class SourceControlsImpl implements SourceControls { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public SourceControlsImpl( - SourceControlsClient innerClient, + public SourceControlsImpl(SourceControlsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listRepositories(String resourceGroupName, String workspaceName, RepoType repoType) { - PagedIterable inner = - this.serviceClient().listRepositories(resourceGroupName, workspaceName, repoType); - return Utils.mapPage(inner, inner1 -> new RepoImpl(inner1, this.manager())); + public PagedIterable listRepositories(String resourceGroupName, String workspaceName, + 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, RepoType repoType, Context context) { - PagedIterable inner = - this.serviceClient().listRepositories(resourceGroupName, workspaceName, repoType, context); - return Utils.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 SourceControlsClient serviceClient() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsClientImpl.java index 154c48e0138a..7562b956242f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsClientImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsClientImpl.java @@ -5,7 +5,6 @@ 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; @@ -13,6 +12,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,26 +30,33 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.SourceControlsOperationsClient; 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.SourceControlList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SourceControlsOperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in SourceControlsOperationsClient. + */ public final class SourceControlsOperationsClientImpl implements SourceControlsOperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SourceControlsOperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of SourceControlsOperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SourceControlsOperationsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy - .create(SourceControlsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(SourceControlsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -59,107 +66,77 @@ public final class SourceControlsOperationsClientImpl implements SourceControlsO */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsSour") - private interface SourceControlsOperationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols") - @ExpectedResponses({200}) + public interface SourceControlsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("sourceControlId") String sourceControlId, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("sourceControlId") String sourceControlId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("sourceControlId") String sourceControlId, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") SourceControlInner sourceControl, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}/delete") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("sourceControlId") String sourceControlId, - @BodyParam("application/json") SourceControlInner sourceControl, - @HeaderParam("Accept") String accept, - Context context); + @BodyParam("application/json") RepositoryAccessProperties repositoryAccess, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all source controls, without source control items along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -170,32 +147,16 @@ private Mono> listSinglePageAsync( } 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -203,22 +164,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -230,28 +187,15 @@ private Mono> listSinglePageAsync( 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -261,13 +205,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -278,14 +222,13 @@ private PagedFlux listAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -300,7 +243,7 @@ public PagedIterable list(String resourceGroupName, String w /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -316,7 +259,7 @@ public PagedIterable list(String resourceGroupName, String w /** * Gets a source control byt its identifier. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. @@ -326,19 +269,15 @@ public PagedIterable list(String resourceGroupName, String w * @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) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String sourceControlId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -353,24 +292,14 @@ private Mono> getWithResponseAsync( } 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sourceControlId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a source control byt its identifier. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. @@ -381,19 +310,15 @@ private Mono> getWithResponseAsync( * @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, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String sourceControlId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -408,21 +333,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - sourceControlId, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, sourceControlId, accept, context); } /** * Gets a source control byt its identifier. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. @@ -439,63 +356,61 @@ private Mono getAsync(String resourceGroupName, String works /** * Gets a source control byt its identifier. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a source control byt its identifier. + * @return a source control byt its identifier along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SourceControlInner get(String resourceGroupName, String workspaceName, String sourceControlId) { - return getAsync(resourceGroupName, workspaceName, sourceControlId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, context).block(); } /** * Gets a source control byt its identifier. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a source control byt its identifier along with {@link Response}. + * @return a source control byt its identifier. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String sourceControlId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, context).block(); + public SourceControlInner get(String resourceGroupName, String workspaceName, String sourceControlId) { + return getWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE).getValue(); } /** - * Delete a source control. - * + * Creates a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return represents a SourceControl 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 sourceControlId) { + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String sourceControlId, SourceControlInner sourceControl) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -508,49 +423,43 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); } + if (sourceControl == null) { + return Mono.error(new IllegalArgumentException("Parameter sourceControl is required and cannot be null.")); + } else { + sourceControl.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - sourceControlId, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sourceControlId, sourceControl, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a source control. - * + * Creates a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return represents a SourceControl 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 sourceControlId, Context context) { + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String sourceControlId, SourceControlInner sourceControl, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -563,97 +472,97 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); } + if (sourceControl == null) { + return Mono.error(new IllegalArgumentException("Parameter sourceControl is required and cannot be null.")); + } else { + sourceControl.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - sourceControlId, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, sourceControlId, sourceControl, accept, context); } /** - * Delete a source control. - * + * Creates a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return represents a SourceControl in Azure Security Insights on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String sourceControlId) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, sourceControlId) - .flatMap(ignored -> Mono.empty()); + private Mono createAsync(String resourceGroupName, String workspaceName, String sourceControlId, + SourceControlInner sourceControl) { + return createWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Delete a source control. - * + * Creates a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. + * @param sourceControl The SourceControl. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a SourceControl in Azure Security Insights along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String sourceControlId) { - deleteAsync(resourceGroupName, workspaceName, sourceControlId).block(); + public Response createWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, SourceControlInner sourceControl, Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl, context) + .block(); } /** - * Delete a source control. - * + * Creates a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param context The context to associate with this operation. + * @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 the {@link Response}. + * @return represents a SourceControl in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String sourceControlId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, context).block(); + public SourceControlInner create(String resourceGroupName, String workspaceName, String sourceControlId, + SourceControlInner sourceControl) { + return createWithResponse(resourceGroupName, workspaceName, sourceControlId, sourceControl, Context.NONE) + .getValue(); } /** - * Creates a source control. - * + * Delete a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param sourceControl The SourceControl. + * @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 represents a SourceControl in Azure Security Insights along with {@link Response} on successful - * completion of {@link Mono}. + * @return warning response structure 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) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String sourceControlId, RepositoryAccessProperties repositoryAccess) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -666,61 +575,43 @@ private Mono> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); } - if (sourceControl == null) { - return Mono.error(new IllegalArgumentException("Parameter sourceControl is required and cannot be null.")); + if (repositoryAccess == null) { + return Mono + .error(new IllegalArgumentException("Parameter repositoryAccess is required and cannot be null.")); } else { - sourceControl.validate(); + repositoryAccess.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - sourceControlId, - sourceControl, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sourceControlId, repositoryAccess, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a source control. - * + * Delete a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param sourceControl The SourceControl. + * @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 represents a SourceControl in Azure Security Insights along with {@link Response} on successful - * completion of {@link Mono}. + * @return warning response structure 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, - Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String sourceControlId, RepositoryAccessProperties repositoryAccess, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -733,92 +624,82 @@ private Mono> createWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter sourceControlId is required and cannot be null.")); } - if (sourceControl == null) { - return Mono.error(new IllegalArgumentException("Parameter sourceControl is required and cannot be null.")); + if (repositoryAccess == null) { + return Mono + .error(new IllegalArgumentException("Parameter repositoryAccess is required and cannot be null.")); } else { - sourceControl.validate(); + repositoryAccess.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - sourceControlId, - sourceControl, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, sourceControlId, repositoryAccess, accept, context); } /** - * Creates a source control. - * + * Delete a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param sourceControl The SourceControl. + * @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 represents a SourceControl in Azure Security Insights on successful completion of {@link Mono}. + * @return warning response structure 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) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, repositoryAccess) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates a source control. - * + * Delete a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param sourceControl The SourceControl. + * @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 represents a SourceControl in Azure Security Insights. + * @return warning response structure along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SourceControlInner create( - String resourceGroupName, String workspaceName, String sourceControlId, SourceControlInner sourceControl) { - return createAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, RepositoryAccessProperties repositoryAccess, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, repositoryAccess, context) + .block(); } /** - * Creates a source control. - * + * Delete a source control. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. - * @param sourceControl The SourceControl. - * @param context The context to associate with this operation. + * @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 represents a SourceControl in Azure Security Insights along with {@link Response}. + * @return warning response structure. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String workspaceName, - String sourceControlId, - SourceControlInner sourceControl, - Context context) { - return createWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl, context) - .block(); + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -830,31 +711,22 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -867,23 +739,13 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsImpl.java index 467e637cf289..841d14498402 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsOperationsImpl.java @@ -11,8 +11,11 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.securityinsights.fluent.SourceControlsOperationsClient; import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import com.azure.resourcemanager.securityinsights.fluent.models.WarningInner; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; import com.azure.resourcemanager.securityinsights.models.SourceControl; import com.azure.resourcemanager.securityinsights.models.SourceControlsOperations; +import com.azure.resourcemanager.securityinsights.models.Warning; public final class SourceControlsOperationsImpl implements SourceControlsOperations { private static final ClientLogger LOGGER = new ClientLogger(SourceControlsOperationsImpl.class); @@ -21,8 +24,7 @@ public final class SourceControlsOperationsImpl implements SourceControlsOperati private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public SourceControlsOperationsImpl( - SourceControlsOperationsClient innerClient, + public SourceControlsOperationsImpl(SourceControlsOperationsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,12 +32,24 @@ public SourceControlsOperationsImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sourceControlId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SourceControlImpl(inner.getValue(), this.manager())); + } else { + return null; + } } public SourceControl get(String resourceGroupName, String workspaceName, String sourceControlId) { @@ -47,138 +61,67 @@ public SourceControl get(String resourceGroupName, String workspaceName, String } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String sourceControlId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sourceControlId, context); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess, Context context) { + Response inner = this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, repositoryAccess, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SourceControlImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WarningImpl(inner.getValue(), this.manager())); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String sourceControlId) { - this.serviceClient().delete(resourceGroupName, workspaceName, sourceControlId); - } - - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String sourceControlId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, context); + public 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String sourceControlId = Utils.getValueFromIdByName(id, "sourcecontrols"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String sourceControlId = Utils.getValueFromIdByName(id, "sourcecontrols"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, sourceControlId, context); } - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String sourceControlId = Utils.getValueFromIdByName(id, "sourcecontrols"); - if (sourceControlId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); - } - this.deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String sourceControlId = Utils.getValueFromIdByName(id, "sourcecontrols"); - if (sourceControlId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); - } - return this.deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, context); - } - private SourceControlsOperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SystemResourceImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SystemResourceImpl.java new file mode 100644 index 000000000000..0b6981e83c34 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SystemResourceImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SystemResourceInner; +import com.azure.resourcemanager.securityinsights.models.Action; +import com.azure.resourcemanager.securityinsights.models.SystemResource; +import com.azure.resourcemanager.securityinsights.models.SystemsConfiguration; +import com.azure.resourcemanager.securityinsights.models.SystemStatusType; +import java.time.OffsetDateTime; + +public final class SystemResourceImpl implements SystemResource, SystemResource.Definition, SystemResource.Update { + private SystemResourceInner 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 SystemStatusType status() { + return this.innerModel().status(); + } + + public SystemsConfiguration configuration() { + return this.innerModel().configuration(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerModel().lastModifiedTimeUtc(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SystemResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String agentResourceName; + + private String systemResourceName; + + public SystemResourceImpl withExistingBusinessApplicationAgent(String resourceGroupName, String workspaceName, + String agentResourceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.agentResourceName = agentResourceName; + return this; + } + + public SystemResource create() { + this.innerObject = serviceManager.serviceClient() + .getSystems() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SystemResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSystems() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + this.innerModel(), context) + .getValue(); + return this; + } + + SystemResourceImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new SystemResourceInner(); + this.serviceManager = serviceManager; + this.systemResourceName = name; + } + + public SystemResourceImpl update() { + return this; + } + + public SystemResource apply() { + this.innerObject = serviceManager.serviceClient() + .getSystems() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SystemResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSystems() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + this.innerModel(), context) + .getValue(); + return this; + } + + SystemResourceImpl(SystemResourceInner 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.agentResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "businessApplicationAgents"); + this.systemResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "systems"); + } + + public SystemResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getSystems() + .getWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, Context.NONE) + .getValue(); + return this; + } + + public SystemResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSystems() + .getWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, context) + .getValue(); + return this; + } + + public PagedIterable listActions() { + return serviceManager.systems() + .listActions(resourceGroupName, workspaceName, agentResourceName, systemResourceName); + } + + public PagedIterable listActions(String filter, String skipToken, Context context) { + return serviceManager.systems() + .listActions(resourceGroupName, workspaceName, agentResourceName, systemResourceName, filter, skipToken, + context); + } + + public Response undoActionWithResponse(Object payload, Context context) { + return serviceManager.systems() + .undoActionWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, payload, + context); + } + + public void undoAction() { + serviceManager.systems().undoAction(resourceGroupName, workspaceName, agentResourceName, systemResourceName); + } + + public Response reportActionStatusWithResponse(Object payload, Context context) { + return serviceManager.systems() + .reportActionStatusWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + payload, context); + } + + public void reportActionStatus() { + serviceManager.systems() + .reportActionStatus(resourceGroupName, workspaceName, agentResourceName, systemResourceName); + } + + public SystemResourceImpl withConfiguration(SystemsConfiguration configuration) { + this.innerModel().withConfiguration(configuration); + return this; + } + + public SystemResourceImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public SystemResourceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public SystemResourceImpl withStatus(SystemStatusType status) { + this.innerModel().withStatus(status); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SystemsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SystemsClientImpl.java new file mode 100644 index 000000000000..3ee68fb11c98 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SystemsClientImpl.java @@ -0,0 +1,1470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.SystemsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SystemResourceInner; +import com.azure.resourcemanager.securityinsights.models.ListActionsResponse; +import com.azure.resourcemanager.securityinsights.models.SystemsList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SystemsClient. + */ +public final class SystemsClientImpl implements SystemsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SystemsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsImpl client; + + /** + * Initializes an instance of SystemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SystemsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(SystemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsSystems to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsSyst") + public interface SystemsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("agentResourceName") String agentResourceName, + @PathParam("systemResourceName") String systemResourceName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SystemResourceInner systemToUpsert, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("agentResourceName") String agentResourceName, + @PathParam("systemResourceName") String systemResourceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("agentResourceName") String agentResourceName, + @PathParam("systemResourceName") String systemResourceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents/{agentResourceName}/systems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("agentResourceName") String agentResourceName, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @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/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}/listActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listActions(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @PathParam("agentResourceName") String agentResourceName, + @PathParam("systemResourceName") String systemResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}/undoAction") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> undoAction(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("agentResourceName") String agentResourceName, + @PathParam("systemResourceName") String systemResourceName, @BodyParam("application/json") Object payload, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}/reportActionStatus") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> reportActionStatus(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("agentResourceName") String agentResourceName, + @PathParam("systemResourceName") String systemResourceName, @BodyParam("application/json") Object payload, + @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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listActionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Creates or updates the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param systemToUpsert The system to upsert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the system within the agent along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String agentResourceName, String systemResourceName, SystemResourceInner systemToUpsert) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + if (systemToUpsert != null) { + systemToUpsert.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, agentResourceName, systemResourceName, this.client.getApiVersion(), + systemToUpsert, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param systemToUpsert The system to upsert. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the system within the agent along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String agentResourceName, String systemResourceName, SystemResourceInner systemToUpsert, + 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + if (systemToUpsert != null) { + systemToUpsert.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, agentResourceName, systemResourceName, this.client.getApiVersion(), systemToUpsert, accept, + context); + } + + /** + * Creates or updates the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the system within the agent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName) { + final SystemResourceInner systemToUpsert = null; + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + systemToUpsert).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param systemToUpsert The system to upsert. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the system within the agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, SystemResourceInner systemToUpsert, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + systemToUpsert, context).block(); + } + + /** + * Creates or updates the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the system within the agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SystemResourceInner createOrUpdate(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + final SystemResourceInner systemToUpsert = null; + return createOrUpdateWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + systemToUpsert, Context.NONE).getValue(); + } + + /** + * Gets the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, agentResourceName, systemResourceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + agentResourceName, systemResourceName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + return getWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, systemResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, systemResourceName, context) + .block(); + } + + /** + * Gets the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SystemResourceInner get(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + return getWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, Context.NONE) + .getValue(); + } + + /** + * Deletes the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 agentResourceName, String systemResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, agentResourceName, systemResourceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 agentResourceName, String systemResourceName, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, agentResourceName, systemResourceName, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 agentResourceName, + String systemResourceName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, systemResourceName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 agentResourceName, + String systemResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, systemResourceName, context) + .block(); + } + + /** + * Deletes the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 agentResourceName, + String systemResourceName) { + deleteWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, Context.NONE); + } + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param filter Filters the results, based on a Boolean condition. 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 list of Agent's Systems along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String filter, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, agentResourceName, this.client.getApiVersion(), filter, 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())); + } + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param filter Filters the results, based on a Boolean condition. 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 list of Agent's Systems along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String filter, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + agentResourceName, this.client.getApiVersion(), filter, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param filter Filters the results, based on a Boolean condition. 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 list of Agent's Systems as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, agentResourceName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 list of Agent's Systems as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String agentResourceName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, agentResourceName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param filter Filters the results, based on a Boolean condition. 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 list of Agent's Systems as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String filter, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, agentResourceName, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 list of Agent's Systems as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String agentResourceName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, agentResourceName, filter, skipToken)); + } + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param filter Filters the results, based on a Boolean condition. 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 list of Agent's Systems as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String agentResourceName, String filter, String skipToken, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, agentResourceName, filter, skipToken, context)); + } + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param filter Filters the results, based on a Boolean condition. 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 list all actions for a system to perform along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listActionsSinglePageAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, String filter, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listActions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, skipToken, agentResourceName, + systemResourceName, 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 actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param filter Filters the results, based on a Boolean condition. 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 list all actions for a system to perform along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listActionsSinglePageAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, String filter, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listActions(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, skipToken, agentResourceName, systemResourceName, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param filter Filters the results, based on a Boolean condition. 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 list all actions for a system to perform as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listActionsAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, String filter, String skipToken) { + return new PagedFlux<>(() -> listActionsSinglePageAsync(resourceGroupName, workspaceName, agentResourceName, + systemResourceName, filter, skipToken), nextLink -> listActionsNextSinglePageAsync(nextLink)); + } + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 actions for a system to perform as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listActionsAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>(() -> listActionsSinglePageAsync(resourceGroupName, workspaceName, agentResourceName, + systemResourceName, filter, skipToken), nextLink -> listActionsNextSinglePageAsync(nextLink)); + } + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param filter Filters the results, based on a Boolean condition. 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 list all actions for a system to perform as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listActionsAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, String filter, String skipToken, Context context) { + return new PagedFlux<>(() -> listActionsSinglePageAsync(resourceGroupName, workspaceName, agentResourceName, + systemResourceName, filter, skipToken, context), + nextLink -> listActionsNextSinglePageAsync(nextLink, context)); + } + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 actions for a system to perform as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listActions(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listActionsAsync(resourceGroupName, workspaceName, agentResourceName, + systemResourceName, filter, skipToken)); + } + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param filter Filters the results, based on a Boolean condition. 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 list all actions for a system to perform as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listActions(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, String filter, String skipToken, Context context) { + return new PagedIterable<>(listActionsAsync(resourceGroupName, workspaceName, agentResourceName, + systemResourceName, filter, skipToken, context)); + } + + /** + * Undo action, based on the actionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Undo action, based on the actionId. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> undoActionWithResponseAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.undoAction(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, agentResourceName, + systemResourceName, payload, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Undo action, based on the actionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Undo action, based on the actionId. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> undoActionWithResponseAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.undoAction(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, agentResourceName, systemResourceName, + payload, accept, context); + } + + /** + * Undo action, based on the actionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 undoActionAsync(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + final Object payload = null; + return undoActionWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + payload).flatMap(ignored -> Mono.empty()); + } + + /** + * Undo action, based on the actionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Undo action, based on the actionId. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 undoActionWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload, Context context) { + return undoActionWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + payload, context).block(); + } + + /** + * Undo action, based on the actionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 undoAction(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + final Object payload = null; + undoActionWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, payload, + Context.NONE); + } + + /** + * Report the status of the action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Report a status of the action that was performed by the agent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> reportActionStatusWithResponseAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.reportActionStatus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, agentResourceName, + systemResourceName, payload, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Report the status of the action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Report a status of the action that was performed by the agent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> reportActionStatusWithResponseAsync(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload, 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 (agentResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentResourceName is required and cannot be null.")); + } + if (systemResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.reportActionStatus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, agentResourceName, systemResourceName, + payload, accept, context); + } + + /** + * Report the status of the action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 reportActionStatusAsync(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + final Object payload = null; + return reportActionStatusWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, + systemResourceName, payload).flatMap(ignored -> Mono.empty()); + } + + /** + * Report the status of the action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Report a status of the action that was performed by the agent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 reportActionStatusWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload, Context context) { + return reportActionStatusWithResponseAsync(resourceGroupName, workspaceName, agentResourceName, + systemResourceName, payload, context).block(); + } + + /** + * Report the status of the action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reportActionStatus(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + final Object payload = null; + reportActionStatusWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, payload, + Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Agent's Systems 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Agent's Systems along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all actions for a system to perform along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listActionsNextSinglePageAsync(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.listActionsNext(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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all actions for a system to perform along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listActionsNextSinglePageAsync(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.listActionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SystemsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SystemsImpl.java new file mode 100644 index 000000000000..ae05e83aa4db --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SystemsImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.SystemsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SystemResourceInner; +import com.azure.resourcemanager.securityinsights.models.Action; +import com.azure.resourcemanager.securityinsights.models.SystemResource; +import com.azure.resourcemanager.securityinsights.models.Systems; + +public final class SystemsImpl implements Systems { + private static final ClientLogger LOGGER = new ClientLogger(SystemsImpl.class); + + private final SystemsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public SystemsImpl(SystemsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SystemResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SystemResource get(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + SystemResourceInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, agentResourceName, systemResourceName); + if (inner != null) { + return new SystemResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + this.serviceClient().delete(resourceGroupName, workspaceName, agentResourceName, systemResourceName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + String agentResourceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, agentResourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SystemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String agentResourceName, + String filter, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, agentResourceName, filter, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SystemResourceImpl(inner1, this.manager())); + } + + public PagedIterable listActions(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + PagedIterable inner + = this.serviceClient().listActions(resourceGroupName, workspaceName, agentResourceName, systemResourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ActionImpl(inner1, this.manager())); + } + + public PagedIterable listActions(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName, String filter, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .listActions(resourceGroupName, workspaceName, agentResourceName, systemResourceName, filter, skipToken, + context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ActionImpl(inner1, this.manager())); + } + + public Response undoActionWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload, Context context) { + return this.serviceClient() + .undoActionWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, payload, + context); + } + + public void undoAction(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + this.serviceClient().undoAction(resourceGroupName, workspaceName, agentResourceName, systemResourceName); + } + + public Response reportActionStatusWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload, Context context) { + return this.serviceClient() + .reportActionStatusWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + payload, context); + } + + public void reportActionStatus(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName) { + this.serviceClient() + .reportActionStatus(resourceGroupName, workspaceName, agentResourceName, systemResourceName); + } + + public SystemResource 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 agentResourceName = ResourceManagerUtils.getValueFromIdByName(id, "businessApplicationAgents"); + if (agentResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'businessApplicationAgents'.", id))); + } + String systemResourceName = ResourceManagerUtils.getValueFromIdByName(id, "systems"); + if (systemResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'systems'.", id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, 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 agentResourceName = ResourceManagerUtils.getValueFromIdByName(id, "businessApplicationAgents"); + if (agentResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'businessApplicationAgents'.", id))); + } + String systemResourceName = ResourceManagerUtils.getValueFromIdByName(id, "systems"); + if (systemResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'systems'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, 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 agentResourceName = ResourceManagerUtils.getValueFromIdByName(id, "businessApplicationAgents"); + if (agentResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'businessApplicationAgents'.", id))); + } + String systemResourceName = ResourceManagerUtils.getValueFromIdByName(id, "systems"); + if (systemResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'systems'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, 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 agentResourceName = ResourceManagerUtils.getValueFromIdByName(id, "businessApplicationAgents"); + if (agentResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'businessApplicationAgents'.", id))); + } + String systemResourceName = ResourceManagerUtils.getValueFromIdByName(id, "systems"); + if (systemResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'systems'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, agentResourceName, systemResourceName, + context); + } + + private SystemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public SystemResourceImpl define(String name) { + return new SystemResourceImpl(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..015b6fb43047 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TIObjectImpl.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.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.UserInfoAutoGenerated; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +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 UserInfoAutoGenerated 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 UUID ingestionRulesVersion() { + return this.innerModel().ingestionRulesVersion(); + } + + public String lastUpdateMethod() { + return this.innerModel().lastUpdateMethod(); + } + + public UserInfoAutoGenerated 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/TeamInformationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TeamInformationImpl.java index 4193894c5c11..ceb266b54132 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TeamInformationImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TeamInformationImpl.java @@ -13,8 +13,7 @@ public final class TeamInformationImpl implements TeamInformation { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - TeamInformationImpl( - TeamInformationInner innerObject, + TeamInformationImpl(TeamInformationInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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..0915520eafab --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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 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 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 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() + .getContentTemplateOperations() + .installWithResponse(resourceGroupName, workspaceName, templateId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public TemplateModel create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContentTemplateOperations() + .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() + .getContentTemplateOperations() + .installWithResponse(resourceGroupName, workspaceName, templateId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public TemplateModel apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContentTemplateOperations() + .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() + .getContentTemplateOperations() + .getWithResponse(resourceGroupName, workspaceName, templateId, Context.NONE) + .getValue(); + return this; + } + + public TemplateModel refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContentTemplateOperations() + .getWithResponse(resourceGroupName, workspaceName, templateId, context) + .getValue(); + return this; + } + + public TemplateModelImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public TemplateModelImpl withMainTemplate(Object mainTemplate) { + this.innerModel().withMainTemplate(mainTemplate); + 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; + } +} 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..51d2b73e67f6 --- /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) AutoRest 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 246f25d1030c..cf7de22bc943 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 @@ -29,24 +29,24 @@ * An instance of this class provides access to all the operations defined in ThreatIntelligenceIndicatorMetricsClient. */ public final class ThreatIntelligenceIndicatorMetricsClientImpl implements ThreatIntelligenceIndicatorMetricsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ThreatIntelligenceIndicatorMetricsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of ThreatIntelligenceIndicatorMetricsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ThreatIntelligenceIndicatorMetricsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy - .create( - ThreatIntelligenceIndicatorMetricsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); + this.service = RestProxy.create(ThreatIntelligenceIndicatorMetricsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -56,48 +56,38 @@ public final class ThreatIntelligenceIndicatorMetricsClientImpl implements Threa */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsThre") - private interface ThreatIntelligenceIndicatorMetricsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics") - @ExpectedResponses({200}) + 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, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); } /** * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source) along with {@link - * Response} on successful completion of {@link Mono}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -108,46 +98,33 @@ private Mono> listWithResponseAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source) along with {@link - * Response} on successful completion of {@link Mono}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -158,27 +135,20 @@ private Mono> listWithResponseAsync } 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); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); } /** * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source) on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync(String resourceGroupName, String workspaceName) { @@ -187,34 +157,34 @@ 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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). + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source) along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThreatIntelligenceMetricsListInner list(String resourceGroupName, String workspaceName) { - return listAsync(resourceGroupName, workspaceName).block(); + public Response listWithResponse(String resourceGroupName, String workspaceName, + Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source) along with {@link - * Response}. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String workspaceName, Context context) { - return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + public ThreatIntelligenceMetricsListInner list(String resourceGroupName, String workspaceName) { + return listWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } } 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 a89b3041bc58..e827c2be6120 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 @@ -20,32 +20,28 @@ public final class ThreatIntelligenceIndicatorMetricsImpl implements ThreatIntel private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public ThreatIntelligenceIndicatorMetricsImpl( - ThreatIntelligenceIndicatorMetricsClient innerClient, + public ThreatIntelligenceIndicatorMetricsImpl(ThreatIntelligenceIndicatorMetricsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public ThreatIntelligenceMetricsList list(String resourceGroupName, String workspaceName) { - ThreatIntelligenceMetricsListInner inner = this.serviceClient().list(resourceGroupName, workspaceName); + public Response listWithResponse(String resourceGroupName, String workspaceName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new ThreatIntelligenceMetricsListImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ThreatIntelligenceMetricsListImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response listWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listWithResponse(resourceGroupName, workspaceName, context); + public ThreatIntelligenceMetricsList list(String resourceGroupName, String workspaceName) { + ThreatIntelligenceMetricsListInner inner = this.serviceClient().list(resourceGroupName, workspaceName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ThreatIntelligenceMetricsListImpl(inner.getValue(), this.manager())); + return new ThreatIntelligenceMetricsListImpl(inner, this.manager()); } else { return null; } 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 c25005bfa019..08671c96144d 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 @@ -37,24 +37,28 @@ import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformationList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ThreatIntelligenceIndicatorsClient. */ +/** + * An instance of this class provides access to all the operations defined in ThreatIntelligenceIndicatorsClient. + */ public final class ThreatIntelligenceIndicatorsClientImpl implements ThreatIntelligenceIndicatorsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ThreatIntelligenceIndicatorsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of ThreatIntelligenceIndicatorsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ThreatIntelligenceIndicatorsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy - .create( - ThreatIntelligenceIndicatorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ThreatIntelligenceIndicatorsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -64,166 +68,109 @@ public final class ThreatIntelligenceIndicatorsClientImpl implements ThreatIntel */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsThre") - private interface ThreatIntelligenceIndicatorsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main" - + "/createIndicator") - @ExpectedResponses({200, 201}) + 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 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createIndicator( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> createIndicator(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - @HeaderParam("Accept") String accept, - Context context); + @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}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" - + "/{name}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("name") String name, @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" - + "/{name}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main" - + "/queryIndicators") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> queryIndicators( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> queryIndicators(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @BodyParam("application/json") ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" - + "/{name}/appendTags") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/appendTags") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> appendTags( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> appendTags(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("name") String name, @BodyParam("application/json") ThreatIntelligenceAppendTags threatIntelligenceAppendTags, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" - + "/{name}/replaceTags") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/replaceTags") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> replaceTags( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> replaceTags(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("name") String name, @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> queryIndicatorsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Create a new threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object along with {@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> 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -233,33 +180,22 @@ private Mono> createIndicatorWithRe 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.")); + 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)) + .withContext(context -> service.createIndicator(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, threatIntelligenceProperties, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a new threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. @@ -267,26 +203,20 @@ private Mono> createIndicatorWithRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -296,30 +226,21 @@ private Mono> createIndicatorWithRe 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.")); + 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); + return service.createIndicator(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, threatIntelligenceProperties, accept, + context); } /** * Create a new threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. @@ -329,77 +250,71 @@ private Mono> createIndicatorWithRe * @return threat intelligence information object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createIndicatorAsync( - String resourceGroupName, String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { + private Mono createIndicatorAsync(String resourceGroupName, + String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { return createIndicatorWithResponseAsync(resourceGroupName, workspaceName, threatIntelligenceProperties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return threat intelligence information object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThreatIntelligenceInformationInner createIndicator( - String resourceGroupName, String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { - return createIndicatorAsync(resourceGroupName, workspaceName, threatIntelligenceProperties).block(); + public Response createIndicatorWithResponse(String resourceGroupName, + String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, Context context) { + return createIndicatorWithResponseAsync(resourceGroupName, workspaceName, threatIntelligenceProperties, context) + .block(); } /** * Create a new threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object along with {@link Response}. + * @return threat intelligence information object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createIndicatorWithResponse( - String resourceGroupName, - String workspaceName, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - Context context) { - return createIndicatorWithResponseAsync(resourceGroupName, workspaceName, threatIntelligenceProperties, context) - .block(); + public ThreatIntelligenceInformationInner createIndicator(String resourceGroupName, String workspaceName, + ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { + return createIndicatorWithResponse(resourceGroupName, workspaceName, threatIntelligenceProperties, Context.NONE) + .getValue(); } /** * View a threat intelligence indicator by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object along with {@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> getWithResponseAsync( - String resourceGroupName, String workspaceName, String name) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -413,24 +328,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * View a threat intelligence indicator by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -438,23 +343,19 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -468,21 +369,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, accept, context); } /** * View a threat intelligence indicator by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -492,49 +385,49 @@ private Mono> getWithResponseAsync( * @return threat intelligence information object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String workspaceName, String name) { + private Mono getAsync(String resourceGroupName, String workspaceName, + String name) { return getWithResponseAsync(resourceGroupName, workspaceName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return threat intelligence information object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThreatIntelligenceInformationInner get(String resourceGroupName, String workspaceName, String name) { - return getAsync(resourceGroupName, workspaceName, name).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String name, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * View a threat intelligence indicator by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 threat intelligence information object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + public ThreatIntelligenceInformationInner get(String resourceGroupName, String workspaceName, String name) { + return getWithResponse(resourceGroupName, workspaceName, name, Context.NONE).getValue(); } /** * 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. @@ -542,26 +435,19 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -574,34 +460,22 @@ private Mono> createWithResponseAsy 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.")); + return Mono.error( + new IllegalArgumentException("Parameter threatIntelligenceProperties is required and cannot be null.")); } else { threatIntelligenceProperties.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - threatIntelligenceProperties, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, threatIntelligenceProperties, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a threat Intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -610,27 +484,20 @@ private Mono> createWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -643,31 +510,20 @@ private Mono> createWithResponseAsy 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.")); + 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); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, threatIntelligenceProperties, accept, context); } /** * Update a threat Intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -678,63 +534,55 @@ private Mono> createWithResponseAsy * @return threat intelligence information object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { + private Mono createAsync(String resourceGroupName, String workspaceName, + String name, ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { return createWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. + * @return threat intelligence information object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThreatIntelligenceInformationInner create( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { - return createAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties).block(); + public Response createWithResponse(String resourceGroupName, + String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, + Context context) { + return createWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties, context) + .block(); } /** * Update a threat Intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 threat intelligence information object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - Context context) { - return createWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties, context) - .block(); + public ThreatIntelligenceInformationInner create(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { + return createWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceProperties, Context.NONE) + .getValue(); } /** * 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. @@ -746,16 +594,12 @@ public Response createWithResponse( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -769,24 +613,14 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -797,19 +631,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -823,21 +653,13 @@ private Mono> deleteWithResponseAsync( } 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, name, accept, context); } /** * Delete a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -853,40 +675,40 @@ 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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String name) { - deleteAsync(resourceGroupName, workspaceName, name).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); } /** * Delete a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 name, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + public void delete(String resourceGroupName, String workspaceName, String name) { + deleteWithResponse(resourceGroupName, workspaceName, name, Context.NONE); } /** * 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. @@ -894,24 +716,19 @@ public Response deleteWithResponse( * @throws 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> queryIndicatorsSinglePageAsync( - String resourceGroupName, - String workspaceName, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -921,42 +738,24 @@ private Mono> queryIndicatorsS 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter threatIntelligenceFilteringCriteria is required and cannot be null.")); } else { threatIntelligenceFilteringCriteria.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .queryIndicators( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - threatIntelligenceFilteringCriteria, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.queryIndicators(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Query threat intelligence indicators as per filtering criteria. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. @@ -965,25 +764,19 @@ private Mono> queryIndicatorsS * @throws 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> queryIndicatorsSinglePageAsync( - String resourceGroupName, - String workspaceName, - ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -993,39 +786,23 @@ private Mono> queryIndicatorsS 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.")); + 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)); + .queryIndicators(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Query threat intelligence indicators as per filtering criteria. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. @@ -1035,10 +812,8 @@ private Mono> queryIndicatorsS * @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) { + private PagedFlux queryIndicatorsAsync(String resourceGroupName, + String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { return new PagedFlux<>( () -> queryIndicatorsSinglePageAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria), nextLink -> queryIndicatorsNextSinglePageAsync(nextLink)); @@ -1046,7 +821,7 @@ private PagedFlux queryIndicatorsAsync( /** * 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. @@ -1057,21 +832,17 @@ private PagedFlux queryIndicatorsAsync( * @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, + private PagedFlux queryIndicatorsAsync(String resourceGroupName, + String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, Context context) { - return new PagedFlux<>( - () -> - queryIndicatorsSinglePageAsync( - resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, context), + return new PagedFlux<>(() -> queryIndicatorsSinglePageAsync(resourceGroupName, workspaceName, + threatIntelligenceFilteringCriteria, context), nextLink -> queryIndicatorsNextSinglePageAsync(nextLink, context)); } /** * Query threat intelligence indicators as per filtering criteria. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. @@ -1081,17 +852,15 @@ private PagedFlux queryIndicatorsAsync( * @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) { + public PagedIterable queryIndicators(String resourceGroupName, + String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { return new PagedIterable<>( queryIndicatorsAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria)); } /** * Query threat intelligence indicators as per filtering criteria. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. @@ -1102,10 +871,8 @@ public PagedIterable queryIndicators( * @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, + public PagedIterable queryIndicators(String resourceGroupName, + String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, Context context) { return new PagedIterable<>( queryIndicatorsAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, context)); @@ -1113,7 +880,7 @@ public PagedIterable queryIndicators( /** * Append tags to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -1124,22 +891,15 @@ public PagedIterable queryIndicators( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> appendTagsWithResponseAsync( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1152,34 +912,22 @@ private Mono> appendTagsWithResponseAsync( 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.")); + 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)) + .withContext(context -> service.appendTags(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Append tags to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -1191,23 +939,15 @@ private Mono> appendTagsWithResponseAsync( * @return the {@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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1220,31 +960,21 @@ private Mono> appendTagsWithResponseAsync( 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.")); + return Mono.error( + new IllegalArgumentException("Parameter threatIntelligenceAppendTags is required and cannot be null.")); } else { threatIntelligenceAppendTags.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .appendTags( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - threatIntelligenceAppendTags, - accept, - context); + return service.appendTags(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, + accept, context); } /** * Append tags to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -1255,10 +985,7 @@ private Mono> appendTagsWithResponseAsync( * @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, + private Mono appendTagsAsync(String resourceGroupName, String workspaceName, String name, ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { return appendTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags) .flatMap(ignored -> Mono.empty()); @@ -1266,52 +993,44 @@ private Mono appendTagsAsync( /** * Append tags to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void appendTags( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { - appendTagsAsync(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags).block(); + public Response appendTagsWithResponse(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, Context context) { + return appendTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, + context).block(); } /** * Append tags to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceAppendTags The threat intelligence append tags request body. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@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 void appendTags(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { + appendTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, Context.NONE); } /** * Replace tags added to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -1319,26 +1038,19 @@ public Response appendTagsWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 threat intelligence information object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> replaceTagsWithResponseAsync( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1351,34 +1063,22 @@ private Mono> replaceTagsWithRespon 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter threatIntelligenceReplaceTags is required and cannot be null.")); } else { threatIntelligenceReplaceTags.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .replaceTags( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - name, - threatIntelligenceReplaceTags, - accept, - context)) + .withContext(context -> service.replaceTags(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Replace tags added to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -1387,27 +1087,20 @@ private Mono> replaceTagsWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 threat intelligence information object along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> replaceTagsWithResponseAsync( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1420,31 +1113,21 @@ private Mono> replaceTagsWithRespon 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.")); + 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); + return service.replaceTags(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, + accept, context); } /** * Replace tags added to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. @@ -1455,135 +1138,109 @@ private Mono> replaceTagsWithRespon * @return threat intelligence information object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono replaceTagsAsync( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { + private Mono replaceTagsAsync(String resourceGroupName, String workspaceName, + String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { return replaceTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Replace tags added to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object. + * @return threat intelligence information object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThreatIntelligenceInformationInner replaceTags( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { - return replaceTagsAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags).block(); + public Response replaceTagsWithResponse(String resourceGroupName, + String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, + Context context) { + return replaceTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, + context).block(); } /** * Replace tags added to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 threat intelligence information object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response replaceTagsWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, - Context context) { - return replaceTagsWithResponseAsync( - resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, context) - .block(); + public ThreatIntelligenceInformationInner replaceTags(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { + return replaceTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, + Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the threat intelligence information objects along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> queryIndicatorsNextSinglePageAsync( - String nextLink) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.queryIndicatorsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the threat intelligence information objects along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> queryIndicatorsNextSinglePageAsync( - String nextLink, Context context) { + private Mono> queryIndicatorsNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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)); + return service.queryIndicatorsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsImpl.java index ad629fc04fc9..1f2f48e617c9 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 @@ -24,17 +24,28 @@ public final class ThreatIntelligenceIndicatorsImpl implements ThreatIntelligenc private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public ThreatIntelligenceIndicatorsImpl( - ThreatIntelligenceIndicatorsClient innerClient, + public ThreatIntelligenceIndicatorsImpl(ThreatIntelligenceIndicatorsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public ThreatIntelligenceInformation createIndicator( - String resourceGroupName, String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { - ThreatIntelligenceInformationInner inner = - this.serviceClient().createIndicator(resourceGroupName, workspaceName, threatIntelligenceProperties); + 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 { @@ -42,20 +53,12 @@ public ThreatIntelligenceInformation createIndicator( } } - public Response createIndicatorWithResponse( - String resourceGroupName, - String workspaceName, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - Context context) { - Response inner = - this - .serviceClient() - .createIndicatorWithResponse(resourceGroupName, workspaceName, threatIntelligenceProperties, context); + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); } else { return null; @@ -71,28 +74,22 @@ public ThreatIntelligenceInformation get(String resourceGroupName, String worksp } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, name, context); + public Response createWithResponse(String resourceGroupName, String workspaceName, + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); } else { return null; } } - public ThreatIntelligenceInformation create( - String resourceGroupName, - String workspaceName, - String name, + public ThreatIntelligenceInformation create(String resourceGroupName, String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { - ThreatIntelligenceInformationInner inner = - this.serviceClient().create(resourceGroupName, workspaceName, name, threatIntelligenceProperties); + ThreatIntelligenceInformationInner inner + = this.serviceClient().create(resourceGroupName, workspaceName, name, threatIntelligenceProperties); if (inner != null) { return new ThreatIntelligenceInformationImpl(inner, this.manager()); } else { @@ -100,107 +97,61 @@ public ThreatIntelligenceInformation create( } } - public Response createWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties, + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, 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 this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, context); } public void delete(String resourceGroupName, String workspaceName, String name) { this.serviceClient().delete(resourceGroupName, workspaceName, name); } - public Response deleteWithResponse( - String resourceGroupName, String workspaceName, String name, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, name, context); + public PagedIterable queryIndicators(String resourceGroupName, String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { + PagedIterable inner = this.serviceClient() + .queryIndicators(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); } - public PagedIterable queryIndicators( - String resourceGroupName, - String workspaceName, - ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { - PagedIterable inner = - this.serviceClient().queryIndicators(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria); - return Utils.mapPage(inner, inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); + public PagedIterable queryIndicators(String resourceGroupName, String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, Context context) { + PagedIterable inner = this.serviceClient() + .queryIndicators(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, context); + return 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 Utils.mapPage(inner, inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); + public Response appendTagsWithResponse(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, Context context) { + return this.serviceClient() + .appendTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, context); } - public void appendTags( - String resourceGroupName, - String workspaceName, - String name, + public void appendTags(String resourceGroupName, String workspaceName, String name, ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { this.serviceClient().appendTags(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags); } - public Response appendTagsWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceAppendTags threatIntelligenceAppendTags, + public Response replaceTagsWithResponse(String resourceGroupName, + String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, Context context) { - return this - .serviceClient() - .appendTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, context); - } - - public ThreatIntelligenceInformation replaceTags( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { - ThreatIntelligenceInformationInner inner = - this.serviceClient().replaceTags(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags); + Response inner = this.serviceClient() + .replaceTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, context); if (inner != null) { - return new ThreatIntelligenceInformationImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response replaceTagsWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, - Context context) { - Response inner = - this - .serviceClient() - .replaceTagsWithResponse( - resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, context); + 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; } 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 ac5099ba79a9..a49abcd0e64a 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 @@ -36,24 +36,24 @@ */ public final class ThreatIntelligenceIndicatorsOperationsClientImpl implements ThreatIntelligenceIndicatorsOperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ThreatIntelligenceIndicatorsOperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of ThreatIntelligenceIndicatorsOperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ThreatIntelligenceIndicatorsOperationsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy - .create( - ThreatIntelligenceIndicatorsOperationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); + this.service = RestProxy.create(ThreatIntelligenceIndicatorsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -63,68 +63,54 @@ public final class ThreatIntelligenceIndicatorsOperationsClientImpl */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsThre") - private interface ThreatIntelligenceIndicatorsOperationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators") - @ExpectedResponses({200}) + 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, - @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); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Get all threat intelligence indicators. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. Optional. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all threat intelligence indicators 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> listSinglePageAsync( - String resourceGroupName, String workspaceName, String filter, String orderby, Integer top, String skipToken) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -135,71 +121,42 @@ private Mono> listSinglePageAs } 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, top, skipToken, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get all threat intelligence indicators. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. Optional. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all threat intelligence indicators 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> listSinglePageAsync( - String resourceGroupName, - String workspaceName, - String filter, - String orderby, - Integer top, - String skipToken, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -211,48 +168,31 @@ private Mono> listSinglePageAs 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)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get all threat intelligence indicators. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. Optional. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all threat intelligence indicators 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) { + 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)); @@ -260,7 +200,7 @@ private PagedFlux listAsync( /** * Get all threat intelligence indicators. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -281,15 +221,15 @@ 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 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. + * 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. @@ -297,14 +237,8 @@ private PagedFlux listAsync(String resourceG * @return all threat intelligence indicators 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, - Context context) { + 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)); @@ -312,7 +246,7 @@ private PagedFlux listAsync( /** * Get all threat intelligence indicators. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -331,15 +265,15 @@ public PagedIterable list(String resourceGro /** * Get all threat intelligence indicators. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter Filters the results, based on a Boolean condition. Optional. * @param orderby Sorts the results. Optional. * @param top Returns only the first n results. Optional. * @param skipToken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. Optional. + * 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. @@ -347,28 +281,23 @@ public PagedIterable list(String resourceGro * @return all threat intelligence indicators 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) { + public PagedIterable list(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, String skipToken, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the threat intelligence information objects along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -376,62 +305,43 @@ private Mono> listNextSinglePa 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all the threat intelligence information objects along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsImpl.java index df68b9a281d2..c5d8eb6aedfa 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 @@ -19,30 +19,25 @@ public final class ThreatIntelligenceIndicatorsOperationsImpl implements ThreatI private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public ThreatIntelligenceIndicatorsOperationsImpl( - ThreatIntelligenceIndicatorsOperationsClient innerClient, + public ThreatIntelligenceIndicatorsOperationsImpl(ThreatIntelligenceIndicatorsOperationsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String workspaceName, - String filter, - String orderby, - Integer top, - String skipToken, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context); - return Utils.mapPage(inner, inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); + 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 ThreatIntelligenceInformationImpl(inner1, this.manager())); } private ThreatIntelligenceIndicatorsOperationsClient serviceClient() { 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 91112c166786..fcdd742c499e 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 @@ -7,14 +7,14 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformation; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceInnerKind; public final class ThreatIntelligenceInformationImpl implements ThreatIntelligenceInformation { private ThreatIntelligenceInformationInner innerObject; private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - ThreatIntelligenceInformationImpl( - ThreatIntelligenceInformationInner innerObject, + ThreatIntelligenceInformationImpl(ThreatIntelligenceInformationInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -40,6 +40,10 @@ 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 2d0154591adb..5913635a2b40 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 @@ -15,8 +15,7 @@ public final class ThreatIntelligenceMetricsListImpl implements ThreatIntelligen private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - ThreatIntelligenceMetricsListImpl( - ThreatIntelligenceMetricsListInner innerObject, + ThreatIntelligenceMetricsListImpl(ThreatIntelligenceMetricsListInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; 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..b82b886a1d2a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesClientImpl.java @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligencesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.QueryAutoGenerated; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceList; +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 SecurityInsightsImpl client; + + /** + * Initializes an instance of ThreatIntelligencesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThreatIntelligencesClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(ThreatIntelligencesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsThreatIntelligences to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsThre") + 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("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("tiType") TiType tiType, @BodyParam("application/json") Query query, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/{tiType}/query") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> query(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("tiType") TiType tiType, @BodyParam("application/json") QueryAutoGenerated query, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> queryNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") 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, Query query) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tiType == null) { + return Mono.error(new IllegalArgumentException("Parameter tiType is required and cannot be null.")); + } + if (query != null) { + query.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.count(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, tiType, query, accept, 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. + * @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} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> countWithResponseAsync(String resourceGroupName, + String workspaceName, TiType tiType, Query query, 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 (tiType == null) { + return Mono.error(new IllegalArgumentException("Parameter tiType is required and cannot be null.")); + } + if (query != null) { + query.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.count(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, tiType, query, accept, 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono countAsync(String resourceGroupName, String workspaceName, + TiType tiType) { + final Query 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, Query query, Context context) { + return countWithResponseAsync(resourceGroupName, workspaceName, tiType, query, context).block(); + } + + /** + * 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 Query 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, QueryAutoGenerated query) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tiType == null) { + return Mono.error(new IllegalArgumentException("Parameter tiType is required and cannot be null.")); + } + if (query != null) { + query.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.query(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, tiType, query, 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 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} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> querySinglePageAsync(String resourceGroupName, String workspaceName, + TiType tiType, QueryAutoGenerated query, 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 (tiType == null) { + return Mono.error(new IllegalArgumentException("Parameter tiType is required and cannot be null.")); + } + if (query != null) { + query.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .query(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, tiType, query, accept, context) + .map(res -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + QueryAutoGenerated 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 QueryAutoGenerated 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + QueryAutoGenerated query, Context context) { + return new PagedFlux<>(() -> querySinglePageAsync(resourceGroupName, workspaceName, tiType, query, context), + nextLink -> queryNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 QueryAutoGenerated query = null; + return new PagedIterable<>(queryAsync(resourceGroupName, workspaceName, tiType, query)); + } + + /** + * 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, + QueryAutoGenerated query, Context context) { + return new PagedIterable<>(queryAsync(resourceGroupName, workspaceName, tiType, query, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the threat intelligence objects on the workspace that match the provided query along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queryNextSinglePageAsync(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.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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the threat intelligence objects on the workspace that match the provided query along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queryNextSinglePageAsync(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.queryNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesImpl.java new file mode 100644 index 000000000000..fabf957a3312 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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.ThreatIntelligenceCountInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.QueryAutoGenerated; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceCount; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligences; +import com.azure.resourcemanager.securityinsights.models.TIObject; +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, Query query, Context context) { + Response inner + = this.serviceClient().countWithResponse(resourceGroupName, workspaceName, tiType, query, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ThreatIntelligenceCountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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, + QueryAutoGenerated 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..63ed17ed336c --- /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) AutoRest 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..a76a2039799f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsClientImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of TriggeredAnalyticsRuleRunOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TriggeredAnalyticsRuleRunOperationsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(TriggeredAnalyticsRuleRunOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsTriggeredAnalyticsRuleRunOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsTrig") + 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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleRunId") String ruleRunId, @QueryParam("api-version") String apiVersion, + @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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleRunId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleRunId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, ruleRunId, this.client.getApiVersion(), 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (ruleRunId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleRunId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, + ruleRunId, this.client.getApiVersion(), 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleRunId, context).block(); + } + + /** + * 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..f9f0e988dd44 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TriggeredAnalyticsRuleRunImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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..fa60b882f6ee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesClientImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.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.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 java.util.UUID; +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 SecurityInsightsImpl client; + + /** + * Initializes an instance of UpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdatesClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(UpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsUpdates to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsUpda") + public interface UpdatesService { + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> recommendation(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("recommendationId") UUID recommendationId, + @BodyParam("application/json") RecommendationPatch recommendationPatch, + @HeaderParam("Accept") String accept, 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, UUID recommendationId, RecommendationPatch recommendationPatch) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (recommendationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recommendationId is required and cannot be null.")); + } + if (recommendationPatch == null) { + return Mono + .error(new IllegalArgumentException("Parameter recommendationPatch is required and cannot be null.")); + } else { + recommendationPatch.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.recommendation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, recommendationId, + recommendationPatch, accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, UUID recommendationId, RecommendationPatch recommendationPatch, 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 (recommendationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recommendationId is required and cannot be null.")); + } + if (recommendationPatch == null) { + return Mono + .error(new IllegalArgumentException("Parameter recommendationPatch is required and cannot be null.")); + } else { + recommendationPatch.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.recommendation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, recommendationId, recommendationPatch, + accept, 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono recommendationAsync(String resourceGroupName, String workspaceName, + UUID 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, + UUID recommendationId, RecommendationPatch recommendationPatch, Context context) { + return recommendationWithResponseAsync(resourceGroupName, workspaceName, recommendationId, recommendationPatch, + context).block(); + } + + /** + * 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, UUID 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..f0111f561d12 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.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; +import java.util.UUID; + +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, + UUID recommendationId, RecommendationPatch recommendationPatch, Context context) { + Response inner = this.serviceClient() + .recommendationWithResponse(resourceGroupName, workspaceName, recommendationId, recommendationPatch, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecommendationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Recommendation recommendation(String resourceGroupName, String workspaceName, UUID 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..f340b57b9a36 --- /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) AutoRest 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 ba1748990562..fef181fba11c 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 @@ -154,24 +154,19 @@ public WatchlistImpl withExistingWorkspace(String resourceGroupName, String work } public Watchlist create() { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlists() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlists() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), + Context.NONE) + .getValue(); return this; } public Watchlist create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlists() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlists() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context) + .getValue(); return this; } @@ -186,53 +181,44 @@ public WatchlistImpl update() { } public Watchlist apply() { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlists() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlists() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), + Context.NONE) + .getValue(); return this; } public Watchlist apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlists() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlists() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context) + .getValue(); return this; } - WatchlistImpl( - WatchlistInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + WatchlistImpl(WatchlistInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.watchlistAlias = Utils.getValueFromIdByName(innerObject.id(), "watchlists"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.watchlistAlias = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "watchlists"); } public Watchlist refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlists() - .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlists() + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE) + .getValue(); return this; } public Watchlist refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlists() - .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlists() + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, context) + .getValue(); 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 4b5b6d0486c8..b08bf7858163 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 @@ -108,8 +108,8 @@ private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manag private String watchlistItemId; - public WatchlistItemImpl withExistingWatchlist( - String resourceGroupName, String workspaceName, String watchlistAlias) { + public WatchlistItemImpl withExistingWatchlist(String resourceGroupName, String workspaceName, + String watchlistAlias) { this.resourceGroupName = resourceGroupName; this.workspaceName = workspaceName; this.watchlistAlias = watchlistAlias; @@ -117,24 +117,20 @@ public WatchlistItemImpl withExistingWatchlist( } public WatchlistItem create() { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlistItems() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlistItems() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + this.innerModel(), Context.NONE) + .getValue(); return this; } public WatchlistItem create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlistItems() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlistItems() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + this.innerModel(), context) + .getValue(); return this; } @@ -149,55 +145,46 @@ public WatchlistItemImpl update() { } public WatchlistItem apply() { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlistItems() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlistItems() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + this.innerModel(), Context.NONE) + .getValue(); return this; } public WatchlistItem apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlistItems() - .createOrUpdateWithResponse( - resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlistItems() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + this.innerModel(), context) + .getValue(); return this; } - WatchlistItemImpl( - WatchlistItemInner innerObject, + WatchlistItemImpl(WatchlistItemInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.watchlistAlias = Utils.getValueFromIdByName(innerObject.id(), "watchlists"); - this.watchlistItemId = Utils.getValueFromIdByName(innerObject.id(), "watchlistItems"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.watchlistAlias = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "watchlists"); + this.watchlistItemId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "watchlistItems"); } public WatchlistItem refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlistItems() - .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlistItems() + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE) + .getValue(); return this; } public WatchlistItem refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWatchlistItems() - .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWatchlistItems() + .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context) + .getValue(); return this; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsClientImpl.java index 0257b61bfb20..12100d077456 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 @@ -33,22 +33,28 @@ import com.azure.resourcemanager.securityinsights.models.WatchlistItemList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in WatchlistItemsClient. */ +/** + * An instance of this class provides access to all the operations defined in WatchlistItemsClient. + */ public final class WatchlistItemsClientImpl implements WatchlistItemsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final WatchlistItemsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of WatchlistItemsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ WatchlistItemsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(WatchlistItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(WatchlistItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,119 +64,80 @@ public final class WatchlistItemsClientImpl implements WatchlistItemsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsWatc") - private interface WatchlistItemsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}" - + "/watchlistItems") - @ExpectedResponses({200}) + public interface WatchlistItemsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("$skipToken") String skipToken, - @PathParam("watchlistAlias") String watchlistAlias, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}" - + "/watchlistItems/{watchlistItemId}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$skipToken") String skipToken, @PathParam("watchlistAlias") String watchlistAlias, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("watchlistAlias") String watchlistAlias, - @PathParam("watchlistItemId") String watchlistItemId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}" - + "/watchlistItems/{watchlistItemId}") - @ExpectedResponses({200, 204}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, @PathParam("watchlistItemId") String watchlistItemId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("watchlistAlias") String watchlistAlias, - @PathParam("watchlistItemId") String watchlistItemId, - @HeaderParam("Accept") String accept, - Context context); + @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}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("watchlistAlias") String watchlistAlias, - @PathParam("watchlistItemId") String watchlistItemId, - @BodyParam("application/json") WatchlistItemInner watchlistItem, - @HeaderParam("Accept") String accept, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, @PathParam("watchlistItemId") String watchlistItemId, + @BodyParam("application/json") WatchlistItemInner watchlistItem, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @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. + * 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String watchlistAlias, String skipToken) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -184,40 +151,23 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - skipToken, - watchlistAlias, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, skipToken, watchlistAlias, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param 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. + * 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. @@ -225,19 +175,15 @@ private Mono> listSinglePageAsync( * @return all watchlist Items along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String watchlistAlias, String skipToken, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -252,52 +198,36 @@ private Mono> listSinglePageAsync( 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, - watchlistAlias, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, skipToken, watchlistAlias, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @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. + * 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), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String watchlistAlias, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -307,23 +237,22 @@ private PagedFlux listAsync( * @return all watchlist Items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String watchlistAlias) { + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String watchlistAlias) { final String skipToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param 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. + * 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. @@ -331,8 +260,8 @@ private PagedFlux listAsync( * @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) { + 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)); @@ -340,7 +269,7 @@ private PagedFlux listAsync( /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -350,21 +279,21 @@ private PagedFlux listAsync( * @return all watchlist Items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String workspaceName, String watchlistAlias) { + public PagedIterable list(String resourceGroupName, String workspaceName, + String watchlistAlias) { final String skipToken = null; return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken)); } /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param 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. + * 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. @@ -372,14 +301,14 @@ public PagedIterable list( * @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) { + public PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, + String skipToken, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken, context)); } /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -387,23 +316,19 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 a watchlist, without its watchlist items 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -421,25 +346,15 @@ private Mono> getWithResponseAsync( } 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -448,27 +363,19 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 a watchlist, without its watchlist items 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -486,22 +393,13 @@ private Mono> getWithResponseAsync( } 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 service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, accept, context); } /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -512,56 +410,53 @@ private Mono> getWithResponseAsync( * @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, String watchlistItemId) { + private Mono getAsync(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId) { return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a watchlist, without its watchlist items. + * @return a watchlist, without its watchlist items along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistItemInner get( - String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { - return getAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, String watchlistItemId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context).block(); } /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a watchlist, without its watchlist items along with {@link Response}. + * @return a watchlist, without its watchlist items. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - String watchlistItemId, - Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context).block(); + public WatchlistItemInner get(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId) { + return getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, 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 watchlistAlias Watchlist Alias. @@ -572,19 +467,15 @@ public Response getWithResponse( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -602,25 +493,15 @@ private Mono> deleteWithResponseAsync( } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -632,23 +513,15 @@ private Mono> deleteWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -666,22 +539,13 @@ private Mono> deleteWithResponseAsync( } 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, accept, context); } /** * Delete a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -692,55 +556,51 @@ private Mono> deleteWithResponseAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + private Mono deleteAsync(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId) { return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId) .flatMap(ignored -> Mono.empty()); } /** * Delete a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { - deleteAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context) + .block(); } /** * Delete a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 watchlistAlias, - String watchlistItemId, - Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context) - .block(); + public void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE); } /** * Creates or updates a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -750,26 +610,18 @@ public Response deleteWithResponse( * @throws 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - String watchlistItemId, - WatchlistItemInner watchlistItem) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -792,26 +644,15 @@ private Mono> createOrUpdateWithResponseAsync( } 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.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + watchlistItem, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -822,27 +663,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - String watchlistItemId, - WatchlistItemInner watchlistItem, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -865,23 +698,14 @@ private Mono> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + watchlistItem, accept, context); } /** * Creates or updates a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -893,73 +717,59 @@ private Mono> createOrUpdateWithResponseAsync( * @return represents a Watchlist item in Azure Security Insights on successful completion of {@link Mono}. */ @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 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())); } /** * Creates or updates a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). * @param watchlistItem The watchlist item. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Watchlist item in Azure Security Insights. + * @return represents a Watchlist item in Azure Security Insights along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistItemInner createOrUpdate( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - String watchlistItemId, - WatchlistItemInner watchlistItem) { - return createOrUpdateAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, watchlistItem) - .block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, String watchlistItemId, WatchlistItemInner watchlistItem, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + watchlistItem, context).block(); } /** * Creates or updates a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). * @param watchlistItem The watchlist item. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 represents a Watchlist item in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - String watchlistItemId, - WatchlistItemInner watchlistItem, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, watchlistItem, context) - .block(); + public WatchlistItemInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, WatchlistItemInner watchlistItem) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + watchlistItem, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -971,31 +781,22 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1008,23 +809,13 @@ private Mono> listNextSinglePageAsync(String n 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsImpl.java index fc1cb65f0917..dcb2ecf24fa9 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 @@ -21,207 +21,151 @@ public final class WatchlistItemsImpl implements WatchlistItems { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public WatchlistItemsImpl( - WatchlistItemsClient innerClient, + public WatchlistItemsImpl(WatchlistItemsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, workspaceName, watchlistAlias); - return Utils.mapPage(inner, inner1 -> new WatchlistItemImpl(inner1, this.manager())); + 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 Utils.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 get( - String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { - WatchlistItemInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId); + 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 WatchlistItemImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WatchlistItemImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - String watchlistItemId, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context); + public WatchlistItem get(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId) { + WatchlistItemInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new WatchlistItemImpl(inner.getValue(), this.manager())); + return new WatchlistItemImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { - this.serviceClient().delete(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context); } - public Response deleteWithResponse( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - String watchlistItemId, - Context context) { - return this - .serviceClient() - .deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context); + public void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId) { + this.serviceClient().delete(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId); } public WatchlistItem getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + String watchlistAlias = ResourceManagerUtils.getValueFromIdByName(id, "watchlists"); if (watchlistAlias == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); } - String watchlistItemId = Utils.getValueFromIdByName(id, "watchlistItems"); + String watchlistItemId = ResourceManagerUtils.getValueFromIdByName(id, "watchlistItems"); if (watchlistItemId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); - } - return this - .getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE) + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + String watchlistAlias = ResourceManagerUtils.getValueFromIdByName(id, "watchlists"); if (watchlistAlias == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); } - String watchlistItemId = Utils.getValueFromIdByName(id, "watchlistItems"); + String watchlistItemId = ResourceManagerUtils.getValueFromIdByName(id, "watchlistItems"); if (watchlistItemId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + String watchlistAlias = ResourceManagerUtils.getValueFromIdByName(id, "watchlists"); if (watchlistAlias == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); } - String watchlistItemId = Utils.getValueFromIdByName(id, "watchlistItems"); + String watchlistItemId = ResourceManagerUtils.getValueFromIdByName(id, "watchlistItems"); if (watchlistItemId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + String watchlistAlias = ResourceManagerUtils.getValueFromIdByName(id, "watchlists"); if (watchlistAlias == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); } - String watchlistItemId = Utils.getValueFromIdByName(id, "watchlistItems"); + String watchlistItemId = ResourceManagerUtils.getValueFromIdByName(id, "watchlistItems"); if (watchlistItemId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlistItems'.", id))); } return this.deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, context); } 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 56e2704b1252..f0b9086136ec 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 @@ -35,22 +35,28 @@ import com.azure.resourcemanager.securityinsights.models.WatchlistsDeleteResponse; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in WatchlistsClient. */ +/** + * An instance of this class provides access to all the operations defined in WatchlistsClient. + */ public final class WatchlistsClientImpl implements WatchlistsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final WatchlistsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityInsightsImpl client; /** * Initializes an instance of WatchlistsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ WatchlistsClientImpl(SecurityInsightsImpl client) { - this.service = - RestProxy.create(WatchlistsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(WatchlistsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -60,111 +66,76 @@ public final class WatchlistsClientImpl implements WatchlistsClient { */ @Host("{$host}") @ServiceInterface(name = "SecurityInsightsWatc") - private interface WatchlistsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists") - @ExpectedResponses({200}) + public interface WatchlistsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @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/{watchlistAlias}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("watchlistAlias") String watchlistAlias, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") - @ExpectedResponses({200, 204}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("watchlistAlias") String watchlistAlias, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights" - + "/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") - @ExpectedResponses({200, 201}) + Mono delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @PathParam("watchlistAlias") String watchlistAlias, - @BodyParam("application/json") WatchlistInner watchlist, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, @BodyParam("application/json") WatchlistInner watchlist, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @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. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skipToken) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -175,59 +146,38 @@ private Mono> listSinglePageAsync( } 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.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())); } /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param 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. + * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String workspaceName, String skipToken, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -239,34 +189,20 @@ private Mono> listSinglePageAsync( 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)); + .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)); } /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param 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. + * 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. @@ -274,14 +210,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skipToken) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -292,19 +227,18 @@ private PagedFlux listAsync(String resourceGroupName, String wor @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String workspaceName) { final String skipToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param 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. + * 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. @@ -312,16 +246,15 @@ private PagedFlux listAsync(String resourceGroupName, String wor * @return all watchlists, without watchlist items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String workspaceName, String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken, context), + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skipToken, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -337,12 +270,12 @@ public PagedIterable list(String resourceGroupName, String works /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param 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. + * 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. @@ -350,37 +283,33 @@ public PagedIterable list(String resourceGroupName, String works * @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) { + public PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, + Context context) { return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skipToken, context)); } /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a watchlist, without its watchlist items along with {@link Response} on successful completion of {@link - * Mono}. + * @return a watchlist, without its watchlist items along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String watchlistAlias) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -394,24 +323,14 @@ private Mono> getWithResponseAsync( } 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -419,23 +338,19 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 a watchlist, without its watchlist items along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -449,21 +364,13 @@ private Mono> getWithResponseAsync( } 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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, watchlistAlias, accept, context); } /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -480,41 +387,41 @@ private Mono getAsync(String resourceGroupName, String workspace /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a watchlist, without its watchlist items. + * @return a watchlist, without its watchlist items along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias) { - return getAsync(resourceGroupName, workspaceName, watchlistAlias).block(); + public Response getWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, context).block(); } /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a watchlist, without its watchlist items along with {@link Response}. + * @return a watchlist, without its watchlist items. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, context).block(); + public WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias) { + return getWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE).getValue(); } /** * Delete a watchlist. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -524,19 +431,15 @@ public Response getWithResponse( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String watchlistAlias) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -550,24 +453,14 @@ private Mono deleteWithResponseAsync( } 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a watchlist. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -578,19 +471,15 @@ private Mono deleteWithResponseAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteWithResponseAsync( - String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + private Mono deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String watchlistAlias, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -604,21 +493,13 @@ private Mono deleteWithResponseAsync( } 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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, watchlistAlias, accept, context); } /** * Delete a watchlist. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -635,35 +516,35 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, 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 watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String watchlistAlias) { - deleteAsync(resourceGroupName, workspaceName, watchlistAlias).block(); + public WatchlistsDeleteResponse deleteWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, context).block(); } /** * Delete a watchlist. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistsDeleteResponse deleteWithResponse( - String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, context).block(); + public void delete(String resourceGroupName, String workspaceName, String watchlistAlias) { + deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE); } /** @@ -672,7 +553,7 @@ public WatchlistsDeleteResponse deleteWithResponse( * contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). The SAS * URI enables the creation of large watchlist, where the content size can go up to 500 MB. The status of processing * such large file can be polled through the URL returned in Azure-AsyncOperation header. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -683,19 +564,15 @@ public WatchlistsDeleteResponse deleteWithResponse( * @return represents a Watchlist in Azure Security Insights on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, String watchlistAlias, WatchlistInner watchlist) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -714,19 +591,9 @@ private Mono createOrUpdateWithResponseAsync( } 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.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, watchlist, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -736,7 +603,7 @@ private Mono createOrUpdateWithResponseAsync( * contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). The SAS * URI enables the creation of large watchlist, where the content size can go up to 500 MB. The status of processing * such large file can be polled through the URL returned in Azure-AsyncOperation header. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -748,23 +615,15 @@ private Mono createOrUpdateWithResponseAsync( * @return represents a Watchlist in Azure Security Insights on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateWithResponseAsync( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - WatchlistInner watchlist, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -783,17 +642,9 @@ private Mono createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, watchlist, accept, + context); } /** @@ -802,7 +653,7 @@ private Mono createOrUpdateWithResponseAsync( * contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). The SAS * URI enables the creation of large watchlist, where the content size can go up to 500 MB. The status of processing * such large file can be polled through the URL returned in Azure-AsyncOperation header. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -813,8 +664,8 @@ private Mono createOrUpdateWithResponseAsync( * @return represents a Watchlist in Azure Security Insights on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, String watchlistAlias, WatchlistInner watchlist) { + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String watchlistAlias, WatchlistInner watchlist) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -825,20 +676,22 @@ private Mono createOrUpdateAsync( * contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). The SAS * URI enables the creation of large watchlist, where the content size can go up to 500 MB. The status of processing * such large file can be polled through the URL returned in Azure-AsyncOperation header. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlist The watchlist. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a Watchlist in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistInner createOrUpdate( - String resourceGroupName, String workspaceName, String watchlistAlias, WatchlistInner watchlist) { - return createOrUpdateAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist).block(); + public WatchlistsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, WatchlistInner watchlist, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist, context) + .block(); } /** @@ -847,33 +700,29 @@ public WatchlistInner createOrUpdate( * contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). The SAS * URI enables the creation of large watchlist, where the content size can go up to 500 MB. The status of processing * such large file can be polled through the URL returned in Azure-AsyncOperation header. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlist The watchlist. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a Watchlist in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistsCreateOrUpdateResponse createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String watchlistAlias, - WatchlistInner watchlist, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist, context) - .block(); + public WatchlistInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + WatchlistInner watchlist) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlist, Context.NONE) + .getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -885,31 +734,22 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -922,23 +762,13 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsImpl.java index 139a0477f33f..bd31709e8c76 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 @@ -22,8 +22,7 @@ public final class WatchlistsImpl implements Watchlists { private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; - public WatchlistsImpl( - WatchlistsClient innerClient, + public WatchlistsImpl(WatchlistsClient innerClient, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,149 +30,118 @@ public WatchlistsImpl( public PagedIterable list(String resourceGroupName, String workspaceName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new WatchlistImpl(inner1, this.manager())); + 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 Utils.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 get(String resourceGroupName, String workspaceName, String watchlistAlias) { - WatchlistInner inner = this.serviceClient().get(resourceGroupName, workspaceName, watchlistAlias); + 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 WatchlistImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WatchlistImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, workspaceName, watchlistAlias, context); + public Watchlist get(String resourceGroupName, String workspaceName, String watchlistAlias) { + WatchlistInner inner = this.serviceClient().get(resourceGroupName, workspaceName, watchlistAlias); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new WatchlistImpl(inner.getValue(), this.manager())); + return new WatchlistImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String workspaceName, String watchlistAlias) { - this.serviceClient().delete(resourceGroupName, workspaceName, watchlistAlias); + public WatchlistsDeleteResponse deleteWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, context); } - public WatchlistsDeleteResponse 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 Watchlist getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + String watchlistAlias = ResourceManagerUtils.getValueFromIdByName(id, "watchlists"); if (watchlistAlias == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + String watchlistAlias = ResourceManagerUtils.getValueFromIdByName(id, "watchlists"); if (watchlistAlias == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); } return this.getWithResponse(resourceGroupName, workspaceName, watchlistAlias, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + String watchlistAlias = ResourceManagerUtils.getValueFromIdByName(id, "watchlists"); if (watchlistAlias == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); } this.deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE); } public WatchlistsDeleteResponse deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } - String watchlistAlias = Utils.getValueFromIdByName(id, "watchlists"); + String watchlistAlias = ResourceManagerUtils.getValueFromIdByName(id, "watchlists"); if (watchlistAlias == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'watchlists'.", id))); + 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); } 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..ba5f6993c654 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +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 ProvisioningState 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..7e859fb73108 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsClientImpl.java @@ -0,0 +1,808 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of WorkspaceManagerAssignmentJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerAssignmentJobsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(WorkspaceManagerAssignmentJobsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsWorkspaceManagerAssignmentJobs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsWork") + public interface WorkspaceManagerAssignmentJobsService { + @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("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("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("$host") 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" }) + @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("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get all 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName 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, workspaceManagerAssignmentName, orderby, top, skipToken, accept, context) + .map(res -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, + workspaceManagerAssignmentName, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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<>( + listAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, orderby, top, skipToken)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, orderby, + top, skipToken, 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName is required and cannot be null.")); + } + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(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 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) { + return createWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context) + .block(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName, context) + .block(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName 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, workspaceManagerAssignmentName, + jobName, accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName 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, workspaceManagerAssignmentName, jobName, accept, 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. + * @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 deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName, + context).block(); + } + + /** + * 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 the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the jobs 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(), + 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsImpl.java new file mode 100644 index 000000000000..c47970288ead --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 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())); + } + + public Response createWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context) { + Response inner = this.serviceClient() + .createWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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); + } + + 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..7a2ac21624eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsClientImpl.java @@ -0,0 +1,798 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of WorkspaceManagerAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerAssignmentsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(WorkspaceManagerAssignmentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsWorkspaceManagerAssignments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsWork") + public interface WorkspaceManagerAssignmentsService { + @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("$host") 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/{workspaceManagerAssignmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @BodyParam("application/json") WorkspaceManagerAssignmentInner workspaceManagerAssignment, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get all 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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, orderby, top, skipToken, accept, context) + .map(res -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, orderby, top, skipToken)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, orderby, top, skipToken, 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context).block(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName is required and cannot be null.")); + } + if (workspaceManagerAssignment == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerAssignment is required and cannot be null.")); + } else { + workspaceManagerAssignment.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, + workspaceManagerAssignment, accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName is required and cannot be null.")); + } + if (workspaceManagerAssignment == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerAssignment is required and cannot be null.")); + } else { + workspaceManagerAssignment.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, workspaceManagerAssignmentName, + workspaceManagerAssignment, accept, 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 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) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, + workspaceManagerAssignment, context).block(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName 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, workspaceManagerAssignmentName, + accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerAssignmentName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerAssignmentName 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, workspaceManagerAssignmentName, accept, 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. + * @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 deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context) + .block(); + } + + /** + * 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 the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the workspace manager assignments 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the workspace manager assignments along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsImpl.java new file mode 100644 index 000000000000..a53e2abf551a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.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 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 Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceManagerAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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..3cbca5357d33 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..c0ef64f8c820 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsClientImpl.java @@ -0,0 +1,799 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of WorkspaceManagerConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerConfigurationsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(WorkspaceManagerConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsWorkspaceManagerConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsWork") + public interface WorkspaceManagerConfigurationsService { + @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("$host") 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/{workspaceManagerConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerConfigurationName") String workspaceManagerConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerConfigurationName") String workspaceManagerConfigurationName, + @BodyParam("application/json") WorkspaceManagerConfigurationInner workspaceManagerConfiguration, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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, orderby, top, skipToken, accept, context) + .map(res -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, orderby, top, skipToken)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, orderby, top, skipToken, 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerConfigurationName 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerConfigurationName 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerConfigurationName, context) + .block(); + } + + /** + * 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(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerConfigurationName 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, workspaceManagerConfigurationName, + accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerConfigurationName 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, workspaceManagerConfigurationName, accept, 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. + * @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 deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerConfigurationName, context) + .block(); + } + + /** + * 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); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerConfigurationName is required and cannot be null.")); + } + if (workspaceManagerConfiguration == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerConfiguration is required and cannot be null.")); + } else { + workspaceManagerConfiguration.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerConfigurationName, + workspaceManagerConfiguration, accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerConfigurationName is required and cannot be null.")); + } + if (workspaceManagerConfiguration == null) { + return Mono.error(new IllegalArgumentException( + "Parameter workspaceManagerConfiguration is required and cannot be null.")); + } else { + workspaceManagerConfiguration.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, workspaceManagerConfigurationName, + workspaceManagerConfiguration, accept, 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 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) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerConfigurationName, + workspaceManagerConfiguration, context).block(); + } + + /** + * 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the workspace manager configurations for the workspace 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list all the workspace manager configurations for the workspace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsImpl.java new file mode 100644 index 000000000000..bd90f56a9b9a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.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 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 Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceManagerConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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..eda7ff50b002 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..8fa334a76aa2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsClientImpl.java @@ -0,0 +1,793 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of WorkspaceManagerGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerGroupsClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(WorkspaceManagerGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsWorkspaceManagerGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsWork") + public interface WorkspaceManagerGroupsService { + @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("$host") 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/{workspaceManagerGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerGroupName") String workspaceManagerGroupName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerGroupName") String workspaceManagerGroupName, + @BodyParam("application/json") WorkspaceManagerGroupInner workspaceManagerGroup, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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, orderby, top, skipToken, accept, context) + .map(res -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, orderby, top, skipToken)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, orderby, top, skipToken, 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerGroupName 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerGroupName 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerGroupName, context).block(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerGroupName is required and cannot be null.")); + } + if (workspaceManagerGroup == null) { + return Mono + .error(new IllegalArgumentException("Parameter workspaceManagerGroup is required and cannot be null.")); + } else { + workspaceManagerGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerGroupName, + workspaceManagerGroup, accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + 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 (workspaceManagerGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerGroupName is required and cannot be null.")); + } + if (workspaceManagerGroup == null) { + return Mono + .error(new IllegalArgumentException("Parameter workspaceManagerGroup is required and cannot be null.")); + } else { + workspaceManagerGroup.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, workspaceManagerGroupName, + workspaceManagerGroup, accept, 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 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) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerGroupName, + workspaceManagerGroup, context).block(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerGroupName 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, workspaceManagerGroupName, accept, + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerGroupName 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, workspaceManagerGroupName, accept, 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. + * @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 deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerGroupName, context).block(); + } + + /** + * 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); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the workspace manager groups 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the workspace manager groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsImpl.java new file mode 100644 index 000000000000..8c9536d060c7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 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 Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceManagerGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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..1746d0f4e61d --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..314adf851912 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersClientImpl.java @@ -0,0 +1,793 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner; +import com.azure.resourcemanager.securityinsights.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 SecurityInsightsImpl client; + + /** + * Initializes an instance of WorkspaceManagerMembersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerMembersClientImpl(SecurityInsightsImpl client) { + this.service = RestProxy.create(WorkspaceManagerMembersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsWorkspaceManagerMembers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityInsightsWork") + public interface WorkspaceManagerMembersService { + @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("$host") 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/{workspaceManagerMemberName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerMemberName") String workspaceManagerMemberName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{workspaceManagerMemberName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerMemberName") String workspaceManagerMemberName, + @BodyParam("application/json") WorkspaceManagerMemberInner workspaceManagerMember, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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, orderby, top, skipToken, accept, context) + .map(res -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, orderby, top, skipToken)); + } + + /** + * 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<>(listAsync(resourceGroupName, workspaceName, orderby, top, skipToken, 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerMemberName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerMemberName 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, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerMemberName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerMemberName 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, 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 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) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerMemberName, context).block(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerMemberName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerMemberName is required and cannot be null.")); + } + if (workspaceManagerMember == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerMember is required and cannot be null.")); + } else { + workspaceManagerMember.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerMemberName, + workspaceManagerMember, accept, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + 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 (workspaceManagerMemberName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerMemberName is required and cannot be null.")); + } + if (workspaceManagerMember == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerMember is required and cannot be null.")); + } else { + workspaceManagerMember.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, workspaceManagerMemberName, + workspaceManagerMember, accept, 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 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) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerMemberName, + workspaceManagerMember, context).block(); + } + + /** + * 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) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceManagerMemberName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerMemberName 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, workspaceManagerMemberName, accept, + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, 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 (workspaceManagerMemberName == null) { + return Mono.error( + new IllegalArgumentException("Parameter workspaceManagerMemberName 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, workspaceManagerMemberName, accept, 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. + * @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 deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerMemberName, context).block(); + } + + /** + * 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); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspace manager members 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(), 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspace manager members along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersImpl.java new file mode 100644 index 000000000000..8edb9063f2ac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.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 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 Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceManagerMemberImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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/implementation/package-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/package-info.java index 456876fc95a3..ec083204691e 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure Security - * Insights) resource provider. + * Package containing the implementations for SecurityInsights. + * API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. */ package com.azure.resourcemanager.securityinsights.implementation; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AadCheckRequirements.java index bf95fed22e28..10a5016d4b10 100644 --- 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 @@ -7,32 +7,82 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.AadCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents AAD (Azure Active Directory) requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents AADIP (Azure Active Directory Identity Protection) requirements check request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AadCheckRequirements.class, visible = true) @JsonTypeName("AzureActiveDirectory") @Fluent public final class AadCheckRequirements extends DataConnectorsCheckRequirements { /* - * AAD (Azure Active Directory) requirements check properties. + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.AZURE_ACTIVE_DIRECTORY; + + /* + * AADIP (Azure Active Directory Identity Protection) requirements check properties. */ @JsonProperty(value = "properties") private AadCheckRequirementsProperties innerProperties; /** - * Get the innerProperties property: AAD (Azure Active Directory) requirements check properties. - * + * 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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 2c2d4b0f24aa..41bf58778dbf 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AadDataConnectorProperties; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents AAD (Azure Active Directory) data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents AADIP (Azure Active Directory Identity Protection) data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AadDataConnector.class, visible = true) @JsonTypeName("AzureActiveDirectory") @Fluent public final class AadDataConnector extends DataConnectorInner { /* - * AAD (Azure Active Directory) data connector properties. + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.AZURE_ACTIVE_DIRECTORY; + + /* + * AADIP (Azure Active Directory Identity Protection) data connector properties. */ @JsonProperty(value = "properties") private AadDataConnectorProperties innerProperties; /** - * Get the innerProperties property: AAD (Azure Active Directory) data connector properties. - * + * Creates an instance of AadDataConnector class. + */ + public AadDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: AADIP (Azure Active Directory Identity Protection) data connector properties. + * * @return the innerProperties value. */ private AadDataConnectorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AadDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public AadDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -49,7 +77,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the AadDataConnector object itself. */ @@ -63,7 +91,7 @@ public AadDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +100,7 @@ public String tenantId() { /** * Set the tenantId property: The tenant id to connect to, and get the data from. - * + * * @param tenantId the tenantId value to set. * @return the AadDataConnector object itself. */ @@ -86,7 +114,7 @@ public AadDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 45cdb56dc88a..027cee5005c8 100644 --- 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 @@ -7,32 +7,81 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.AatpCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents AATP (Azure Advanced Threat Protection) requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents AATP (Azure Advanced Threat Protection) requirements check request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AatpCheckRequirements.class, visible = true) @JsonTypeName("AzureAdvancedThreatProtection") @Fluent public final class AatpCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.AZURE_ADVANCED_THREAT_PROTECTION; + /* * AATP (Azure Advanced Threat Protection) requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 25261e2030c4..6d14b4202bce 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AatpDataConnectorProperties; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents AATP (Azure Advanced Threat Protection) data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents AATP (Azure Advanced Threat Protection) data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AatpDataConnector.class, visible = true) @JsonTypeName("AzureAdvancedThreatProtection") @Fluent public final class AatpDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.AZURE_ADVANCED_THREAT_PROTECTION; + /* * AATP (Azure Advanced Threat Protection) data connector properties. */ @JsonProperty(value = "properties") private AatpDataConnectorProperties innerProperties; + /** + * Creates an instance of AatpDataConnector class. + */ + public AatpDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + /** * Get the innerProperties property: AATP (Azure Advanced Threat Protection) data connector properties. - * + * * @return the innerProperties value. */ private AatpDataConnectorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AatpDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public AatpDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -49,7 +77,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the AatpDataConnector object itself. */ @@ -63,7 +91,7 @@ public AatpDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +100,7 @@ public String tenantId() { /** * Set the tenantId property: The tenant id to connect to, and get the data from. - * + * * @param tenantId the tenantId value to set. * @return the AatpDataConnector object itself. */ @@ -86,7 +114,7 @@ public AatpDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 d662cdb888ec..6130511d2c49 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 @@ -4,29 +4,55 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.AccountEntityProperties; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; import java.util.UUID; -/** Represents an account entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents an account entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AccountEntity.class, visible = true) @JsonTypeName("Account") -@Fluent +@Immutable public final class AccountEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.ACCOUNT; + /* * Account entity properties */ @JsonProperty(value = "properties") private AccountEntityProperties innerProperties; + /** + * Creates an instance of AccountEntity class. + */ + public AccountEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Account entity properties. - * + * * @return the innerProperties value. */ private AccountEntityProperties innerProperties() { @@ -35,7 +61,7 @@ private AccountEntityProperties innerProperties() { /** * Get the aadTenantId property: The Azure Active Directory tenant id. - * + * * @return the aadTenantId value. */ public String aadTenantId() { @@ -44,7 +70,7 @@ public String aadTenantId() { /** * Get the aadUserId property: The Azure Active Directory user id. - * + * * @return the aadUserId value. */ public String aadUserId() { @@ -54,7 +80,7 @@ public String aadUserId() { /** * Get the accountName property: The name of the account. This field should hold only the name without any domain * added to it, i.e. administrator. - * + * * @return the accountName value. */ public String accountName() { @@ -63,7 +89,7 @@ public String accountName() { /** * Get the displayName property: The display name of the account. - * + * * @return the displayName value. */ public String displayName() { @@ -73,7 +99,7 @@ public String displayName() { /** * Get the hostEntityId property: The Host entity id that contains the account in case it is a local account (not * domain joined). - * + * * @return the hostEntityId value. */ public String hostEntityId() { @@ -82,7 +108,7 @@ public String hostEntityId() { /** * Get the isDomainJoined property: Determines whether this is a domain account. - * + * * @return the isDomainJoined value. */ public Boolean isDomainJoined() { @@ -92,7 +118,7 @@ public Boolean isDomainJoined() { /** * Get the ntDomain property: The NetBIOS domain name as it appears in the alert format domain/username. Examples: * NT AUTHORITY. - * + * * @return the ntDomain value. */ public String ntDomain() { @@ -102,7 +128,7 @@ public String ntDomain() { /** * Get the objectGuid property: The objectGUID attribute is a single-value attribute that is the unique identifier * for the object, assigned by active directory. - * + * * @return the objectGuid value. */ public UUID objectGuid() { @@ -111,7 +137,7 @@ public UUID objectGuid() { /** * Get the puid property: The Azure Active Directory Passport User ID. - * + * * @return the puid value. */ public String puid() { @@ -120,7 +146,7 @@ public String puid() { /** * Get the sid property: The account security identifier, e.g. S-1-5-18. - * + * * @return the sid value. */ public String sid() { @@ -130,7 +156,7 @@ public String sid() { /** * Get the upnSuffix property: The user principal name suffix for the account, in some cases it is also the domain * name. Examples: contoso.com. - * + * * @return the upnSuffix value. */ public String upnSuffix() { @@ -139,7 +165,7 @@ public String upnSuffix() { /** * Get the dnsDomain property: The fully qualified domain DNS name. - * + * * @return the dnsDomain value. */ public String dnsDomain() { @@ -149,7 +175,7 @@ public String dnsDomain() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -159,7 +185,7 @@ public Map 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() { @@ -168,7 +194,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Action.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Action.java new file mode 100644 index 000000000000..965def89f51b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Action.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.ActionInner; + +/** + * An immutable client-side representation of Action. + */ +public interface Action { + /** + * Gets the kind property: The actions kind. + * + * @return the kind value. + */ + ListActionKind kind(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ActionInner object. + * + * @return the inner object. + */ + ActionInner innerModel(); +} 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 385e767940bd..df63e3a34b30 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 @@ -8,20 +8,27 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Action property bag base. */ +/** + * Action property bag base. + */ @Fluent public class ActionPropertiesBase { /* - * Logic App Resource Id, - * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * Logic App Resource Id, /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. */ @JsonProperty(value = "logicAppResourceId", required = true) private String logicAppResourceId; + /** + * Creates an instance of ActionPropertiesBase class. + */ + public ActionPropertiesBase() { + } + /** * Get the logicAppResourceId property: Logic App Resource Id, * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. - * + * * @return the logicAppResourceId value. */ public String logicAppResourceId() { @@ -31,7 +38,7 @@ public String logicAppResourceId() { /** * Set the logicAppResourceId property: Logic App Resource Id, * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. - * + * * @param logicAppResourceId the logicAppResourceId value to set. * @return the ActionPropertiesBase object itself. */ @@ -42,15 +49,14 @@ public ActionPropertiesBase withLogicAppResourceId(String logicAppResourceId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (logicAppResourceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property logicAppResourceId in model ActionPropertiesBase")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property logicAppResourceId in model ActionPropertiesBase")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionRequest.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionRequest.java index ccc8692cff41..e1f36dfc9bef 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.securityinsights.fluent.models.ActionRequestProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** Action for alert rule. */ +/** + * Action for alert rule. + */ @Fluent public final class ActionRequest extends ResourceWithEtag { /* @@ -17,16 +19,24 @@ public final class ActionRequest extends ResourceWithEtag { @JsonProperty(value = "properties") private ActionRequestProperties innerProperties; + /** + * Creates an instance of ActionRequest class. + */ + public ActionRequest() { + } + /** * Get the innerProperties property: Action properties for put request. - * + * * @return the innerProperties value. */ private ActionRequestProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActionRequest withEtag(String etag) { super.withEtag(etag); @@ -35,7 +45,7 @@ public ActionRequest withEtag(String etag) { /** * Get the triggerUri property: Logic App Callback URL for this specific workflow. - * + * * @return the triggerUri value. */ public String triggerUri() { @@ -44,7 +54,7 @@ public String triggerUri() { /** * Set the triggerUri property: Logic App Callback URL for this specific workflow. - * + * * @param triggerUri the triggerUri value to set. * @return the ActionRequest object itself. */ @@ -59,7 +69,7 @@ public ActionRequest withTriggerUri(String triggerUri) { /** * Get the logicAppResourceId property: Logic App Resource Id, * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. - * + * * @return the logicAppResourceId value. */ public String logicAppResourceId() { @@ -69,7 +79,7 @@ public String logicAppResourceId() { /** * Set the logicAppResourceId property: Logic App Resource Id, * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. - * + * * @param logicAppResourceId the logicAppResourceId value to set. * @return the ActionRequest object itself. */ @@ -83,7 +93,7 @@ public ActionRequest withLogicAppResourceId(String logicAppResourceId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 3540eefe0690..13d67dcc7046 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 @@ -8,46 +8,48 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; -/** An immutable client-side representation of ActionResponse. */ +/** + * An immutable client-side representation of ActionResponse. + */ public interface ActionResponse { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the workflowId property: The name of the logic app's workflow. - * + * * @return the workflowId value. */ String workflowId(); @@ -55,39 +57,49 @@ public interface ActionResponse { /** * Gets the logicAppResourceId property: Logic App Resource Id, * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. - * + * * @return the logicAppResourceId value. */ String logicAppResourceId(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner object. - * + * * @return the inner object. */ ActionResponseInner innerModel(); - /** The entirety of the ActionResponse definition. */ + /** + * The entirety of the ActionResponse definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The ActionResponse definition stages. */ + + /** + * The ActionResponse definition stages. + */ interface DefinitionStages { - /** The first stage of the ActionResponse definition. */ + /** + * The first stage of the ActionResponse definition. + */ interface Blank extends WithParentResource { } - /** The stage of the ActionResponse definition allowing to specify parent resource. */ + + /** + * The stage of the ActionResponse definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName, ruleId. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -95,131 +107,154 @@ interface WithParentResource { */ WithCreate withExistingAlertRule(String resourceGroupName, String workspaceName, String ruleId); } + /** * The stage of the ActionResponse definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithEtag, - DefinitionStages.WithTriggerUri, - DefinitionStages.WithLogicAppResourceId { + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithTriggerUri, + DefinitionStages.WithLogicAppResourceId { /** * Executes the create request. - * + * * @return the created resource. */ ActionResponse create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ActionResponse create(Context context); } - /** The stage of the ActionResponse definition allowing to specify etag. */ + + /** + * The stage of the ActionResponse definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the ActionResponse definition allowing to specify triggerUri. */ + + /** + * The stage of the ActionResponse definition allowing to specify triggerUri. + */ interface WithTriggerUri { /** * Specifies the triggerUri property: Logic App Callback URL for this specific workflow.. - * + * * @param triggerUri Logic App Callback URL for this specific workflow. * @return the next definition stage. */ WithCreate withTriggerUri(String triggerUri); } - /** The stage of the ActionResponse definition allowing to specify logicAppResourceId. */ + + /** + * The stage of the ActionResponse definition allowing to specify logicAppResourceId. + */ interface WithLogicAppResourceId { /** * Specifies the logicAppResourceId property: Logic App Resource Id, * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.. - * + * * @param logicAppResourceId Logic App Resource Id, - * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. * @return the next definition stage. */ WithCreate withLogicAppResourceId(String logicAppResourceId); } } + /** * Begins update for the ActionResponse resource. - * + * * @return the stage of resource update. */ ActionResponse.Update update(); - /** The template for ActionResponse update. */ + /** + * The template for ActionResponse update. + */ interface Update extends UpdateStages.WithEtag, UpdateStages.WithTriggerUri, UpdateStages.WithLogicAppResourceId { /** * Executes the update request. - * + * * @return the updated resource. */ ActionResponse apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ActionResponse apply(Context context); } - /** The ActionResponse update stages. */ + + /** + * The ActionResponse update stages. + */ interface UpdateStages { - /** The stage of the ActionResponse update allowing to specify etag. */ + /** + * The stage of the ActionResponse update allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ Update withEtag(String etag); } - /** The stage of the ActionResponse update allowing to specify triggerUri. */ + + /** + * The stage of the ActionResponse update allowing to specify triggerUri. + */ interface WithTriggerUri { /** * Specifies the triggerUri property: Logic App Callback URL for this specific workflow.. - * + * * @param triggerUri Logic App Callback URL for this specific workflow. * @return the next definition stage. */ Update withTriggerUri(String triggerUri); } - /** The stage of the ActionResponse update allowing to specify logicAppResourceId. */ + + /** + * The stage of the ActionResponse update allowing to specify logicAppResourceId. + */ interface WithLogicAppResourceId { /** * Specifies the logicAppResourceId property: Logic App Resource Id, * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.. - * + * * @param logicAppResourceId Logic App Resource Id, - * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. + * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. * @return the next definition stage. */ Update withLogicAppResourceId(String logicAppResourceId); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ActionResponse refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ 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 9e8ad565443d..2f5b5ebe6e7b 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 @@ -8,17 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the automation rule action. */ +/** + * The type of the automation rule action. + */ public final class ActionType extends ExpandableStringEnum { - /** Static value ModifyProperties for ActionType. */ + /** + * Static value ModifyProperties for ActionType. + */ public static final ActionType MODIFY_PROPERTIES = fromString("ModifyProperties"); - /** Static value RunPlaybook for ActionType. */ + /** + * Static value RunPlaybook for ActionType. + */ public static final ActionType RUN_PLAYBOOK = fromString("RunPlaybook"); + /** + * Static value AddIncidentTask for ActionType. + */ + public static final ActionType ADD_INCIDENT_TASK = fromString("AddIncidentTask"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + /** * Creates or finds a ActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionType. */ @@ -29,7 +49,7 @@ public static ActionType fromString(String name) { /** * Gets known ActionType values. - * + * * @return known ActionType values. */ public static Collection values() { 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 97de0d03303b..534faa4366b0 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Actions. */ +/** + * Resource collection API of Actions. + */ public interface Actions { /** * Gets all actions of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -25,7 +27,7 @@ public interface Actions { /** * Gets all actions of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. @@ -35,71 +37,71 @@ public interface Actions { * @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}. */ - PagedIterable listByAlertRule( - String resourceGroupName, String workspaceName, String ruleId, Context context); + PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId, + Context context); /** * Gets the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return the action of alert rule along with {@link Response}. */ - ActionResponse get(String resourceGroupName, String workspaceName, String ruleId, String actionId); + Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, + String actionId, Context context); /** * Gets the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 action of alert rule. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String ruleId, String actionId, Context context); + ActionResponse get(String resourceGroupName, String workspaceName, String ruleId, String actionId); /** * Delete the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, String actionId, + Context context); /** * Delete the action of alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 ruleId, String actionId, Context context); + void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId); /** * Gets the action of alert rule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -110,7 +112,7 @@ Response deleteWithResponse( /** * Gets the action of alert rule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,7 +124,7 @@ Response deleteWithResponse( /** * Delete the action of alert rule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -132,7 +134,7 @@ Response deleteWithResponse( /** * Delete the action of alert rule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -144,7 +146,7 @@ Response deleteWithResponse( /** * Begins definition for a new ActionResponse resource. - * + * * @param name resource name. * @return the first stage of the new ActionResponse definition. */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionsList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionsList.java index 4f7ecdd353b9..5fa9e4f579b2 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/models/ActionsList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the actions. */ +/** + * List all the actions. + */ @Fluent public final class ActionsList { /* @@ -25,9 +27,15 @@ public final class ActionsList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of ActionsList class. + */ + public ActionsList() { + } + /** * Get the nextLink property: URL to fetch the next set of actions. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of actions. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of actions. - * + * * @param value the value value to set. * @return the ActionsList object itself. */ @@ -56,14 +64,13 @@ public ActionsList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ActionsList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ActionsList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityCustomEntityQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityCustomEntityQuery.java index e010a8c88c2a..c8ba46129d34 100644 --- 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 @@ -7,33 +7,65 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** Represents Activity entity query. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Activity entity query. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = ActivityCustomEntityQuery.class, + visible = true) @JsonTypeName("Activity") @Fluent public final class ActivityCustomEntityQuery extends CustomEntityQuery { + /* + * the entity query kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private CustomEntityQueryKind kind = CustomEntityQueryKind.ACTIVITY; + /* * Activity entity query properties */ @JsonProperty(value = "properties") private ActivityEntityQueriesProperties innerProperties; + /** + * 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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActivityCustomEntityQuery withEtag(String etag) { super.withEtag(etag); @@ -42,7 +74,7 @@ public ActivityCustomEntityQuery withEtag(String etag) { /** * Get the title property: The entity query title. - * + * * @return the title value. */ public String title() { @@ -51,7 +83,7 @@ public String title() { /** * Set the title property: The entity query title. - * + * * @param title the title value to set. * @return the ActivityCustomEntityQuery object itself. */ @@ -65,7 +97,7 @@ public ActivityCustomEntityQuery withTitle(String title) { /** * Get the content property: The entity query content to display in timeline. - * + * * @return the content value. */ public String content() { @@ -74,7 +106,7 @@ public String 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. */ @@ -88,7 +120,7 @@ public ActivityCustomEntityQuery withContent(String content) { /** * Get the description property: The entity query description. - * + * * @return the description value. */ public String description() { @@ -97,7 +129,7 @@ public String description() { /** * Set the description property: The entity query description. - * + * * @param description the description value to set. * @return the ActivityCustomEntityQuery object itself. */ @@ -111,7 +143,7 @@ public ActivityCustomEntityQuery withDescription(String description) { /** * Get the queryDefinitions property: The Activity query definitions. - * + * * @return the queryDefinitions value. */ public ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions() { @@ -120,12 +152,12 @@ public ActivityEntityQueriesPropertiesQueryDefinitions 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) { + public ActivityCustomEntityQuery + withQueryDefinitions(ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions) { if (this.innerProperties() == null) { this.innerProperties = new ActivityEntityQueriesProperties(); } @@ -135,7 +167,7 @@ public ActivityCustomEntityQuery withQueryDefinitions( /** * Get the inputEntityType property: The type of the query's source entity. - * + * * @return the inputEntityType value. */ public EntityType inputEntityType() { @@ -144,7 +176,7 @@ public EntityType 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. */ @@ -159,7 +191,7 @@ public ActivityCustomEntityQuery withInputEntityType(EntityType 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() { @@ -169,7 +201,7 @@ public List> 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. */ @@ -183,7 +215,7 @@ public ActivityCustomEntityQuery withRequiredInputFieldsSets(List> /** * Get the entitiesFilter property: The query applied only to entities matching to all filters. - * + * * @return the entitiesFilter value. */ public Map> entitiesFilter() { @@ -192,7 +224,7 @@ public Map> 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. */ @@ -206,7 +238,7 @@ public ActivityCustomEntityQuery withEntitiesFilter(Map> en /** * Get the templateName property: The template id this activity was created from. - * + * * @return the templateName value. */ public String templateName() { @@ -215,7 +247,7 @@ public String 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. */ @@ -229,7 +261,7 @@ public ActivityCustomEntityQuery withTemplateName(String templateName) { /** * Get the enabled property: Determines whether this activity is enabled or disabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -238,7 +270,7 @@ public Boolean 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. */ @@ -252,7 +284,7 @@ public ActivityCustomEntityQuery withEnabled(Boolean enabled) { /** * Get the createdTimeUtc property: The time the activity was created. - * + * * @return the createdTimeUtc value. */ public OffsetDateTime createdTimeUtc() { @@ -261,7 +293,7 @@ public OffsetDateTime createdTimeUtc() { /** * Get the lastModifiedTimeUtc property: The last time the activity was updated. - * + * * @return the lastModifiedTimeUtc value. */ public OffsetDateTime lastModifiedTimeUtc() { @@ -270,7 +302,7 @@ public OffsetDateTime lastModifiedTimeUtc() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 610d4eff8d46..f8481524c491 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Activity query definitions. */ +/** + * The Activity query definitions. + */ @Fluent public final class ActivityEntityQueriesPropertiesQueryDefinitions { /* @@ -16,9 +18,15 @@ public final class ActivityEntityQueriesPropertiesQueryDefinitions { @JsonProperty(value = "query") 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() { @@ -27,7 +35,7 @@ public String 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. */ @@ -38,7 +46,7 @@ public ActivityEntityQueriesPropertiesQueryDefinitions withQuery(String query) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQuery.java index 7aadce92dcd4..6c10d8c016c3 100644 --- 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 @@ -8,33 +8,61 @@ import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties; import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** Represents Activity entity query. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Activity entity query. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ActivityEntityQuery.class, visible = true) @JsonTypeName("Activity") @Fluent public final class ActivityEntityQuery extends EntityQueryInner { + /* + * the entity query kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityQueryKind kind = EntityQueryKind.ACTIVITY; + /* * Activity entity query properties */ @JsonProperty(value = "properties") private ActivityEntityQueriesProperties innerProperties; + /** + * Creates an instance of ActivityEntityQuery class. + */ + public ActivityEntityQuery() { + } + + /** + * Get the kind property: the entity query kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActivityEntityQuery withEtag(String etag) { super.withEtag(etag); @@ -43,7 +71,7 @@ public ActivityEntityQuery withEtag(String etag) { /** * Get the title property: The entity query title. - * + * * @return the title value. */ public String title() { @@ -52,7 +80,7 @@ public String title() { /** * Set the title property: The entity query title. - * + * * @param title the title value to set. * @return the ActivityEntityQuery object itself. */ @@ -66,7 +94,7 @@ public ActivityEntityQuery withTitle(String title) { /** * Get the content property: The entity query content to display in timeline. - * + * * @return the content value. */ public String content() { @@ -75,7 +103,7 @@ public String content() { /** * Set the content property: The entity query content to display in timeline. - * + * * @param content the content value to set. * @return the ActivityEntityQuery object itself. */ @@ -89,7 +117,7 @@ public ActivityEntityQuery withContent(String content) { /** * Get the description property: The entity query description. - * + * * @return the description value. */ public String description() { @@ -98,7 +126,7 @@ public String description() { /** * Set the description property: The entity query description. - * + * * @param description the description value to set. * @return the ActivityEntityQuery object itself. */ @@ -112,7 +140,7 @@ public ActivityEntityQuery withDescription(String description) { /** * Get the queryDefinitions property: The Activity query definitions. - * + * * @return the queryDefinitions value. */ public ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions() { @@ -121,7 +149,7 @@ public ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions() { /** * Set the queryDefinitions property: The Activity query definitions. - * + * * @param queryDefinitions the queryDefinitions value to set. * @return the ActivityEntityQuery object itself. */ @@ -135,7 +163,7 @@ public ActivityEntityQuery withQueryDefinitions(ActivityEntityQueriesPropertiesQ /** * Get the inputEntityType property: The type of the query's source entity. - * + * * @return the inputEntityType value. */ public EntityType inputEntityType() { @@ -144,7 +172,7 @@ public EntityType inputEntityType() { /** * Set the inputEntityType property: The type of the query's source entity. - * + * * @param inputEntityType the inputEntityType value to set. * @return the ActivityEntityQuery object itself. */ @@ -159,7 +187,7 @@ public ActivityEntityQuery withInputEntityType(EntityType 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() { @@ -169,7 +197,7 @@ public List> requiredInputFieldsSets() { /** * Set the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the * query. - * + * * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. * @return the ActivityEntityQuery object itself. */ @@ -183,7 +211,7 @@ public ActivityEntityQuery withRequiredInputFieldsSets(List> requir /** * Get the entitiesFilter property: The query applied only to entities matching to all filters. - * + * * @return the entitiesFilter value. */ public Map> entitiesFilter() { @@ -192,7 +220,7 @@ public Map> entitiesFilter() { /** * Set the entitiesFilter property: The query applied only to entities matching to all filters. - * + * * @param entitiesFilter the entitiesFilter value to set. * @return the ActivityEntityQuery object itself. */ @@ -206,7 +234,7 @@ public ActivityEntityQuery withEntitiesFilter(Map> entities /** * Get the templateName property: The template id this activity was created from. - * + * * @return the templateName value. */ public String templateName() { @@ -215,7 +243,7 @@ public String templateName() { /** * Set the templateName property: The template id this activity was created from. - * + * * @param templateName the templateName value to set. * @return the ActivityEntityQuery object itself. */ @@ -229,7 +257,7 @@ public ActivityEntityQuery withTemplateName(String templateName) { /** * Get the enabled property: Determines whether this activity is enabled or disabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -238,7 +266,7 @@ public Boolean enabled() { /** * Set the enabled property: Determines whether this activity is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the ActivityEntityQuery object itself. */ @@ -252,7 +280,7 @@ public ActivityEntityQuery withEnabled(Boolean enabled) { /** * Get the createdTimeUtc property: The time the activity was created. - * + * * @return the createdTimeUtc value. */ public OffsetDateTime createdTimeUtc() { @@ -261,7 +289,7 @@ public OffsetDateTime createdTimeUtc() { /** * Get the lastModifiedTimeUtc property: The last time the activity was updated. - * + * * @return the lastModifiedTimeUtc value. */ public OffsetDateTime lastModifiedTimeUtc() { @@ -270,7 +298,7 @@ public OffsetDateTime lastModifiedTimeUtc() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 9066b404574c..99134ef30e2e 100644 --- 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 @@ -8,25 +8,55 @@ import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueryTemplateProperties; import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; import java.util.Map; -/** Represents Activity entity query. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Activity entity query. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = ActivityEntityQueryTemplate.class, + visible = true) @JsonTypeName("Activity") @Fluent public final class ActivityEntityQueryTemplate extends EntityQueryTemplateInner { + /* + * the entity query template kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityQueryTemplateKind kind = EntityQueryTemplateKind.ACTIVITY; + /* * Activity entity query properties */ @JsonProperty(value = "properties") private ActivityEntityQueryTemplateProperties innerProperties; + /** + * Creates an instance of ActivityEntityQueryTemplate class. + */ + public ActivityEntityQueryTemplate() { + } + + /** + * Get the kind property: the entity query template kind. + * + * @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() { @@ -35,7 +65,7 @@ private ActivityEntityQueryTemplateProperties innerProperties() { /** * Get the title property: The entity query title. - * + * * @return the title value. */ public String title() { @@ -44,7 +74,7 @@ public String title() { /** * Set the title property: The entity query title. - * + * * @param title the title value to set. * @return the ActivityEntityQueryTemplate object itself. */ @@ -58,7 +88,7 @@ public ActivityEntityQueryTemplate withTitle(String title) { /** * Get the content property: The entity query content to display in timeline. - * + * * @return the content value. */ public String content() { @@ -67,7 +97,7 @@ public String content() { /** * Set the content property: The entity query content to display in timeline. - * + * * @param content the content value to set. * @return the ActivityEntityQueryTemplate object itself. */ @@ -81,7 +111,7 @@ public ActivityEntityQueryTemplate withContent(String content) { /** * Get the description property: The entity query description. - * + * * @return the description value. */ public String description() { @@ -90,7 +120,7 @@ public String description() { /** * Set the description property: The entity query description. - * + * * @param description the description value to set. * @return the ActivityEntityQueryTemplate object itself. */ @@ -104,7 +134,7 @@ public ActivityEntityQueryTemplate withDescription(String description) { /** * Get the queryDefinitions property: The Activity query definitions. - * + * * @return the queryDefinitions value. */ public ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions() { @@ -113,12 +143,12 @@ public ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions() /** * Set the queryDefinitions property: The Activity query definitions. - * + * * @param queryDefinitions the queryDefinitions value to set. * @return the ActivityEntityQueryTemplate object itself. */ - public ActivityEntityQueryTemplate withQueryDefinitions( - ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions) { + public ActivityEntityQueryTemplate + withQueryDefinitions(ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions) { if (this.innerProperties() == null) { this.innerProperties = new ActivityEntityQueryTemplateProperties(); } @@ -128,7 +158,7 @@ public ActivityEntityQueryTemplate withQueryDefinitions( /** * Get the dataTypes property: List of required data types for the given entity query template. - * + * * @return the dataTypes value. */ public List dataTypes() { @@ -137,7 +167,7 @@ public List dataTypes() { /** * Set the dataTypes property: List of required data types for the given entity query template. - * + * * @param dataTypes the dataTypes value to set. * @return the ActivityEntityQueryTemplate object itself. */ @@ -151,7 +181,7 @@ public ActivityEntityQueryTemplate withDataTypes(List dataT /** * Get the inputEntityType property: The type of the query's source entity. - * + * * @return the inputEntityType value. */ public EntityType inputEntityType() { @@ -160,7 +190,7 @@ public EntityType inputEntityType() { /** * Set the inputEntityType property: The type of the query's source entity. - * + * * @param inputEntityType the inputEntityType value to set. * @return the ActivityEntityQueryTemplate object itself. */ @@ -175,7 +205,7 @@ public ActivityEntityQueryTemplate withInputEntityType(EntityType inputEntityTyp /** * 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() { @@ -185,7 +215,7 @@ public List> requiredInputFieldsSets() { /** * Set the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the * query. - * + * * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. * @return the ActivityEntityQueryTemplate object itself. */ @@ -199,7 +229,7 @@ public ActivityEntityQueryTemplate withRequiredInputFieldsSets(List /** * Get the entitiesFilter property: The query applied only to entities matching to all filters. - * + * * @return the entitiesFilter value. */ public Map> entitiesFilter() { @@ -208,7 +238,7 @@ public Map> entitiesFilter() { /** * Set the entitiesFilter property: The query applied only to entities matching to all filters. - * + * * @param entitiesFilter the entitiesFilter value to set. * @return the ActivityEntityQueryTemplate object itself. */ @@ -222,7 +252,7 @@ public ActivityEntityQueryTemplate withEntitiesFilter(Map> /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 9a85f95ebfa3..1087609efd8d 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Activity query definitions. */ +/** + * The Activity query definitions. + */ @Fluent public final class ActivityEntityQueryTemplatePropertiesQueryDefinitions { /* @@ -22,9 +24,15 @@ public final class ActivityEntityQueryTemplatePropertiesQueryDefinitions { @JsonProperty(value = "summarizeBy") private String summarizeBy; + /** + * Creates an instance of ActivityEntityQueryTemplatePropertiesQueryDefinitions class. + */ + public ActivityEntityQueryTemplatePropertiesQueryDefinitions() { + } + /** * Get the query property: The Activity query to run on a given entity. - * + * * @return the query value. */ public String query() { @@ -33,7 +41,7 @@ public String query() { /** * Set the query property: The Activity query to run on a given entity. - * + * * @param query the query value to set. * @return the ActivityEntityQueryTemplatePropertiesQueryDefinitions object itself. */ @@ -45,7 +53,7 @@ public ActivityEntityQueryTemplatePropertiesQueryDefinitions withQuery(String qu /** * 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() { @@ -55,7 +63,7 @@ public String summarizeBy() { /** * Set the summarizeBy property: The dimensions we want to summarize the timeline results on, this is comma * separated list. - * + * * @param summarizeBy the summarizeBy value to set. * @return the ActivityEntityQueryTemplatePropertiesQueryDefinitions object itself. */ @@ -66,7 +74,7 @@ public ActivityEntityQueryTemplatePropertiesQueryDefinitions withSummarizeBy(Str /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityTimelineItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityTimelineItem.java index 1e6b52c71395..d1e1223e6554 100644 --- 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 @@ -7,15 +7,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; -/** Represents Activity timeline item. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Activity timeline item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ActivityTimelineItem.class, visible = true) @JsonTypeName("Activity") @Fluent public final class ActivityTimelineItem extends EntityTimelineItem { + /* + * The entity query kind type. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityTimelineKind kind = EntityTimelineKind.ACTIVITY; + /* * The activity query id. */ @@ -58,9 +68,25 @@ public final class ActivityTimelineItem extends EntityTimelineItem { @JsonProperty(value = "title", required = true) private String title; + /** + * Creates an instance of ActivityTimelineItem class. + */ + public 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() { @@ -69,7 +95,7 @@ public String queryId() { /** * Set the queryId property: The activity query id. - * + * * @param queryId the queryId value to set. * @return the ActivityTimelineItem object itself. */ @@ -80,7 +106,7 @@ public ActivityTimelineItem withQueryId(String queryId) { /** * Get the bucketStartTimeUtc property: The grouping bucket start time. - * + * * @return the bucketStartTimeUtc value. */ public OffsetDateTime bucketStartTimeUtc() { @@ -89,7 +115,7 @@ public OffsetDateTime bucketStartTimeUtc() { /** * Set the bucketStartTimeUtc property: The grouping bucket start time. - * + * * @param bucketStartTimeUtc the bucketStartTimeUtc value to set. * @return the ActivityTimelineItem object itself. */ @@ -100,7 +126,7 @@ public ActivityTimelineItem withBucketStartTimeUtc(OffsetDateTime bucketStartTim /** * Get the bucketEndTimeUtc property: The grouping bucket end time. - * + * * @return the bucketEndTimeUtc value. */ public OffsetDateTime bucketEndTimeUtc() { @@ -109,7 +135,7 @@ public OffsetDateTime bucketEndTimeUtc() { /** * Set the bucketEndTimeUtc property: The grouping bucket end time. - * + * * @param bucketEndTimeUtc the bucketEndTimeUtc value to set. * @return the ActivityTimelineItem object itself. */ @@ -120,7 +146,7 @@ public ActivityTimelineItem withBucketEndTimeUtc(OffsetDateTime bucketEndTimeUtc /** * Get the firstActivityTimeUtc property: The time of the first activity in the grouping bucket. - * + * * @return the firstActivityTimeUtc value. */ public OffsetDateTime firstActivityTimeUtc() { @@ -129,7 +155,7 @@ public OffsetDateTime firstActivityTimeUtc() { /** * Set the firstActivityTimeUtc property: The time of the first activity in the grouping bucket. - * + * * @param firstActivityTimeUtc the firstActivityTimeUtc value to set. * @return the ActivityTimelineItem object itself. */ @@ -140,7 +166,7 @@ public ActivityTimelineItem withFirstActivityTimeUtc(OffsetDateTime firstActivit /** * Get the lastActivityTimeUtc property: The time of the last activity in the grouping bucket. - * + * * @return the lastActivityTimeUtc value. */ public OffsetDateTime lastActivityTimeUtc() { @@ -149,7 +175,7 @@ public OffsetDateTime lastActivityTimeUtc() { /** * Set the lastActivityTimeUtc property: The time of the last activity in the grouping bucket. - * + * * @param lastActivityTimeUtc the lastActivityTimeUtc value to set. * @return the ActivityTimelineItem object itself. */ @@ -160,7 +186,7 @@ public ActivityTimelineItem withLastActivityTimeUtc(OffsetDateTime lastActivityT /** * Get the content property: The activity timeline content. - * + * * @return the content value. */ public String content() { @@ -169,7 +195,7 @@ public String content() { /** * Set the content property: The activity timeline content. - * + * * @param content the content value to set. * @return the ActivityTimelineItem object itself. */ @@ -180,7 +206,7 @@ public ActivityTimelineItem withContent(String content) { /** * Get the title property: The activity timeline title. - * + * * @return the title value. */ public String title() { @@ -189,7 +215,7 @@ public String title() { /** * Set the title property: The activity timeline title. - * + * * @param title the title value to set. * @return the ActivityTimelineItem object itself. */ @@ -200,50 +226,43 @@ public ActivityTimelineItem withTitle(String title) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (queryId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property queryId in model ActivityTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property queryId in model ActivityTimelineItem")); } if (bucketStartTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property bucketStartTimeUtc in model ActivityTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bucketStartTimeUtc in model ActivityTimelineItem")); } if (bucketEndTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property bucketEndTimeUtc in model ActivityTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bucketEndTimeUtc in model ActivityTimelineItem")); } if (firstActivityTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property firstActivityTimeUtc in model ActivityTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property firstActivityTimeUtc in model ActivityTimelineItem")); } if (lastActivityTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property lastActivityTimeUtc in model ActivityTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property lastActivityTimeUtc in model ActivityTimelineItem")); } if (content() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property content in model ActivityTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property content in model ActivityTimelineItem")); } if (title() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property title in model ActivityTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property title in model ActivityTimelineItem")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AddIncidentTaskActionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AddIncidentTaskActionProperties.java new file mode 100644 index 000000000000..8fd80be1fd99 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AddIncidentTaskActionProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AddIncidentTaskActionProperties model. + */ +@Fluent +public final class AddIncidentTaskActionProperties { + /* + * The title of the task. + */ + @JsonProperty(value = "title", required = true) + private String title; + + /* + * The description of the task. + */ + @JsonProperty(value = "description") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (title() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property title in model AddIncidentTaskActionProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AddIncidentTaskActionProperties.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AgentConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AgentConfiguration.java new file mode 100644 index 000000000000..68a1d33084f2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AgentConfiguration.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the configuration of a Business Application Agent. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = AgentConfiguration.class, visible = true) +@JsonTypeName("AgentConfiguration") +@JsonSubTypes({ @JsonSubTypes.Type(name = "SAP", value = SapAgentConfiguration.class) }) +@Immutable +public class AgentConfiguration { + /* + * Type of the agent + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private AgentType type; + + /** + * Creates an instance of AgentConfiguration class. + */ + public AgentConfiguration() { + this.type = AgentType.fromString("AgentConfiguration"); + } + + /** + * Get the type property: Type of the agent. + * + * @return the type value. + */ + public AgentType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AgentSystem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AgentSystem.java new file mode 100644 index 000000000000..1f1a313ea1f4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AgentSystem.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the configuration of a system inside the agent. + */ +@Fluent +public final class AgentSystem { + /* + * The systemResourceName property. + */ + @JsonProperty(value = "systemResourceName") + private String systemResourceName; + + /* + * The systemDisplayName property. + */ + @JsonProperty(value = "systemDisplayName") + private String systemDisplayName; + + /** + * Creates an instance of AgentSystem class. + */ + public AgentSystem() { + } + + /** + * Get the systemResourceName property: The systemResourceName property. + * + * @return the systemResourceName value. + */ + public String systemResourceName() { + return this.systemResourceName; + } + + /** + * Set the systemResourceName property: The systemResourceName property. + * + * @param systemResourceName the systemResourceName value to set. + * @return the AgentSystem object itself. + */ + public AgentSystem withSystemResourceName(String systemResourceName) { + this.systemResourceName = systemResourceName; + return this; + } + + /** + * Get the systemDisplayName property: The systemDisplayName property. + * + * @return the systemDisplayName value. + */ + public String systemDisplayName() { + return this.systemDisplayName; + } + + /** + * Set the systemDisplayName property: The systemDisplayName property. + * + * @param systemDisplayName the systemDisplayName value to set. + * @return the AgentSystem object itself. + */ + public AgentSystem withSystemDisplayName(String systemDisplayName) { + this.systemDisplayName = systemDisplayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AgentType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AgentType.java new file mode 100644 index 000000000000..3c1a461a4e66 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AgentType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of the agent. + */ +public final class AgentType extends ExpandableStringEnum { + /** + * Static value SAP for AgentType. + */ + public static final AgentType SAP = fromString("SAP"); + + /** + * Creates a new instance of AgentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentType() { + } + + /** + * Creates or finds a AgentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentType. + */ + @JsonCreator + public static AgentType fromString(String name) { + return fromString(name, AgentType.class); + } + + /** + * Gets known AgentType values. + * + * @return known AgentType values. + */ + public static Collection values() { + return values(AgentType.class); + } +} 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 eff4838eabd8..7407feb1425b 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Alert detail. */ +/** + * Alert detail. + */ public final class AlertDetail extends ExpandableStringEnum { - /** Static value DisplayName for AlertDetail. */ + /** + * Static value DisplayName for AlertDetail. + */ public static final AlertDetail DISPLAY_NAME = fromString("DisplayName"); - /** Static value Severity for AlertDetail. */ + /** + * Static value Severity for AlertDetail. + */ public static final AlertDetail SEVERITY = fromString("Severity"); + /** + * Creates a new instance of AlertDetail value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AlertDetail() { + } + /** * Creates or finds a AlertDetail from its string representation. - * + * * @param name a name to look for. * @return the corresponding AlertDetail. */ @@ -29,7 +44,7 @@ public static AlertDetail fromString(String name) { /** * Gets known AlertDetail values. - * + * * @return known AlertDetail values. */ public static Collection values() { 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 6abe8f54b47d..c55e84fa41e1 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 @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; -/** Settings for how to dynamically override alert static details. */ +/** + * Settings for how to dynamically override alert static details. + */ @Fluent public final class AlertDetailsOverride { /* @@ -34,9 +37,21 @@ public final class AlertDetailsOverride { @JsonProperty(value = "alertSeverityColumnName") private String alertSeverityColumnName; + /* + * List of additional dynamic properties to override + */ + @JsonProperty(value = "alertDynamicProperties") + private List alertDynamicProperties; + + /** + * Creates an instance of AlertDetailsOverride class. + */ + public AlertDetailsOverride() { + } + /** * Get the alertDisplayNameFormat property: the format containing columns name(s) to override the alert name. - * + * * @return the alertDisplayNameFormat value. */ public String alertDisplayNameFormat() { @@ -45,7 +60,7 @@ public String alertDisplayNameFormat() { /** * Set the alertDisplayNameFormat property: the format containing columns name(s) to override the alert name. - * + * * @param alertDisplayNameFormat the alertDisplayNameFormat value to set. * @return the AlertDetailsOverride object itself. */ @@ -56,7 +71,7 @@ public AlertDetailsOverride withAlertDisplayNameFormat(String alertDisplayNameFo /** * Get the alertDescriptionFormat property: the format containing columns name(s) to override the alert description. - * + * * @return the alertDescriptionFormat value. */ public String alertDescriptionFormat() { @@ -65,7 +80,7 @@ public String alertDescriptionFormat() { /** * Set the alertDescriptionFormat property: the format containing columns name(s) to override the alert description. - * + * * @param alertDescriptionFormat the alertDescriptionFormat value to set. * @return the AlertDetailsOverride object itself. */ @@ -76,7 +91,7 @@ public AlertDetailsOverride withAlertDescriptionFormat(String alertDescriptionFo /** * Get the alertTacticsColumnName property: the column name to take the alert tactics from. - * + * * @return the alertTacticsColumnName value. */ public String alertTacticsColumnName() { @@ -85,7 +100,7 @@ public String alertTacticsColumnName() { /** * Set the alertTacticsColumnName property: the column name to take the alert tactics from. - * + * * @param alertTacticsColumnName the alertTacticsColumnName value to set. * @return the AlertDetailsOverride object itself. */ @@ -96,7 +111,7 @@ public AlertDetailsOverride withAlertTacticsColumnName(String alertTacticsColumn /** * Get the alertSeverityColumnName property: the column name to take the alert severity from. - * + * * @return the alertSeverityColumnName value. */ public String alertSeverityColumnName() { @@ -105,7 +120,7 @@ public String alertSeverityColumnName() { /** * Set the alertSeverityColumnName property: the column name to take the alert severity from. - * + * * @param alertSeverityColumnName the alertSeverityColumnName value to set. * @return the AlertDetailsOverride object itself. */ @@ -114,11 +129,34 @@ public AlertDetailsOverride withAlertSeverityColumnName(String alertSeverityColu return this; } + /** + * 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. + * + * @param alertDynamicProperties the alertDynamicProperties value to set. + * @return the AlertDetailsOverride object itself. + */ + public AlertDetailsOverride withAlertDynamicProperties(List alertDynamicProperties) { + this.alertDynamicProperties = alertDynamicProperties; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (alertDynamicProperties() != null) { + alertDynamicProperties().forEach(e -> e.validate()); + } } } 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..f516bd9b963b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertProperty.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The V3 alert property. + */ +public final class AlertProperty extends ExpandableStringEnum { + /** + * Static value AlertLink for AlertProperty. + */ + public static final AlertProperty ALERT_LINK = fromString("AlertLink"); + + /** + * Static value ConfidenceLevel for AlertProperty. + */ + public static final AlertProperty CONFIDENCE_LEVEL = fromString("ConfidenceLevel"); + + /** + * Static value ConfidenceScore for AlertProperty. + */ + public static final AlertProperty CONFIDENCE_SCORE = fromString("ConfidenceScore"); + + /** + * Static value ExtendedLinks for AlertProperty. + */ + public static final AlertProperty EXTENDED_LINKS = fromString("ExtendedLinks"); + + /** + * Static value ProductName for AlertProperty. + */ + public static final AlertProperty PRODUCT_NAME = fromString("ProductName"); + + /** + * Static value ProviderName for AlertProperty. + */ + public static final AlertProperty PROVIDER_NAME = fromString("ProviderName"); + + /** + * Static value ProductComponentName for AlertProperty. + */ + public static final AlertProperty PRODUCT_COMPONENT_NAME = fromString("ProductComponentName"); + + /** + * Static value RemediationSteps for AlertProperty. + */ + public static final AlertProperty REMEDIATION_STEPS = fromString("RemediationSteps"); + + /** + * Static value Techniques for AlertProperty. + */ + public static final AlertProperty TECHNIQUES = fromString("Techniques"); + + /** + * Static value SubTechniques for AlertProperty. + */ + 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. + */ + @JsonCreator + 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..7ddc388f2869 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertPropertyMapping.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single alert property mapping to override. + */ +@Fluent +public final class AlertPropertyMapping { + /* + * The V3 alert property + */ + @JsonProperty(value = "alertProperty") + private AlertProperty alertProperty; + + /* + * the column name to use to override this property + */ + @JsonProperty(value = "value") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRule.java index 7b9839a7561f..9462aef62741 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 @@ -7,46 +7,55 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; -/** An immutable client-side representation of AlertRule. */ +/** + * An immutable client-side representation of AlertRule. + */ public interface AlertRule { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + AlertRuleKind kind(); + /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner object. - * + * * @return the inner object. */ AlertRuleInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleKind.java index fb0c0d7f86b2..6d7c0cf9ee3d 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 @@ -8,30 +8,53 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of the alert rule. */ +/** + * The kind of the alert rule. + */ public final class AlertRuleKind extends ExpandableStringEnum { - /** Static value Scheduled for AlertRuleKind. */ + /** + * Static value Scheduled for AlertRuleKind. + */ public static final AlertRuleKind SCHEDULED = fromString("Scheduled"); - /** Static value MicrosoftSecurityIncidentCreation for AlertRuleKind. */ - public static final AlertRuleKind MICROSOFT_SECURITY_INCIDENT_CREATION = - fromString("MicrosoftSecurityIncidentCreation"); + /** + * Static value MicrosoftSecurityIncidentCreation for AlertRuleKind. + */ + public static final AlertRuleKind MICROSOFT_SECURITY_INCIDENT_CREATION + = fromString("MicrosoftSecurityIncidentCreation"); - /** Static value Fusion for AlertRuleKind. */ + /** + * Static value Fusion for AlertRuleKind. + */ public static final AlertRuleKind FUSION = fromString("Fusion"); - /** Static value MLBehaviorAnalytics for AlertRuleKind. */ + /** + * Static value MLBehaviorAnalytics for AlertRuleKind. + */ public static final AlertRuleKind MLBEHAVIOR_ANALYTICS = fromString("MLBehaviorAnalytics"); - /** Static value ThreatIntelligence for AlertRuleKind. */ + /** + * Static value ThreatIntelligence for AlertRuleKind. + */ public static final AlertRuleKind THREAT_INTELLIGENCE = fromString("ThreatIntelligence"); - /** Static value NRT for AlertRuleKind. */ + /** + * Static value NRT for AlertRuleKind. + */ public static final AlertRuleKind NRT = fromString("NRT"); + /** + * Creates a new instance of AlertRuleKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AlertRuleKind() { + } + /** * Creates or finds a AlertRuleKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding AlertRuleKind. */ @@ -42,7 +65,7 @@ public static AlertRuleKind fromString(String name) { /** * Gets known AlertRuleKind values. - * + * * @return known AlertRuleKind values. */ public static Collection values() { 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..f76b9fcfc740 --- /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) AutoRest 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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The Analytics Rule Run Trigger parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + 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 247c2492e403..3744e8327dea 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 @@ -7,39 +7,48 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; -/** An immutable client-side representation of AlertRuleTemplate. */ +/** + * An immutable client-side representation of AlertRuleTemplate. + */ public interface AlertRuleTemplate { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); + /** + * Gets the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + AlertRuleKind 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.AlertRuleTemplateInner object. - * + * * @return the inner object. */ AlertRuleTemplateInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateDataSource.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateDataSource.java index a8705467713b..73ee0dc69bc0 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** alert rule template data sources. */ +/** + * alert rule template data sources. + */ @Fluent public final class AlertRuleTemplateDataSource { /* @@ -23,9 +25,15 @@ public final class AlertRuleTemplateDataSource { @JsonProperty(value = "dataTypes") private List dataTypes; + /** + * Creates an instance of AlertRuleTemplateDataSource class. + */ + public AlertRuleTemplateDataSource() { + } + /** * Get the connectorId property: The connector id that provides the following data types. - * + * * @return the connectorId value. */ public String connectorId() { @@ -34,7 +42,7 @@ public String connectorId() { /** * Set the connectorId property: The connector id that provides the following data types. - * + * * @param connectorId the connectorId value to set. * @return the AlertRuleTemplateDataSource object itself. */ @@ -45,7 +53,7 @@ public AlertRuleTemplateDataSource withConnectorId(String connectorId) { /** * Get the dataTypes property: The data types used by the alert rule template. - * + * * @return the dataTypes value. */ public List dataTypes() { @@ -54,7 +62,7 @@ public List 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. */ @@ -65,7 +73,7 @@ public AlertRuleTemplateDataSource withDataTypes(List dataTypes) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatePropertiesBase.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatePropertiesBase.java index 9ec04325df71..8937aa7bd4d5 100644 --- 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 @@ -9,7 +9,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Base alert rule template property bag. */ +/** + * Base alert rule template property bag. + */ @Fluent public class AlertRuleTemplatePropertiesBase { /* @@ -54,9 +56,15 @@ public class AlertRuleTemplatePropertiesBase { @JsonProperty(value = "status") private TemplateStatus status; + /** + * Creates an instance of AlertRuleTemplatePropertiesBase class. + */ + public AlertRuleTemplatePropertiesBase() { + } + /** * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @return the alertRulesCreatedByTemplateCount value. */ public Integer alertRulesCreatedByTemplateCount() { @@ -65,19 +73,19 @@ public Integer alertRulesCreatedByTemplateCount() { /** * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. * @return the AlertRuleTemplatePropertiesBase object itself. */ - public AlertRuleTemplatePropertiesBase withAlertRulesCreatedByTemplateCount( - Integer alertRulesCreatedByTemplateCount) { + public AlertRuleTemplatePropertiesBase + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { this.alertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; return this; } /** * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. - * + * * @return the lastUpdatedDateUtc value. */ public OffsetDateTime lastUpdatedDateUtc() { @@ -86,7 +94,7 @@ public OffsetDateTime lastUpdatedDateUtc() { /** * Get the createdDateUtc property: The time that this alert rule template has been added. - * + * * @return the createdDateUtc value. */ public OffsetDateTime createdDateUtc() { @@ -95,7 +103,7 @@ public OffsetDateTime createdDateUtc() { /** * Get the description property: The description of the alert rule template. - * + * * @return the description value. */ public String description() { @@ -104,7 +112,7 @@ public String description() { /** * Set the description property: The description of the alert rule template. - * + * * @param description the description value to set. * @return the AlertRuleTemplatePropertiesBase object itself. */ @@ -115,7 +123,7 @@ public AlertRuleTemplatePropertiesBase withDescription(String description) { /** * Get the displayName property: The display name for alert rule template. - * + * * @return the displayName value. */ public String displayName() { @@ -124,7 +132,7 @@ public String displayName() { /** * Set the displayName property: The display name for alert rule template. - * + * * @param displayName the displayName value to set. * @return the AlertRuleTemplatePropertiesBase object itself. */ @@ -135,7 +143,7 @@ public AlertRuleTemplatePropertiesBase withDisplayName(String displayName) { /** * Get the requiredDataConnectors property: The required data sources for this template. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -144,19 +152,19 @@ public List requiredDataConnectors() { /** * Set the requiredDataConnectors property: The required data sources for this template. - * + * * @param requiredDataConnectors the requiredDataConnectors value to set. * @return the AlertRuleTemplatePropertiesBase object itself. */ - public AlertRuleTemplatePropertiesBase withRequiredDataConnectors( - List requiredDataConnectors) { + public AlertRuleTemplatePropertiesBase + withRequiredDataConnectors(List requiredDataConnectors) { this.requiredDataConnectors = requiredDataConnectors; return this; } /** * Get the status property: The alert rule template status. - * + * * @return the status value. */ public TemplateStatus status() { @@ -165,7 +173,7 @@ public TemplateStatus status() { /** * Set the status property: The alert rule template status. - * + * * @param status the status value to set. * @return the AlertRuleTemplatePropertiesBase object itself. */ @@ -176,7 +184,7 @@ public AlertRuleTemplatePropertiesBase withStatus(TemplateStatus status) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateWithMitreProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateWithMitreProperties.java index 7ab1567de6d3..359fd919917c 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Alert rule template with MITRE property bag. */ +/** + * Alert rule template with MITRE property bag. + */ @Fluent public class AlertRuleTemplateWithMitreProperties extends AlertRuleTemplatePropertiesBase { /* @@ -23,9 +25,15 @@ public class AlertRuleTemplateWithMitreProperties extends AlertRuleTemplatePrope @JsonProperty(value = "techniques") private List techniques; + /** + * Creates an instance of AlertRuleTemplateWithMitreProperties class. + */ + public AlertRuleTemplateWithMitreProperties() { + } + /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -34,7 +42,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the alert rule. - * + * * @param tactics the tactics value to set. * @return the AlertRuleTemplateWithMitreProperties object itself. */ @@ -45,7 +53,7 @@ public AlertRuleTemplateWithMitreProperties withTactics(List tacti /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -54,7 +62,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the AlertRuleTemplateWithMitreProperties object itself. */ @@ -63,37 +71,47 @@ public AlertRuleTemplateWithMitreProperties withTechniques(List techniqu return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public AlertRuleTemplateWithMitreProperties withAlertRulesCreatedByTemplateCount( - Integer alertRulesCreatedByTemplateCount) { + public AlertRuleTemplateWithMitreProperties + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { super.withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AlertRuleTemplateWithMitreProperties withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AlertRuleTemplateWithMitreProperties withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public AlertRuleTemplateWithMitreProperties withRequiredDataConnectors( - List requiredDataConnectors) { + public AlertRuleTemplateWithMitreProperties + withRequiredDataConnectors(List requiredDataConnectors) { super.withRequiredDataConnectors(requiredDataConnectors); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AlertRuleTemplateWithMitreProperties withStatus(TemplateStatus status) { super.withStatus(status); @@ -102,7 +120,7 @@ public AlertRuleTemplateWithMitreProperties withStatus(TemplateStatus status) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 6c1e23964aae..83a51918b249 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AlertRuleTemplates. */ +/** + * Resource collection API of AlertRuleTemplates. + */ public interface AlertRuleTemplates { /** * Gets all alert rule templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface AlertRuleTemplates { /** * Gets all alert rule templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -37,29 +39,29 @@ public interface AlertRuleTemplates { /** * Gets the alert rule template. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param alertRuleTemplateId Alert rule template ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule template. + * @return the alert rule template along with {@link Response}. */ - AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); + Response getWithResponse(String resourceGroupName, String workspaceName, + String alertRuleTemplateId, Context context); /** * Gets the alert rule template. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param alertRuleTemplateId Alert rule template ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 the alert rule template. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String alertRuleTemplateId, Context context); + AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatesList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatesList.java index 8292bf9e3852..9d6698e26c7e 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/models/AlertRuleTemplatesList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the alert rule templates. */ +/** + * List all the alert rule templates. + */ @Fluent public final class AlertRuleTemplatesList { /* @@ -25,9 +27,15 @@ public final class AlertRuleTemplatesList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of AlertRuleTemplatesList class. + */ + public AlertRuleTemplatesList() { + } + /** * Get the nextLink property: URL to fetch the next set of alert rule templates. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of alert rule templates. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of alert rule templates. - * + * * @param value the value value to set. * @return the AlertRuleTemplatesList object itself. */ @@ -56,14 +64,13 @@ public AlertRuleTemplatesList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AlertRuleTemplatesList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AlertRuleTemplatesList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRules.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRules.java index 4ce770f0de66..19061f989059 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 @@ -9,11 +9,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; -/** Resource collection API of AlertRules. */ +/** + * 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. @@ -25,7 +27,7 @@ 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. * @param context The context to associate with this operation. @@ -38,84 +40,84 @@ 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 ruleId Alert rule ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the alert rule. + * @return the alert rule along with {@link Response}. */ - AlertRule get(String resourceGroupName, String workspaceName, String ruleId); + Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, Context context); /** * Gets the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the alert rule. */ - Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, Context context); + AlertRule get(String resourceGroupName, String workspaceName, String ruleId); /** * Creates or updates the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return alert rule. + * @return alert rule along with {@link Response}. */ - AlertRule createOrUpdate(String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String ruleId, + AlertRuleInner alertRule, Context context); /** * Creates or updates the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return alert rule. */ - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule, Context context); + AlertRule createOrUpdate(String resourceGroupName, String workspaceName, String ruleId, AlertRuleInner alertRule); /** * Delete the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String ruleId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, Context context); /** * Delete the alert rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param ruleId Alert rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 ruleId, Context context); + void delete(String resourceGroupName, String workspaceName, String ruleId); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRulesList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRulesList.java index c758bd659a27..00b9fe9a58b9 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/models/AlertRulesList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the alert rules. */ +/** + * List all the alert rules. + */ @Fluent public final class AlertRulesList { /* @@ -25,9 +27,15 @@ public final class AlertRulesList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of AlertRulesList class. + */ + public AlertRulesList() { + } + /** * Get the nextLink property: URL to fetch the next set of alert rules. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of alert rules. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of alert rules. - * + * * @param value the value value to set. * @return the AlertRulesList object itself. */ @@ -56,14 +64,13 @@ public AlertRulesList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AlertRulesList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AlertRulesList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertSeverity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertSeverity.java index 4c140f2d9b58..4ce82a75195e 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The severity of the alert. */ +/** + * The severity of the alert. + */ public final class AlertSeverity extends ExpandableStringEnum { - /** Static value High for AlertSeverity. */ + /** + * Static value High for AlertSeverity. + */ public static final AlertSeverity HIGH = fromString("High"); - /** Static value Medium for AlertSeverity. */ + /** + * Static value Medium for AlertSeverity. + */ public static final AlertSeverity MEDIUM = fromString("Medium"); - /** Static value Low for AlertSeverity. */ + /** + * Static value Low for AlertSeverity. + */ public static final AlertSeverity LOW = fromString("Low"); - /** Static value Informational for AlertSeverity. */ + /** + * Static value Informational for AlertSeverity. + */ public static final AlertSeverity INFORMATIONAL = fromString("Informational"); + /** + * Creates a new instance of AlertSeverity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AlertSeverity() { + } + /** * Creates or finds a AlertSeverity from its string representation. - * + * * @param name a name to look for. * @return the corresponding AlertSeverity. */ @@ -35,7 +54,7 @@ public static AlertSeverity fromString(String name) { /** * Gets known AlertSeverity values. - * + * * @return known AlertSeverity values. */ public static Collection values() { 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 db728892d6f1..d53bd2e79fa4 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 @@ -8,26 +8,47 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The lifecycle status of the alert. */ +/** + * The lifecycle status of the alert. + */ public final class AlertStatus extends ExpandableStringEnum { - /** Static value Unknown for AlertStatus. */ + /** + * Static value Unknown for AlertStatus. + */ public static final AlertStatus UNKNOWN = fromString("Unknown"); - /** Static value New for AlertStatus. */ + /** + * Static value New for AlertStatus. + */ public static final AlertStatus NEW = fromString("New"); - /** Static value Resolved for AlertStatus. */ + /** + * Static value Resolved for AlertStatus. + */ public static final AlertStatus RESOLVED = fromString("Resolved"); - /** Static value Dismissed for AlertStatus. */ + /** + * Static value Dismissed for AlertStatus. + */ public static final AlertStatus DISMISSED = fromString("Dismissed"); - /** Static value InProgress for AlertStatus. */ + /** + * Static value InProgress for AlertStatus. + */ public static final AlertStatus IN_PROGRESS = fromString("InProgress"); + /** + * Creates a new instance of AlertStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AlertStatus() { + } + /** * Creates or finds a AlertStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding AlertStatus. */ @@ -38,7 +59,7 @@ public static AlertStatus fromString(String name) { /** * Gets known AlertStatus values. - * + * * @return known AlertStatus values. */ public static Collection values() { 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 2b9ea1a54378..62ae95688523 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Alerts data type for data connectors. */ +/** + * Alerts data type for data connectors. + */ @Fluent public class AlertsDataTypeOfDataConnector { /* @@ -17,9 +19,15 @@ public class AlertsDataTypeOfDataConnector { @JsonProperty(value = "alerts", required = true) private DataConnectorDataTypeCommon alerts; + /** + * Creates an instance of AlertsDataTypeOfDataConnector class. + */ + public AlertsDataTypeOfDataConnector() { + } + /** * Get the alerts property: Alerts data type connection. - * + * * @return the alerts value. */ public DataConnectorDataTypeCommon alerts() { @@ -28,7 +36,7 @@ public DataConnectorDataTypeCommon alerts() { /** * Set the alerts property: Alerts data type connection. - * + * * @param alerts the alerts value to set. * @return the AlertsDataTypeOfDataConnector object itself. */ @@ -39,15 +47,14 @@ public AlertsDataTypeOfDataConnector withAlerts(DataConnectorDataTypeCommon aler /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (alerts() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alerts in model AlertsDataTypeOfDataConnector")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property alerts in model AlertsDataTypeOfDataConnector")); } else { alerts().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnalyticsRuleRunTrigger.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnalyticsRuleRunTrigger.java new file mode 100644 index 000000000000..ad750afd830f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnalyticsRuleRunTrigger.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.AnalyticsRuleRunTriggerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Analytics Rule Run Trigger request. + */ +@Fluent +public final class AnalyticsRuleRunTrigger { + /* + * The analytics Rule Run Trigger request + */ + @JsonProperty(value = "properties", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model AnalyticsRuleRunTrigger")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AnalyticsRuleRunTrigger.class); +} 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 index a06d6aea9018..aa64a7343c00 100644 --- 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AnomaliesSettingsProperties; import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Settings with single toggle. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Settings with single toggle. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = Anomalies.class, visible = true) @JsonTypeName("Anomalies") @Fluent public final class Anomalies extends SettingsInner { + /* + * The kind of the setting + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private SettingKind kind = SettingKind.ANOMALIES; + /* * Anomalies properties */ @JsonProperty(value = "properties") private AnomaliesSettingsProperties innerProperties; + /** + * Creates an instance of Anomalies class. + */ + public Anomalies() { + } + + /** + * Get the kind property: The kind of the setting. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Anomalies withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public Anomalies withEtag(String etag) { /** * Get the isEnabled property: Determines whether the setting is enable or disabled. - * + * * @return the isEnabled value. */ public Boolean isEnabled() { @@ -49,7 +77,7 @@ public Boolean isEnabled() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 3a67f21d0c14..98a6cd3153b4 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 @@ -8,6 +8,7 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AnomalySecurityMLAnalyticsSettingsProperties; import com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; @@ -15,27 +16,58 @@ import java.util.List; import java.util.UUID; -/** Represents Anomaly Security ML Analytics Settings. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Anomaly Security ML Analytics Settings. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = AnomalySecurityMLAnalyticsSettings.class, + visible = true) @JsonTypeName("Anomaly") @Fluent public final class AnomalySecurityMLAnalyticsSettings extends SecurityMLAnalyticsSettingInner { + /* + * The kind of security ML Analytics Settings + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private SecurityMLAnalyticsSettingsKind kind = SecurityMLAnalyticsSettingsKind.ANOMALY; + /* * Anomaly Security ML Analytics Settings properties */ @JsonProperty(value = "properties") private AnomalySecurityMLAnalyticsSettingsProperties innerProperties; + /** + * Creates an instance of AnomalySecurityMLAnalyticsSettings class. + */ + public AnomalySecurityMLAnalyticsSettings() { + } + + /** + * Get the kind property: The kind of security ML Analytics Settings. + * + * @return the kind value. + */ + @Override + public SecurityMLAnalyticsSettingsKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Anomaly Security ML Analytics Settings properties. - * + * * @return the innerProperties value. */ private AnomalySecurityMLAnalyticsSettingsProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AnomalySecurityMLAnalyticsSettings withEtag(String etag) { super.withEtag(etag); @@ -44,7 +76,7 @@ public AnomalySecurityMLAnalyticsSettings withEtag(String etag) { /** * Get the description property: The description of the SecurityMLAnalyticsSettings. - * + * * @return the description value. */ public String description() { @@ -53,7 +85,7 @@ public String description() { /** * Set the description property: The description of the SecurityMLAnalyticsSettings. - * + * * @param description the description value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -67,7 +99,7 @@ public AnomalySecurityMLAnalyticsSettings withDescription(String description) { /** * Get the displayName property: The display name for settings created by this SecurityMLAnalyticsSettings. - * + * * @return the displayName value. */ public String displayName() { @@ -76,7 +108,7 @@ public String displayName() { /** * Set the displayName property: The display name for settings created by this SecurityMLAnalyticsSettings. - * + * * @param displayName the displayName value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -90,7 +122,7 @@ public AnomalySecurityMLAnalyticsSettings withDisplayName(String displayName) { /** * Get the enabled property: Determines whether this settings is enabled or disabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -99,7 +131,7 @@ public Boolean enabled() { /** * Set the enabled property: Determines whether this settings is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -113,7 +145,7 @@ public AnomalySecurityMLAnalyticsSettings withEnabled(Boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this SecurityMLAnalyticsSettings has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -122,7 +154,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the requiredDataConnectors property: The required data sources for this SecurityMLAnalyticsSettings. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -131,12 +163,12 @@ public List requiredDataConnectors() { /** * Set the requiredDataConnectors property: The required data sources for this SecurityMLAnalyticsSettings. - * + * * @param requiredDataConnectors the requiredDataConnectors value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ - public AnomalySecurityMLAnalyticsSettings withRequiredDataConnectors( - List requiredDataConnectors) { + public AnomalySecurityMLAnalyticsSettings + withRequiredDataConnectors(List requiredDataConnectors) { if (this.innerProperties() == null) { this.innerProperties = new AnomalySecurityMLAnalyticsSettingsProperties(); } @@ -146,7 +178,7 @@ public AnomalySecurityMLAnalyticsSettings withRequiredDataConnectors( /** * Get the tactics property: The tactics of the SecurityMLAnalyticsSettings. - * + * * @return the tactics value. */ public List tactics() { @@ -155,7 +187,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the SecurityMLAnalyticsSettings. - * + * * @param tactics the tactics value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -169,7 +201,7 @@ public AnomalySecurityMLAnalyticsSettings withTactics(List tactics /** * Get the techniques property: The techniques of the SecurityMLAnalyticsSettings. - * + * * @return the techniques value. */ public List techniques() { @@ -178,7 +210,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the SecurityMLAnalyticsSettings. - * + * * @param techniques the techniques value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -192,7 +224,7 @@ public AnomalySecurityMLAnalyticsSettings withTechniques(List techniques /** * Get the anomalyVersion property: The anomaly version of the AnomalySecurityMLAnalyticsSettings. - * + * * @return the anomalyVersion value. */ public String anomalyVersion() { @@ -201,7 +233,7 @@ public String anomalyVersion() { /** * Set the anomalyVersion property: The anomaly version of the AnomalySecurityMLAnalyticsSettings. - * + * * @param anomalyVersion the anomalyVersion value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -216,7 +248,7 @@ public AnomalySecurityMLAnalyticsSettings withAnomalyVersion(String anomalyVersi /** * Get the customizableObservations property: The customizable observations of the * AnomalySecurityMLAnalyticsSettings. - * + * * @return the customizableObservations value. */ public Object customizableObservations() { @@ -226,7 +258,7 @@ public Object customizableObservations() { /** * Set the customizableObservations property: The customizable observations of the * AnomalySecurityMLAnalyticsSettings. - * + * * @param customizableObservations the customizableObservations value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -240,7 +272,7 @@ public AnomalySecurityMLAnalyticsSettings withCustomizableObservations(Object cu /** * Get the frequency property: The frequency that this SecurityMLAnalyticsSettings will be run. - * + * * @return the frequency value. */ public Duration frequency() { @@ -249,7 +281,7 @@ public Duration frequency() { /** * Set the frequency property: The frequency that this SecurityMLAnalyticsSettings will be run. - * + * * @param frequency the frequency value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -263,7 +295,7 @@ public AnomalySecurityMLAnalyticsSettings withFrequency(Duration frequency) { /** * Get the settingsStatus property: The anomaly SecurityMLAnalyticsSettings status. - * + * * @return the settingsStatus value. */ public SettingsStatus settingsStatus() { @@ -272,7 +304,7 @@ public SettingsStatus settingsStatus() { /** * Set the settingsStatus property: The anomaly SecurityMLAnalyticsSettings status. - * + * * @param settingsStatus the settingsStatus value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -287,7 +319,7 @@ public AnomalySecurityMLAnalyticsSettings withSettingsStatus(SettingsStatus sett /** * Get the isDefaultSettings property: Determines whether this anomaly security ml analytics settings is a default * settings. - * + * * @return the isDefaultSettings value. */ public Boolean isDefaultSettings() { @@ -297,7 +329,7 @@ public Boolean isDefaultSettings() { /** * Set the isDefaultSettings property: Determines whether this anomaly security ml analytics settings is a default * settings. - * + * * @param isDefaultSettings the isDefaultSettings value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -312,7 +344,7 @@ public AnomalySecurityMLAnalyticsSettings withIsDefaultSettings(Boolean isDefaul /** * Get the anomalySettingsVersion property: The anomaly settings version of the Anomaly security ml analytics * settings that dictates whether job version gets updated or not. - * + * * @return the anomalySettingsVersion value. */ public Integer anomalySettingsVersion() { @@ -322,7 +354,7 @@ public Integer anomalySettingsVersion() { /** * Set the anomalySettingsVersion property: The anomaly settings version of the Anomaly security ml analytics * settings that dictates whether job version gets updated or not. - * + * * @param anomalySettingsVersion the anomalySettingsVersion value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -336,7 +368,7 @@ public AnomalySecurityMLAnalyticsSettings withAnomalySettingsVersion(Integer ano /** * Get the settingsDefinitionId property: The anomaly settings definition Id. - * + * * @return the settingsDefinitionId value. */ public UUID settingsDefinitionId() { @@ -345,7 +377,7 @@ public UUID settingsDefinitionId() { /** * Set the settingsDefinitionId property: The anomaly settings definition Id. - * + * * @param settingsDefinitionId the settingsDefinitionId value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ @@ -359,7 +391,7 @@ public AnomalySecurityMLAnalyticsSettings withSettingsDefinitionId(UUID settings /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 28ec81da3af0..1cfa38f7aff0 100644 --- 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 @@ -7,16 +7,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents anomaly timeline item. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents anomaly timeline item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AnomalyTimelineItem.class, visible = true) @JsonTypeName("Anomaly") @Fluent public final class AnomalyTimelineItem extends EntityTimelineItem { + /* + * The entity query kind type. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityTimelineKind kind = EntityTimelineKind.ANOMALY; + /* * The anomaly azure resource id. */ @@ -83,9 +93,25 @@ public final class AnomalyTimelineItem extends EntityTimelineItem { @JsonProperty(value = "reasons") private List reasons; + /** + * Creates an instance of AnomalyTimelineItem class. + */ + public 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() { @@ -94,7 +120,7 @@ public String azureResourceId() { /** * Set the azureResourceId property: The anomaly azure resource id. - * + * * @param azureResourceId the azureResourceId value to set. * @return the AnomalyTimelineItem object itself. */ @@ -105,7 +131,7 @@ public AnomalyTimelineItem withAzureResourceId(String azureResourceId) { /** * Get the productName property: The anomaly product name. - * + * * @return the productName value. */ public String productName() { @@ -114,7 +140,7 @@ public String productName() { /** * Set the productName property: The anomaly product name. - * + * * @param productName the productName value to set. * @return the AnomalyTimelineItem object itself. */ @@ -125,7 +151,7 @@ public AnomalyTimelineItem withProductName(String productName) { /** * Get the description property: The anomaly description. - * + * * @return the description value. */ public String description() { @@ -134,7 +160,7 @@ public String description() { /** * Set the description property: The anomaly description. - * + * * @param description the description value to set. * @return the AnomalyTimelineItem object itself. */ @@ -145,7 +171,7 @@ public AnomalyTimelineItem withDescription(String description) { /** * Get the displayName property: The anomaly name. - * + * * @return the displayName value. */ public String displayName() { @@ -154,7 +180,7 @@ public String displayName() { /** * Set the displayName property: The anomaly name. - * + * * @param displayName the displayName value to set. * @return the AnomalyTimelineItem object itself. */ @@ -165,7 +191,7 @@ public AnomalyTimelineItem withDisplayName(String displayName) { /** * Get the endTimeUtc property: The anomaly end time. - * + * * @return the endTimeUtc value. */ public OffsetDateTime endTimeUtc() { @@ -174,7 +200,7 @@ public OffsetDateTime endTimeUtc() { /** * Set the endTimeUtc property: The anomaly end time. - * + * * @param endTimeUtc the endTimeUtc value to set. * @return the AnomalyTimelineItem object itself. */ @@ -185,7 +211,7 @@ public AnomalyTimelineItem withEndTimeUtc(OffsetDateTime endTimeUtc) { /** * Get the startTimeUtc property: The anomaly start time. - * + * * @return the startTimeUtc value. */ public OffsetDateTime startTimeUtc() { @@ -194,7 +220,7 @@ public OffsetDateTime startTimeUtc() { /** * Set the startTimeUtc property: The anomaly start time. - * + * * @param startTimeUtc the startTimeUtc value to set. * @return the AnomalyTimelineItem object itself. */ @@ -205,7 +231,7 @@ public AnomalyTimelineItem withStartTimeUtc(OffsetDateTime startTimeUtc) { /** * Get the timeGenerated property: The anomaly generated time. - * + * * @return the timeGenerated value. */ public OffsetDateTime timeGenerated() { @@ -214,7 +240,7 @@ public OffsetDateTime timeGenerated() { /** * Set the timeGenerated property: The anomaly generated time. - * + * * @param timeGenerated the timeGenerated value to set. * @return the AnomalyTimelineItem object itself. */ @@ -225,7 +251,7 @@ public AnomalyTimelineItem withTimeGenerated(OffsetDateTime timeGenerated) { /** * Get the vendor property: The name of the anomaly vendor. - * + * * @return the vendor value. */ public String vendor() { @@ -234,7 +260,7 @@ public String vendor() { /** * Set the vendor property: The name of the anomaly vendor. - * + * * @param vendor the vendor value to set. * @return the AnomalyTimelineItem object itself. */ @@ -245,7 +271,7 @@ public AnomalyTimelineItem withVendor(String vendor) { /** * Get the intent property: The intent of the anomaly. - * + * * @return the intent value. */ public String intent() { @@ -254,7 +280,7 @@ public String intent() { /** * Set the intent property: The intent of the anomaly. - * + * * @param intent the intent value to set. * @return the AnomalyTimelineItem object itself. */ @@ -265,7 +291,7 @@ public AnomalyTimelineItem withIntent(String intent) { /** * Get the techniques property: The techniques of the anomaly. - * + * * @return the techniques value. */ public List techniques() { @@ -274,7 +300,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the anomaly. - * + * * @param techniques the techniques value to set. * @return the AnomalyTimelineItem object itself. */ @@ -285,7 +311,7 @@ public AnomalyTimelineItem withTechniques(List techniques) { /** * Get the reasons property: The reasons that cause the anomaly. - * + * * @return the reasons value. */ public List reasons() { @@ -294,7 +320,7 @@ public List reasons() { /** * Set the reasons property: The reasons that cause the anomaly. - * + * * @param reasons the reasons value to set. * @return the AnomalyTimelineItem object itself. */ @@ -305,39 +331,35 @@ public AnomalyTimelineItem withReasons(List reasons) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (azureResourceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property azureResourceId in model AnomalyTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureResourceId in model AnomalyTimelineItem")); } if (displayName() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property displayName in model AnomalyTimelineItem")); } if (endTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property endTimeUtc in model AnomalyTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property endTimeUtc in model AnomalyTimelineItem")); } if (startTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startTimeUtc in model AnomalyTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property startTimeUtc in model AnomalyTimelineItem")); } if (timeGenerated() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property timeGenerated in model AnomalyTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property timeGenerated in model AnomalyTimelineItem")); } } 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 a6c58a1e0595..084bd06911fc 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The directionality of this mail message. */ +/** + * The directionality of this mail message. + */ public final class AntispamMailDirection extends ExpandableStringEnum { - /** Static value Unknown for AntispamMailDirection. */ + /** + * Static value Unknown for AntispamMailDirection. + */ public static final AntispamMailDirection UNKNOWN = fromString("Unknown"); - /** Static value Inbound for AntispamMailDirection. */ + /** + * Static value Inbound for AntispamMailDirection. + */ public static final AntispamMailDirection INBOUND = fromString("Inbound"); - /** Static value Outbound for AntispamMailDirection. */ + /** + * Static value Outbound for AntispamMailDirection. + */ public static final AntispamMailDirection OUTBOUND = fromString("Outbound"); - /** Static value Intraorg for AntispamMailDirection. */ + /** + * Static value Intraorg for AntispamMailDirection. + */ public static final AntispamMailDirection INTRAORG = fromString("Intraorg"); + /** + * Creates a new instance of AntispamMailDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AntispamMailDirection() { + } + /** * Creates or finds a AntispamMailDirection from its string representation. - * + * * @param name a name to look for. * @return the corresponding AntispamMailDirection. */ @@ -35,7 +54,7 @@ public static AntispamMailDirection fromString(String name) { /** * Gets known AntispamMailDirection values. - * + * * @return known AntispamMailDirection values. */ public static Collection values() { 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..20dfe736afc2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ApiKeyAuthModel.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = ApiKeyAuthModel.class, visible = true) +@JsonTypeName("APIKey") +@Fluent +public final class ApiKeyAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private CcpAuthType type = CcpAuthType.APIKEY; + + /* + * API Key for the user secret key credential + */ + @JsonProperty(value = "apiKey", required = true) + private String apiKey; + + /* + * API Key name + */ + @JsonProperty(value = "apiKeyName", required = true) + private String apiKeyName; + + /* + * API Key Identifier + */ + @JsonProperty(value = "apiKeyIdentifier") + private String apiKeyIdentifier; + + /* + * Flag to indicate if API key is set in HTTP POST payload + */ + @JsonProperty(value = "isApiKeyInPostPayload") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (apiKey() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property apiKey in model ApiKeyAuthModel")); + } + if (apiKeyName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property apiKeyName in model ApiKeyAuthModel")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApiKeyAuthModel.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AscCheckRequirements.java index 836a4a6fdd8f..4f222434dff2 100644 --- 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 @@ -7,23 +7,49 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.AscCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents ASC (Azure Security Center) requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents ASC (Azure Security Center) requirements check request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AscCheckRequirements.class, visible = true) @JsonTypeName("AzureSecurityCenter") @Fluent public final class AscCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.AZURE_SECURITY_CENTER; + /* * ASC (Azure Security Center) requirements check properties. */ @JsonProperty(value = "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. */ private AscCheckRequirementsProperties innerProperties() { @@ -32,7 +58,7 @@ private AscCheckRequirementsProperties innerProperties() { /** * Get the subscriptionId property: The subscription id to connect to, and get the data from. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -41,7 +67,7 @@ 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 AscCheckRequirements object itself. */ @@ -55,7 +81,7 @@ public AscCheckRequirements withSubscriptionId(String subscriptionId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 683d6beac5b1..be4d968a09b3 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AscDataConnectorProperties; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents ASC (Azure Security Center) data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents ASC (Azure Security Center) data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AscDataConnector.class, visible = true) @JsonTypeName("AzureSecurityCenter") @Fluent public final class AscDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.AZURE_SECURITY_CENTER; + /* * ASC (Azure Security Center) data connector properties. */ @JsonProperty(value = "properties") private AscDataConnectorProperties innerProperties; + /** + * Creates an instance of AscDataConnector class. + */ + public AscDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + /** * Get the innerProperties property: ASC (Azure Security Center) data connector properties. - * + * * @return the innerProperties value. */ private AscDataConnectorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AscDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public AscDataConnector withEtag(String etag) { /** * Get the subscriptionId property: The subscription id to connect to, and get the data from. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -49,7 +77,7 @@ 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 AscDataConnector object itself. */ @@ -63,7 +91,7 @@ public AscDataConnector withSubscriptionId(String subscriptionId) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -72,7 +100,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the AscDataConnector object itself. */ @@ -86,7 +114,7 @@ public AscDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..4c13e20f0cf3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AssignmentItem.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An entity describing a content item. + */ +@Fluent +public final class AssignmentItem { + /* + * The resource id of the content item + */ + @JsonProperty(value = "resourceId") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackPattern.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackPattern.java new file mode 100644 index 000000000000..930214c05ec8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackPattern.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an attack pattern in Azure Security Insights. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AttackPattern.class, visible = true) +@JsonTypeName("AttackPattern") +@Immutable +public final class AttackPattern extends TIObjectInner { + /* + * The kind of the TI object + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private TIObjectKind kind = TIObjectKind.ATTACK_PATTERN; + + /** + * Creates an instance of AttackPattern class. + */ + public AttackPattern() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + @Override + public TIObjectKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackTactic.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackTactic.java index 9c1c9f98c9ea..8c435b055119 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 @@ -8,62 +8,107 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The severity for alerts created by this alert rule. */ +/** + * The severity for alerts created by this alert rule. + */ public final class AttackTactic extends ExpandableStringEnum { - /** Static value Reconnaissance for AttackTactic. */ + /** + * Static value Reconnaissance for AttackTactic. + */ public static final AttackTactic RECONNAISSANCE = fromString("Reconnaissance"); - /** Static value ResourceDevelopment for AttackTactic. */ + /** + * Static value ResourceDevelopment for AttackTactic. + */ public static final AttackTactic RESOURCE_DEVELOPMENT = fromString("ResourceDevelopment"); - /** Static value InitialAccess for AttackTactic. */ + /** + * Static value InitialAccess for AttackTactic. + */ public static final AttackTactic INITIAL_ACCESS = fromString("InitialAccess"); - /** Static value Execution for AttackTactic. */ + /** + * Static value Execution for AttackTactic. + */ public static final AttackTactic EXECUTION = fromString("Execution"); - /** Static value Persistence for AttackTactic. */ + /** + * Static value Persistence for AttackTactic. + */ public static final AttackTactic PERSISTENCE = fromString("Persistence"); - /** Static value PrivilegeEscalation for AttackTactic. */ + /** + * Static value PrivilegeEscalation for AttackTactic. + */ public static final AttackTactic PRIVILEGE_ESCALATION = fromString("PrivilegeEscalation"); - /** Static value DefenseEvasion for AttackTactic. */ + /** + * Static value DefenseEvasion for AttackTactic. + */ public static final AttackTactic DEFENSE_EVASION = fromString("DefenseEvasion"); - /** Static value CredentialAccess for AttackTactic. */ + /** + * Static value CredentialAccess for AttackTactic. + */ public static final AttackTactic CREDENTIAL_ACCESS = fromString("CredentialAccess"); - /** Static value Discovery for AttackTactic. */ + /** + * Static value Discovery for AttackTactic. + */ public static final AttackTactic DISCOVERY = fromString("Discovery"); - /** Static value LateralMovement for AttackTactic. */ + /** + * Static value LateralMovement for AttackTactic. + */ public static final AttackTactic LATERAL_MOVEMENT = fromString("LateralMovement"); - /** Static value Collection for AttackTactic. */ + /** + * Static value Collection for AttackTactic. + */ public static final AttackTactic COLLECTION = fromString("Collection"); - /** Static value Exfiltration for AttackTactic. */ + /** + * Static value Exfiltration for AttackTactic. + */ public static final AttackTactic EXFILTRATION = fromString("Exfiltration"); - /** Static value CommandAndControl for AttackTactic. */ + /** + * Static value CommandAndControl for AttackTactic. + */ public static final AttackTactic COMMAND_AND_CONTROL = fromString("CommandAndControl"); - /** Static value Impact for AttackTactic. */ + /** + * Static value Impact for AttackTactic. + */ public static final AttackTactic IMPACT = fromString("Impact"); - /** Static value PreAttack for AttackTactic. */ + /** + * Static value PreAttack for AttackTactic. + */ public static final AttackTactic PRE_ATTACK = fromString("PreAttack"); - /** Static value ImpairProcessControl for AttackTactic. */ + /** + * Static value ImpairProcessControl for AttackTactic. + */ public static final AttackTactic IMPAIR_PROCESS_CONTROL = fromString("ImpairProcessControl"); - /** Static value InhibitResponseFunction for AttackTactic. */ + /** + * Static value InhibitResponseFunction for AttackTactic. + */ public static final AttackTactic INHIBIT_RESPONSE_FUNCTION = fromString("InhibitResponseFunction"); + /** + * Creates a new instance of AttackTactic value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AttackTactic() { + } + /** * Creates or finds a AttackTactic from its string representation. - * + * * @param name a name to look for. * @return the corresponding AttackTactic. */ @@ -74,7 +119,7 @@ public static AttackTactic fromString(String name) { /** * Gets known AttackTactic values. - * + * * @return known AttackTactic values. */ public static Collection values() { 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 76325ea78317..a6cc4484cf7d 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 @@ -10,179 +10,199 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of AutomationRule. */ +/** + * An immutable client-side representation of AutomationRule. + */ public interface AutomationRule { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the displayName property: The display name of the automation rule. - * + * * @return the displayName value. */ String displayName(); /** * Gets the order property: The order of execution of the automation rule. - * + * * @return the order value. */ int order(); /** * Gets the triggeringLogic property: Describes automation rule triggering logic. - * + * * @return the triggeringLogic value. */ AutomationRuleTriggeringLogic triggeringLogic(); /** * Gets the actions property: The actions to execute when the automation rule is triggered. - * + * * @return the actions value. */ List actions(); /** * Gets the lastModifiedTimeUtc property: The last time the automation rule was updated. - * + * * @return the lastModifiedTimeUtc value. */ OffsetDateTime lastModifiedTimeUtc(); /** * Gets the createdTimeUtc property: The time the automation rule was created. - * + * * @return the createdTimeUtc value. */ OffsetDateTime createdTimeUtc(); /** * Gets the lastModifiedBy property: Information on the client (user or application) that made some action. - * + * * @return the lastModifiedBy value. */ ClientInfo lastModifiedBy(); /** * Gets the createdBy property: Information on the client (user or application) that made some action. - * + * * @return the createdBy value. */ ClientInfo createdBy(); /** * 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.AutomationRuleInner object. - * + * * @return the inner object. */ AutomationRuleInner innerModel(); - /** The entirety of the AutomationRule definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithDisplayName, - DefinitionStages.WithOrder, - DefinitionStages.WithTriggeringLogic, - DefinitionStages.WithActions, - DefinitionStages.WithCreate { + /** + * The entirety of the AutomationRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithDisplayName, DefinitionStages.WithOrder, DefinitionStages.WithTriggeringLogic, + DefinitionStages.WithActions, DefinitionStages.WithCreate { } - /** The AutomationRule definition stages. */ + + /** + * The AutomationRule definition stages. + */ interface DefinitionStages { - /** The first stage of the AutomationRule definition. */ + /** + * The first stage of the AutomationRule definition. + */ interface Blank extends WithParentResource { } - /** The stage of the AutomationRule definition allowing to specify parent resource. */ + + /** + * The stage of the AutomationRule definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @return the next definition stage. */ WithDisplayName withExistingWorkspace(String resourceGroupName, String workspaceName); } - /** The stage of the AutomationRule definition allowing to specify displayName. */ + + /** + * The stage of the AutomationRule definition allowing to specify displayName. + */ interface WithDisplayName { /** * Specifies the displayName property: The display name of the automation rule.. - * + * * @param displayName The display name of the automation rule. * @return the next definition stage. */ WithOrder withDisplayName(String displayName); } - /** The stage of the AutomationRule definition allowing to specify order. */ + + /** + * The stage of the AutomationRule definition allowing to specify order. + */ interface WithOrder { /** * Specifies the order property: The order of execution of the automation rule.. - * + * * @param order The order of execution of the automation rule. * @return the next definition stage. */ WithTriggeringLogic withOrder(int order); } - /** The stage of the AutomationRule definition allowing to specify triggeringLogic. */ + + /** + * The stage of the AutomationRule definition allowing to specify triggeringLogic. + */ interface WithTriggeringLogic { /** * Specifies the triggeringLogic property: Describes automation rule triggering logic.. - * + * * @param triggeringLogic Describes automation rule triggering logic. * @return the next definition stage. */ WithActions withTriggeringLogic(AutomationRuleTriggeringLogic triggeringLogic); } - /** The stage of the AutomationRule definition allowing to specify actions. */ + + /** + * The stage of the AutomationRule definition allowing to specify actions. + */ interface WithActions { /** * Specifies the actions property: The actions to execute when the automation rule is triggered.. - * + * * @param actions The actions to execute when the automation rule is triggered. * @return the next definition stage. */ WithCreate withActions(List actions); } + /** * The stage of the AutomationRule definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -190,122 +210,142 @@ interface WithActions { interface WithCreate extends DefinitionStages.WithEtag { /** * Executes the create request. - * + * * @return the created resource. */ AutomationRule create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ AutomationRule create(Context context); } - /** The stage of the AutomationRule definition allowing to specify etag. */ + + /** + * The stage of the AutomationRule definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } } + /** * Begins update for the AutomationRule resource. - * + * * @return the stage of resource update. */ AutomationRule.Update update(); - /** The template for AutomationRule update. */ - interface Update - extends UpdateStages.WithEtag, - UpdateStages.WithDisplayName, - UpdateStages.WithOrder, - UpdateStages.WithTriggeringLogic, - UpdateStages.WithActions { + /** + * The template for AutomationRule update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithDisplayName, UpdateStages.WithOrder, + UpdateStages.WithTriggeringLogic, UpdateStages.WithActions { /** * Executes the update request. - * + * * @return the updated resource. */ AutomationRule apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ AutomationRule apply(Context context); } - /** The AutomationRule update stages. */ + + /** + * The AutomationRule update stages. + */ interface UpdateStages { - /** The stage of the AutomationRule update allowing to specify etag. */ + /** + * The stage of the AutomationRule update allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ Update withEtag(String etag); } - /** The stage of the AutomationRule update allowing to specify displayName. */ + + /** + * The stage of the AutomationRule update allowing to specify displayName. + */ interface WithDisplayName { /** * Specifies the displayName property: The display name of the automation rule.. - * + * * @param displayName The display name of the automation rule. * @return the next definition stage. */ Update withDisplayName(String displayName); } - /** The stage of the AutomationRule update allowing to specify order. */ + + /** + * The stage of the AutomationRule update allowing to specify order. + */ interface WithOrder { /** * Specifies the order property: The order of execution of the automation rule.. - * + * * @param order The order of execution of the automation rule. * @return the next definition stage. */ Update withOrder(int order); } - /** The stage of the AutomationRule update allowing to specify triggeringLogic. */ + + /** + * The stage of the AutomationRule update allowing to specify triggeringLogic. + */ interface WithTriggeringLogic { /** * Specifies the triggeringLogic property: Describes automation rule triggering logic.. - * + * * @param triggeringLogic Describes automation rule triggering logic. * @return the next definition stage. */ Update withTriggeringLogic(AutomationRuleTriggeringLogic triggeringLogic); } - /** The stage of the AutomationRule update allowing to specify actions. */ + + /** + * The stage of the AutomationRule update allowing to specify actions. + */ interface WithActions { /** * Specifies the actions property: The actions to execute when the automation rule is triggered.. - * + * * @param actions The actions to execute when the automation rule is triggered. * @return the next definition stage. */ Update withActions(List actions); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ AutomationRule refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ 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 3ff1bf1a59fe..7a57cb321245 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 @@ -7,31 +7,57 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an automation rule action. */ +/** + * Describes an automation rule action. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, property = "actionType", - defaultImpl = AutomationRuleAction.class) + defaultImpl = AutomationRuleAction.class, + visible = true) @JsonTypeName("AutomationRuleAction") @JsonSubTypes({ + @JsonSubTypes.Type(name = "AddIncidentTask", value = AutomationRuleAddIncidentTaskAction.class), @JsonSubTypes.Type(name = "ModifyProperties", value = AutomationRuleModifyPropertiesAction.class), - @JsonSubTypes.Type(name = "RunPlaybook", value = AutomationRuleRunPlaybookAction.class) -}) + @JsonSubTypes.Type(name = "RunPlaybook", value = AutomationRuleRunPlaybookAction.class) }) @Fluent public class AutomationRuleAction { + /* + * The type of the automation rule action. + */ + @JsonTypeId + @JsonProperty(value = "actionType", required = true) + private ActionType actionType; + /* * The order property. */ @JsonProperty(value = "order", required = true) private int order; + /** + * Creates an instance of AutomationRuleAction class. + */ + public AutomationRuleAction() { + this.actionType = ActionType.fromString("AutomationRuleAction"); + } + + /** + * Get the actionType property: The type of the automation rule action. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + /** * Get the order property: The order property. - * + * * @return the order value. */ public int order() { @@ -40,7 +66,7 @@ public int order() { /** * Set the order property: The order property. - * + * * @param order the order value to set. * @return the AutomationRuleAction object itself. */ @@ -51,7 +77,7 @@ public AutomationRuleAction withOrder(int order) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAddIncidentTaskAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAddIncidentTaskAction.java new file mode 100644 index 000000000000..e25272bc148b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAddIncidentTaskAction.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes an automation rule action to add a task to an incident. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "actionType", + defaultImpl = AutomationRuleAddIncidentTaskAction.class, + visible = true) +@JsonTypeName("AddIncidentTask") +@Fluent +public final class AutomationRuleAddIncidentTaskAction extends AutomationRuleAction { + /* + * The type of the automation rule action. + */ + @JsonTypeId + @JsonProperty(value = "actionType", required = true) + private ActionType actionType = ActionType.ADD_INCIDENT_TASK; + + /* + * The actionConfiguration property. + */ + @JsonProperty(value = "actionConfiguration") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (actionConfiguration() != null) { + actionConfiguration().validate(); + } + } +} 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 index 0eee30498e7c..76004d400a27 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The AutomationRuleBooleanCondition model. */ +/** + * The AutomationRuleBooleanCondition model. + */ @Fluent public final class AutomationRuleBooleanCondition { /* @@ -23,9 +25,15 @@ public final class AutomationRuleBooleanCondition { @JsonProperty(value = "innerConditions") 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() { @@ -34,7 +42,7 @@ public AutomationRuleBooleanConditionSupportedOperator operator() { /** * Set the operator property: The operator property. - * + * * @param operator the operator value to set. * @return the AutomationRuleBooleanCondition object itself. */ @@ -45,7 +53,7 @@ public AutomationRuleBooleanCondition withOperator(AutomationRuleBooleanConditio /** * Get the innerConditions property: The innerConditions property. - * + * * @return the innerConditions value. */ public List innerConditions() { @@ -54,7 +62,7 @@ public List innerConditions() { /** * Set the innerConditions property: The innerConditions property. - * + * * @param innerConditions the innerConditions value to set. * @return the AutomationRuleBooleanCondition object itself. */ @@ -65,7 +73,7 @@ public AutomationRuleBooleanCondition withInnerConditions(List { - /** Static value And for AutomationRuleBooleanConditionSupportedOperator. */ + /** + * Static value And for AutomationRuleBooleanConditionSupportedOperator. + */ public static final AutomationRuleBooleanConditionSupportedOperator AND = fromString("And"); - /** Static value Or for AutomationRuleBooleanConditionSupportedOperator. */ + /** + * Static value Or for AutomationRuleBooleanConditionSupportedOperator. + */ 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. */ @@ -30,7 +45,7 @@ public static AutomationRuleBooleanConditionSupportedOperator fromString(String /** * Gets known AutomationRuleBooleanConditionSupportedOperator values. - * + * * @return known AutomationRuleBooleanConditionSupportedOperator values. */ public static Collection values() { 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 fbd2b4bcaef2..2d75679417be 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 @@ -5,29 +5,55 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an automation rule condition. */ +/** + * Describes an automation rule condition. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, property = "conditionType", - defaultImpl = AutomationRuleCondition.class) + defaultImpl = AutomationRuleCondition.class, + visible = true) @JsonTypeName("AutomationRuleCondition") @JsonSubTypes({ @JsonSubTypes.Type(name = "Boolean", value = BooleanConditionProperties.class), @JsonSubTypes.Type(name = "PropertyArrayChanged", value = PropertyArrayChangedConditionProperties.class), @JsonSubTypes.Type(name = "PropertyArray", value = PropertyArrayConditionProperties.class), @JsonSubTypes.Type(name = "PropertyChanged", value = PropertyChangedConditionProperties.class), - @JsonSubTypes.Type(name = "Property", value = PropertyConditionProperties.class) -}) + @JsonSubTypes.Type(name = "Property", value = PropertyConditionProperties.class) }) @Immutable public class AutomationRuleCondition { + /* + * The conditionType property. + */ + @JsonTypeId + @JsonProperty(value = "conditionType", required = true) + private ConditionType conditionType; + + /** + * Creates an instance of AutomationRuleCondition class. + */ + public AutomationRuleCondition() { + this.conditionType = ConditionType.fromString("AutomationRuleCondition"); + } + + /** + * Get the conditionType property: The conditionType property. + * + * @return the conditionType value. + */ + public ConditionType conditionType() { + return this.conditionType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesAction.java index 0f56b3772f36..f5af4fbc9f27 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 @@ -6,23 +6,53 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an automation rule action to modify an object's properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") +/** + * Describes an automation rule action to modify an object's properties. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "actionType", + defaultImpl = AutomationRuleModifyPropertiesAction.class, + visible = true) @JsonTypeName("ModifyProperties") @Fluent public final class AutomationRuleModifyPropertiesAction extends AutomationRuleAction { + /* + * The type of the automation rule action. + */ + @JsonTypeId + @JsonProperty(value = "actionType", required = true) + private ActionType actionType = ActionType.MODIFY_PROPERTIES; + /* * The actionConfiguration property. */ @JsonProperty(value = "actionConfiguration") private IncidentPropertiesAction actionConfiguration; + /** + * Creates an instance of AutomationRuleModifyPropertiesAction class. + */ + public AutomationRuleModifyPropertiesAction() { + } + + /** + * 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 IncidentPropertiesAction actionConfiguration() { @@ -31,7 +61,7 @@ public IncidentPropertiesAction actionConfiguration() { /** * Set the actionConfiguration property: The actionConfiguration property. - * + * * @param actionConfiguration the actionConfiguration value to set. * @return the AutomationRuleModifyPropertiesAction object itself. */ @@ -40,7 +70,9 @@ public AutomationRuleModifyPropertiesAction withActionConfiguration(IncidentProp return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutomationRuleModifyPropertiesAction withOrder(int order) { super.withOrder(order); @@ -49,7 +81,7 @@ public AutomationRuleModifyPropertiesAction withOrder(int order) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 6b0b8389178c..2158b511ce81 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 @@ -8,24 +8,43 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AutomationRulePropertyArrayChangedConditionSupportedArrayType. */ +/** + * Defines values for AutomationRulePropertyArrayChangedConditionSupportedArrayType. + */ public final class AutomationRulePropertyArrayChangedConditionSupportedArrayType extends ExpandableStringEnum { - /** Static value Alerts for AutomationRulePropertyArrayChangedConditionSupportedArrayType. */ + /** + * Static value Alerts for AutomationRulePropertyArrayChangedConditionSupportedArrayType. + */ public static final AutomationRulePropertyArrayChangedConditionSupportedArrayType ALERTS = fromString("Alerts"); - /** Static value Labels for AutomationRulePropertyArrayChangedConditionSupportedArrayType. */ + /** + * Static value Labels for AutomationRulePropertyArrayChangedConditionSupportedArrayType. + */ public static final AutomationRulePropertyArrayChangedConditionSupportedArrayType LABELS = fromString("Labels"); - /** Static value Tactics for AutomationRulePropertyArrayChangedConditionSupportedArrayType. */ + /** + * Static value Tactics for AutomationRulePropertyArrayChangedConditionSupportedArrayType. + */ public static final AutomationRulePropertyArrayChangedConditionSupportedArrayType TACTICS = fromString("Tactics"); - /** Static value Comments for AutomationRulePropertyArrayChangedConditionSupportedArrayType. */ + /** + * Static value Comments for AutomationRulePropertyArrayChangedConditionSupportedArrayType. + */ public static final AutomationRulePropertyArrayChangedConditionSupportedArrayType COMMENTS = fromString("Comments"); + /** + * Creates a new instance of AutomationRulePropertyArrayChangedConditionSupportedArrayType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutomationRulePropertyArrayChangedConditionSupportedArrayType() { + } + /** * Creates or finds a AutomationRulePropertyArrayChangedConditionSupportedArrayType from its string representation. - * + * * @param name a name to look for. * @return the corresponding AutomationRulePropertyArrayChangedConditionSupportedArrayType. */ @@ -36,7 +55,7 @@ public static AutomationRulePropertyArrayChangedConditionSupportedArrayType from /** * Gets known AutomationRulePropertyArrayChangedConditionSupportedArrayType values. - * + * * @return known AutomationRulePropertyArrayChangedConditionSupportedArrayType values. */ public static Collection values() { 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 1d0e54020290..905796605103 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 @@ -8,15 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AutomationRulePropertyArrayChangedConditionSupportedChangeType. */ +/** + * Defines values for AutomationRulePropertyArrayChangedConditionSupportedChangeType. + */ public final class AutomationRulePropertyArrayChangedConditionSupportedChangeType extends ExpandableStringEnum { - /** Static value Added for AutomationRulePropertyArrayChangedConditionSupportedChangeType. */ + /** + * Static value Added for AutomationRulePropertyArrayChangedConditionSupportedChangeType. + */ public static final AutomationRulePropertyArrayChangedConditionSupportedChangeType ADDED = fromString("Added"); + /** + * Creates a new instance of AutomationRulePropertyArrayChangedConditionSupportedChangeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutomationRulePropertyArrayChangedConditionSupportedChangeType() { + } + /** * Creates or finds a AutomationRulePropertyArrayChangedConditionSupportedChangeType from its string representation. - * + * * @param name a name to look for. * @return the corresponding AutomationRulePropertyArrayChangedConditionSupportedChangeType. */ @@ -27,7 +40,7 @@ public static AutomationRulePropertyArrayChangedConditionSupportedChangeType fro /** * Gets known AutomationRulePropertyArrayChangedConditionSupportedChangeType values. - * + * * @return known AutomationRulePropertyArrayChangedConditionSupportedChangeType values. */ public static Collection values() { 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 33ee0d2d5aee..5146170d54a1 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The AutomationRulePropertyArrayChangedValuesCondition model. */ +/** + * The AutomationRulePropertyArrayChangedValuesCondition model. + */ @Fluent public final class AutomationRulePropertyArrayChangedValuesCondition { /* @@ -22,9 +24,15 @@ public final class AutomationRulePropertyArrayChangedValuesCondition { @JsonProperty(value = "changeType") private AutomationRulePropertyArrayChangedConditionSupportedChangeType changeType; + /** + * Creates an instance of AutomationRulePropertyArrayChangedValuesCondition class. + */ + public AutomationRulePropertyArrayChangedValuesCondition() { + } + /** * Get the arrayType property: The arrayType property. - * + * * @return the arrayType value. */ public AutomationRulePropertyArrayChangedConditionSupportedArrayType arrayType() { @@ -33,19 +41,19 @@ public AutomationRulePropertyArrayChangedConditionSupportedArrayType arrayType() /** * Set the arrayType property: The arrayType property. - * + * * @param arrayType the arrayType value to set. * @return the AutomationRulePropertyArrayChangedValuesCondition object itself. */ - public AutomationRulePropertyArrayChangedValuesCondition withArrayType( - AutomationRulePropertyArrayChangedConditionSupportedArrayType arrayType) { + public AutomationRulePropertyArrayChangedValuesCondition + withArrayType(AutomationRulePropertyArrayChangedConditionSupportedArrayType arrayType) { this.arrayType = arrayType; return this; } /** * Get the changeType property: The changeType property. - * + * * @return the changeType value. */ public AutomationRulePropertyArrayChangedConditionSupportedChangeType changeType() { @@ -54,19 +62,19 @@ public AutomationRulePropertyArrayChangedConditionSupportedChangeType changeType /** * Set the changeType property: The changeType property. - * + * * @param changeType the changeType value to set. * @return the AutomationRulePropertyArrayChangedValuesCondition object itself. */ - public AutomationRulePropertyArrayChangedValuesCondition withChangeType( - AutomationRulePropertyArrayChangedConditionSupportedChangeType changeType) { + public AutomationRulePropertyArrayChangedValuesCondition + withChangeType(AutomationRulePropertyArrayChangedConditionSupportedChangeType changeType) { this.changeType = changeType; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.java index 670c64ea5936..7d44b4824f6c 100644 --- 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 @@ -8,17 +8,36 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AutomationRulePropertyArrayConditionSupportedArrayConditionType. */ +/** + * Defines values for AutomationRulePropertyArrayConditionSupportedArrayConditionType. + */ public final class AutomationRulePropertyArrayConditionSupportedArrayConditionType extends ExpandableStringEnum { - /** Static value AnyItem for AutomationRulePropertyArrayConditionSupportedArrayConditionType. */ - public static final AutomationRulePropertyArrayConditionSupportedArrayConditionType ANY_ITEM = - fromString("AnyItem"); + /** + * Static value AnyItem for AutomationRulePropertyArrayConditionSupportedArrayConditionType. + */ + public static final AutomationRulePropertyArrayConditionSupportedArrayConditionType ANY_ITEM + = fromString("AnyItem"); + + /** + * Static value AllItems for AutomationRulePropertyArrayConditionSupportedArrayConditionType. + */ + 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. */ @@ -29,7 +48,7 @@ public static AutomationRulePropertyArrayConditionSupportedArrayConditionType fr /** * Gets known AutomationRulePropertyArrayConditionSupportedArrayConditionType values. - * + * * @return known AutomationRulePropertyArrayConditionSupportedArrayConditionType values. */ public static Collection values() { 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 index af5e23b9d813..6c04f815bf5e 100644 --- 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 @@ -8,20 +8,41 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AutomationRulePropertyArrayConditionSupportedArrayType. */ +/** + * Defines values for AutomationRulePropertyArrayConditionSupportedArrayType. + */ public final class AutomationRulePropertyArrayConditionSupportedArrayType extends ExpandableStringEnum { - /** Static value CustomDetails for AutomationRulePropertyArrayConditionSupportedArrayType. */ - public static final AutomationRulePropertyArrayConditionSupportedArrayType CUSTOM_DETAILS = - fromString("CustomDetails"); + /** + * Static value CustomDetails for AutomationRulePropertyArrayConditionSupportedArrayType. + */ + public static final AutomationRulePropertyArrayConditionSupportedArrayType CUSTOM_DETAILS + = fromString("CustomDetails"); + + /** + * Static value CustomDetailValues for AutomationRulePropertyArrayConditionSupportedArrayType. + */ + public static final AutomationRulePropertyArrayConditionSupportedArrayType CUSTOM_DETAIL_VALUES + = fromString("CustomDetailValues"); - /** Static value CustomDetailValues for AutomationRulePropertyArrayConditionSupportedArrayType. */ - public static final AutomationRulePropertyArrayConditionSupportedArrayType CUSTOM_DETAIL_VALUES = - fromString("CustomDetailValues"); + /** + * Static value IncidentLabels for AutomationRulePropertyArrayConditionSupportedArrayType. + */ + 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. */ @@ -32,7 +53,7 @@ public static AutomationRulePropertyArrayConditionSupportedArrayType fromString( /** * Gets known AutomationRulePropertyArrayConditionSupportedArrayType values. - * + * * @return known AutomationRulePropertyArrayConditionSupportedArrayType values. */ public static Collection values() { 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 index 40158ab460bc..cd6bab7e98cf 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The AutomationRulePropertyArrayValuesCondition model. */ +/** + * The AutomationRulePropertyArrayValuesCondition model. + */ @Fluent public final class AutomationRulePropertyArrayValuesCondition { /* @@ -29,9 +31,15 @@ public final class AutomationRulePropertyArrayValuesCondition { @JsonProperty(value = "itemConditions") 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() { @@ -40,19 +48,19 @@ public AutomationRulePropertyArrayConditionSupportedArrayType 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) { + public AutomationRulePropertyArrayValuesCondition + withArrayType(AutomationRulePropertyArrayConditionSupportedArrayType arrayType) { this.arrayType = arrayType; return this; } /** * Get the arrayConditionType property: The arrayConditionType property. - * + * * @return the arrayConditionType value. */ public AutomationRulePropertyArrayConditionSupportedArrayConditionType arrayConditionType() { @@ -61,19 +69,19 @@ public AutomationRulePropertyArrayConditionSupportedArrayConditionType arrayCond /** * Set the arrayConditionType property: The arrayConditionType property. - * + * * @param arrayConditionType the arrayConditionType value to set. * @return the AutomationRulePropertyArrayValuesCondition object itself. */ - public AutomationRulePropertyArrayValuesCondition withArrayConditionType( - AutomationRulePropertyArrayConditionSupportedArrayConditionType arrayConditionType) { + public AutomationRulePropertyArrayValuesCondition + withArrayConditionType(AutomationRulePropertyArrayConditionSupportedArrayConditionType arrayConditionType) { this.arrayConditionType = arrayConditionType; return this; } /** * Get the itemConditions property: The itemConditions property. - * + * * @return the itemConditions value. */ public List itemConditions() { @@ -82,7 +90,7 @@ public List itemConditions() { /** * Set the itemConditions property: The itemConditions property. - * + * * @param itemConditions the itemConditions value to set. * @return the AutomationRulePropertyArrayValuesCondition object itself. */ @@ -93,7 +101,7 @@ public AutomationRulePropertyArrayValuesCondition withItemConditions(List { - /** Static value ChangedFrom for AutomationRulePropertyChangedConditionSupportedChangedType. */ - public static final AutomationRulePropertyChangedConditionSupportedChangedType CHANGED_FROM = - fromString("ChangedFrom"); + /** + * Static value ChangedFrom for AutomationRulePropertyChangedConditionSupportedChangedType. + */ + public static final AutomationRulePropertyChangedConditionSupportedChangedType CHANGED_FROM + = fromString("ChangedFrom"); - /** Static value ChangedTo for AutomationRulePropertyChangedConditionSupportedChangedType. */ + /** + * Static value ChangedTo for AutomationRulePropertyChangedConditionSupportedChangedType. + */ public static final AutomationRulePropertyChangedConditionSupportedChangedType CHANGED_TO = fromString("ChangedTo"); + /** + * Creates a new instance of AutomationRulePropertyChangedConditionSupportedChangedType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutomationRulePropertyChangedConditionSupportedChangedType() { + } + /** * Creates or finds a AutomationRulePropertyChangedConditionSupportedChangedType from its string representation. - * + * * @param name a name to look for. * @return the corresponding AutomationRulePropertyChangedConditionSupportedChangedType. */ @@ -31,7 +46,7 @@ public static AutomationRulePropertyChangedConditionSupportedChangedType fromStr /** * Gets known AutomationRulePropertyChangedConditionSupportedChangedType values. - * + * * @return known AutomationRulePropertyChangedConditionSupportedChangedType values. */ public static Collection values() { 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 7f7b6618b841..9fb1cff718ed 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 @@ -8,24 +8,41 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AutomationRulePropertyChangedConditionSupportedPropertyType. */ +/** + * Defines values for AutomationRulePropertyChangedConditionSupportedPropertyType. + */ public final class AutomationRulePropertyChangedConditionSupportedPropertyType extends ExpandableStringEnum { - /** Static value IncidentSeverity for AutomationRulePropertyChangedConditionSupportedPropertyType. */ - public static final AutomationRulePropertyChangedConditionSupportedPropertyType INCIDENT_SEVERITY = - fromString("IncidentSeverity"); + /** + * Static value IncidentSeverity for AutomationRulePropertyChangedConditionSupportedPropertyType. + */ + public static final AutomationRulePropertyChangedConditionSupportedPropertyType INCIDENT_SEVERITY + = fromString("IncidentSeverity"); + + /** + * Static value IncidentStatus for AutomationRulePropertyChangedConditionSupportedPropertyType. + */ + public static final AutomationRulePropertyChangedConditionSupportedPropertyType INCIDENT_STATUS + = fromString("IncidentStatus"); - /** Static value IncidentStatus for AutomationRulePropertyChangedConditionSupportedPropertyType. */ - public static final AutomationRulePropertyChangedConditionSupportedPropertyType INCIDENT_STATUS = - fromString("IncidentStatus"); + /** + * Static value IncidentOwner for AutomationRulePropertyChangedConditionSupportedPropertyType. + */ + public static final AutomationRulePropertyChangedConditionSupportedPropertyType INCIDENT_OWNER + = fromString("IncidentOwner"); - /** Static value IncidentOwner for AutomationRulePropertyChangedConditionSupportedPropertyType. */ - public static final AutomationRulePropertyChangedConditionSupportedPropertyType INCIDENT_OWNER = - fromString("IncidentOwner"); + /** + * Creates a new instance of AutomationRulePropertyChangedConditionSupportedPropertyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutomationRulePropertyChangedConditionSupportedPropertyType() { + } /** * Creates or finds a AutomationRulePropertyChangedConditionSupportedPropertyType from its string representation. - * + * * @param name a name to look for. * @return the corresponding AutomationRulePropertyChangedConditionSupportedPropertyType. */ @@ -36,7 +53,7 @@ public static AutomationRulePropertyChangedConditionSupportedPropertyType fromSt /** * Gets known AutomationRulePropertyChangedConditionSupportedPropertyType values. - * + * * @return known AutomationRulePropertyChangedConditionSupportedPropertyType values. */ public static Collection values() { 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 ae9a8ff2891d..da0c4554ee26 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 @@ -8,36 +8,63 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AutomationRulePropertyConditionSupportedOperator. */ +/** + * Defines values for AutomationRulePropertyConditionSupportedOperator. + */ public final class AutomationRulePropertyConditionSupportedOperator extends ExpandableStringEnum { - /** Static value Equals for AutomationRulePropertyConditionSupportedOperator. */ + /** + * Static value Equals for AutomationRulePropertyConditionSupportedOperator. + */ public static final AutomationRulePropertyConditionSupportedOperator EQUALS = fromString("Equals"); - /** Static value NotEquals for AutomationRulePropertyConditionSupportedOperator. */ + /** + * Static value NotEquals for AutomationRulePropertyConditionSupportedOperator. + */ public static final AutomationRulePropertyConditionSupportedOperator NOT_EQUALS = fromString("NotEquals"); - /** Static value Contains for AutomationRulePropertyConditionSupportedOperator. */ + /** + * Static value Contains for AutomationRulePropertyConditionSupportedOperator. + */ public static final AutomationRulePropertyConditionSupportedOperator CONTAINS = fromString("Contains"); - /** Static value NotContains for AutomationRulePropertyConditionSupportedOperator. */ + /** + * Static value NotContains for AutomationRulePropertyConditionSupportedOperator. + */ public static final AutomationRulePropertyConditionSupportedOperator NOT_CONTAINS = fromString("NotContains"); - /** Static value StartsWith for AutomationRulePropertyConditionSupportedOperator. */ + /** + * Static value StartsWith for AutomationRulePropertyConditionSupportedOperator. + */ public static final AutomationRulePropertyConditionSupportedOperator STARTS_WITH = fromString("StartsWith"); - /** Static value NotStartsWith for AutomationRulePropertyConditionSupportedOperator. */ + /** + * Static value NotStartsWith for AutomationRulePropertyConditionSupportedOperator. + */ public static final AutomationRulePropertyConditionSupportedOperator NOT_STARTS_WITH = fromString("NotStartsWith"); - /** Static value EndsWith for AutomationRulePropertyConditionSupportedOperator. */ + /** + * Static value EndsWith for AutomationRulePropertyConditionSupportedOperator. + */ public static final AutomationRulePropertyConditionSupportedOperator ENDS_WITH = fromString("EndsWith"); - /** Static value NotEndsWith for AutomationRulePropertyConditionSupportedOperator. */ + /** + * Static value NotEndsWith for AutomationRulePropertyConditionSupportedOperator. + */ public static final AutomationRulePropertyConditionSupportedOperator NOT_ENDS_WITH = fromString("NotEndsWith"); + /** + * Creates a new instance of AutomationRulePropertyConditionSupportedOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutomationRulePropertyConditionSupportedOperator() { + } + /** * Creates or finds a AutomationRulePropertyConditionSupportedOperator from its string representation. - * + * * @param name a name to look for. * @return the corresponding AutomationRulePropertyConditionSupportedOperator. */ @@ -48,7 +75,7 @@ public static AutomationRulePropertyConditionSupportedOperator fromString(String /** * Gets known AutomationRulePropertyConditionSupportedOperator values. - * + * * @return known AutomationRulePropertyConditionSupportedOperator values. */ public static Collection values() { 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 72af96f863db..0ac01388a4e8 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 @@ -8,221 +8,348 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The property to evaluate in an automation rule property condition. */ +/** + * The property to evaluate in an automation rule property condition. + */ public final class AutomationRulePropertyConditionSupportedProperty extends ExpandableStringEnum { - /** Static value IncidentTitle for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value IncidentTitle for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_TITLE = fromString("IncidentTitle"); - /** Static value IncidentDescription for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_DESCRIPTION = - fromString("IncidentDescription"); + /** + * Static value IncidentDescription for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_DESCRIPTION + = fromString("IncidentDescription"); - /** Static value IncidentSeverity for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_SEVERITY = - fromString("IncidentSeverity"); + /** + * Static value IncidentSeverity for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_SEVERITY + = fromString("IncidentSeverity"); - /** Static value IncidentStatus for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value IncidentStatus for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_STATUS = fromString("IncidentStatus"); - /** Static value IncidentRelatedAnalyticRuleIds for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_RELATED_ANALYTIC_RULE_IDS = - fromString("IncidentRelatedAnalyticRuleIds"); + /** + * Static value IncidentRelatedAnalyticRuleIds for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_RELATED_ANALYTIC_RULE_IDS + = fromString("IncidentRelatedAnalyticRuleIds"); - /** Static value IncidentTactics for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_TACTICS = - fromString("IncidentTactics"); + /** + * Static value IncidentTactics for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_TACTICS + = fromString("IncidentTactics"); - /** Static value IncidentLabel for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value IncidentLabel for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_LABEL = fromString("IncidentLabel"); - /** Static value IncidentProviderName for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_PROVIDER_NAME = - fromString("IncidentProviderName"); + /** + * Static value IncidentProviderName for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_PROVIDER_NAME + = fromString("IncidentProviderName"); - /** Static value IncidentUpdatedBySource for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_UPDATED_BY_SOURCE = - fromString("IncidentUpdatedBySource"); + /** + * Static value IncidentUpdatedBySource for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_UPDATED_BY_SOURCE + = fromString("IncidentUpdatedBySource"); - /** Static value IncidentCustomDetailsKey for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_CUSTOM_DETAILS_KEY = - fromString("IncidentCustomDetailsKey"); + /** + * Static value IncidentCustomDetailsKey for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_CUSTOM_DETAILS_KEY + = fromString("IncidentCustomDetailsKey"); - /** Static value IncidentCustomDetailsValue for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_CUSTOM_DETAILS_VALUE = - fromString("IncidentCustomDetailsValue"); + /** + * Static value IncidentCustomDetailsValue for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_CUSTOM_DETAILS_VALUE + = fromString("IncidentCustomDetailsValue"); - /** Static value AccountAadTenantId for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_AAD_TENANT_ID = - fromString("AccountAadTenantId"); + /** + * Static value AccountAadTenantId for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_AAD_TENANT_ID + = fromString("AccountAadTenantId"); - /** Static value AccountAadUserId for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_AAD_USER_ID = - fromString("AccountAadUserId"); + /** + * Static value AccountAadUserId for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_AAD_USER_ID + = fromString("AccountAadUserId"); - /** Static value AccountName for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value AccountName for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_NAME = fromString("AccountName"); - /** Static value AccountNTDomain for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_NTDOMAIN = - fromString("AccountNTDomain"); + /** + * Static value AccountNTDomain for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_NTDOMAIN + = fromString("AccountNTDomain"); - /** Static value AccountPUID for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value AccountPUID for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_PUID = fromString("AccountPUID"); - /** Static value AccountSid for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value AccountSid for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_SID = fromString("AccountSid"); - /** Static value AccountObjectGuid for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_OBJECT_GUID = - fromString("AccountObjectGuid"); + /** + * Static value AccountObjectGuid for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_OBJECT_GUID + = fromString("AccountObjectGuid"); - /** Static value AccountUPNSuffix for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_UPNSUFFIX = - fromString("AccountUPNSuffix"); + /** + * Static value AccountUPNSuffix for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_UPNSUFFIX + = fromString("AccountUPNSuffix"); - /** Static value AlertProductNames for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty ALERT_PRODUCT_NAMES = - fromString("AlertProductNames"); + /** + * Static value AlertProductNames for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty ALERT_PRODUCT_NAMES + = fromString("AlertProductNames"); - /** Static value AlertAnalyticRuleIds for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty ALERT_ANALYTIC_RULE_IDS = - fromString("AlertAnalyticRuleIds"); + /** + * Static value AlertAnalyticRuleIds for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty ALERT_ANALYTIC_RULE_IDS + = fromString("AlertAnalyticRuleIds"); - /** Static value AzureResourceResourceId for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty AZURE_RESOURCE_RESOURCE_ID = - fromString("AzureResourceResourceId"); + /** + * Static value AzureResourceResourceId for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty AZURE_RESOURCE_RESOURCE_ID + = fromString("AzureResourceResourceId"); - /** Static value AzureResourceSubscriptionId for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty AZURE_RESOURCE_SUBSCRIPTION_ID = - fromString("AzureResourceSubscriptionId"); + /** + * Static value AzureResourceSubscriptionId for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty AZURE_RESOURCE_SUBSCRIPTION_ID + = fromString("AzureResourceSubscriptionId"); - /** Static value CloudApplicationAppId for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty CLOUD_APPLICATION_APP_ID = - fromString("CloudApplicationAppId"); + /** + * Static value CloudApplicationAppId for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty CLOUD_APPLICATION_APP_ID + = fromString("CloudApplicationAppId"); - /** Static value CloudApplicationAppName for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty CLOUD_APPLICATION_APP_NAME = - fromString("CloudApplicationAppName"); + /** + * Static value CloudApplicationAppName for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty CLOUD_APPLICATION_APP_NAME + = fromString("CloudApplicationAppName"); - /** Static value DNSDomainName for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value DNSDomainName for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty DNSDOMAIN_NAME = fromString("DNSDomainName"); - /** Static value FileDirectory for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value FileDirectory for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty FILE_DIRECTORY = fromString("FileDirectory"); - /** Static value FileName for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value FileName for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty FILE_NAME = fromString("FileName"); - /** Static value FileHashValue for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value FileHashValue for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty FILE_HASH_VALUE = fromString("FileHashValue"); - /** Static value HostAzureID for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value HostAzureID for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty HOST_AZURE_ID = fromString("HostAzureID"); - /** Static value HostName for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value HostName for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty HOST_NAME = fromString("HostName"); - /** Static value HostNetBiosName for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty HOST_NET_BIOS_NAME = - fromString("HostNetBiosName"); + /** + * Static value HostNetBiosName for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty HOST_NET_BIOS_NAME + = fromString("HostNetBiosName"); - /** Static value HostNTDomain for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value HostNTDomain for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty HOST_NTDOMAIN = fromString("HostNTDomain"); - /** Static value HostOSVersion for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value HostOSVersion for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty HOST_OSVERSION = fromString("HostOSVersion"); - /** Static value IoTDeviceId for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value IoTDeviceId for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_ID = fromString("IoTDeviceId"); - /** Static value IoTDeviceName for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value IoTDeviceName for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_NAME = fromString("IoTDeviceName"); - /** Static value IoTDeviceType for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value IoTDeviceType for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_TYPE = fromString("IoTDeviceType"); - /** Static value IoTDeviceVendor for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_VENDOR = - fromString("IoTDeviceVendor"); + /** + * Static value IoTDeviceVendor for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_VENDOR + = fromString("IoTDeviceVendor"); - /** Static value IoTDeviceModel for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_MODEL = - fromString("IoTDeviceModel"); + /** + * Static value IoTDeviceModel for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_MODEL + = fromString("IoTDeviceModel"); - /** Static value IoTDeviceOperatingSystem for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_OPERATING_SYSTEM = - fromString("IoTDeviceOperatingSystem"); + /** + * Static value IoTDeviceOperatingSystem for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_OPERATING_SYSTEM + = fromString("IoTDeviceOperatingSystem"); - /** Static value IPAddress for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value IPAddress for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty IPADDRESS = fromString("IPAddress"); - /** Static value MailboxDisplayName for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_DISPLAY_NAME = - fromString("MailboxDisplayName"); + /** + * Static value MailboxDisplayName for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_DISPLAY_NAME + = fromString("MailboxDisplayName"); - /** Static value MailboxPrimaryAddress for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_PRIMARY_ADDRESS = - fromString("MailboxPrimaryAddress"); + /** + * Static value MailboxPrimaryAddress for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_PRIMARY_ADDRESS + = fromString("MailboxPrimaryAddress"); - /** Static value MailboxUPN for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value MailboxUPN for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_UPN = fromString("MailboxUPN"); - /** Static value MailMessageDeliveryAction for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_DELIVERY_ACTION = - fromString("MailMessageDeliveryAction"); + /** + * Static value MailMessageDeliveryAction for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_DELIVERY_ACTION + = fromString("MailMessageDeliveryAction"); - /** Static value MailMessageDeliveryLocation for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_DELIVERY_LOCATION = - fromString("MailMessageDeliveryLocation"); + /** + * Static value MailMessageDeliveryLocation for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_DELIVERY_LOCATION + = fromString("MailMessageDeliveryLocation"); - /** Static value MailMessageRecipient for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_RECIPIENT = - fromString("MailMessageRecipient"); + /** + * Static value MailMessageRecipient for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_RECIPIENT + = fromString("MailMessageRecipient"); - /** Static value MailMessageSenderIP for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_SENDER_IP = - fromString("MailMessageSenderIP"); + /** + * Static value MailMessageSenderIP for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_SENDER_IP + = fromString("MailMessageSenderIP"); - /** Static value MailMessageSubject for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_SUBJECT = - fromString("MailMessageSubject"); + /** + * Static value MailMessageSubject for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_SUBJECT + = fromString("MailMessageSubject"); - /** Static value MailMessageP1Sender for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_P1SENDER = - fromString("MailMessageP1Sender"); + /** + * Static value MailMessageP1Sender for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_P1SENDER + = fromString("MailMessageP1Sender"); - /** Static value MailMessageP2Sender for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_P2SENDER = - fromString("MailMessageP2Sender"); + /** + * Static value MailMessageP2Sender for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_P2SENDER + = fromString("MailMessageP2Sender"); - /** Static value MalwareCategory for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty MALWARE_CATEGORY = - fromString("MalwareCategory"); + /** + * Static value MalwareCategory for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty MALWARE_CATEGORY + = fromString("MalwareCategory"); - /** Static value MalwareName for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value MalwareName for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty MALWARE_NAME = fromString("MalwareName"); - /** Static value ProcessCommandLine for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty PROCESS_COMMAND_LINE = - fromString("ProcessCommandLine"); + /** + * Static value ProcessCommandLine for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty PROCESS_COMMAND_LINE + = fromString("ProcessCommandLine"); - /** Static value ProcessId for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value ProcessId for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty PROCESS_ID = fromString("ProcessId"); - /** Static value RegistryKey for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value RegistryKey for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty REGISTRY_KEY = fromString("RegistryKey"); - /** Static value RegistryValueData for AutomationRulePropertyConditionSupportedProperty. */ - public static final AutomationRulePropertyConditionSupportedProperty REGISTRY_VALUE_DATA = - fromString("RegistryValueData"); + /** + * Static value RegistryValueData for AutomationRulePropertyConditionSupportedProperty. + */ + public static final AutomationRulePropertyConditionSupportedProperty REGISTRY_VALUE_DATA + = fromString("RegistryValueData"); - /** Static value Url for AutomationRulePropertyConditionSupportedProperty. */ + /** + * Static value Url for AutomationRulePropertyConditionSupportedProperty. + */ public static final AutomationRulePropertyConditionSupportedProperty URL = fromString("Url"); + /** + * Creates a new instance of AutomationRulePropertyConditionSupportedProperty value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutomationRulePropertyConditionSupportedProperty() { + } + /** * Creates or finds a AutomationRulePropertyConditionSupportedProperty from its string representation. - * + * * @param name a name to look for. * @return the corresponding AutomationRulePropertyConditionSupportedProperty. */ @@ -233,7 +360,7 @@ public static AutomationRulePropertyConditionSupportedProperty fromString(String /** * Gets known AutomationRulePropertyConditionSupportedProperty values. - * + * * @return known AutomationRulePropertyConditionSupportedProperty values. */ public static Collection values() { 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 9996382f4bdd..1357a358abd2 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The AutomationRulePropertyValuesChangedCondition model. */ +/** + * The AutomationRulePropertyValuesChangedCondition model. + */ @Fluent public final class AutomationRulePropertyValuesChangedCondition { /* @@ -35,9 +37,15 @@ public final class AutomationRulePropertyValuesChangedCondition { @JsonProperty(value = "propertyValues") private List propertyValues; + /** + * Creates an instance of AutomationRulePropertyValuesChangedCondition class. + */ + public AutomationRulePropertyValuesChangedCondition() { + } + /** * Get the propertyName property: The propertyName property. - * + * * @return the propertyName value. */ public AutomationRulePropertyChangedConditionSupportedPropertyType propertyName() { @@ -46,19 +54,19 @@ public AutomationRulePropertyChangedConditionSupportedPropertyType propertyName( /** * Set the propertyName property: The propertyName property. - * + * * @param propertyName the propertyName value to set. * @return the AutomationRulePropertyValuesChangedCondition object itself. */ - public AutomationRulePropertyValuesChangedCondition withPropertyName( - AutomationRulePropertyChangedConditionSupportedPropertyType propertyName) { + public AutomationRulePropertyValuesChangedCondition + withPropertyName(AutomationRulePropertyChangedConditionSupportedPropertyType propertyName) { this.propertyName = propertyName; return this; } /** * Get the changeType property: The changeType property. - * + * * @return the changeType value. */ public AutomationRulePropertyChangedConditionSupportedChangedType changeType() { @@ -67,19 +75,19 @@ public AutomationRulePropertyChangedConditionSupportedChangedType changeType() { /** * Set the changeType property: The changeType property. - * + * * @param changeType the changeType value to set. * @return the AutomationRulePropertyValuesChangedCondition object itself. */ - public AutomationRulePropertyValuesChangedCondition withChangeType( - AutomationRulePropertyChangedConditionSupportedChangedType changeType) { + public AutomationRulePropertyValuesChangedCondition + withChangeType(AutomationRulePropertyChangedConditionSupportedChangedType changeType) { this.changeType = changeType; return this; } /** * Get the operator property: The operator property. - * + * * @return the operator value. */ public AutomationRulePropertyConditionSupportedOperator operator() { @@ -88,19 +96,19 @@ public AutomationRulePropertyConditionSupportedOperator operator() { /** * Set the operator property: The operator property. - * + * * @param operator the operator value to set. * @return the AutomationRulePropertyValuesChangedCondition object itself. */ - public AutomationRulePropertyValuesChangedCondition withOperator( - AutomationRulePropertyConditionSupportedOperator operator) { + public AutomationRulePropertyValuesChangedCondition + withOperator(AutomationRulePropertyConditionSupportedOperator operator) { this.operator = operator; return this; } /** * Get the propertyValues property: The propertyValues property. - * + * * @return the propertyValues value. */ public List propertyValues() { @@ -109,7 +117,7 @@ public List propertyValues() { /** * Set the propertyValues property: The propertyValues property. - * + * * @param propertyValues the propertyValues value to set. * @return the AutomationRulePropertyValuesChangedCondition object itself. */ @@ -120,7 +128,7 @@ public AutomationRulePropertyValuesChangedCondition withPropertyValues(List propertyValues; + /** + * Creates an instance of AutomationRulePropertyValuesCondition class. + */ + public AutomationRulePropertyValuesCondition() { + } + /** * Get the propertyName property: The property to evaluate in an automation rule property condition. - * + * * @return the propertyName value. */ public AutomationRulePropertyConditionSupportedProperty propertyName() { @@ -40,19 +48,19 @@ public AutomationRulePropertyConditionSupportedProperty propertyName() { /** * Set the propertyName property: The property to evaluate in an automation rule property condition. - * + * * @param propertyName the propertyName value to set. * @return the AutomationRulePropertyValuesCondition object itself. */ - public AutomationRulePropertyValuesCondition withPropertyName( - AutomationRulePropertyConditionSupportedProperty propertyName) { + public AutomationRulePropertyValuesCondition + withPropertyName(AutomationRulePropertyConditionSupportedProperty propertyName) { this.propertyName = propertyName; return this; } /** * Get the operator property: The operator property. - * + * * @return the operator value. */ public AutomationRulePropertyConditionSupportedOperator operator() { @@ -61,19 +69,19 @@ public AutomationRulePropertyConditionSupportedOperator operator() { /** * Set the operator property: The operator property. - * + * * @param operator the operator value to set. * @return the AutomationRulePropertyValuesCondition object itself. */ - public AutomationRulePropertyValuesCondition withOperator( - AutomationRulePropertyConditionSupportedOperator operator) { + public AutomationRulePropertyValuesCondition + withOperator(AutomationRulePropertyConditionSupportedOperator operator) { this.operator = operator; return this; } /** * Get the propertyValues property: The propertyValues property. - * + * * @return the propertyValues value. */ public List propertyValues() { @@ -82,7 +90,7 @@ public List propertyValues() { /** * Set the propertyValues property: The propertyValues property. - * + * * @param propertyValues the propertyValues value to set. * @return the AutomationRulePropertyValuesCondition object itself. */ @@ -93,7 +101,7 @@ public AutomationRulePropertyValuesCondition withPropertyValues(List pro /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookAction.java index f2b367315f61..63af7e13f521 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 @@ -6,23 +6,53 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an automation rule action to run a playbook. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") +/** + * Describes an automation rule action to run a playbook. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "actionType", + defaultImpl = AutomationRuleRunPlaybookAction.class, + visible = true) @JsonTypeName("RunPlaybook") @Fluent public final class AutomationRuleRunPlaybookAction extends AutomationRuleAction { + /* + * The type of the automation rule action. + */ + @JsonTypeId + @JsonProperty(value = "actionType", required = true) + private ActionType actionType = ActionType.RUN_PLAYBOOK; + /* * The actionConfiguration property. */ @JsonProperty(value = "actionConfiguration") private PlaybookActionProperties actionConfiguration; + /** + * Creates an instance of AutomationRuleRunPlaybookAction class. + */ + public AutomationRuleRunPlaybookAction() { + } + + /** + * 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 PlaybookActionProperties actionConfiguration() { @@ -31,7 +61,7 @@ public PlaybookActionProperties actionConfiguration() { /** * Set the actionConfiguration property: The actionConfiguration property. - * + * * @param actionConfiguration the actionConfiguration value to set. * @return the AutomationRuleRunPlaybookAction object itself. */ @@ -40,7 +70,9 @@ public AutomationRuleRunPlaybookAction withActionConfiguration(PlaybookActionPro return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutomationRuleRunPlaybookAction withOrder(int order) { super.withOrder(order); @@ -49,7 +81,7 @@ public AutomationRuleRunPlaybookAction withOrder(int order) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 066a10e1830e..828cd6ab88e8 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 @@ -10,7 +10,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Describes automation rule triggering logic. */ +/** + * Describes automation rule triggering logic. + */ @Fluent public final class AutomationRuleTriggeringLogic { /* @@ -43,9 +45,15 @@ public final class AutomationRuleTriggeringLogic { @JsonProperty(value = "conditions") private List conditions; + /** + * Creates an instance of AutomationRuleTriggeringLogic class. + */ + public AutomationRuleTriggeringLogic() { + } + /** * Get the isEnabled property: Determines whether the automation rule is enabled or disabled. - * + * * @return the isEnabled value. */ public boolean isEnabled() { @@ -54,7 +62,7 @@ public boolean isEnabled() { /** * Set the isEnabled property: Determines whether the automation rule is enabled or disabled. - * + * * @param isEnabled the isEnabled value to set. * @return the AutomationRuleTriggeringLogic object itself. */ @@ -66,7 +74,7 @@ public AutomationRuleTriggeringLogic withIsEnabled(boolean isEnabled) { /** * Get the expirationTimeUtc property: Determines when the automation rule should automatically expire and be * disabled. - * + * * @return the expirationTimeUtc value. */ public OffsetDateTime expirationTimeUtc() { @@ -76,7 +84,7 @@ public OffsetDateTime expirationTimeUtc() { /** * Set the expirationTimeUtc property: Determines when the automation rule should automatically expire and be * disabled. - * + * * @param expirationTimeUtc the expirationTimeUtc value to set. * @return the AutomationRuleTriggeringLogic object itself. */ @@ -87,7 +95,7 @@ public AutomationRuleTriggeringLogic withExpirationTimeUtc(OffsetDateTime expira /** * Get the triggersOn property: The triggersOn property. - * + * * @return the triggersOn value. */ public TriggersOn triggersOn() { @@ -96,7 +104,7 @@ public TriggersOn triggersOn() { /** * Set the triggersOn property: The triggersOn property. - * + * * @param triggersOn the triggersOn value to set. * @return the AutomationRuleTriggeringLogic object itself. */ @@ -107,7 +115,7 @@ public AutomationRuleTriggeringLogic withTriggersOn(TriggersOn triggersOn) { /** * Get the triggersWhen property: The triggersWhen property. - * + * * @return the triggersWhen value. */ public TriggersWhen triggersWhen() { @@ -116,7 +124,7 @@ public TriggersWhen triggersWhen() { /** * Set the triggersWhen property: The triggersWhen property. - * + * * @param triggersWhen the triggersWhen value to set. * @return the AutomationRuleTriggeringLogic object itself. */ @@ -128,7 +136,7 @@ public AutomationRuleTriggeringLogic withTriggersWhen(TriggersWhen triggersWhen) /** * Get the conditions property: The conditions to evaluate to determine if the automation rule should be triggered * on a given object. - * + * * @return the conditions value. */ public List conditions() { @@ -138,7 +146,7 @@ public List conditions() { /** * Set the conditions property: The conditions to evaluate to determine if the automation rule should be triggered * on a given object. - * + * * @param conditions the conditions value to set. * @return the AutomationRuleTriggeringLogic object itself. */ @@ -149,21 +157,19 @@ public AutomationRuleTriggeringLogic withConditions(List e.validate()); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRules.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRules.java index 157bf09eeafd..ccedb6a317b4 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 @@ -8,67 +8,69 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AutomationRules. */ +/** + * Resource collection API of AutomationRules. + */ 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 automationRuleId Automation rule ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the automation rule. + * @return the automation rule along with {@link Response}. */ - AutomationRule get(String resourceGroupName, String workspaceName, String automationRuleId); + Response getWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, + Context context); /** * Gets the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the automation rule. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String automationRuleId, Context context); + AutomationRule get(String resourceGroupName, String workspaceName, String automationRuleId); /** * Delete the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. + * @return any object along with {@link Response}. */ - Object delete(String resourceGroupName, String workspaceName, String automationRuleId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, + Context context); /** * Delete the automation rule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param automationRuleId Automation rule ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 any object. */ - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String automationRuleId, Context context); + Object delete(String resourceGroupName, String workspaceName, String automationRuleId); /** * Gets all automation rules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -80,7 +82,7 @@ Response deleteWithResponse( /** * 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. @@ -93,7 +95,7 @@ Response deleteWithResponse( /** * Gets the automation rule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -104,7 +106,7 @@ Response deleteWithResponse( /** * Gets the automation rule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -116,7 +118,7 @@ Response deleteWithResponse( /** * Delete the automation rule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -127,7 +129,7 @@ Response deleteWithResponse( /** * Delete the automation rule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -139,7 +141,7 @@ Response deleteWithResponse( /** * Begins definition for a new AutomationRule resource. - * + * * @param name resource name. * @return the first stage of the new AutomationRule definition. */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulesList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulesList.java index ca0dc3474b77..f3223bbee360 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/models/AutomationRulesList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The AutomationRulesList model. */ +/** + * The AutomationRulesList model. + */ @Fluent public final class AutomationRulesList { /* @@ -24,9 +26,15 @@ public final class AutomationRulesList { @JsonProperty(value = "nextLink") private String nextLink; + /** + * Creates an instance of AutomationRulesList class. + */ + public AutomationRulesList() { + } + /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -35,7 +43,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the AutomationRulesList object itself. */ @@ -46,7 +54,7 @@ public AutomationRulesList withValue(List value) { /** * Get the nextLink property: The nextLink property. - * + * * @return the nextLink value. */ public String nextLink() { @@ -55,7 +63,7 @@ public String nextLink() { /** * Set the nextLink property: The nextLink property. - * + * * @param nextLink the nextLink value to set. * @return the AutomationRulesList object itself. */ @@ -66,7 +74,7 @@ public AutomationRulesList withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Availability.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Availability.java index 30665983543b..1c2c806a724e 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Connector Availability Status. */ +/** + * Connector Availability Status. + */ @Fluent public final class Availability { /* @@ -22,9 +24,15 @@ public final class Availability { @JsonProperty(value = "isPreview") 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() { @@ -33,7 +41,7 @@ public AvailabilityStatus status() { /** * Set the status property: The connector Availability Status. - * + * * @param status the status value to set. * @return the Availability object itself. */ @@ -44,7 +52,7 @@ public Availability withStatus(AvailabilityStatus status) { /** * Get the isPreview property: Set connector as preview. - * + * * @return the isPreview value. */ public Boolean isPreview() { @@ -53,7 +61,7 @@ public Boolean isPreview() { /** * Set the isPreview property: Set connector as preview. - * + * * @param isPreview the isPreview value to set. * @return the Availability object itself. */ @@ -64,7 +72,7 @@ public Availability withIsPreview(Boolean isPreview) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AvailabilityStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AvailabilityStatus.java index 4943056eabbf..e503351d5096 100644 --- 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 @@ -7,12 +7,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The connector Availability Status. */ +/** + * The connector Availability Status. + */ public enum AvailabilityStatus { - /** Enum value 1. */ + /** + * Enum value 1. + */ ONE(1); - /** The actual serialized value for a AvailabilityStatus instance. */ + /** + * The actual serialized value for a AvailabilityStatus instance. + */ private final int value; AvailabilityStatus(int value) { @@ -21,7 +27,7 @@ public enum AvailabilityStatus { /** * 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. */ @@ -38,7 +44,7 @@ public static AvailabilityStatus fromInt(int value) { /** * De-serializes the instance to int value. - * + * * @return the int value. */ @JsonValue 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..bd831fe1e703 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsAuthModel.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for API authentication with AWS. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = AwsAuthModel.class, visible = true) +@JsonTypeName("AWS") +@Fluent +public final class AwsAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private CcpAuthType type = CcpAuthType.AWS; + + /* + * AWS STS assume role ARN + */ + @JsonProperty(value = "roleArn", required = true) + 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' + */ + @JsonProperty(value = "externalId") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (roleArn() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property roleArn in model AwsAuthModel")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AwsAuthModel.class); +} 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 index 047f80cbc5a1..1ea76c5328a9 100644 --- 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 @@ -5,17 +5,48 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Amazon Web Services CloudTrail requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Amazon Web Services CloudTrail requirements check request. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = AwsCloudTrailCheckRequirements.class, + visible = true) @JsonTypeName("AmazonWebServicesCloudTrail") @Immutable public final class AwsCloudTrailCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 85fed62b4c13..28abbb160cac 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 @@ -8,30 +8,62 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AwsCloudTrailDataConnectorProperties; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Amazon Web Services CloudTrail data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Amazon Web Services CloudTrail data connector. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = AwsCloudTrailDataConnector.class, + visible = true) @JsonTypeName("AmazonWebServicesCloudTrail") @Fluent public final class AwsCloudTrailDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.AMAZON_WEB_SERVICES_CLOUD_TRAIL; + /* * Amazon Web Services CloudTrail data connector properties. */ @JsonProperty(value = "properties") private AwsCloudTrailDataConnectorProperties innerProperties; + /** + * Creates an instance of AwsCloudTrailDataConnector class. + */ + public AwsCloudTrailDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Amazon Web Services CloudTrail data connector properties. - * + * * @return the innerProperties value. */ private AwsCloudTrailDataConnectorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AwsCloudTrailDataConnector withEtag(String etag) { super.withEtag(etag); @@ -41,7 +73,7 @@ public AwsCloudTrailDataConnector withEtag(String etag) { /** * Get the awsRoleArn property: The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws * account. - * + * * @return the awsRoleArn value. */ public String awsRoleArn() { @@ -51,7 +83,7 @@ public String awsRoleArn() { /** * Set the awsRoleArn property: The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws * account. - * + * * @param awsRoleArn the awsRoleArn value to set. * @return the AwsCloudTrailDataConnector object itself. */ @@ -65,7 +97,7 @@ public AwsCloudTrailDataConnector withAwsRoleArn(String awsRoleArn) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AwsCloudTrailDataConnectorDataTypes dataTypes() { @@ -74,7 +106,7 @@ public AwsCloudTrailDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the AwsCloudTrailDataConnector object itself. */ @@ -88,7 +120,7 @@ public AwsCloudTrailDataConnector withDataTypes(AwsCloudTrailDataConnectorDataTy /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 019e54161be6..490490b586f0 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for Amazon Web Services CloudTrail data connector. */ +/** + * The available data types for Amazon Web Services CloudTrail data connector. + */ @Fluent public final class AwsCloudTrailDataConnectorDataTypes { /* @@ -17,9 +19,15 @@ public final class AwsCloudTrailDataConnectorDataTypes { @JsonProperty(value = "logs", required = true) private AwsCloudTrailDataConnectorDataTypesLogs logs; + /** + * Creates an instance of AwsCloudTrailDataConnectorDataTypes class. + */ + public AwsCloudTrailDataConnectorDataTypes() { + } + /** * Get the logs property: Logs data type. - * + * * @return the logs value. */ public AwsCloudTrailDataConnectorDataTypesLogs logs() { @@ -28,7 +36,7 @@ public AwsCloudTrailDataConnectorDataTypesLogs logs() { /** * Set the logs property: Logs data type. - * + * * @param logs the logs value to set. * @return the AwsCloudTrailDataConnectorDataTypes object itself. */ @@ -39,15 +47,14 @@ public AwsCloudTrailDataConnectorDataTypes withLogs(AwsCloudTrailDataConnectorDa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (logs() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property logs in model AwsCloudTrailDataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property logs in model AwsCloudTrailDataConnectorDataTypes")); } else { logs().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypesLogs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypesLogs.java index f11d9c72a1d9..24bce0e39269 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Logs data type. */ +/** + * Logs data type. + */ @Fluent public final class AwsCloudTrailDataConnectorDataTypesLogs extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of AwsCloudTrailDataConnectorDataTypesLogs class. + */ + public AwsCloudTrailDataConnectorDataTypesLogs() { + } + + /** + * {@inheritDoc} + */ @Override public AwsCloudTrailDataConnectorDataTypesLogs withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public AwsCloudTrailDataConnectorDataTypesLogs withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index ddfb6f7d40c1..2099bcfef5ce 100644 --- 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 @@ -5,17 +5,44 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Amazon Web Services S3 requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Amazon Web Services S3 requirements check request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AwsS3CheckRequirements.class, visible = true) @JsonTypeName("AmazonWebServicesS3") @Immutable public final class AwsS3CheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 3739b6ccb523..98e465be3974 100644 --- 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 @@ -8,31 +8,59 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AwsS3DataConnectorProperties; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** Represents Amazon Web Services S3 data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Amazon Web Services S3 data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AwsS3DataConnector.class, visible = true) @JsonTypeName("AmazonWebServicesS3") @Fluent public final class AwsS3DataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.AMAZON_WEB_SERVICES_S3; + /* * Amazon Web Services S3 data connector properties. */ @JsonProperty(value = "properties") private AwsS3DataConnectorProperties innerProperties; + /** + * Creates an instance of AwsS3DataConnector class. + */ + public AwsS3DataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AwsS3DataConnector withEtag(String etag) { super.withEtag(etag); @@ -41,7 +69,7 @@ public AwsS3DataConnector withEtag(String etag) { /** * Get the destinationTable property: The logs destination table name in LogAnalytics. - * + * * @return the destinationTable value. */ public String destinationTable() { @@ -50,7 +78,7 @@ public String destinationTable() { /** * Set the destinationTable property: The logs destination table name in LogAnalytics. - * + * * @param destinationTable the destinationTable value to set. * @return the AwsS3DataConnector object itself. */ @@ -64,7 +92,7 @@ public AwsS3DataConnector withDestinationTable(String destinationTable) { /** * Get the sqsUrls property: The AWS sqs urls for the connector. - * + * * @return the sqsUrls value. */ public List sqsUrls() { @@ -73,7 +101,7 @@ public List sqsUrls() { /** * Set the sqsUrls property: The AWS sqs urls for the connector. - * + * * @param sqsUrls the sqsUrls value to set. * @return the AwsS3DataConnector object itself. */ @@ -87,7 +115,7 @@ public AwsS3DataConnector withSqsUrls(List sqsUrls) { /** * Get the roleArn property: The Aws Role Arn that is used to access the Aws account. - * + * * @return the roleArn value. */ public String roleArn() { @@ -96,7 +124,7 @@ public String 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. */ @@ -110,7 +138,7 @@ public AwsS3DataConnector withRoleArn(String roleArn) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AwsS3DataConnectorDataTypes dataTypes() { @@ -119,7 +147,7 @@ public AwsS3DataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the AwsS3DataConnector object itself. */ @@ -133,7 +161,7 @@ public AwsS3DataConnector withDataTypes(AwsS3DataConnectorDataTypes dataTypes) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 14c7a6754785..5a05da89c921 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for Amazon Web Services S3 data connector. */ +/** + * The available data types for Amazon Web Services S3 data connector. + */ @Fluent public final class AwsS3DataConnectorDataTypes { /* @@ -17,9 +19,15 @@ public final class AwsS3DataConnectorDataTypes { @JsonProperty(value = "logs", required = true) 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() { @@ -28,7 +36,7 @@ public AwsS3DataConnectorDataTypesLogs logs() { /** * Set the logs property: Logs data type. - * + * * @param logs the logs value to set. * @return the AwsS3DataConnectorDataTypes object itself. */ @@ -39,15 +47,14 @@ public AwsS3DataConnectorDataTypes withLogs(AwsS3DataConnectorDataTypesLogs logs /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (logs() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property logs in model AwsS3DataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property logs in model AwsS3DataConnectorDataTypes")); } else { logs().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypesLogs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypesLogs.java index dd24d8ad6de3..5587bbc1d81a 100644 --- 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Logs data type. */ +/** + * Logs data type. + */ @Fluent public final class AwsS3DataConnectorDataTypesLogs extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of AwsS3DataConnectorDataTypesLogs class. + */ + public AwsS3DataConnectorDataTypesLogs() { + } + + /** + * {@inheritDoc} + */ @Override public AwsS3DataConnectorDataTypesLogs withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public AwsS3DataConnectorDataTypesLogs withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 4c8ea0212461..153222e642ac 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Resources created in Azure DevOps repository. */ +/** + * Resources created in Azure DevOps repository. + */ @Fluent public final class AzureDevOpsResourceInfo { /* @@ -22,9 +24,15 @@ public final class AzureDevOpsResourceInfo { @JsonProperty(value = "serviceConnectionId") private String serviceConnectionId; + /** + * Creates an instance of AzureDevOpsResourceInfo class. + */ + public AzureDevOpsResourceInfo() { + } + /** * Get the pipelineId property: Id of the pipeline created for the source-control. - * + * * @return the pipelineId value. */ public String pipelineId() { @@ -33,7 +41,7 @@ public String pipelineId() { /** * Set the pipelineId property: Id of the pipeline created for the source-control. - * + * * @param pipelineId the pipelineId value to set. * @return the AzureDevOpsResourceInfo object itself. */ @@ -44,7 +52,7 @@ public AzureDevOpsResourceInfo withPipelineId(String pipelineId) { /** * Get the serviceConnectionId property: Id of the service-connection created for the source-control. - * + * * @return the serviceConnectionId value. */ public String serviceConnectionId() { @@ -53,7 +61,7 @@ public String serviceConnectionId() { /** * Set the serviceConnectionId property: Id of the service-connection created for the source-control. - * + * * @param serviceConnectionId the serviceConnectionId value to set. * @return the AzureDevOpsResourceInfo object itself. */ @@ -64,7 +72,7 @@ public AzureDevOpsResourceInfo withServiceConnectionId(String serviceConnectionI /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureEntityResource.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureEntityResource.java new file mode 100644 index 000000000000..329c6f65e0a1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureEntityResource.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Entity Resource + * + * The resource model definition for an Azure Resource Manager resource with an etag. + */ +@Immutable +public class AzureEntityResource extends ProxyResource { + /* + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of AzureEntityResource class. + */ + public AzureEntityResource() { + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureResourceEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureResourceEntity.java index 64b4871d5cf4..1e161cc18994 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 @@ -4,28 +4,54 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.AzureResourceEntityProperties; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** Represents an azure resource entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents an azure resource entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AzureResourceEntity.class, visible = true) @JsonTypeName("AzureResource") -@Fluent +@Immutable public final class AzureResourceEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.AZURE_RESOURCE; + /* * AzureResource entity properties */ @JsonProperty(value = "properties") private AzureResourceEntityProperties innerProperties; + /** + * Creates an instance of AzureResourceEntity class. + */ + public AzureResourceEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: AzureResource entity properties. - * + * * @return the innerProperties value. */ private AzureResourceEntityProperties innerProperties() { @@ -34,7 +60,7 @@ private AzureResourceEntityProperties innerProperties() { /** * Get the resourceId property: The azure resource id of the resource. - * + * * @return the resourceId value. */ public String resourceId() { @@ -43,7 +69,7 @@ public String resourceId() { /** * Get the subscriptionId property: The subscription id of the resource. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -53,7 +79,7 @@ public String subscriptionId() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -63,7 +89,7 @@ public Map 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() { @@ -72,7 +98,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..8f425c2aa937 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BasicAuthModel.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for API authentication with basic flow - user name + password. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = BasicAuthModel.class, visible = true) +@JsonTypeName("Basic") +@Fluent +public final class BasicAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private CcpAuthType type = CcpAuthType.BASIC; + + /* + * The user name. + */ + @JsonProperty(value = "userName", required = true) + private String username; + + /* + * The password + */ + @JsonProperty(value = "password", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (username() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property username in model BasicAuthModel")); + } + if (password() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property password in model BasicAuthModel")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BasicAuthModel.class); +} 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..d337cf2e29ae --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistic.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.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 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 kind property: The kind of the billing statistic. + * + * @return the kind value. + */ + BillingStatisticKind kind(); + + /** + * 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..41d038e9a7ef --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatisticKind.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The kind of the billing statistic. + */ +public final class BillingStatisticKind extends ExpandableStringEnum { + /** + * Static value SapSolutionUsage for BillingStatisticKind. + */ + 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. + */ + @JsonCreator + 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/BillingStatisticList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatisticList.java new file mode 100644 index 000000000000..cc41cbf7b27f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatisticList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of all Microsoft Sentinel billing statistics. + */ +@Fluent +public final class BillingStatisticList { + /* + * URL to fetch the next set of billing statistics. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of billing statistics. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of BillingStatisticList class. + */ + public BillingStatisticList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of billing statistics. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of billing statistics. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of billing statistics. + * + * @param value the value value to set. + * @return the BillingStatisticList object itself. + */ + public BillingStatisticList 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 BillingStatisticList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BillingStatisticList.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..da93c3681b5e --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BillingStatistics. + */ +public interface BillingStatistics { + /** + * 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); + + /** + * 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); +} 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 bfdfb6f62b95..348d0badacfc 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 @@ -10,621 +10,717 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of Bookmark. */ +/** + * An immutable client-side representation of Bookmark. + */ public interface Bookmark { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the created property: The time the bookmark was created. - * + * * @return the created value. */ OffsetDateTime created(); /** * Gets the createdBy property: Describes a user that created the bookmark. - * + * * @return the createdBy value. */ UserInfo createdBy(); /** * Gets the displayName property: The display name of the bookmark. - * + * * @return the displayName value. */ String displayName(); /** * Gets the labels property: List of labels relevant to this bookmark. - * + * * @return the labels value. */ List labels(); /** * Gets the notes property: The notes of the bookmark. - * + * * @return the notes value. */ String notes(); /** * Gets the query property: The query of the bookmark. - * + * * @return the query value. */ String query(); /** * Gets the queryResult property: The query result of the bookmark. - * + * * @return the queryResult value. */ String queryResult(); /** * Gets the updated property: The last time the bookmark was updated. - * + * * @return the updated value. */ OffsetDateTime updated(); /** * Gets the updatedBy property: Describes a user that updated the bookmark. - * + * * @return the updatedBy value. */ UserInfo updatedBy(); /** * Gets the eventTime property: The bookmark event time. - * + * * @return the eventTime value. */ OffsetDateTime eventTime(); /** * Gets the queryStartTime property: The start time for the query. - * + * * @return the queryStartTime value. */ OffsetDateTime queryStartTime(); /** * Gets the queryEndTime property: The end time for the query. - * + * * @return the queryEndTime value. */ OffsetDateTime queryEndTime(); /** * Gets the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @return the incidentInfo value. */ IncidentInfo incidentInfo(); /** * Gets the 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. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner object. - * + * * @return the inner object. */ BookmarkInner innerModel(); - /** The entirety of the Bookmark definition. */ + /** + * The entirety of the Bookmark definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The Bookmark definition stages. */ + + /** + * The Bookmark definition stages. + */ interface DefinitionStages { - /** The first stage of the Bookmark definition. */ + /** + * The first stage of the Bookmark definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Bookmark definition allowing to specify parent resource. */ + + /** + * The stage of the Bookmark definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** * The stage of the Bookmark definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithEtag, - DefinitionStages.WithCreated, - DefinitionStages.WithCreatedBy, - DefinitionStages.WithDisplayName, - DefinitionStages.WithLabels, - DefinitionStages.WithNotes, - DefinitionStages.WithQuery, - DefinitionStages.WithQueryResult, - DefinitionStages.WithUpdated, - DefinitionStages.WithUpdatedBy, - DefinitionStages.WithEventTime, - DefinitionStages.WithQueryStartTime, - DefinitionStages.WithQueryEndTime, - DefinitionStages.WithIncidentInfo, - DefinitionStages.WithEntityMappings, - DefinitionStages.WithTactics, - DefinitionStages.WithTechniques { + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithCreated, + DefinitionStages.WithCreatedBy, DefinitionStages.WithDisplayName, DefinitionStages.WithLabels, + DefinitionStages.WithNotes, DefinitionStages.WithQuery, DefinitionStages.WithQueryResult, + DefinitionStages.WithUpdated, DefinitionStages.WithUpdatedBy, DefinitionStages.WithEventTime, + DefinitionStages.WithQueryStartTime, DefinitionStages.WithQueryEndTime, DefinitionStages.WithIncidentInfo, + DefinitionStages.WithEntityMappings, DefinitionStages.WithTactics, DefinitionStages.WithTechniques { /** * Executes the create request. - * + * * @return the created resource. */ Bookmark create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Bookmark create(Context context); } - /** The stage of the Bookmark definition allowing to specify etag. */ + + /** + * The stage of the Bookmark definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the Bookmark definition allowing to specify created. */ + + /** + * The stage of the Bookmark definition allowing to specify created. + */ interface WithCreated { /** * Specifies the created property: The time the bookmark was created. - * + * * @param created The time the bookmark was created. * @return the next definition stage. */ WithCreate withCreated(OffsetDateTime created); } - /** The stage of the Bookmark definition allowing to specify createdBy. */ + + /** + * The stage of the Bookmark definition allowing to specify createdBy. + */ interface WithCreatedBy { /** * Specifies the createdBy property: Describes a user that created the bookmark. - * + * * @param createdBy Describes a user that created the bookmark. * @return the next definition stage. */ WithCreate withCreatedBy(UserInfo createdBy); } - /** The stage of the Bookmark definition allowing to specify displayName. */ + + /** + * The stage of the Bookmark definition allowing to specify displayName. + */ interface WithDisplayName { /** * Specifies the displayName property: The display name of the bookmark. - * + * * @param displayName The display name of the bookmark. * @return the next definition stage. */ WithCreate withDisplayName(String displayName); } - /** The stage of the Bookmark definition allowing to specify labels. */ + + /** + * The stage of the Bookmark definition allowing to specify labels. + */ interface WithLabels { /** * Specifies the labels property: List of labels relevant to this bookmark. - * + * * @param labels List of labels relevant to this bookmark. * @return the next definition stage. */ WithCreate withLabels(List labels); } - /** The stage of the Bookmark definition allowing to specify notes. */ + + /** + * The stage of the Bookmark definition allowing to specify notes. + */ interface WithNotes { /** * Specifies the notes property: The notes of the bookmark. - * + * * @param notes The notes of the bookmark. * @return the next definition stage. */ WithCreate withNotes(String notes); } - /** The stage of the Bookmark definition allowing to specify query. */ + + /** + * The stage of the Bookmark definition allowing to specify query. + */ interface WithQuery { /** * Specifies the query property: The query of the bookmark.. - * + * * @param query The query of the bookmark. * @return the next definition stage. */ WithCreate withQuery(String query); } - /** The stage of the Bookmark definition allowing to specify queryResult. */ + + /** + * The stage of the Bookmark definition allowing to specify queryResult. + */ interface WithQueryResult { /** * Specifies the queryResult property: The query result of the bookmark.. - * + * * @param queryResult The query result of the bookmark. * @return the next definition stage. */ WithCreate withQueryResult(String queryResult); } - /** The stage of the Bookmark definition allowing to specify updated. */ + + /** + * The stage of the Bookmark definition allowing to specify updated. + */ interface WithUpdated { /** * Specifies the updated property: The last time the bookmark was updated. - * + * * @param updated The last time the bookmark was updated. * @return the next definition stage. */ WithCreate withUpdated(OffsetDateTime updated); } - /** The stage of the Bookmark definition allowing to specify updatedBy. */ + + /** + * The stage of the Bookmark definition allowing to specify updatedBy. + */ interface WithUpdatedBy { /** * Specifies the updatedBy property: Describes a user that updated the bookmark. - * + * * @param updatedBy Describes a user that updated the bookmark. * @return the next definition stage. */ WithCreate withUpdatedBy(UserInfo updatedBy); } - /** The stage of the Bookmark definition allowing to specify eventTime. */ + + /** + * The stage of the Bookmark definition allowing to specify eventTime. + */ interface WithEventTime { /** * Specifies the eventTime property: The bookmark event time. - * + * * @param eventTime The bookmark event time. * @return the next definition stage. */ WithCreate withEventTime(OffsetDateTime eventTime); } - /** The stage of the Bookmark definition allowing to specify queryStartTime. */ + + /** + * The stage of the Bookmark definition allowing to specify queryStartTime. + */ interface WithQueryStartTime { /** * Specifies the queryStartTime property: The start time for the query. - * + * * @param queryStartTime The start time for the query. * @return the next definition stage. */ WithCreate withQueryStartTime(OffsetDateTime queryStartTime); } - /** The stage of the Bookmark definition allowing to specify queryEndTime. */ + + /** + * The stage of the Bookmark definition allowing to specify queryEndTime. + */ interface WithQueryEndTime { /** * Specifies the queryEndTime property: The end time for the query. - * + * * @param queryEndTime The end time for the query. * @return the next definition stage. */ WithCreate withQueryEndTime(OffsetDateTime queryEndTime); } - /** The stage of the Bookmark definition allowing to specify incidentInfo. */ + + /** + * The stage of the Bookmark definition allowing to specify incidentInfo. + */ interface WithIncidentInfo { /** * Specifies the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @param incidentInfo Describes an incident that relates to bookmark. * @return the next definition stage. */ WithCreate withIncidentInfo(IncidentInfo incidentInfo); } - /** The stage of the Bookmark definition allowing to specify entityMappings. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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); } } + /** * Begins update for the Bookmark resource. - * + * * @return the stage of resource update. */ Bookmark.Update update(); - /** The template for Bookmark update. */ - interface Update - extends UpdateStages.WithEtag, - UpdateStages.WithCreated, - UpdateStages.WithCreatedBy, - UpdateStages.WithDisplayName, - UpdateStages.WithLabels, - UpdateStages.WithNotes, - UpdateStages.WithQuery, - UpdateStages.WithQueryResult, - UpdateStages.WithUpdated, - UpdateStages.WithUpdatedBy, - UpdateStages.WithEventTime, - UpdateStages.WithQueryStartTime, - UpdateStages.WithQueryEndTime, - UpdateStages.WithIncidentInfo, - UpdateStages.WithEntityMappings, - UpdateStages.WithTactics, - UpdateStages.WithTechniques { + /** + * The template for Bookmark update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithCreated, UpdateStages.WithCreatedBy, + UpdateStages.WithDisplayName, UpdateStages.WithLabels, UpdateStages.WithNotes, UpdateStages.WithQuery, + UpdateStages.WithQueryResult, UpdateStages.WithUpdated, UpdateStages.WithUpdatedBy, UpdateStages.WithEventTime, + UpdateStages.WithQueryStartTime, UpdateStages.WithQueryEndTime, UpdateStages.WithIncidentInfo, + UpdateStages.WithEntityMappings, UpdateStages.WithTactics, UpdateStages.WithTechniques { /** * Executes the update request. - * + * * @return the updated resource. */ Bookmark apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Bookmark apply(Context context); } - /** The Bookmark update stages. */ + + /** + * The Bookmark update stages. + */ interface UpdateStages { - /** The stage of the Bookmark update allowing to specify etag. */ + /** + * The stage of the Bookmark update allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ Update withEtag(String etag); } - /** The stage of the Bookmark update allowing to specify created. */ + + /** + * The stage of the Bookmark update allowing to specify created. + */ interface WithCreated { /** * Specifies the created property: The time the bookmark was created. - * + * * @param created The time the bookmark was created. * @return the next definition stage. */ Update withCreated(OffsetDateTime created); } - /** The stage of the Bookmark update allowing to specify createdBy. */ + + /** + * The stage of the Bookmark update allowing to specify createdBy. + */ interface WithCreatedBy { /** * Specifies the createdBy property: Describes a user that created the bookmark. - * + * * @param createdBy Describes a user that created the bookmark. * @return the next definition stage. */ Update withCreatedBy(UserInfo createdBy); } - /** The stage of the Bookmark update allowing to specify displayName. */ + + /** + * The stage of the Bookmark update allowing to specify displayName. + */ interface WithDisplayName { /** * Specifies the displayName property: The display name of the bookmark. - * + * * @param displayName The display name of the bookmark. * @return the next definition stage. */ Update withDisplayName(String displayName); } - /** The stage of the Bookmark update allowing to specify labels. */ + + /** + * The stage of the Bookmark update allowing to specify labels. + */ interface WithLabels { /** * Specifies the labels property: List of labels relevant to this bookmark. - * + * * @param labels List of labels relevant to this bookmark. * @return the next definition stage. */ Update withLabels(List labels); } - /** The stage of the Bookmark update allowing to specify notes. */ + + /** + * The stage of the Bookmark update allowing to specify notes. + */ interface WithNotes { /** * Specifies the notes property: The notes of the bookmark. - * + * * @param notes The notes of the bookmark. * @return the next definition stage. */ Update withNotes(String notes); } - /** The stage of the Bookmark update allowing to specify query. */ + + /** + * The stage of the Bookmark update allowing to specify query. + */ interface WithQuery { /** * Specifies the query property: The query of the bookmark.. - * + * * @param query The query of the bookmark. * @return the next definition stage. */ Update withQuery(String query); } - /** The stage of the Bookmark update allowing to specify queryResult. */ + + /** + * The stage of the Bookmark update allowing to specify queryResult. + */ interface WithQueryResult { /** * Specifies the queryResult property: The query result of the bookmark.. - * + * * @param queryResult The query result of the bookmark. * @return the next definition stage. */ Update withQueryResult(String queryResult); } - /** The stage of the Bookmark update allowing to specify updated. */ + + /** + * The stage of the Bookmark update allowing to specify updated. + */ interface WithUpdated { /** * Specifies the updated property: The last time the bookmark was updated. - * + * * @param updated The last time the bookmark was updated. * @return the next definition stage. */ Update withUpdated(OffsetDateTime updated); } - /** The stage of the Bookmark update allowing to specify updatedBy. */ + + /** + * The stage of the Bookmark update allowing to specify updatedBy. + */ interface WithUpdatedBy { /** * Specifies the updatedBy property: Describes a user that updated the bookmark. - * + * * @param updatedBy Describes a user that updated the bookmark. * @return the next definition stage. */ Update withUpdatedBy(UserInfo updatedBy); } - /** The stage of the Bookmark update allowing to specify eventTime. */ + + /** + * The stage of the Bookmark update allowing to specify eventTime. + */ interface WithEventTime { /** * Specifies the eventTime property: The bookmark event time. - * + * * @param eventTime The bookmark event time. * @return the next definition stage. */ Update withEventTime(OffsetDateTime eventTime); } - /** The stage of the Bookmark update allowing to specify queryStartTime. */ + + /** + * The stage of the Bookmark update allowing to specify queryStartTime. + */ interface WithQueryStartTime { /** * Specifies the queryStartTime property: The start time for the query. - * + * * @param queryStartTime The start time for the query. * @return the next definition stage. */ Update withQueryStartTime(OffsetDateTime queryStartTime); } - /** The stage of the Bookmark update allowing to specify queryEndTime. */ + + /** + * The stage of the Bookmark update allowing to specify queryEndTime. + */ interface WithQueryEndTime { /** * Specifies the queryEndTime property: The end time for the query. - * + * * @param queryEndTime The end time for the query. * @return the next definition stage. */ Update withQueryEndTime(OffsetDateTime queryEndTime); } - /** The stage of the Bookmark update allowing to specify incidentInfo. */ + + /** + * The stage of the Bookmark update allowing to specify incidentInfo. + */ interface WithIncidentInfo { /** * Specifies the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @param incidentInfo Describes an incident that relates to bookmark. * @return the next definition stage. */ Update withIncidentInfo(IncidentInfo incidentInfo); } - /** The stage of the Bookmark update allowing to specify entityMappings. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Bookmark refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ 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 index b46a2d88c95d..92853a149789 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes the entity mappings of a single entity. */ +/** + * Describes the entity mappings of a single entity. + */ @Fluent public final class BookmarkEntityMappings { /* @@ -23,9 +25,15 @@ public final class BookmarkEntityMappings { @JsonProperty(value = "fieldMappings") 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() { @@ -34,7 +42,7 @@ public String entityType() { /** * Set the entityType property: The entity type. - * + * * @param entityType the entityType value to set. * @return the BookmarkEntityMappings object itself. */ @@ -45,7 +53,7 @@ public BookmarkEntityMappings withEntityType(String entityType) { /** * Get the fieldMappings property: Array of fields mapping for that entity type. - * + * * @return the fieldMappings value. */ public List fieldMappings() { @@ -54,7 +62,7 @@ public List 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. */ @@ -65,7 +73,7 @@ public BookmarkEntityMappings withFieldMappings(List fieldMa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandParameters.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandParameters.java index ea70e0521448..68687de257fc 100644 --- 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 @@ -9,7 +9,9 @@ import java.time.OffsetDateTime; import java.util.UUID; -/** The parameters required to execute an expand operation on the given bookmark. */ +/** + * The parameters required to execute an expand operation on the given bookmark. + */ @Fluent public final class BookmarkExpandParameters { /* @@ -30,9 +32,15 @@ public final class BookmarkExpandParameters { @JsonProperty(value = "startTime") 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() { @@ -41,7 +49,7 @@ public OffsetDateTime 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. */ @@ -52,7 +60,7 @@ public BookmarkExpandParameters withEndTime(OffsetDateTime endTime) { /** * Get the expansionId property: The Id of the expansion to perform. - * + * * @return the expansionId value. */ public UUID expansionId() { @@ -61,7 +69,7 @@ public UUID expansionId() { /** * Set the expansionId property: The Id of the expansion to perform. - * + * * @param expansionId the expansionId value to set. * @return the BookmarkExpandParameters object itself. */ @@ -72,7 +80,7 @@ public BookmarkExpandParameters withExpansionId(UUID expansionId) { /** * 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() { @@ -81,7 +89,7 @@ public OffsetDateTime 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. */ @@ -92,7 +100,7 @@ public BookmarkExpandParameters withStartTime(OffsetDateTime startTime) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponse.java index 0df634388d5e..bd7abecdfabe 100644 --- 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 @@ -6,25 +6,27 @@ import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner; -/** An immutable client-side representation of BookmarkExpandResponse. */ +/** + * 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 index b9b48339a131..7e269098fce0 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The expansion result values. */ +/** + * The expansion result values. + */ @Fluent public final class BookmarkExpandResponseValue { /* @@ -24,9 +26,15 @@ public final class BookmarkExpandResponseValue { @JsonProperty(value = "edges") private List edges; + /** + * Creates an instance of BookmarkExpandResponseValue class. + */ + public BookmarkExpandResponseValue() { + } + /** * Get the entities property: Array of the expansion result entities. - * + * * @return the entities value. */ public List entities() { @@ -35,7 +43,7 @@ public List entities() { /** * Set the entities property: Array of the expansion result entities. - * + * * @param entities the entities value to set. * @return the BookmarkExpandResponseValue object itself. */ @@ -46,7 +54,7 @@ public BookmarkExpandResponseValue withEntities(List entities) { /** * Get the edges property: Array of expansion result connected entities. - * + * * @return the edges value. */ public List edges() { @@ -55,7 +63,7 @@ public List edges() { /** * Set the edges property: Array of expansion result connected entities. - * + * * @param edges the edges value to set. * @return the BookmarkExpandResponseValue object itself. */ @@ -66,7 +74,7 @@ public BookmarkExpandResponseValue withEdges(List edges) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkList.java index f89890b19242..c2147bde0eea 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/models/BookmarkList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the bookmarks. */ +/** + * List all the bookmarks. + */ @Fluent public final class BookmarkList { /* @@ -25,9 +27,15 @@ public final class BookmarkList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of BookmarkList class. + */ + public BookmarkList() { + } + /** * Get the nextLink property: URL to fetch the next set of bookmarks. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of bookmarks. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of bookmarks. - * + * * @param value the value value to set. * @return the BookmarkList object itself. */ @@ -56,14 +64,13 @@ public BookmarkList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model BookmarkList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model BookmarkList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkOperations.java index cf54322f2c78..21b4cefc76d3 100644 --- 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 @@ -7,40 +7,38 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of BookmarkOperations. */ +/** + * Resource collection API of BookmarkOperations. + */ public interface BookmarkOperations { /** * Expand an bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param parameters The parameters required to execute an expand operation on the given bookmark. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return the entity expansion result operation response along with {@link Response}. */ - BookmarkExpandResponse expand( - String resourceGroupName, String workspaceName, String bookmarkId, BookmarkExpandParameters parameters); + 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 workspace. * @param bookmarkId Bookmark ID. * @param parameters The parameters required to execute an expand operation on the given bookmark. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entity expansion result operation response along with {@link Response}. + * @return the entity expansion result operation response. */ - Response expandWithResponse( - String resourceGroupName, - String workspaceName, - String bookmarkId, - BookmarkExpandParameters parameters, - Context context); + 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 index e1db491640d0..32ac4cf02886 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of BookmarkRelations. */ +/** + * Resource collection API of BookmarkRelations. + */ public interface BookmarkRelations { /** * Gets all bookmark relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -25,7 +27,7 @@ public interface BookmarkRelations { /** * Gets all bookmark relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -33,86 +35,79 @@ public interface BookmarkRelations { * @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. + * 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); + PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId, String filter, + String orderby, Integer top, String skipToken, Context context); /** * Gets a bookmark relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. * @param relationName Relation Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return a bookmark relation along with {@link Response}. */ - Relation get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return a bookmark relation. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context); + 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}. */ - void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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); + void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); /** * 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. @@ -123,7 +118,7 @@ Response deleteWithResponse( /** * 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. @@ -135,7 +130,7 @@ Response deleteWithResponse( /** * 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. @@ -145,7 +140,7 @@ Response deleteWithResponse( /** * 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. @@ -157,7 +152,7 @@ Response deleteWithResponse( /** * Begins definition for a new Relation resource. - * + * * @param name resource name. * @return the first stage of the new Relation definition. */ 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 index bfad411f1ce6..e433d08a79a2 100644 --- 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 @@ -7,16 +7,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents bookmark timeline item. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents bookmark timeline item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = BookmarkTimelineItem.class, visible = true) @JsonTypeName("Bookmark") @Fluent public final class BookmarkTimelineItem extends EntityTimelineItem { + /* + * The entity query kind type. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityTimelineKind kind = EntityTimelineKind.BOOKMARK; + /* * The bookmark azure resource id. */ @@ -65,9 +75,25 @@ public final class BookmarkTimelineItem extends EntityTimelineItem { @JsonProperty(value = "labels") private List labels; + /** + * Creates an instance of BookmarkTimelineItem class. + */ + public 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() { @@ -76,7 +102,7 @@ public String azureResourceId() { /** * Set the azureResourceId property: The bookmark azure resource id. - * + * * @param azureResourceId the azureResourceId value to set. * @return the BookmarkTimelineItem object itself. */ @@ -87,7 +113,7 @@ public BookmarkTimelineItem withAzureResourceId(String azureResourceId) { /** * Get the displayName property: The bookmark display name. - * + * * @return the displayName value. */ public String displayName() { @@ -96,7 +122,7 @@ public String displayName() { /** * Set the displayName property: The bookmark display name. - * + * * @param displayName the displayName value to set. * @return the BookmarkTimelineItem object itself. */ @@ -107,7 +133,7 @@ public BookmarkTimelineItem withDisplayName(String displayName) { /** * Get the notes property: The notes of the bookmark. - * + * * @return the notes value. */ public String notes() { @@ -116,7 +142,7 @@ public String notes() { /** * Set the notes property: The notes of the bookmark. - * + * * @param notes the notes value to set. * @return the BookmarkTimelineItem object itself. */ @@ -127,7 +153,7 @@ public BookmarkTimelineItem withNotes(String notes) { /** * Get the endTimeUtc property: The bookmark end time. - * + * * @return the endTimeUtc value. */ public OffsetDateTime endTimeUtc() { @@ -136,7 +162,7 @@ public OffsetDateTime endTimeUtc() { /** * Set the endTimeUtc property: The bookmark end time. - * + * * @param endTimeUtc the endTimeUtc value to set. * @return the BookmarkTimelineItem object itself. */ @@ -147,7 +173,7 @@ public BookmarkTimelineItem withEndTimeUtc(OffsetDateTime endTimeUtc) { /** * Get the startTimeUtc property: The bookmark start time. - * + * * @return the startTimeUtc value. */ public OffsetDateTime startTimeUtc() { @@ -156,7 +182,7 @@ public OffsetDateTime startTimeUtc() { /** * Set the startTimeUtc property: The bookmark start time. - * + * * @param startTimeUtc the startTimeUtc value to set. * @return the BookmarkTimelineItem object itself. */ @@ -167,7 +193,7 @@ public BookmarkTimelineItem withStartTimeUtc(OffsetDateTime startTimeUtc) { /** * Get the eventTime property: The bookmark event time. - * + * * @return the eventTime value. */ public OffsetDateTime eventTime() { @@ -176,7 +202,7 @@ public OffsetDateTime eventTime() { /** * Set the eventTime property: The bookmark event time. - * + * * @param eventTime the eventTime value to set. * @return the BookmarkTimelineItem object itself. */ @@ -187,7 +213,7 @@ public BookmarkTimelineItem withEventTime(OffsetDateTime eventTime) { /** * Get the createdBy property: Describes a user that created the bookmark. - * + * * @return the createdBy value. */ public UserInfo createdBy() { @@ -196,7 +222,7 @@ public UserInfo createdBy() { /** * Set the createdBy property: Describes a user that created the bookmark. - * + * * @param createdBy the createdBy value to set. * @return the BookmarkTimelineItem object itself. */ @@ -207,7 +233,7 @@ public BookmarkTimelineItem withCreatedBy(UserInfo createdBy) { /** * Get the labels property: List of labels relevant to this bookmark. - * + * * @return the labels value. */ public List labels() { @@ -216,7 +242,7 @@ public List labels() { /** * Set the labels property: List of labels relevant to this bookmark. - * + * * @param labels the labels value to set. * @return the BookmarkTimelineItem object itself. */ @@ -227,17 +253,16 @@ public BookmarkTimelineItem withLabels(List labels) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (azureResourceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property azureResourceId in model BookmarkTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureResourceId in model BookmarkTimelineItem")); } if (createdBy() != null) { createdBy().validate(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmarks.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmarks.java index 3b3706f36fd8..4aaa14eec43d 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Bookmarks. */ +/** + * Resource collection API of Bookmarks. + */ public interface Bookmarks { /** * Gets all bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface Bookmarks { /** * Gets all bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -37,62 +39,62 @@ public interface 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 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. + * @return a bookmark along with {@link Response}. */ - Bookmark get(String resourceGroupName, String workspaceName, String bookmarkId); + Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Context context); /** * Gets a bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a bookmark. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String bookmarkId, Context context); + Bookmark get(String resourceGroupName, String workspaceName, String bookmarkId); /** * Delete the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String bookmarkId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Context context); /** * Delete the bookmark. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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, Context context); + void delete(String resourceGroupName, String workspaceName, String bookmarkId); /** * Gets a bookmark. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -103,7 +105,7 @@ Response deleteWithResponse( /** * Gets a bookmark. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -115,7 +117,7 @@ Response deleteWithResponse( /** * Delete the bookmark. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -125,7 +127,7 @@ Response deleteWithResponse( /** * Delete the bookmark. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,7 +139,7 @@ Response deleteWithResponse( /** * Begins definition for a new Bookmark resource. - * + * * @param name resource name. * @return the first stage of the new Bookmark definition. */ 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 index be26717140de..bd5a9f3f9734 100644 --- 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 @@ -6,23 +6,53 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an automation rule condition that applies a boolean operator (e.g AND, OR) to conditions. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "conditionType") +/** + * Describes an automation rule condition that applies a boolean operator (e.g AND, OR) to conditions. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "conditionType", + defaultImpl = BooleanConditionProperties.class, + visible = true) @JsonTypeName("Boolean") @Fluent public final class BooleanConditionProperties extends AutomationRuleCondition { + /* + * The conditionType property. + */ + @JsonTypeId + @JsonProperty(value = "conditionType", required = true) + private ConditionType conditionType = ConditionType.BOOLEAN; + /* * The conditionProperties property. */ @JsonProperty(value = "conditionProperties") 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() { @@ -31,7 +61,7 @@ public AutomationRuleBooleanCondition conditionProperties() { /** * Set the conditionProperties property: The conditionProperties property. - * + * * @param conditionProperties the conditionProperties value to set. * @return the BooleanConditionProperties object itself. */ @@ -42,7 +72,7 @@ public BooleanConditionProperties withConditionProperties(AutomationRuleBooleanC /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgentOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgentOperations.java new file mode 100644 index 000000000000..7663fe8dbd5a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgentOperations.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BusinessApplicationAgentOperations. + */ +public interface BusinessApplicationAgentOperations { + /** + * Gets Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 business Application Agent along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, Context context); + + /** + * Gets Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 business Application Agent. + */ + BusinessApplicationAgentResource get(String resourceGroupName, String workspaceName, String agentResourceName); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgentResource.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgentResource.java new file mode 100644 index 000000000000..c0940908e238 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgentResource.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.BusinessApplicationAgentResourceInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of BusinessApplicationAgentResource. + */ +public interface BusinessApplicationAgentResource { + /** + * 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 configuration property: Describes the configuration of a Business Application Agent. + * + * @return the configuration value. + */ + AgentConfiguration configuration(); + + /** + * Gets the agentSystems property: The agentSystems property. + * + * @return the agentSystems value. + */ + List agentSystems(); + + /** + * Gets the displayName property: The displayName property. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the lastModifiedTimeUtc property: The lastModifiedTimeUtc property. + * + * @return the lastModifiedTimeUtc value. + */ + OffsetDateTime lastModifiedTimeUtc(); + + /** + * 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.BusinessApplicationAgentResourceInner + * object. + * + * @return the inner object. + */ + BusinessApplicationAgentResourceInner innerModel(); + + /** + * The entirety of the BusinessApplicationAgentResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithConfiguration, DefinitionStages.WithDisplayName, DefinitionStages.WithCreate { + } + + /** + * The BusinessApplicationAgentResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the BusinessApplicationAgentResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the BusinessApplicationAgentResource 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. + */ + WithConfiguration withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the BusinessApplicationAgentResource definition allowing to specify configuration. + */ + interface WithConfiguration { + /** + * Specifies the configuration property: Describes the configuration of a Business Application Agent.. + * + * @param configuration Describes the configuration of a Business Application Agent. + * @return the next definition stage. + */ + WithDisplayName withConfiguration(AgentConfiguration configuration); + } + + /** + * The stage of the BusinessApplicationAgentResource definition allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The displayName property.. + * + * @param displayName The displayName property. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the BusinessApplicationAgentResource 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + BusinessApplicationAgentResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BusinessApplicationAgentResource create(Context context); + } + + /** + * The stage of the BusinessApplicationAgentResource 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); + } + } + + /** + * Begins update for the BusinessApplicationAgentResource resource. + * + * @return the stage of resource update. + */ + BusinessApplicationAgentResource.Update update(); + + /** + * The template for BusinessApplicationAgentResource update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithConfiguration, UpdateStages.WithDisplayName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BusinessApplicationAgentResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BusinessApplicationAgentResource apply(Context context); + } + + /** + * The BusinessApplicationAgentResource update stages. + */ + interface UpdateStages { + /** + * The stage of the BusinessApplicationAgentResource 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 BusinessApplicationAgentResource update allowing to specify configuration. + */ + interface WithConfiguration { + /** + * Specifies the configuration property: Describes the configuration of a Business Application Agent.. + * + * @param configuration Describes the configuration of a Business Application Agent. + * @return the next definition stage. + */ + Update withConfiguration(AgentConfiguration configuration); + } + + /** + * The stage of the BusinessApplicationAgentResource update allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The displayName property.. + * + * @param displayName The displayName property. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgents.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgents.java new file mode 100644 index 000000000000..ebe936a8d969 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgents.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BusinessApplicationAgents. + */ +public interface BusinessApplicationAgents { + /** + * Delete the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 agentResourceName, + Context context); + + /** + * Delete the Business Application Agent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 agentResourceName); + + /** + * Gets all Business Application Agents under the 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 Business Application Agents under the workspace as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all Business Application Agents under the workspace. + * + * @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 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 Business Application Agents under the workspace as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String skipToken, Context context); + + /** + * Delete the Business Application Agent. + * + * @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 Business Application Agent. + * + * @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 BusinessApplicationAgentResource resource. + * + * @param name resource name. + * @return the first stage of the new BusinessApplicationAgentResource definition. + */ + BusinessApplicationAgentResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgentsList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgentsList.java new file mode 100644 index 000000000000..aecf63845057 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BusinessApplicationAgentsList.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.BusinessApplicationAgentResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of agents. + */ +@Fluent +public final class BusinessApplicationAgentsList { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of BusinessApplicationAgentsList class. + */ + public BusinessApplicationAgentsList() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the BusinessApplicationAgentsList object itself. + */ + public BusinessApplicationAgentsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the BusinessApplicationAgentsList object itself. + */ + public BusinessApplicationAgentsList 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()); + } + } +} 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..42a4ca42a0c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthConfig.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base Model for API authentication. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = CcpAuthConfig.class, visible = true) +@JsonTypeName("CcpAuthConfig") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "APIKey", value = ApiKeyAuthModel.class), + @JsonSubTypes.Type(name = "AWS", value = AwsAuthModel.class), + @JsonSubTypes.Type(name = "Basic", value = BasicAuthModel.class), + @JsonSubTypes.Type(name = "GCP", value = GcpAuthModel.class), + @JsonSubTypes.Type(name = "ServiceBus", value = GenericBlobSbsAuthModel.class), + @JsonSubTypes.Type(name = "GitHub", value = GitHubAuthModel.class), + @JsonSubTypes.Type(name = "None", value = NoneAuthModel.class), + @JsonSubTypes.Type(name = "JwtToken", value = JwtAuthModel.class), + @JsonSubTypes.Type(name = "OAuth2", value = OAuthModel.class), + @JsonSubTypes.Type(name = "Oracle", value = OracleAuthModel.class), + @JsonSubTypes.Type(name = "Session", value = SessionAuthModel.class) }) +@Immutable +public class CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private CcpAuthType type; + + /** + * Creates an instance of CcpAuthConfig class. + */ + public CcpAuthConfig() { + this.type = CcpAuthType.fromString("CcpAuthConfig"); + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + public CcpAuthType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthType.java new file mode 100644 index 000000000000..d0c40bb70fcb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthType.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of paging. + */ +public final class CcpAuthType extends ExpandableStringEnum { + /** + * Static value Basic for CcpAuthType. + */ + public static final CcpAuthType BASIC = fromString("Basic"); + + /** + * Static value APIKey for CcpAuthType. + */ + public static final CcpAuthType APIKEY = fromString("APIKey"); + + /** + * Static value OAuth2 for CcpAuthType. + */ + public static final CcpAuthType OAUTH2 = fromString("OAuth2"); + + /** + * Static value AWS for CcpAuthType. + */ + public static final CcpAuthType AWS = fromString("AWS"); + + /** + * Static value GCP for CcpAuthType. + */ + public static final CcpAuthType GCP = fromString("GCP"); + + /** + * Static value Session for CcpAuthType. + */ + public static final CcpAuthType SESSION = fromString("Session"); + + /** + * Static value JwtToken for CcpAuthType. + */ + public static final CcpAuthType JWT_TOKEN = fromString("JwtToken"); + + /** + * Static value GitHub for CcpAuthType. + */ + public static final CcpAuthType GIT_HUB = fromString("GitHub"); + + /** + * Static value ServiceBus for CcpAuthType. + */ + public static final CcpAuthType SERVICE_BUS = fromString("ServiceBus"); + + /** + * Static value Oracle for CcpAuthType. + */ + public static final CcpAuthType ORACLE = fromString("Oracle"); + + /** + * Static value None for CcpAuthType. + */ + 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. + */ + @JsonCreator + 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..7726ab5c79fc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpResponseConfig.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A custom response configuration for a rule. + */ +@Fluent +public final class CcpResponseConfig { + /* + * The json paths, '$' char is the json root. + */ + @JsonProperty(value = "eventsJsonPaths", required = true) + private List eventsJsonPaths; + + /* + * The value where the status message/code should appear in the response. + */ + @JsonProperty(value = "successStatusJsonPath") + private String successStatusJsonPath; + + /* + * The the status value. + */ + @JsonProperty(value = "successStatusValue") + private String successStatusValue; + + /* + * The value indicating whether the remote server support Gzip and we should expect Gzip response. + */ + @JsonProperty(value = "isGzipCompressed") + private Boolean isGzipCompressed; + + /* + * The compression algorithm. + */ + @JsonProperty(value = "compressionAlgo") + private String compressionAlgo; + + /* + * The response format. possible values are json,csv,xml + */ + @JsonProperty(value = "format") + private String format; + + /* + * The csv delimiter, in case the response format is CSV. + */ + @JsonProperty(value = "csvDelimiter") + private String csvDelimiter; + + /* + * The value indicating whether the response has CSV boundary in case the response in CSV format. + */ + @JsonProperty(value = "hasCsvBoundary") + private Boolean hasCsvBoundary; + + /* + * The value indicating whether the response has headers in case the response in CSV format. + */ + @JsonProperty(value = "hasCsvHeader") + private Boolean hasCsvHeader; + + /* + * The a 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. + */ + @JsonProperty(value = "convertChildPropertiesToArray") + private Boolean convertChildPropertiesToArray; + + /* + * Th character used to escape characters in CSV. + */ + @JsonProperty(value = "csvEscape") + 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 the status value. + * + * @return the successStatusValue value. + */ + public String successStatusValue() { + return this.successStatusValue; + } + + /** + * Set the successStatusValue property: The 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. + * + * @return the compressionAlgo value. + */ + public String compressionAlgo() { + return this.compressionAlgo; + } + + /** + * Set the compressionAlgo property: The compression algorithm. + * + * @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 a 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 a 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: Th character used to escape characters in CSV. + * + * @return the csvEscape value. + */ + public String csvEscape() { + return this.csvEscape; + } + + /** + * Set the csvEscape property: Th 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (eventsJsonPaths() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property eventsJsonPaths in model CcpResponseConfig")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CcpResponseConfig.class); +} 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 9d6d5e61b586..519fdaef128f 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; -/** Information on the client (user or application) that made some action. */ +/** + * Information on the client (user or application) that made some action. + */ @Fluent public final class ClientInfo { /* @@ -35,9 +37,15 @@ public final class ClientInfo { @JsonProperty(value = "userPrincipalName") private String userPrincipalName; + /** + * Creates an instance of ClientInfo class. + */ + public ClientInfo() { + } + /** * Get the email property: The email of the client. - * + * * @return the email value. */ public String email() { @@ -46,7 +54,7 @@ public String email() { /** * Set the email property: The email of the client. - * + * * @param email the email value to set. * @return the ClientInfo object itself. */ @@ -57,7 +65,7 @@ public ClientInfo withEmail(String email) { /** * Get the name property: The name of the client. - * + * * @return the name value. */ public String name() { @@ -66,7 +74,7 @@ public String name() { /** * Set the name property: The name of the client. - * + * * @param name the name value to set. * @return the ClientInfo object itself. */ @@ -77,7 +85,7 @@ public ClientInfo withName(String name) { /** * Get the objectId property: The object id of the client. - * + * * @return the objectId value. */ public UUID objectId() { @@ -86,7 +94,7 @@ public UUID objectId() { /** * Set the objectId property: The object id of the client. - * + * * @param objectId the objectId value to set. * @return the ClientInfo object itself. */ @@ -97,7 +105,7 @@ public ClientInfo withObjectId(UUID objectId) { /** * Get the userPrincipalName property: The user principal name of the client. - * + * * @return the userPrincipalName value. */ public String userPrincipalName() { @@ -106,7 +114,7 @@ public String userPrincipalName() { /** * Set the userPrincipalName property: The user principal name of the client. - * + * * @param userPrincipalName the userPrincipalName value to set. * @return the ClientInfo object itself. */ @@ -117,7 +125,7 @@ public ClientInfo withUserPrincipalName(String userPrincipalName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CloudApplicationEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CloudApplicationEntity.java index 2d0908e927da..5afc5b966677 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 @@ -4,28 +4,54 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.CloudApplicationEntityProperties; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** Represents a cloud application entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a cloud application entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = CloudApplicationEntity.class, visible = true) @JsonTypeName("CloudApplication") -@Fluent +@Immutable public final class CloudApplicationEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.CLOUD_APPLICATION; + /* * CloudApplication entity properties */ @JsonProperty(value = "properties") private CloudApplicationEntityProperties innerProperties; + /** + * Creates an instance of CloudApplicationEntity class. + */ + public CloudApplicationEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: CloudApplication entity properties. - * + * * @return the innerProperties value. */ private CloudApplicationEntityProperties innerProperties() { @@ -34,7 +60,7 @@ private CloudApplicationEntityProperties innerProperties() { /** * Get the appId property: The technical identifier of the application. - * + * * @return the appId value. */ public Integer appId() { @@ -43,7 +69,7 @@ public Integer appId() { /** * Get the appName property: The name of the related cloud application. - * + * * @return the appName value. */ public String appName() { @@ -53,7 +79,7 @@ public String appName() { /** * Get the instanceName property: The user defined instance name of the cloud application. It is often used to * distinguish between several applications of the same type that a customer has. - * + * * @return the instanceName value. */ public String instanceName() { @@ -63,7 +89,7 @@ public String instanceName() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -73,7 +99,7 @@ public Map 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() { @@ -82,7 +108,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 396d69282da3..a10a1d04afcf 100644 --- 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 @@ -8,30 +8,62 @@ import com.azure.resourcemanager.securityinsights.fluent.models.ApiPollingParameters; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Codeless API Polling data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Codeless API Polling data connector. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = CodelessApiPollingDataConnector.class, + visible = true) @JsonTypeName("APIPolling") @Fluent public final class CodelessApiPollingDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.APIPOLLING; + /* * Codeless poling data connector properties */ @JsonProperty(value = "properties") private ApiPollingParameters innerProperties; + /** + * Creates an instance of CodelessApiPollingDataConnector class. + */ + public CodelessApiPollingDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodelessApiPollingDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +72,7 @@ public CodelessApiPollingDataConnector withEtag(String etag) { /** * Get the connectorUiConfig property: Config to describe the instructions blade. - * + * * @return the connectorUiConfig value. */ public CodelessUiConnectorConfigProperties connectorUiConfig() { @@ -49,12 +81,12 @@ public CodelessUiConnectorConfigProperties 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) { + public CodelessApiPollingDataConnector + withConnectorUiConfig(CodelessUiConnectorConfigProperties connectorUiConfig) { if (this.innerProperties() == null) { this.innerProperties = new ApiPollingParameters(); } @@ -64,7 +96,7 @@ public CodelessApiPollingDataConnector withConnectorUiConfig( /** * Get the pollingConfig property: Config to describe the polling instructions. - * + * * @return the pollingConfig value. */ public CodelessConnectorPollingConfigProperties pollingConfig() { @@ -73,7 +105,7 @@ public CodelessConnectorPollingConfigProperties pollingConfig() { /** * Set the pollingConfig property: Config to describe the polling instructions. - * + * * @param pollingConfig the pollingConfig value to set. * @return the CodelessApiPollingDataConnector object itself. */ @@ -87,7 +119,7 @@ public CodelessApiPollingDataConnector withPollingConfig(CodelessConnectorPollin /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index a9a781b14c94..ac2d58b1c784 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describe the authentication properties needed to successfully authenticate with the server. */ +/** + * Describe the authentication properties needed to successfully authenticate with the server. + */ @Fluent public final class CodelessConnectorPollingAuthProperties { /* @@ -89,9 +91,15 @@ public final class CodelessConnectorPollingAuthProperties { @JsonProperty(value = "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() { @@ -100,7 +108,7 @@ public String authType() { /** * Set the authType property: The authentication type. - * + * * @param authType the authType value to set. * @return the CodelessConnectorPollingAuthProperties object itself. */ @@ -111,7 +119,7 @@ public CodelessConnectorPollingAuthProperties withAuthType(String authType) { /** * Get the apiKeyName property: The header name which the token is sent with. - * + * * @return the apiKeyName value. */ public String apiKeyName() { @@ -120,7 +128,7 @@ public String 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. */ @@ -131,7 +139,7 @@ public CodelessConnectorPollingAuthProperties withApiKeyName(String apiKeyName) /** * Get the apiKeyIdentifier property: A prefix send in the header before the actual token. - * + * * @return the apiKeyIdentifier value. */ public String apiKeyIdentifier() { @@ -140,7 +148,7 @@ public String 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. */ @@ -151,7 +159,7 @@ public CodelessConnectorPollingAuthProperties withApiKeyIdentifier(String apiKey /** * Get the isApiKeyInPostPayload property: Marks if the key should sent in header. - * + * * @return the isApiKeyInPostPayload value. */ public String isApiKeyInPostPayload() { @@ -160,7 +168,7 @@ public String 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. */ @@ -171,7 +179,7 @@ public CodelessConnectorPollingAuthProperties withIsApiKeyInPostPayload(String i /** * Get the flowName property: Describes the flow name, for example 'AuthCode' for Oauth 2.0. - * + * * @return the flowName value. */ public String flowName() { @@ -180,7 +188,7 @@ public String 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. */ @@ -191,7 +199,7 @@ public CodelessConnectorPollingAuthProperties withFlowName(String flowName) { /** * Get the tokenEndpoint property: The endpoint used to issue a token, used in Oauth 2.0 flow. - * + * * @return the tokenEndpoint value. */ public String tokenEndpoint() { @@ -200,7 +208,7 @@ public String 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. */ @@ -211,7 +219,7 @@ public CodelessConnectorPollingAuthProperties withTokenEndpoint(String tokenEndp /** * Get the authorizationEndpoint property: The endpoint used to authorize the user, used in Oauth 2.0 flow. - * + * * @return the authorizationEndpoint value. */ public String authorizationEndpoint() { @@ -220,7 +228,7 @@ public String 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. */ @@ -232,7 +240,7 @@ public CodelessConnectorPollingAuthProperties withAuthorizationEndpoint(String a /** * Get the authorizationEndpointQueryParameters property: The query parameters used in authorization request, used * in Oauth 2.0 flow. - * + * * @return the authorizationEndpointQueryParameters value. */ public Object authorizationEndpointQueryParameters() { @@ -242,12 +250,12 @@ public Object 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) { + public CodelessConnectorPollingAuthProperties + withAuthorizationEndpointQueryParameters(Object authorizationEndpointQueryParameters) { this.authorizationEndpointQueryParameters = authorizationEndpointQueryParameters; return this; } @@ -255,7 +263,7 @@ public CodelessConnectorPollingAuthProperties withAuthorizationEndpointQueryPara /** * 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() { @@ -265,7 +273,7 @@ public String 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. */ @@ -276,7 +284,7 @@ public CodelessConnectorPollingAuthProperties withRedirectionEndpoint(String red /** * Get the tokenEndpointHeaders property: The query headers used in token request, used in Oauth 2.0 flow. - * + * * @return the tokenEndpointHeaders value. */ public Object tokenEndpointHeaders() { @@ -285,7 +293,7 @@ public Object 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. */ @@ -297,7 +305,7 @@ public CodelessConnectorPollingAuthProperties withTokenEndpointHeaders(Object to /** * Get the tokenEndpointQueryParameters property: The query parameters used in token request, used in Oauth 2.0 * flow. - * + * * @return the tokenEndpointQueryParameters value. */ public Object tokenEndpointQueryParameters() { @@ -307,12 +315,12 @@ public Object 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) { + public CodelessConnectorPollingAuthProperties + withTokenEndpointQueryParameters(Object tokenEndpointQueryParameters) { this.tokenEndpointQueryParameters = tokenEndpointQueryParameters; return this; } @@ -320,7 +328,7 @@ public CodelessConnectorPollingAuthProperties withTokenEndpointQueryParameters( /** * 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() { @@ -330,7 +338,7 @@ public Boolean 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. */ @@ -341,7 +349,7 @@ public CodelessConnectorPollingAuthProperties withIsClientSecretInHeader(Boolean /** * Get the scope property: The OAuth token scope. - * + * * @return the scope value. */ public String scope() { @@ -350,7 +358,7 @@ public String scope() { /** * Set the scope property: The OAuth token scope. - * + * * @param scope the scope value to set. * @return the CodelessConnectorPollingAuthProperties object itself. */ @@ -361,15 +369,14 @@ public CodelessConnectorPollingAuthProperties withScope(String scope) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (authType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property authType in model CodelessConnectorPollingAuthProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property authType in model CodelessConnectorPollingAuthProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingConfigProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingConfigProperties.java index b1040c30de77..0cf7dd034db5 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Config to describe the polling config for API poller connector. */ +/** + * Config to describe the polling config for API poller connector. + */ @Fluent public final class CodelessConnectorPollingConfigProperties { /* @@ -41,9 +43,15 @@ public final class CodelessConnectorPollingConfigProperties { @JsonProperty(value = "response") 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() { @@ -52,7 +60,7 @@ public Boolean isActive() { /** * Set the isActive property: The poller active status. - * + * * @param isActive the isActive value to set. * @return the CodelessConnectorPollingConfigProperties object itself. */ @@ -63,7 +71,7 @@ public CodelessConnectorPollingConfigProperties withIsActive(Boolean isActive) { /** * Get the auth property: Describe the authentication type of the poller. - * + * * @return the auth value. */ public CodelessConnectorPollingAuthProperties auth() { @@ -72,7 +80,7 @@ public CodelessConnectorPollingAuthProperties auth() { /** * Set the auth property: Describe the authentication type of the poller. - * + * * @param auth the auth value to set. * @return the CodelessConnectorPollingConfigProperties object itself. */ @@ -83,7 +91,7 @@ public CodelessConnectorPollingConfigProperties withAuth(CodelessConnectorPollin /** * Get the request property: Describe the poll request config parameters of the poller. - * + * * @return the request value. */ public CodelessConnectorPollingRequestProperties request() { @@ -92,7 +100,7 @@ public CodelessConnectorPollingRequestProperties 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. */ @@ -103,7 +111,7 @@ public CodelessConnectorPollingConfigProperties withRequest(CodelessConnectorPol /** * Get the paging property: Describe the poll request paging config of the poller. - * + * * @return the paging value. */ public CodelessConnectorPollingPagingProperties paging() { @@ -112,7 +120,7 @@ public CodelessConnectorPollingPagingProperties 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. */ @@ -123,7 +131,7 @@ public CodelessConnectorPollingConfigProperties withPaging(CodelessConnectorPoll /** * Get the response property: Describe the response config parameters of the poller. - * + * * @return the response value. */ public CodelessConnectorPollingResponseProperties response() { @@ -132,7 +140,7 @@ public CodelessConnectorPollingResponseProperties 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. */ @@ -143,23 +151,21 @@ public CodelessConnectorPollingConfigProperties withResponse(CodelessConnectorPo /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (auth() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property auth in model CodelessConnectorPollingConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property auth in model CodelessConnectorPollingConfigProperties")); } else { auth().validate(); } if (request() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property request in model CodelessConnectorPollingConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property request in model CodelessConnectorPollingConfigProperties")); } else { request().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingPagingProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingPagingProperties.java index a0d01a5af717..1fe1da9109cd 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describe the properties needed to make a pagination call. */ +/** + * Describe the properties needed to make a pagination call. + */ @Fluent public final class CodelessConnectorPollingPagingProperties { /* @@ -65,9 +67,15 @@ public final class CodelessConnectorPollingPagingProperties { @JsonProperty(value = "pageSize") 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() { @@ -76,7 +84,7 @@ public String 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. */ @@ -87,7 +95,7 @@ public CodelessConnectorPollingPagingProperties withPagingType(String pagingType /** * Get the nextPageParaName property: Defines the name of a next page attribute. - * + * * @return the nextPageParaName value. */ public String nextPageParaName() { @@ -96,7 +104,7 @@ public String 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. */ @@ -107,7 +115,7 @@ public CodelessConnectorPollingPagingProperties withNextPageParaName(String next /** * Get the nextPageTokenJsonPath property: Defines the path to a next page token JSON. - * + * * @return the nextPageTokenJsonPath value. */ public String nextPageTokenJsonPath() { @@ -116,7 +124,7 @@ public String 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. */ @@ -127,7 +135,7 @@ public CodelessConnectorPollingPagingProperties withNextPageTokenJsonPath(String /** * Get the pageCountAttributePath property: Defines the path to a page count attribute. - * + * * @return the pageCountAttributePath value. */ public String pageCountAttributePath() { @@ -136,7 +144,7 @@ public String 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. */ @@ -147,7 +155,7 @@ public CodelessConnectorPollingPagingProperties withPageCountAttributePath(Strin /** * Get the pageTotalCountAttributePath property: Defines the path to a page total count attribute. - * + * * @return the pageTotalCountAttributePath value. */ public String pageTotalCountAttributePath() { @@ -156,19 +164,19 @@ public String 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) { + 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() { @@ -177,7 +185,7 @@ public String 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. */ @@ -189,7 +197,7 @@ public CodelessConnectorPollingPagingProperties withPageTimestampAttributePath(S /** * Get the searchTheLatestTimestampFromEventsList property: Determines whether to search for the latest time stamp * in the events list. - * + * * @return the searchTheLatestTimestampFromEventsList value. */ public String searchTheLatestTimestampFromEventsList() { @@ -199,19 +207,19 @@ public String 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) { + 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() { @@ -220,7 +228,7 @@ public String 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. */ @@ -231,7 +239,7 @@ public CodelessConnectorPollingPagingProperties withPageSizeParaName(String page /** * Get the pageSize property: Defines the paging size. - * + * * @return the pageSize value. */ public Integer pageSize() { @@ -240,7 +248,7 @@ public Integer pageSize() { /** * Set the pageSize property: Defines the paging size. - * + * * @param pageSize the pageSize value to set. * @return the CodelessConnectorPollingPagingProperties object itself. */ @@ -251,15 +259,14 @@ public CodelessConnectorPollingPagingProperties withPageSize(Integer pageSize) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (pagingType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property pagingType in model CodelessConnectorPollingPagingProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property pagingType in model CodelessConnectorPollingPagingProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingRequestProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingRequestProperties.java index cf4d6e8754b9..8b1ec1de7e42 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describe the request properties needed to successfully pull from the server. */ +/** + * Describe the request properties needed to successfully pull from the server. + */ @Fluent public final class CodelessConnectorPollingRequestProperties { /* @@ -83,9 +85,15 @@ public final class CodelessConnectorPollingRequestProperties { @JsonProperty(value = "endTimeAttributeName") 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() { @@ -94,7 +102,7 @@ public String 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. */ @@ -105,7 +113,7 @@ public CodelessConnectorPollingRequestProperties withApiEndpoint(String apiEndpo /** * Get the rateLimitQps property: Defines the rate limit QPS. - * + * * @return the rateLimitQps value. */ public Integer rateLimitQps() { @@ -114,7 +122,7 @@ public Integer rateLimitQps() { /** * Set the rateLimitQps property: Defines the rate limit QPS. - * + * * @param rateLimitQps the rateLimitQps value to set. * @return the CodelessConnectorPollingRequestProperties object itself. */ @@ -125,7 +133,7 @@ public CodelessConnectorPollingRequestProperties withRateLimitQps(Integer rateLi /** * Get the queryWindowInMin property: The window interval we will use the pull the data. - * + * * @return the queryWindowInMin value. */ public int queryWindowInMin() { @@ -134,7 +142,7 @@ public int 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. */ @@ -145,7 +153,7 @@ public CodelessConnectorPollingRequestProperties withQueryWindowInMin(int queryW /** * 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() { @@ -154,7 +162,7 @@ public String 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. */ @@ -165,7 +173,7 @@ public CodelessConnectorPollingRequestProperties withHttpMethod(String httpMetho /** * Get the queryTimeFormat property: The time format will be used the query events in a specific window. - * + * * @return the queryTimeFormat value. */ public String queryTimeFormat() { @@ -174,7 +182,7 @@ public String 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. */ @@ -185,7 +193,7 @@ public CodelessConnectorPollingRequestProperties withQueryTimeFormat(String quer /** * 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() { @@ -194,7 +202,7 @@ public Integer 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. */ @@ -205,7 +213,7 @@ public CodelessConnectorPollingRequestProperties withRetryCount(Integer retryCou /** * Get the timeoutInSeconds property: The number of seconds we will consider as a request timeout. - * + * * @return the timeoutInSeconds value. */ public Integer timeoutInSeconds() { @@ -214,7 +222,7 @@ public Integer 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. */ @@ -225,7 +233,7 @@ public CodelessConnectorPollingRequestProperties withTimeoutInSeconds(Integer ti /** * Get the headers property: Describe the headers sent in the poll request. - * + * * @return the headers value. */ public Object headers() { @@ -234,7 +242,7 @@ public Object 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. */ @@ -245,7 +253,7 @@ public CodelessConnectorPollingRequestProperties withHeaders(Object headers) { /** * Get the queryParameters property: Describe the query parameters sent in the poll request. - * + * * @return the queryParameters value. */ public Object queryParameters() { @@ -254,7 +262,7 @@ public Object 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. */ @@ -266,7 +274,7 @@ public CodelessConnectorPollingRequestProperties withQueryParameters(Object quer /** * Get the queryParametersTemplate property: For advanced scenarios for example user name/password embedded in * nested JSON payload. - * + * * @return the queryParametersTemplate value. */ public String queryParametersTemplate() { @@ -276,7 +284,7 @@ public String 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. */ @@ -287,7 +295,7 @@ public CodelessConnectorPollingRequestProperties withQueryParametersTemplate(Str /** * 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() { @@ -296,7 +304,7 @@ public String 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. */ @@ -307,7 +315,7 @@ public CodelessConnectorPollingRequestProperties withStartTimeAttributeName(Stri /** * 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() { @@ -316,7 +324,7 @@ public String 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. */ @@ -327,28 +335,24 @@ public CodelessConnectorPollingRequestProperties withEndTimeAttributeName(String /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (apiEndpoint() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property apiEndpoint in model CodelessConnectorPollingRequestProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property apiEndpoint in model CodelessConnectorPollingRequestProperties")); } if (httpMethod() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property httpMethod in model CodelessConnectorPollingRequestProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property httpMethod in model CodelessConnectorPollingRequestProperties")); } if (queryTimeFormat() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property queryTimeFormat in model" - + " CodelessConnectorPollingRequestProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property queryTimeFormat in model CodelessConnectorPollingRequestProperties")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingResponseProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingResponseProperties.java index 561f409ee82f..70dcb0818c4a 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes the response from the external server. */ +/** + * Describes the response from the external server. + */ @Fluent public final class CodelessConnectorPollingResponseProperties { /* @@ -36,9 +38,15 @@ public final class CodelessConnectorPollingResponseProperties { @JsonProperty(value = "isGzipCompressed") 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() { @@ -47,7 +55,7 @@ public List 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. */ @@ -58,7 +66,7 @@ public CodelessConnectorPollingResponseProperties withEventsJsonPaths(List instructionSteps; + /** + * Creates an instance of CodelessUiConnectorConfigProperties class. + */ + public CodelessUiConnectorConfigProperties() { + } + /** * Get the title property: Connector blade title. - * + * * @return the title value. */ public String title() { @@ -95,7 +103,7 @@ public String title() { /** * Set the title property: Connector blade title. - * + * * @param title the title value to set. * @return the CodelessUiConnectorConfigProperties object itself. */ @@ -106,7 +114,7 @@ public CodelessUiConnectorConfigProperties withTitle(String title) { /** * Get the publisher property: Connector publisher name. - * + * * @return the publisher value. */ public String publisher() { @@ -115,7 +123,7 @@ public String publisher() { /** * Set the publisher property: Connector publisher name. - * + * * @param publisher the publisher value to set. * @return the CodelessUiConnectorConfigProperties object itself. */ @@ -126,7 +134,7 @@ public CodelessUiConnectorConfigProperties withPublisher(String publisher) { /** * Get the descriptionMarkdown property: Connector description. - * + * * @return the descriptionMarkdown value. */ public String descriptionMarkdown() { @@ -135,7 +143,7 @@ public String descriptionMarkdown() { /** * Set the descriptionMarkdown property: Connector description. - * + * * @param descriptionMarkdown the descriptionMarkdown value to set. * @return the CodelessUiConnectorConfigProperties object itself. */ @@ -147,7 +155,7 @@ public CodelessUiConnectorConfigProperties withDescriptionMarkdown(String descri /** * 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() { @@ -157,7 +165,7 @@ public String 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. */ @@ -168,7 +176,7 @@ public CodelessUiConnectorConfigProperties withCustomImage(String customImage) { /** * Get the graphQueriesTableName property: Name of the table the connector will insert the data to. - * + * * @return the graphQueriesTableName value. */ public String graphQueriesTableName() { @@ -177,7 +185,7 @@ public String 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. */ @@ -188,7 +196,7 @@ public CodelessUiConnectorConfigProperties withGraphQueriesTableName(String grap /** * Get the graphQueries property: The graph query to show the current data status. - * + * * @return the graphQueries value. */ public List graphQueries() { @@ -197,19 +205,19 @@ public List 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) { + 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() { @@ -218,19 +226,19 @@ public List 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) { + 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() { @@ -239,19 +247,19 @@ public List 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) { + 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() { @@ -260,7 +268,7 @@ public List connect /** * Set the connectivityCriteria property: Define the way the connector check connectivity. - * + * * @param connectivityCriteria the connectivityCriteria value to set. * @return the CodelessUiConnectorConfigProperties object itself. */ @@ -272,7 +280,7 @@ public CodelessUiConnectorConfigProperties withConnectivityCriteria( /** * Get the availability property: Connector Availability Status. - * + * * @return the availability value. */ public Availability availability() { @@ -281,7 +289,7 @@ public Availability availability() { /** * Set the availability property: Connector Availability Status. - * + * * @param availability the availability value to set. * @return the CodelessUiConnectorConfigProperties object itself. */ @@ -292,7 +300,7 @@ public CodelessUiConnectorConfigProperties withAvailability(Availability availab /** * Get the permissions property: Permissions required for the connector. - * + * * @return the permissions value. */ public Permissions permissions() { @@ -301,7 +309,7 @@ public Permissions permissions() { /** * Set the permissions property: Permissions required for the connector. - * + * * @param permissions the permissions value to set. * @return the CodelessUiConnectorConfigProperties object itself. */ @@ -312,7 +320,7 @@ public CodelessUiConnectorConfigProperties withPermissions(Permissions permissio /** * Get the instructionSteps property: Instruction steps to enable the connector. - * + * * @return the instructionSteps value. */ public List instructionSteps() { @@ -321,100 +329,88 @@ public List instruction /** * 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) { + public CodelessUiConnectorConfigProperties + withInstructionSteps(List instructionSteps) { this.instructionSteps = instructionSteps; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (title() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property title in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property title in model CodelessUiConnectorConfigProperties")); } if (publisher() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publisher in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publisher in model CodelessUiConnectorConfigProperties")); } if (descriptionMarkdown() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property descriptionMarkdown in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property descriptionMarkdown in model CodelessUiConnectorConfigProperties")); } if (graphQueriesTableName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property graphQueriesTableName in model" - + " CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property graphQueriesTableName in model CodelessUiConnectorConfigProperties")); } if (graphQueries() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property graphQueries in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property graphQueries in model CodelessUiConnectorConfigProperties")); } else { graphQueries().forEach(e -> e.validate()); } if (sampleQueries() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sampleQueries in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sampleQueries in model CodelessUiConnectorConfigProperties")); } else { sampleQueries().forEach(e -> e.validate()); } if (dataTypes() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dataTypes in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model CodelessUiConnectorConfigProperties")); } else { dataTypes().forEach(e -> e.validate()); } if (connectivityCriteria() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property connectivityCriteria in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectivityCriteria in model CodelessUiConnectorConfigProperties")); } else { connectivityCriteria().forEach(e -> e.validate()); } if (availability() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property availability in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property availability in model CodelessUiConnectorConfigProperties")); } else { availability().validate(); } if (permissions() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property permissions in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property permissions in model CodelessUiConnectorConfigProperties")); } else { permissions().validate(); } if (instructionSteps() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property instructionSteps in model CodelessUiConnectorConfigProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property instructionSteps in model CodelessUiConnectorConfigProperties")); } else { instructionSteps().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.java index c57fe3ddde43..411ad606e82d 100644 --- 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 @@ -7,17 +7,29 @@ import com.azure.core.annotation.Fluent; import java.util.List; -/** The CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem model. */ +/** + * The CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem model. + */ @Fluent public final class CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem extends ConnectivityCriteria { - /** {@inheritDoc} */ + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem class. + */ + public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() { + } + + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem withType(ConnectivityType type) { super.withType(type); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem withValue(List value) { super.withValue(value); @@ -26,7 +38,7 @@ public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem withValue(Lis /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 1f9a8f78eb43..30b965e220aa 100644 --- 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 @@ -6,17 +6,29 @@ import com.azure.core.annotation.Fluent; -/** The CodelessUiConnectorConfigPropertiesDataTypesItem model. */ +/** + * The CodelessUiConnectorConfigPropertiesDataTypesItem model. + */ @Fluent public final class CodelessUiConnectorConfigPropertiesDataTypesItem extends LastDataReceivedDataType { - /** {@inheritDoc} */ + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesDataTypesItem class. + */ + public CodelessUiConnectorConfigPropertiesDataTypesItem() { + } + + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesDataTypesItem withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesDataTypesItem withLastDataReceivedQuery(String lastDataReceivedQuery) { super.withLastDataReceivedQuery(lastDataReceivedQuery); @@ -25,7 +37,7 @@ public CodelessUiConnectorConfigPropertiesDataTypesItem withLastDataReceivedQuer /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 80ff447db0ad..84e4e7a6c8e7 100644 --- 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 @@ -6,24 +6,38 @@ import com.azure.core.annotation.Fluent; -/** The CodelessUiConnectorConfigPropertiesGraphQueriesItem model. */ +/** + * The CodelessUiConnectorConfigPropertiesGraphQueriesItem model. + */ @Fluent public final class CodelessUiConnectorConfigPropertiesGraphQueriesItem extends GraphQueries { - /** {@inheritDoc} */ + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesGraphQueriesItem class. + */ + public CodelessUiConnectorConfigPropertiesGraphQueriesItem() { + } + + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesGraphQueriesItem withMetricName(String metricName) { super.withMetricName(metricName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesGraphQueriesItem withLegend(String legend) { super.withLegend(legend); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesGraphQueriesItem withBaseQuery(String baseQuery) { super.withBaseQuery(baseQuery); @@ -32,7 +46,7 @@ public CodelessUiConnectorConfigPropertiesGraphQueriesItem withBaseQuery(String /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 187727984833..9441121ba6d6 100644 --- 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 @@ -7,34 +7,48 @@ import com.azure.core.annotation.Fluent; import java.util.List; -/** The CodelessUiConnectorConfigPropertiesInstructionStepsItem model. */ +/** + * The CodelessUiConnectorConfigPropertiesInstructionStepsItem model. + */ @Fluent public final class CodelessUiConnectorConfigPropertiesInstructionStepsItem extends InstructionSteps { - /** {@inheritDoc} */ + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesInstructionStepsItem class. + */ + public CodelessUiConnectorConfigPropertiesInstructionStepsItem() { + } + + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesInstructionStepsItem withTitle(String title) { super.withTitle(title); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesInstructionStepsItem withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public CodelessUiConnectorConfigPropertiesInstructionStepsItem withInstructions( - List instructions) { + public CodelessUiConnectorConfigPropertiesInstructionStepsItem + withInstructions(List instructions) { super.withInstructions(instructions); return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 288bd8d550f8..911d7a5a3891 100644 --- 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 @@ -6,17 +6,29 @@ import com.azure.core.annotation.Fluent; -/** The CodelessUiConnectorConfigPropertiesSampleQueriesItem model. */ +/** + * The CodelessUiConnectorConfigPropertiesSampleQueriesItem model. + */ @Fluent public final class CodelessUiConnectorConfigPropertiesSampleQueriesItem extends SampleQueries { - /** {@inheritDoc} */ + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesSampleQueriesItem class. + */ + public CodelessUiConnectorConfigPropertiesSampleQueriesItem() { + } + + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesSampleQueriesItem withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodelessUiConnectorConfigPropertiesSampleQueriesItem withQuery(String query) { super.withQuery(query); @@ -25,7 +37,7 @@ public CodelessUiConnectorConfigPropertiesSampleQueriesItem withQuery(String que /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 06cd156687bb..bbda35e4afac 100644 --- 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 @@ -8,30 +8,62 @@ import com.azure.resourcemanager.securityinsights.fluent.models.CodelessParameters; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Codeless UI data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Codeless UI data connector. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = CodelessUiDataConnector.class, + visible = true) @JsonTypeName("GenericUI") @Fluent public final class CodelessUiDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.GENERIC_UI; + /* * Codeless UI data connector properties */ @JsonProperty(value = "properties") private CodelessParameters innerProperties; + /** + * Creates an instance of CodelessUiDataConnector class. + */ + public CodelessUiDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CodelessUiDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +72,7 @@ public CodelessUiDataConnector withEtag(String etag) { /** * Get the connectorUiConfig property: Config to describe the instructions blade. - * + * * @return the connectorUiConfig value. */ public CodelessUiConnectorConfigProperties connectorUiConfig() { @@ -49,7 +81,7 @@ public CodelessUiConnectorConfigProperties connectorUiConfig() { /** * Set the connectorUiConfig property: Config to describe the instructions blade. - * + * * @param connectorUiConfig the connectorUiConfig value to set. * @return the CodelessUiDataConnector object itself. */ @@ -63,7 +95,7 @@ public CodelessUiDataConnector withConnectorUiConfig(CodelessUiConnectorConfigPr /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..d9f9f515ddf2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionClause.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents a single clause to be evaluated by a NormalizedCondition. + */ +@Fluent +public final class ConditionClause { + /* + * The connective used to join all values in this ConditionClause + */ + @JsonProperty(value = "clauseConnective") + private Connective clauseConnective; + + /* + * The name of the field that is evaluated. + */ + @JsonProperty(value = "field", required = true) + private String field; + + /* + * Represents an operator in a ConditionClause. + */ + @JsonProperty(value = "operator", required = true) + private Operator operator; + + /* + * The top level connective operator for this condition. + */ + @JsonProperty(value = "values", required = true) + 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; + } + + /** + * Set the clauseConnective property: The connective used to join all values in this ConditionClause. + * + * @param clauseConnective the clauseConnective value to set. + * @return the ConditionClause object itself. + */ + public ConditionClause withClauseConnective(Connective clauseConnective) { + this.clauseConnective = clauseConnective; + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (field() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property field in model ConditionClause")); + } + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property operator in model ConditionClause")); + } + if (values() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property values in model ConditionClause")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConditionClause.class); +} 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..fceda7a62058 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionProperties.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents a condition used to query for TI objects. + */ +@Fluent +public final class ConditionProperties { + /* + * The STIX type for the objects returned by this query. + */ + @JsonProperty(value = "stixObjectType", access = JsonProperty.Access.WRITE_ONLY) + private String stixObjectType; + + /* + * The list of clauses to be evaluated in disjunction or conjunction base on the specified top level connective operator. + */ + @JsonProperty(value = "clauses", required = true) + private List clauses; + + /* + * The top level connective operator for this condition. + */ + @JsonProperty(value = "conditionConnective") + 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; + } + + /** + * Set the conditionConnective property: The top level connective operator for this condition. + * + * @param conditionConnective the conditionConnective value to set. + * @return the ConditionProperties object itself. + */ + public ConditionProperties withConditionConnective(Connective conditionConnective) { + this.conditionConnective = conditionConnective; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clauses() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property clauses in model ConditionProperties")); + } else { + clauses().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConditionProperties.class); +} 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 2e471ac418a2..7f3876f45a50 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 @@ -8,26 +8,47 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ConditionType. */ +/** + * Defines values for ConditionType. + */ public final class ConditionType extends ExpandableStringEnum { - /** Static value Property for ConditionType. */ + /** + * Static value Property for ConditionType. + */ public static final ConditionType PROPERTY = fromString("Property"); - /** Static value PropertyArray for ConditionType. */ + /** + * Static value PropertyArray for ConditionType. + */ public static final ConditionType PROPERTY_ARRAY = fromString("PropertyArray"); - /** Static value PropertyChanged for ConditionType. */ + /** + * Static value PropertyChanged for ConditionType. + */ public static final ConditionType PROPERTY_CHANGED = fromString("PropertyChanged"); - /** Static value PropertyArrayChanged for ConditionType. */ + /** + * Static value PropertyArrayChanged for ConditionType. + */ public static final ConditionType PROPERTY_ARRAY_CHANGED = fromString("PropertyArrayChanged"); - /** Static value Boolean for ConditionType. */ + /** + * Static value Boolean for ConditionType. + */ public static final ConditionType BOOLEAN = fromString("Boolean"); + /** + * Creates a new instance of ConditionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConditionType() { + } + /** * Creates or finds a ConditionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConditionType. */ @@ -38,7 +59,7 @@ public static ConditionType fromString(String name) { /** * Gets known ConditionType values. - * + * * @return known ConditionType values. */ public static Collection values() { 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 7e6818923a42..550eb559d8e8 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The confidence level of this alert. */ +/** + * The confidence level of this alert. + */ public final class ConfidenceLevel extends ExpandableStringEnum { - /** Static value Unknown for ConfidenceLevel. */ + /** + * Static value Unknown for ConfidenceLevel. + */ public static final ConfidenceLevel UNKNOWN = fromString("Unknown"); - /** Static value Low for ConfidenceLevel. */ + /** + * Static value Low for ConfidenceLevel. + */ public static final ConfidenceLevel LOW = fromString("Low"); - /** Static value High for ConfidenceLevel. */ + /** + * Static value High for ConfidenceLevel. + */ public static final ConfidenceLevel HIGH = fromString("High"); + /** + * Creates a new instance of ConfidenceLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfidenceLevel() { + } + /** * Creates or finds a ConfidenceLevel from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConfidenceLevel. */ @@ -32,7 +49,7 @@ public static ConfidenceLevel fromString(String name) { /** * Gets known ConfidenceLevel values. - * + * * @return known ConfidenceLevel values. */ public static Collection values() { 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 1f8966323364..bb7088dc6378 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 @@ -13,21 +13,38 @@ * applicable or final. */ public final class ConfidenceScoreStatus extends ExpandableStringEnum { - /** Static value NotApplicable for ConfidenceScoreStatus. */ + /** + * Static value NotApplicable for ConfidenceScoreStatus. + */ public static final ConfidenceScoreStatus NOT_APPLICABLE = fromString("NotApplicable"); - /** Static value InProcess for ConfidenceScoreStatus. */ + /** + * Static value InProcess for ConfidenceScoreStatus. + */ public static final ConfidenceScoreStatus IN_PROCESS = fromString("InProcess"); - /** Static value NotFinal for ConfidenceScoreStatus. */ + /** + * Static value NotFinal for ConfidenceScoreStatus. + */ public static final ConfidenceScoreStatus NOT_FINAL = fromString("NotFinal"); - /** Static value Final for ConfidenceScoreStatus. */ + /** + * Static value Final for ConfidenceScoreStatus. + */ public static final ConfidenceScoreStatus FINAL = fromString("Final"); + /** + * Creates a new instance of ConfidenceScoreStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfidenceScoreStatus() { + } + /** * Creates or finds a ConfidenceScoreStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConfidenceScoreStatus. */ @@ -38,7 +55,7 @@ public static ConfidenceScoreStatus fromString(String name) { /** * Gets known ConfidenceScoreStatus values. - * + * * @return known ConfidenceScoreStatus values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfigurationType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfigurationType.java new file mode 100644 index 000000000000..5c8314658ee6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConfigurationType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Represents the types of configuration for a system. + */ +public final class ConfigurationType extends ExpandableStringEnum { + /** + * Static value SAP for ConfigurationType. + */ + public static final ConfigurationType SAP = fromString("SAP"); + + /** + * Creates a new instance of ConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigurationType() { + } + + /** + * Creates or finds a ConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationType. + */ + @JsonCreator + public static ConfigurationType fromString(String name) { + return fromString(name, ConfigurationType.class); + } + + /** + * Gets known ConfigurationType values. + * + * @return known ConfigurationType values. + */ + public static Collection values() { + return values(ConfigurationType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectAuthKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectAuthKind.java index 689962ec3325..85b16c502f37 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The authentication kind used to poll the data. */ +/** + * The authentication kind used to poll the data. + */ public final class ConnectAuthKind extends ExpandableStringEnum { - /** Static value Basic for ConnectAuthKind. */ + /** + * Static value Basic for ConnectAuthKind. + */ public static final ConnectAuthKind BASIC = fromString("Basic"); - /** Static value OAuth2 for ConnectAuthKind. */ + /** + * Static value OAuth2 for ConnectAuthKind. + */ public static final ConnectAuthKind OAUTH2 = fromString("OAuth2"); - /** Static value APIKey for ConnectAuthKind. */ + /** + * Static value APIKey for ConnectAuthKind. + */ 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. */ @@ -32,7 +49,7 @@ public static ConnectAuthKind fromString(String name) { /** * Gets known ConnectAuthKind values. - * + * * @return known ConnectAuthKind values. */ public static Collection values() { 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 index 655facb3559a..bdccd3bd3766 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Expansion result connected entities. */ +/** + * Expansion result connected entities. + */ @Fluent public final class ConnectedEntity { /* @@ -22,9 +24,15 @@ public final class ConnectedEntity { @JsonProperty(value = "additionalData") private Object additionalData; + /** + * Creates an instance of ConnectedEntity class. + */ + public ConnectedEntity() { + } + /** * Get the targetEntityId property: Entity Id of the connected entity. - * + * * @return the targetEntityId value. */ public String targetEntityId() { @@ -33,7 +41,7 @@ public String targetEntityId() { /** * Set the targetEntityId property: Entity Id of the connected entity. - * + * * @param targetEntityId the targetEntityId value to set. * @return the ConnectedEntity object itself. */ @@ -44,7 +52,7 @@ public ConnectedEntity withTargetEntityId(String targetEntityId) { /** * Get the additionalData property: key-value pairs for a connected entity mapping. - * + * * @return the additionalData value. */ public Object additionalData() { @@ -53,7 +61,7 @@ public Object additionalData() { /** * Set the additionalData property: key-value pairs for a connected entity mapping. - * + * * @param additionalData the additionalData value to set. * @return the ConnectedEntity object itself. */ @@ -64,7 +72,7 @@ public ConnectedEntity withAdditionalData(Object additionalData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Connective.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Connective.java new file mode 100644 index 000000000000..be234ce06332 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Connective.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Represents boolean connectives used to join clauses in conditions. + */ +public final class Connective extends ExpandableStringEnum { + /** + * Static value And for Connective. + */ + public static final Connective AND = fromString("And"); + + /** + * Static value Or for 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. + */ + @JsonCreator + 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 index da5f0724d422..def0ce4e6549 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Setting for the connector check connectivity. */ +/** + * Setting for the connector check connectivity. + */ @Fluent public class ConnectivityCriteria { /* @@ -23,9 +25,15 @@ public class ConnectivityCriteria { @JsonProperty(value = "value") 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() { @@ -34,7 +42,7 @@ public ConnectivityType type() { /** * Set the type property: type of connectivity. - * + * * @param type the type value to set. * @return the ConnectivityCriteria object itself. */ @@ -45,7 +53,7 @@ public ConnectivityCriteria withType(ConnectivityType type) { /** * Get the value property: Queries for checking connectivity. - * + * * @return the value value. */ public List value() { @@ -54,7 +62,7 @@ public List value() { /** * Set the value property: Queries for checking connectivity. - * + * * @param value the value value to set. * @return the ConnectivityCriteria object itself. */ @@ -65,7 +73,7 @@ public ConnectivityCriteria withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriterion.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriterion.java new file mode 100644 index 000000000000..d63cf46f5473 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriterion.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Gets or sets the type of connectivity. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * Gets or sets the queries for checking connectivity. + */ + @JsonProperty(value = "value") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ConnectivityCriterion")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivityCriterion.class); +} 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 index d3298e56cbd9..3e43fd62cc23 100644 --- 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 @@ -8,14 +8,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** type of connectivity. */ +/** + * type of connectivity. + */ public final class ConnectivityType extends ExpandableStringEnum { - /** Static value IsConnectedQuery for ConnectivityType. */ + /** + * Static value IsConnectedQuery for ConnectivityType. + */ 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. */ @@ -26,7 +39,7 @@ public static ConnectivityType fromString(String name) { /** * Gets known ConnectivityType values. - * + * * @return known ConnectivityType values. */ public static Collection values() { 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..03e71aed971b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDataType.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + /* + * Gets or sets the name of the data type to show in the graph. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Gets or sets the query to indicate when relevant data was last received in the workspace. + */ + @JsonProperty(value = "lastDataReceivedQuery", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ConnectorDataType")); + } + if (lastDataReceivedQuery() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property lastDataReceivedQuery in model ConnectorDataType")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectorDataType.class); +} 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..a4b9132393b9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsAvailability.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The exposure status of the connector to the customers. + */ +@Fluent +public final class ConnectorDefinitionsAvailability { + /* + * The exposure status of the connector to the customers. Available values are 0-4 (0=None, 1=Available, 2=FeatureFlag, 3=Internal). + */ + @JsonProperty(value = "status") + private Integer status; + + /* + * Gets or sets a value indicating whether the connector is preview. + */ + @JsonProperty(value = "isPreview") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsPermissions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsPermissions.java new file mode 100644 index 000000000000..0561cd709337 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsPermissions.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The required Permissions for the connector. + */ +@Fluent +public final class ConnectorDefinitionsPermissions { + /* + * Gets or sets the required tenant permissions for the connector. + */ + @JsonProperty(value = "tenant") + private List tenant; + + /* + * Gets or sets the required licenses for the user to create connections. + */ + @JsonProperty(value = "licenses") + private List licenses; + + /* + * Gets or sets the resource provider permissions required for the user to create connections. + */ + @JsonProperty(value = "resourceProvider") + private List resourceProvider; + + /* + * Gets or sets the customs permissions required for the user to create connections. + */ + @JsonProperty(value = "customs") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceProvider() != null) { + resourceProvider().forEach(e -> e.validate()); + } + if (customs() != null) { + customs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsResourceProvider.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsResourceProvider.java new file mode 100644 index 000000000000..f2b9d3d82e58 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsResourceProvider.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + /* + * Gets or sets the provider name. + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /* + * Gets or sets the permissions description text. + */ + @JsonProperty(value = "permissionsDisplayText", required = true) + private String permissionsDisplayText; + + /* + * Gets or sets the permissions provider display name. + */ + @JsonProperty(value = "providerDisplayName", required = true) + private String providerDisplayName; + + /* + * The scope on which the user should have permissions, in order to be able to create connections. + */ + @JsonProperty(value = "scope", required = true) + private ProviderPermissionsScope scope; + + /* + * Required permissions for the connector resource provider that define in ResourceProviders. + * For more information about the permissions see here. + */ + @JsonProperty(value = "requiredPermissions", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provider() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property provider in model ConnectorDefinitionsResourceProvider")); + } + if (permissionsDisplayText() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property permissionsDisplayText in model ConnectorDefinitionsResourceProvider")); + } + if (providerDisplayName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property providerDisplayName in model ConnectorDefinitionsResourceProvider")); + } + if (scope() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property scope in model ConnectorDefinitionsResourceProvider")); + } + if (requiredPermissions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property requiredPermissions in model ConnectorDefinitionsResourceProvider")); + } else { + requiredPermissions().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectorDefinitionsResourceProvider.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorInstructionModelBase.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorInstructionModelBase.java index c710b1b251e2..7548e7a3b2c8 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Instruction step details. */ +/** + * Instruction step details. + */ @Fluent public class ConnectorInstructionModelBase { /* @@ -23,9 +25,15 @@ public class ConnectorInstructionModelBase { @JsonProperty(value = "type", required = true) 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() { @@ -34,7 +42,7 @@ public Object parameters() { /** * Set the parameters property: The parameters for the setting. - * + * * @param parameters the parameters value to set. * @return the ConnectorInstructionModelBase object itself. */ @@ -45,7 +53,7 @@ public ConnectorInstructionModelBase withParameters(Object parameters) { /** * Get the type property: The kind of the setting. - * + * * @return the type value. */ public SettingType type() { @@ -54,7 +62,7 @@ public SettingType type() { /** * Set the type property: The kind of the setting. - * + * * @param type the type value to set. * @return the ConnectorInstructionModelBase object itself. */ @@ -65,15 +73,14 @@ public ConnectorInstructionModelBase withType(SettingType type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (type() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property type in model ConnectorInstructionModelBase")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model ConnectorInstructionModelBase")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant88.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant124.java similarity index 59% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant88.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant124.java index 32293661fa1d..05381ed6b8c8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant88.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Constant124.java @@ -7,31 +7,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for Constant88. */ -public enum Constant88 { - /** Enum value Activity. */ +/** + * Defines values for Constant124. + */ +public enum Constant124 { + /** + * Enum value Activity. + */ ACTIVITY("Activity"); - /** The actual serialized value for a Constant88 instance. */ + /** + * The actual serialized value for a Constant124 instance. + */ private final String value; - Constant88(String value) { + Constant124(String value) { this.value = value; } /** - * Parses a serialized value to a Constant88 instance. - * + * Parses a serialized value to a Constant124 instance. + * * @param value the serialized value to parse. - * @return the parsed Constant88 object, or null if unable to parse. + * @return the parsed Constant124 object, or null if unable to parse. */ @JsonCreator - public static Constant88 fromString(String value) { + public static Constant124 fromString(String value) { if (value == null) { return null; } - Constant88[] items = Constant88.values(); - for (Constant88 item : items) { + Constant124[] items = Constant124.values(); + for (Constant124 item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } @@ -39,7 +45,9 @@ public static Constant88 fromString(String value) { return null; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @JsonValue @Override public String toString() { 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..1582d6f1670a --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of 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 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 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..a2e96c6e88e1 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ContentPackages. + */ +public interface ContentPackages { + /** + * Gets all installed packages. + * + * @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 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 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); + + /** + * 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 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 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); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPathMap.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPathMap.java deleted file mode 100644 index 55e4aa0cd259..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPathMap.java +++ /dev/null @@ -1,72 +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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The mapping of content type to a repo path. */ -@Fluent -public final class ContentPathMap { - /* - * Content type. - */ - @JsonProperty(value = "contentType") - private ContentType contentType; - - /* - * The path to the content. - */ - @JsonProperty(value = "path") - private String path; - - /** - * Get the contentType property: Content type. - * - * @return the contentType value. - */ - public ContentType contentType() { - return this.contentType; - } - - /** - * Set the contentType property: Content type. - * - * @param contentType the contentType value to set. - * @return the ContentPathMap object itself. - */ - public ContentPathMap withContentType(ContentType contentType) { - this.contentType = contentType; - return this; - } - - /** - * Get the path property: The path to the content. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: The path to the content. - * - * @param path the path value to set. - * @return the ContentPathMap object itself. - */ - public ContentPathMap withPath(String path) { - this.path = path; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplateOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplateOperations.java new file mode 100644 index 000000000000..65c17f7ef3c7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplateOperations.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ContentTemplateOperations. + */ +public interface ContentTemplateOperations { + /** + * 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 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 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 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 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/ContentTemplates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplates.java new file mode 100644 index 000000000000..6affdc0d1d81 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplates.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ContentTemplates. + */ +public interface ContentTemplates { + /** + * 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 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 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 index d9976250f875..edf9eff82d03 100644 --- 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 @@ -8,17 +8,52 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The content type of a source control path. */ +/** + * The content type of a source control path. + */ public final class ContentType extends ExpandableStringEnum { - /** Static value AnalyticRule for ContentType. */ + /** + * Static value AnalyticRule for ContentType. + */ public static final ContentType ANALYTIC_RULE = fromString("AnalyticRule"); - /** Static value Workbook for ContentType. */ + /** + * Static value AutomationRule for ContentType. + */ + public static final ContentType AUTOMATION_RULE = fromString("AutomationRule"); + + /** + * Static value HuntingQuery for ContentType. + */ + public static final ContentType HUNTING_QUERY = fromString("HuntingQuery"); + + /** + * Static value Parser for ContentType. + */ + public static final ContentType PARSER = fromString("Parser"); + + /** + * Static value Playbook for ContentType. + */ + public static final ContentType PLAYBOOK = fromString("Playbook"); + + /** + * Static value Workbook for ContentType. + */ 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. */ @@ -29,7 +64,7 @@ public static ContentType fromString(String name) { /** * Gets known ContentType values. - * + * * @return known ContentType values. */ public static Collection values() { 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 index 76169a7542b0..1612a269ab03 100644 --- 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 @@ -5,21 +5,46 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Specific entity query that supports put requests. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = CustomEntityQuery.class) +/** + * Specific entity query that supports put requests. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = CustomEntityQuery.class, visible = true) @JsonTypeName("CustomEntityQuery") -@JsonSubTypes({@JsonSubTypes.Type(name = "Activity", value = ActivityCustomEntityQuery.class)}) +@JsonSubTypes({ @JsonSubTypes.Type(name = "Activity", value = ActivityCustomEntityQuery.class) }) @Fluent public class CustomEntityQuery extends ResourceWithEtag { - /** {@inheritDoc} */ + /* + * the entity query kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private CustomEntityQueryKind kind; + + /** + * Creates an instance of CustomEntityQuery class. + */ + public CustomEntityQuery() { + this.kind = CustomEntityQueryKind.fromString("CustomEntityQuery"); + } + + /** + * Get the kind property: the entity query kind. + * + * @return the kind value. + */ + public CustomEntityQueryKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ @Override public CustomEntityQuery withEtag(String etag) { super.withEtag(etag); @@ -28,7 +53,7 @@ public CustomEntityQuery withEtag(String etag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index b0e8395c6c5f..f0e5e5d3dcc1 100644 --- 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 @@ -8,14 +8,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of the entity query that supports put request. */ +/** + * The kind of the entity query that supports put request. + */ public final class CustomEntityQueryKind extends ExpandableStringEnum { - /** Static value Activity for CustomEntityQueryKind. */ + /** + * Static value Activity for CustomEntityQueryKind. + */ 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. */ @@ -26,7 +39,7 @@ public static CustomEntityQueryKind fromString(String name) { /** * Gets known CustomEntityQueryKind values. - * + * * @return known CustomEntityQueryKind values. */ public static Collection values() { 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..453aa86606c4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomPermissionDetails.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Custom permissions required for the connector. + */ +@Fluent +public final class CustomPermissionDetails { + /* + * Gets or sets the custom permissions name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Gets or sets the custom permissions description. + */ + @JsonProperty(value = "description", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model CustomPermissionDetails")); + } + if (description() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property description in model CustomPermissionDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomPermissionDetails.class); +} 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..82e1054e82a8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectionsConfig.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UiConfig for 'Customizable' connector definition kind. + */ +@Fluent +public final class CustomizableConnectionsConfig { + /* + * 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. + */ + @JsonProperty(value = "templateSpecName", required = true) + private String templateSpecName; + + /* + * Gets or sets the template version. + */ + @JsonProperty(value = "templateSpecVersion", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (templateSpecName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property templateSpecName in model CustomizableConnectionsConfig")); + } + if (templateSpecVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property templateSpecVersion in model CustomizableConnectionsConfig")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomizableConnectionsConfig.class); +} 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..a18506dc6b4f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorDefinition.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.CustomizableConnectorDefinitionProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** + * Connector definition for kind 'Customizable'. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = CustomizableConnectorDefinition.class, + visible = true) +@JsonTypeName("Customizable") +@Fluent +public final class CustomizableConnectorDefinition extends DataConnectorDefinitionInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorDefinitionKind kind = DataConnectorDefinitionKind.CUSTOMIZABLE; + + /* + * Customizable properties. + */ + @JsonProperty(value = "properties") + private CustomizableConnectorDefinitionProperties innerProperties; + + /** + * Creates an instance of CustomizableConnectorDefinition class. + */ + public CustomizableConnectorDefinition() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; + } + + /** + * {@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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorUiConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorUiConfig.java new file mode 100644 index 000000000000..c647996007b9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorUiConfig.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The UiConfig for 'Customizable' connector definition kind. + */ +@Fluent +public final class CustomizableConnectorUiConfig { + /* + * Gets or sets custom connector id. optional field. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Gets or sets the connector blade title. + */ + @JsonProperty(value = "title", required = true) + private String title; + + /* + * Gets or sets the connector publisher name. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * Gets or sets the connector description in markdown format. + */ + @JsonProperty(value = "descriptionMarkdown", required = true) + private String descriptionMarkdown; + + /* + * Gets or sets the graph queries to show the current data volume over time. + */ + @JsonProperty(value = "graphQueries", required = true) + private List graphQueries; + + /* + * Gets or sets the data types to check for last data received. + */ + @JsonProperty(value = "dataTypes", required = true) + private List dataTypes; + + /* + * Gets or sets the way the connector checks whether the connector is connected. + */ + @JsonProperty(value = "connectivityCriteria", required = true) + private List connectivityCriteria; + + /* + * The exposure status of the connector to the customers. + */ + @JsonProperty(value = "availability") + private ConnectorDefinitionsAvailability availability; + + /* + * The required Permissions for the connector. + */ + @JsonProperty(value = "permissions", required = true) + private ConnectorDefinitionsPermissions permissions; + + /* + * Gets or sets the instruction steps to enable the connector. + */ + @JsonProperty(value = "instructionSteps", required = true) + 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. + */ + @JsonProperty(value = "logo") + private String logo; + + /* + * Gets or sets a value indicating whether to use 'OR'(SOME) or 'AND' between ConnectivityCriteria items. + */ + @JsonProperty(value = "isConnectivityCriteriasMatchSome") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (title() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property title in model CustomizableConnectorUiConfig")); + } + if (publisher() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publisher in model CustomizableConnectorUiConfig")); + } + if (descriptionMarkdown() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property descriptionMarkdown in model CustomizableConnectorUiConfig")); + } + if (graphQueries() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property graphQueries in model CustomizableConnectorUiConfig")); + } else { + graphQueries().forEach(e -> e.validate()); + } + if (dataTypes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypes in model CustomizableConnectorUiConfig")); + } else { + dataTypes().forEach(e -> e.validate()); + } + if (connectivityCriteria() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectivityCriteria in model CustomizableConnectorUiConfig")); + } else { + connectivityCriteria().forEach(e -> e.validate()); + } + if (availability() != null) { + availability().validate(); + } + if (permissions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property permissions in model CustomizableConnectorUiConfig")); + } else { + permissions().validate(); + } + if (instructionSteps() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property instructionSteps in model CustomizableConnectorUiConfig")); + } else { + instructionSteps().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomizableConnectorUiConfig.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Customs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Customs.java index 9507f46b98de..00ac017b657f 100644 --- 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 @@ -6,17 +6,29 @@ import com.azure.core.annotation.Fluent; -/** Customs permissions required for the connector. */ +/** + * Customs permissions required for the connector. + */ @Fluent public class Customs extends CustomsPermission { - /** {@inheritDoc} */ + /** + * Creates an instance of Customs class. + */ + public Customs() { + } + + /** + * {@inheritDoc} + */ @Override public Customs withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Customs withDescription(String description) { super.withDescription(description); @@ -25,7 +37,7 @@ public Customs withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index a7ade225346b..e28be264d340 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Customs permissions required for the connector. */ +/** + * Customs permissions required for the connector. + */ @Fluent public class CustomsPermission { /* @@ -22,9 +24,15 @@ public class CustomsPermission { @JsonProperty(value = "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() { @@ -33,7 +41,7 @@ public String name() { /** * Set the name property: Customs permissions name. - * + * * @param name the name value to set. * @return the CustomsPermission object itself. */ @@ -44,7 +52,7 @@ public CustomsPermission withName(String name) { /** * Get the description property: Customs permissions description. - * + * * @return the description value. */ public String description() { @@ -53,7 +61,7 @@ public String description() { /** * Set the description property: Customs permissions description. - * + * * @param description the description value to set. * @return the CustomsPermission object itself. */ @@ -64,7 +72,7 @@ public CustomsPermission withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnector.java index 2a1b02e65c82..867136cff206 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 @@ -7,46 +7,55 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; -/** An immutable client-side representation of DataConnector. */ +/** + * An immutable client-side representation of DataConnector. + */ public interface DataConnector { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the kind property: The data connector kind. + * + * @return the kind value. + */ + DataConnectorKind kind(); + /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner object. - * + * * @return the inner object. */ DataConnectorInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorAuthorizationState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorAuthorizationState.java index 52380b5cedc2..5c1b788ddc19 100644 --- 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Describes the state of user's authorization for a connector kind. */ +/** + * Describes the state of user's authorization for a connector kind. + */ public final class DataConnectorAuthorizationState extends ExpandableStringEnum { - /** Static value Valid for DataConnectorAuthorizationState. */ + /** + * Static value Valid for DataConnectorAuthorizationState. + */ public static final DataConnectorAuthorizationState VALID = fromString("Valid"); - /** Static value Invalid for DataConnectorAuthorizationState. */ + /** + * Static value Invalid for DataConnectorAuthorizationState. + */ 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. */ @@ -29,7 +44,7 @@ public static DataConnectorAuthorizationState fromString(String name) { /** * Gets known DataConnectorAuthorizationState values. - * + * * @return known DataConnectorAuthorizationState values. */ public static Collection values() { 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 index 331014e42fa0..2c26211850f5 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents Codeless API Polling data connector. */ +/** + * Represents Codeless API Polling data connector. + */ @Fluent public final class DataConnectorConnectBody { /* @@ -30,15 +32,13 @@ public final class DataConnectorConnectBody { private String dataCollectionEndpoint; /* - * Used in v2 logs connector. The data collection rule immutable id, the rule defines the transformation and data - * destination. + * Used in v2 logs connector. The data collection rule immutable id, the rule defines the transformation and data destination. */ @JsonProperty(value = "dataCollectionRuleImmutableId") 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. + * Used in v2 logs connector. The stream we are sending the data to, this is the name of the streamDeclarations defined in the DCR. */ @JsonProperty(value = "outputStream") private String outputStream; @@ -79,9 +79,15 @@ public final class DataConnectorConnectBody { @JsonProperty(value = "requestConfigUserInputValues") 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() { @@ -90,7 +96,7 @@ public ConnectAuthKind 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. */ @@ -101,7 +107,7 @@ public DataConnectorConnectBody withKind(ConnectAuthKind kind) { /** * Get the apiKey property: The API key of the audit server. - * + * * @return the apiKey value. */ public String apiKey() { @@ -110,7 +116,7 @@ public String apiKey() { /** * Set the apiKey property: The API key of the audit server. - * + * * @param apiKey the apiKey value to set. * @return the DataConnectorConnectBody object itself. */ @@ -122,7 +128,7 @@ public DataConnectorConnectBody withApiKey(String apiKey) { /** * 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() { @@ -132,7 +138,7 @@ public String 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. */ @@ -144,7 +150,7 @@ public DataConnectorConnectBody withDataCollectionEndpoint(String dataCollection /** * 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() { @@ -154,7 +160,7 @@ public String 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. */ @@ -166,7 +172,7 @@ public DataConnectorConnectBody withDataCollectionRuleImmutableId(String dataCol /** * 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() { @@ -176,7 +182,7 @@ public String 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. */ @@ -187,7 +193,7 @@ public DataConnectorConnectBody withOutputStream(String outputStream) { /** * Get the clientSecret property: The client secret of the OAuth 2.0 application. - * + * * @return the clientSecret value. */ public String clientSecret() { @@ -196,7 +202,7 @@ public String 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. */ @@ -207,7 +213,7 @@ public DataConnectorConnectBody withClientSecret(String clientSecret) { /** * Get the clientId property: The client id of the OAuth 2.0 application. - * + * * @return the clientId value. */ public String clientId() { @@ -216,7 +222,7 @@ public String 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. */ @@ -227,7 +233,7 @@ public DataConnectorConnectBody withClientId(String clientId) { /** * 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() { @@ -236,7 +242,7 @@ public String 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. */ @@ -247,7 +253,7 @@ public DataConnectorConnectBody withAuthorizationCode(String authorizationCode) /** * Get the username property: The user name in the audit log server. - * + * * @return the username value. */ public String username() { @@ -256,7 +262,7 @@ public String 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. */ @@ -267,7 +273,7 @@ public DataConnectorConnectBody withUsername(String username) { /** * Get the password property: The user password in the audit log server. - * + * * @return the password value. */ public String password() { @@ -276,7 +282,7 @@ public String 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. */ @@ -287,7 +293,7 @@ public DataConnectorConnectBody withPassword(String password) { /** * Get the requestConfigUserInputValues property: The requestConfigUserInputValues property. - * + * * @return the requestConfigUserInputValues value. */ public List requestConfigUserInputValues() { @@ -296,7 +302,7 @@ public List requestConfigUserInputValues() { /** * Set the requestConfigUserInputValues property: The requestConfigUserInputValues property. - * + * * @param requestConfigUserInputValues the requestConfigUserInputValues value to set. * @return the DataConnectorConnectBody object itself. */ @@ -307,7 +313,7 @@ public DataConnectorConnectBody withRequestConfigUserInputValues(List re /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDataTypeCommon.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDataTypeCommon.java index 936cd58c9114..c7f38b3e3304 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Common field for data type in data connectors. */ +/** + * Common field for data type in data connectors. + */ @Fluent public class DataConnectorDataTypeCommon { /* @@ -17,9 +19,15 @@ public class DataConnectorDataTypeCommon { @JsonProperty(value = "state", required = true) private DataTypeState state; + /** + * Creates an instance of DataConnectorDataTypeCommon class. + */ + public DataConnectorDataTypeCommon() { + } + /** * Get the state property: Describe whether this data type connection is enabled or not. - * + * * @return the state value. */ public DataTypeState state() { @@ -28,7 +36,7 @@ public DataTypeState state() { /** * Set the state property: Describe whether this data type connection is enabled or not. - * + * * @param state the state value to set. * @return the DataConnectorDataTypeCommon object itself. */ @@ -39,15 +47,14 @@ public DataConnectorDataTypeCommon withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (state() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property state in model DataConnectorDataTypeCommon")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property state in model DataConnectorDataTypeCommon")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinition.java new file mode 100644 index 000000000000..cce67600aad6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinition.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.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 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 kind property: The data connector kind. + * + * @return the kind value. + */ + DataConnectorDefinitionKind kind(); + + /** + * 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/DataConnectorDefinitionArmCollectionWrapper.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitionArmCollectionWrapper.java new file mode 100644 index 000000000000..d524a052e1cb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitionArmCollectionWrapper.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Encapsulate the data connector definition object. + */ +@Fluent +public final class DataConnectorDefinitionArmCollectionWrapper { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of DataConnectorDefinitionArmCollectionWrapper class. + */ + public DataConnectorDefinitionArmCollectionWrapper() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the DataConnectorDefinitionArmCollectionWrapper object itself. + */ + public DataConnectorDefinitionArmCollectionWrapper withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the DataConnectorDefinitionArmCollectionWrapper object itself. + */ + public DataConnectorDefinitionArmCollectionWrapper 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()); + } + } +} 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..076e9ead438a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitionKind.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The kind of the data connector definitions. + */ +public final class DataConnectorDefinitionKind extends ExpandableStringEnum { + /** + * Static value Customizable for DataConnectorDefinitionKind. + */ + 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. + */ + @JsonCreator + 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..a93872df5e69 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; + +/** + * Resource collection API of DataConnectorDefinitions. + */ +public interface DataConnectorDefinitions { + /** + * Gets all data connector definitions. + * + * @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 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 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); + + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the 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 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 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 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 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 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); +} 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 b140a12dfff7..d51a3aa4b9be 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 @@ -8,73 +8,140 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of the data connector. */ +/** + * The kind of the data connector. + */ public final class DataConnectorKind extends ExpandableStringEnum { - /** Static value AzureActiveDirectory for DataConnectorKind. */ + /** + * Static value AzureActiveDirectory for DataConnectorKind. + */ public static final DataConnectorKind AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); - /** Static value AzureSecurityCenter for DataConnectorKind. */ + /** + * Static value AzureSecurityCenter for DataConnectorKind. + */ public static final DataConnectorKind AZURE_SECURITY_CENTER = fromString("AzureSecurityCenter"); - /** Static value MicrosoftCloudAppSecurity for DataConnectorKind. */ + /** + * Static value MicrosoftCloudAppSecurity for DataConnectorKind. + */ public static final DataConnectorKind MICROSOFT_CLOUD_APP_SECURITY = fromString("MicrosoftCloudAppSecurity"); - /** Static value ThreatIntelligence for DataConnectorKind. */ + /** + * Static value ThreatIntelligence for DataConnectorKind. + */ public static final DataConnectorKind THREAT_INTELLIGENCE = fromString("ThreatIntelligence"); - /** Static value ThreatIntelligenceTaxii for DataConnectorKind. */ + /** + * Static value ThreatIntelligenceTaxii for DataConnectorKind. + */ public static final DataConnectorKind THREAT_INTELLIGENCE_TAXII = fromString("ThreatIntelligenceTaxii"); - /** Static value Office365 for DataConnectorKind. */ + /** + * Static value Office365 for DataConnectorKind. + */ public static final DataConnectorKind OFFICE365 = fromString("Office365"); - /** Static value OfficeATP for DataConnectorKind. */ + /** + * Static value OfficeATP for DataConnectorKind. + */ public static final DataConnectorKind OFFICE_ATP = fromString("OfficeATP"); - /** Static value OfficeIRM for DataConnectorKind. */ + /** + * Static value OfficeIRM for DataConnectorKind. + */ public static final DataConnectorKind OFFICE_IRM = fromString("OfficeIRM"); - /** Static value Office365Project for DataConnectorKind. */ + /** + * Static value Office365Project for DataConnectorKind. + */ public static final DataConnectorKind OFFICE365PROJECT = fromString("Office365Project"); - /** Static value OfficePowerBI for DataConnectorKind. */ + /** + * Static value MicrosoftPurviewInformationProtection for DataConnectorKind. + */ + public static final DataConnectorKind MICROSOFT_PURVIEW_INFORMATION_PROTECTION + = fromString("MicrosoftPurviewInformationProtection"); + + /** + * Static value OfficePowerBI for DataConnectorKind. + */ public static final DataConnectorKind OFFICE_POWER_BI = fromString("OfficePowerBI"); - /** Static value AmazonWebServicesCloudTrail for DataConnectorKind. */ + /** + * Static value AmazonWebServicesCloudTrail for DataConnectorKind. + */ public static final DataConnectorKind AMAZON_WEB_SERVICES_CLOUD_TRAIL = fromString("AmazonWebServicesCloudTrail"); - /** Static value AmazonWebServicesS3 for DataConnectorKind. */ + /** + * Static value AmazonWebServicesS3 for DataConnectorKind. + */ public static final DataConnectorKind AMAZON_WEB_SERVICES_S3 = fromString("AmazonWebServicesS3"); - /** Static value AzureAdvancedThreatProtection for DataConnectorKind. */ - public static final DataConnectorKind AZURE_ADVANCED_THREAT_PROTECTION = - fromString("AzureAdvancedThreatProtection"); + /** + * Static value AzureAdvancedThreatProtection for DataConnectorKind. + */ + public static final DataConnectorKind AZURE_ADVANCED_THREAT_PROTECTION + = fromString("AzureAdvancedThreatProtection"); - /** Static value MicrosoftDefenderAdvancedThreatProtection for DataConnectorKind. */ - public static final DataConnectorKind MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION = - fromString("MicrosoftDefenderAdvancedThreatProtection"); + /** + * Static value MicrosoftDefenderAdvancedThreatProtection for DataConnectorKind. + */ + public static final DataConnectorKind MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION + = fromString("MicrosoftDefenderAdvancedThreatProtection"); - /** Static value Dynamics365 for DataConnectorKind. */ + /** + * Static value Dynamics365 for DataConnectorKind. + */ public static final DataConnectorKind DYNAMICS365 = fromString("Dynamics365"); - /** Static value MicrosoftThreatProtection for DataConnectorKind. */ + /** + * Static value MicrosoftThreatProtection for DataConnectorKind. + */ public static final DataConnectorKind MICROSOFT_THREAT_PROTECTION = fromString("MicrosoftThreatProtection"); - /** Static value MicrosoftThreatIntelligence for DataConnectorKind. */ + /** + * Static value MicrosoftThreatIntelligence for DataConnectorKind. + */ public static final DataConnectorKind MICROSOFT_THREAT_INTELLIGENCE = fromString("MicrosoftThreatIntelligence"); - /** Static value GenericUI for DataConnectorKind. */ + /** + * Static value GenericUI for DataConnectorKind. + */ public static final DataConnectorKind GENERIC_UI = fromString("GenericUI"); - /** Static value APIPolling for DataConnectorKind. */ + /** + * Static value APIPolling for DataConnectorKind. + */ public static final DataConnectorKind APIPOLLING = fromString("APIPolling"); - /** Static value IOT for DataConnectorKind. */ + /** + * Static value IOT for DataConnectorKind. + */ public static final DataConnectorKind IOT = fromString("IOT"); + /** + * Static value GCP for DataConnectorKind. + */ + public static final DataConnectorKind GCP = fromString("GCP"); + + /** + * Static value RestApiPoller for DataConnectorKind. + */ + public static final DataConnectorKind REST_API_POLLER = fromString("RestApiPoller"); + + /** + * Creates a new instance of DataConnectorKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataConnectorKind() { + } + /** * Creates or finds a DataConnectorKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding DataConnectorKind. */ @@ -85,7 +152,7 @@ public static DataConnectorKind fromString(String name) { /** * Gets known DataConnectorKind values. - * + * * @return known DataConnectorKind values. */ public static Collection values() { 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 index 2d507206aaab..16469d94c48d 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Describes the state of user's license for a connector kind. */ +/** + * Describes the state of user's license for a connector kind. + */ public final class DataConnectorLicenseState extends ExpandableStringEnum { - /** Static value Valid for DataConnectorLicenseState. */ + /** + * Static value Valid for DataConnectorLicenseState. + */ public static final DataConnectorLicenseState VALID = fromString("Valid"); - /** Static value Invalid for DataConnectorLicenseState. */ + /** + * Static value Invalid for DataConnectorLicenseState. + */ public static final DataConnectorLicenseState INVALID = fromString("Invalid"); - /** Static value Unknown for DataConnectorLicenseState. */ + /** + * Static value Unknown for DataConnectorLicenseState. + */ 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. */ @@ -32,7 +49,7 @@ public static DataConnectorLicenseState fromString(String name) { /** * Gets known DataConnectorLicenseState values. - * + * * @return known DataConnectorLicenseState values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorList.java index 623d64d420bd..106e630462a8 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/models/DataConnectorList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the data connectors. */ +/** + * List all the data connectors. + */ @Fluent public final class DataConnectorList { /* @@ -25,9 +27,15 @@ public final class DataConnectorList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of DataConnectorList class. + */ + public DataConnectorList() { + } + /** * Get the nextLink property: URL to fetch the next set of data connectors. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of data connectors. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of data connectors. - * + * * @param value the value value to set. * @return the DataConnectorList object itself. */ @@ -56,14 +64,13 @@ public DataConnectorList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DataConnectorList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DataConnectorList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorRequirementsState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorRequirementsState.java index 96aa7a63791f..039364a89b15 100644 --- 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 @@ -6,18 +6,20 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorRequirementsStateInner; -/** An immutable client-side representation of DataConnectorRequirementsState. */ +/** + * 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(); @@ -25,7 +27,7 @@ public interface DataConnectorRequirementsState { /** * 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 index 36d4914ce98b..b4b4db7348cd 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Properties data connector on tenant level. */ +/** + * Properties data connector on tenant level. + */ @Fluent public class DataConnectorTenantId { /* @@ -17,9 +19,15 @@ public class DataConnectorTenantId { @JsonProperty(value = "tenantId", required = true) 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() { @@ -28,7 +36,7 @@ public String 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. */ @@ -39,14 +47,13 @@ public DataConnectorTenantId withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (tenantId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property tenantId in model DataConnectorTenantId")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tenantId in model DataConnectorTenantId")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorWithAlertsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorWithAlertsProperties.java index e0bbbf5d0334..3d0792f4152e 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Data connector properties. */ +/** + * Data connector properties. + */ @Fluent public class DataConnectorWithAlertsProperties { /* @@ -16,9 +18,15 @@ public class DataConnectorWithAlertsProperties { @JsonProperty(value = "dataTypes") private AlertsDataTypeOfDataConnector dataTypes; + /** + * Creates an instance of DataConnectorWithAlertsProperties class. + */ + public DataConnectorWithAlertsProperties() { + } + /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -27,7 +35,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the DataConnectorWithAlertsProperties object itself. */ @@ -38,7 +46,7 @@ public DataConnectorWithAlertsProperties withDataTypes(AlertsDataTypeOfDataConne /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectors.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectors.java index f80628152117..41a7a9f8415e 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 @@ -9,11 +9,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; -/** Resource collection API of DataConnectors. */ +/** + * 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. @@ -25,7 +27,7 @@ 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. * @param context The context to associate with this operation. @@ -38,152 +40,144 @@ public interface DataConnectors { /** * Gets a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data connector. + * @return a data connector along with {@link Response}. */ - DataConnector get(String resourceGroupName, String workspaceName, String dataConnectorId); + Response getWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + Context context); /** * Gets a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a data connector. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String dataConnectorId, Context context); + DataConnector get(String resourceGroupName, String workspaceName, String dataConnectorId); /** * Creates or updates the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data connector. + * @return data connector along with {@link Response}. */ - DataConnector createOrUpdate( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorInner dataConnector); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorInner dataConnector, Context context); /** * Creates or updates the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 data connector. */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorInner dataConnector, - Context context); + DataConnector createOrUpdate(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorInner dataConnector); /** * Delete the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String dataConnectorId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + Context context); /** * Delete the data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 dataConnectorId, Context context); + void delete(String resourceGroupName, String workspaceName, String dataConnectorId); /** * Connects a data connector. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param dataConnectorId Connector ID. * @param connectBody The data connector. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void connect( - String resourceGroupName, String workspaceName, String dataConnectorId, DataConnectorConnectBody connectBody); + 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 workspace. * @param dataConnectorId Connector ID. * @param connectBody The data connector. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ - Response connectWithResponse( - String resourceGroupName, - String workspaceName, - String dataConnectorId, - DataConnectorConnectBody connectBody, - Context context); + 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 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}. */ - void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId); + 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 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); + 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 index 57317f6ffc3c..d3f573bfb2a8 100644 --- 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 @@ -5,16 +5,20 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Data connector requirements properties. */ +/** + * Data connector requirements properties. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = DataConnectorsCheckRequirements.class) + defaultImpl = DataConnectorsCheckRequirements.class, + visible = true) @JsonTypeName("DataConnectorsCheckRequirements") @JsonSubTypes({ @JsonSubTypes.Type(name = "AzureActiveDirectory", value = AadCheckRequirements.class), @@ -29,17 +33,42 @@ @JsonSubTypes.Type(name = "MicrosoftThreatProtection", value = MtpCheckRequirements.class), @JsonSubTypes.Type(name = "OfficeATP", value = OfficeAtpCheckRequirements.class), @JsonSubTypes.Type(name = "OfficeIRM", value = OfficeIrmCheckRequirements.class), + @JsonSubTypes.Type( + name = "MicrosoftPurviewInformationProtection", + value = MicrosoftPurviewInformationProtectionCheckRequirements.class), @JsonSubTypes.Type(name = "Office365Project", value = Office365ProjectCheckRequirements.class), @JsonSubTypes.Type(name = "OfficePowerBI", value = OfficePowerBICheckRequirements.class), @JsonSubTypes.Type(name = "ThreatIntelligence", value = TICheckRequirements.class), @JsonSubTypes.Type(name = "ThreatIntelligenceTaxii", value = TiTaxiiCheckRequirements.class), - @JsonSubTypes.Type(name = "IOT", value = IoTCheckRequirements.class) -}) + @JsonSubTypes.Type(name = "IOT", value = IoTCheckRequirements.class) }) @Immutable public class DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind; + + /** + * Creates an instance of DataConnectorsCheckRequirements class. + */ + public DataConnectorsCheckRequirements() { + this.kind = DataConnectorKind.fromString("DataConnectorsCheckRequirements"); + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + public DataConnectorKind kind() { + return this.kind; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirementsOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirementsOperations.java index 6524d59b3515..6dd61aa5ffc9 100644 --- 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 @@ -7,39 +7,36 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of DataConnectorsCheckRequirementsOperations. */ +/** + * 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. + * @return requirements state for a data connector type along with {@link Response}. */ - DataConnectorRequirementsState post( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return requirements state for a data connector type. */ - Response postWithResponse( - String resourceGroupName, - String workspaceName, - DataConnectorsCheckRequirements dataConnectorsCheckRequirements, - Context context); + 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 index 419ceca40540..56390b687959 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The data type definition. */ +/** + * The data type definition. + */ @Fluent public final class DataTypeDefinitions { /* @@ -16,9 +18,15 @@ public final class DataTypeDefinitions { @JsonProperty(value = "dataType") private String dataType; + /** + * Creates an instance of DataTypeDefinitions class. + */ + public DataTypeDefinitions() { + } + /** * Get the dataType property: The data type name. - * + * * @return the dataType value. */ public String dataType() { @@ -27,7 +35,7 @@ public String dataType() { /** * Set the dataType property: The data type name. - * + * * @param dataType the dataType value to set. * @return the DataTypeDefinitions object itself. */ @@ -38,7 +46,7 @@ public DataTypeDefinitions withDataType(String dataType) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeState.java index f0851844c733..bcea115c0100 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Describe whether this data type connection is enabled or not. */ +/** + * Describe whether this data type connection is enabled or not. + */ public final class DataTypeState extends ExpandableStringEnum { - /** Static value Enabled for DataTypeState. */ + /** + * Static value Enabled for DataTypeState. + */ public static final DataTypeState ENABLED = fromString("Enabled"); - /** Static value Disabled for DataTypeState. */ + /** + * Static value Disabled for DataTypeState. + */ public static final DataTypeState DISABLED = fromString("Disabled"); + /** + * Creates a new instance of DataTypeState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataTypeState() { + } + /** * Creates or finds a DataTypeState from its string representation. - * + * * @param name a name to look for. * @return the corresponding DataTypeState. */ @@ -29,7 +44,7 @@ public static DataTypeState fromString(String name) { /** * Gets known DataTypeState values. - * + * * @return known DataTypeState values. */ public static Collection values() { 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..0aca35e44676 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DcrConfiguration.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration of the destination of the data. + */ +@Fluent +public final class DcrConfiguration { + /* + * Represents the data collection ingestion endpoint in log analytics. + */ + @JsonProperty(value = "dataCollectionEndpoint", required = true) + private String dataCollectionEndpoint; + + /* + * The data collection rule immutable id, the rule defines the transformation and data destination. + */ + @JsonProperty(value = "dataCollectionRuleImmutableId", required = true) + private String dataCollectionRuleImmutableId; + + /* + * The stream we are sending the data to. + */ + @JsonProperty(value = "streamName", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataCollectionEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataCollectionEndpoint in model DcrConfiguration")); + } + if (dataCollectionRuleImmutableId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataCollectionRuleImmutableId in model DcrConfiguration")); + } + if (streamName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property streamName in model DcrConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DcrConfiguration.class); +} 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 index f0501a0e1fbc..fcc69773e64f 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Indicates whether the file was deleted from the storage account. */ +/** + * Indicates whether the file was deleted from the storage account. + */ public final class DeleteStatus extends ExpandableStringEnum { - /** Static value Deleted for DeleteStatus. */ + /** + * Static value Deleted for DeleteStatus. + */ public static final DeleteStatus DELETED = fromString("Deleted"); - /** Static value NotDeleted for DeleteStatus. */ + /** + * Static value NotDeleted for DeleteStatus. + */ public static final DeleteStatus NOT_DELETED = fromString("NotDeleted"); - /** Static value Unspecified for DeleteStatus. */ + /** + * Static value Unspecified for DeleteStatus. + */ 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. */ @@ -32,7 +49,7 @@ public static DeleteStatus fromString(String name) { /** * Gets known DeleteStatus values. - * + * * @return known DeleteStatus values. */ public static Collection values() { 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 236b4cc28563..c711ea68f3c7 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 @@ -7,24 +7,38 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The delivery action of this mail message like Delivered, Blocked, Replaced etc. */ +/** + * The delivery action of this mail message like Delivered, Blocked, Replaced etc. + */ public enum DeliveryAction { - /** Enum value Unknown. */ + /** + * Enum value Unknown. + */ UNKNOWN("Unknown"), - /** Enum value DeliveredAsSpam. */ + /** + * Enum value DeliveredAsSpam. + */ DELIVERED_AS_SPAM("DeliveredAsSpam"), - /** Enum value Delivered. */ + /** + * Enum value Delivered. + */ DELIVERED("Delivered"), - /** Enum value Blocked. */ + /** + * Enum value Blocked. + */ BLOCKED("Blocked"), - /** Enum value Replaced. */ + /** + * Enum value Replaced. + */ REPLACED("Replaced"); - /** The actual serialized value for a DeliveryAction instance. */ + /** + * The actual serialized value for a DeliveryAction instance. + */ private final String value; DeliveryAction(String value) { @@ -33,7 +47,7 @@ public enum DeliveryAction { /** * Parses a serialized value to a DeliveryAction instance. - * + * * @param value the serialized value to parse. * @return the parsed DeliveryAction object, or null if unable to parse. */ @@ -51,7 +65,9 @@ public static DeliveryAction fromString(String value) { return null; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @JsonValue @Override public String toString() { 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 cc29c09ff4c3..ad0d20fa14cc 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 @@ -7,36 +7,58 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The delivery location of this mail message like Inbox, JunkFolder etc. */ +/** + * The delivery location of this mail message like Inbox, JunkFolder etc. + */ public enum DeliveryLocation { - /** Enum value Unknown. */ + /** + * Enum value Unknown. + */ UNKNOWN("Unknown"), - /** Enum value Inbox. */ + /** + * Enum value Inbox. + */ INBOX("Inbox"), - /** Enum value JunkFolder. */ + /** + * Enum value JunkFolder. + */ JUNK_FOLDER("JunkFolder"), - /** Enum value DeletedFolder. */ + /** + * Enum value DeletedFolder. + */ DELETED_FOLDER("DeletedFolder"), - /** Enum value Quarantine. */ + /** + * Enum value Quarantine. + */ QUARANTINE("Quarantine"), - /** Enum value External. */ + /** + * Enum value External. + */ EXTERNAL("External"), - /** Enum value Failed. */ + /** + * Enum value Failed. + */ FAILED("Failed"), - /** Enum value Dropped. */ + /** + * Enum value Dropped. + */ DROPPED("Dropped"), - /** Enum value Forwarded. */ + /** + * Enum value Forwarded. + */ FORWARDED("Forwarded"); - /** The actual serialized value for a DeliveryLocation instance. */ + /** + * The actual serialized value for a DeliveryLocation instance. + */ private final String value; DeliveryLocation(String value) { @@ -45,7 +67,7 @@ public enum DeliveryLocation { /** * Parses a serialized value to a DeliveryLocation instance. - * + * * @param value the serialized value to parse. * @return the parsed DeliveryLocation object, or null if unable to parse. */ @@ -63,7 +85,9 @@ public static DeliveryLocation fromString(String value) { return null; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @JsonValue @Override public String toString() { 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 index f500a22a553e..ffde8f8dd305 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Description about a deployment. */ +/** + * Description about a deployment. + */ @Fluent public final class Deployment { /* @@ -41,9 +43,15 @@ public final class Deployment { @JsonProperty(value = "deploymentLogsUrl") private String deploymentLogsUrl; + /** + * Creates an instance of Deployment class. + */ + public Deployment() { + } + /** * Get the deploymentId property: Deployment identifier. - * + * * @return the deploymentId value. */ public String deploymentId() { @@ -52,7 +60,7 @@ public String deploymentId() { /** * Set the deploymentId property: Deployment identifier. - * + * * @param deploymentId the deploymentId value to set. * @return the Deployment object itself. */ @@ -63,7 +71,7 @@ public Deployment withDeploymentId(String deploymentId) { /** * Get the deploymentState property: Current status of the deployment. - * + * * @return the deploymentState value. */ public DeploymentState deploymentState() { @@ -72,7 +80,7 @@ public DeploymentState deploymentState() { /** * Set the deploymentState property: Current status of the deployment. - * + * * @param deploymentState the deploymentState value to set. * @return the Deployment object itself. */ @@ -83,7 +91,7 @@ public Deployment withDeploymentState(DeploymentState deploymentState) { /** * Get the deploymentResult property: The outcome of the deployment. - * + * * @return the deploymentResult value. */ public DeploymentResult deploymentResult() { @@ -92,7 +100,7 @@ public DeploymentResult deploymentResult() { /** * Set the deploymentResult property: The outcome of the deployment. - * + * * @param deploymentResult the deploymentResult value to set. * @return the Deployment object itself. */ @@ -103,7 +111,7 @@ public Deployment withDeploymentResult(DeploymentResult deploymentResult) { /** * Get the deploymentTime property: The time when the deployment finished. - * + * * @return the deploymentTime value. */ public OffsetDateTime deploymentTime() { @@ -112,7 +120,7 @@ public OffsetDateTime deploymentTime() { /** * Set the deploymentTime property: The time when the deployment finished. - * + * * @param deploymentTime the deploymentTime value to set. * @return the Deployment object itself. */ @@ -123,7 +131,7 @@ public Deployment withDeploymentTime(OffsetDateTime deploymentTime) { /** * Get the deploymentLogsUrl property: Url to access repository action logs. - * + * * @return the deploymentLogsUrl value. */ public String deploymentLogsUrl() { @@ -132,7 +140,7 @@ public String deploymentLogsUrl() { /** * Set the deploymentLogsUrl property: Url to access repository action logs. - * + * * @param deploymentLogsUrl the deploymentLogsUrl value to set. * @return the Deployment object itself. */ @@ -143,7 +151,7 @@ public Deployment withDeploymentLogsUrl(String deploymentLogsUrl) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentFetchStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentFetchStatus.java index 0cfc63e3b5a8..cc44276f09c0 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Status while trying to fetch the deployment information. */ +/** + * Status while trying to fetch the deployment information. + */ public final class DeploymentFetchStatus extends ExpandableStringEnum { - /** Static value Success for DeploymentFetchStatus. */ + /** + * Static value Success for DeploymentFetchStatus. + */ public static final DeploymentFetchStatus SUCCESS = fromString("Success"); - /** Static value Unauthorized for DeploymentFetchStatus. */ + /** + * Static value Unauthorized for DeploymentFetchStatus. + */ public static final DeploymentFetchStatus UNAUTHORIZED = fromString("Unauthorized"); - /** Static value NotFound for DeploymentFetchStatus. */ + /** + * Static value NotFound for DeploymentFetchStatus. + */ 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. */ @@ -32,7 +49,7 @@ public static DeploymentFetchStatus fromString(String name) { /** * Gets known DeploymentFetchStatus values. - * + * * @return known DeploymentFetchStatus values. */ public static Collection values() { 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 index 6f8b486f4c2e..76d9bae090a1 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Information regarding a deployment. */ +/** + * Information regarding a deployment. + */ @Fluent public final class DeploymentInfo { /* @@ -28,9 +30,15 @@ public final class DeploymentInfo { @JsonProperty(value = "message") private String message; + /** + * Creates an instance of DeploymentInfo class. + */ + public DeploymentInfo() { + } + /** * Get the deploymentFetchStatus property: Status while fetching the last deployment. - * + * * @return the deploymentFetchStatus value. */ public DeploymentFetchStatus deploymentFetchStatus() { @@ -39,7 +47,7 @@ public DeploymentFetchStatus deploymentFetchStatus() { /** * Set the deploymentFetchStatus property: Status while fetching the last deployment. - * + * * @param deploymentFetchStatus the deploymentFetchStatus value to set. * @return the DeploymentInfo object itself. */ @@ -50,7 +58,7 @@ public DeploymentInfo withDeploymentFetchStatus(DeploymentFetchStatus deployment /** * Get the deployment property: Deployment information. - * + * * @return the deployment value. */ public Deployment deployment() { @@ -59,7 +67,7 @@ public Deployment deployment() { /** * Set the deployment property: Deployment information. - * + * * @param deployment the deployment value to set. * @return the DeploymentInfo object itself. */ @@ -70,7 +78,7 @@ public DeploymentInfo withDeployment(Deployment deployment) { /** * Get the message property: Additional details about the deployment that can be shown to the user. - * + * * @return the message value. */ public String message() { @@ -79,7 +87,7 @@ public String message() { /** * Set the message property: Additional details about the deployment that can be shown to the user. - * + * * @param message the message value to set. * @return the DeploymentInfo object itself. */ @@ -90,7 +98,7 @@ public DeploymentInfo withMessage(String message) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentResult.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentResult.java index b9bc8016e8c4..deeeeca40e01 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Status while trying to fetch the deployment information. */ +/** + * Status while trying to fetch the deployment information. + */ public final class DeploymentResult extends ExpandableStringEnum { - /** Static value Success for DeploymentResult. */ + /** + * Static value Success for DeploymentResult. + */ public static final DeploymentResult SUCCESS = fromString("Success"); - /** Static value Canceled for DeploymentResult. */ + /** + * Static value Canceled for DeploymentResult. + */ public static final DeploymentResult CANCELED = fromString("Canceled"); - /** Static value Failed for DeploymentResult. */ + /** + * Static value Failed for DeploymentResult. + */ 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. */ @@ -32,7 +49,7 @@ public static DeploymentResult fromString(String name) { /** * Gets known DeploymentResult values. - * + * * @return known DeploymentResult values. */ public static Collection values() { 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 index 770b490ee8bc..1d4194a9af87 100644 --- 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current state of the deployment. */ +/** + * The current state of the deployment. + */ public final class DeploymentState extends ExpandableStringEnum { - /** Static value In_Progress for DeploymentState. */ + /** + * Static value In_Progress for DeploymentState. + */ public static final DeploymentState IN_PROGRESS = fromString("In_Progress"); - /** Static value Completed for DeploymentState. */ + /** + * Static value Completed for DeploymentState. + */ public static final DeploymentState COMPLETED = fromString("Completed"); - /** Static value Queued for DeploymentState. */ + /** + * Static value Queued for DeploymentState. + */ public static final DeploymentState QUEUED = fromString("Queued"); - /** Static value Canceling for DeploymentState. */ + /** + * Static value Canceling for DeploymentState. + */ 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. */ @@ -35,7 +54,7 @@ public static DeploymentState fromString(String name) { /** * Gets known DeploymentState values. - * + * * @return known DeploymentState values. */ public static Collection values() { 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 index 2a78da582b0b..1cb68f58c820 100644 --- 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Device importance, determines if the device classified as 'crown jewel'. */ +/** + * Device importance, determines if the device classified as 'crown jewel'. + */ public final class DeviceImportance extends ExpandableStringEnum { - /** Static value Unknown for DeviceImportance. */ + /** + * Static value Unknown for DeviceImportance. + */ public static final DeviceImportance UNKNOWN = fromString("Unknown"); - /** Static value Low for DeviceImportance. */ + /** + * Static value Low for DeviceImportance. + */ public static final DeviceImportance LOW = fromString("Low"); - /** Static value Normal for DeviceImportance. */ + /** + * Static value Normal for DeviceImportance. + */ public static final DeviceImportance NORMAL = fromString("Normal"); - /** Static value High for DeviceImportance. */ + /** + * Static value High for DeviceImportance. + */ 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. */ @@ -35,7 +54,7 @@ public static DeviceImportance fromString(String name) { /** * Gets known DeviceImportance values. - * + * * @return known DeviceImportance values. */ public static Collection values() { 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 ed3969162e66..7e814c0aa530 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 @@ -4,29 +4,55 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.DnsEntityProperties; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; import java.util.Map; -/** Represents a dns entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a dns entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = DnsEntity.class, visible = true) @JsonTypeName("DnsResolution") -@Fluent +@Immutable public final class DnsEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.DNS_RESOLUTION; + /* * Dns entity properties */ @JsonProperty(value = "properties") private DnsEntityProperties innerProperties; + /** + * Creates an instance of DnsEntity class. + */ + public DnsEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Dns entity properties. - * + * * @return the innerProperties value. */ private DnsEntityProperties innerProperties() { @@ -35,7 +61,7 @@ private DnsEntityProperties innerProperties() { /** * Get the dnsServerIpEntityId property: An ip entity id for the dns server resolving the request. - * + * * @return the dnsServerIpEntityId value. */ public String dnsServerIpEntityId() { @@ -44,7 +70,7 @@ public String dnsServerIpEntityId() { /** * Get the domainName property: The name of the dns record associated with the alert. - * + * * @return the domainName value. */ public String domainName() { @@ -53,7 +79,7 @@ public String domainName() { /** * Get the hostIpAddressEntityId property: An ip entity id for the dns request client. - * + * * @return the hostIpAddressEntityId value. */ public String hostIpAddressEntityId() { @@ -62,7 +88,7 @@ public String hostIpAddressEntityId() { /** * Get the ipAddressEntityIds property: Ip entity identifiers for the resolved ip address. - * + * * @return the ipAddressEntityIds value. */ public List ipAddressEntityIds() { @@ -72,7 +98,7 @@ public List ipAddressEntityIds() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -82,7 +108,7 @@ public Map 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() { @@ -91,7 +117,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index eaa3c125f567..3c5863e5ccc4 100644 --- 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 @@ -7,32 +7,85 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365CheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Dynamics365 requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Dynamics365 requirements check request. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = Dynamics365CheckRequirements.class, + visible = true) @JsonTypeName("Dynamics365") @Fluent public final class Dynamics365CheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.DYNAMICS365; + /* * Dynamics365 requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 653d886600c3..58b27f9ecb2e 100644 --- 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 @@ -8,30 +8,62 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365DataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Dynamics365 data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Dynamics365 data connector. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = Dynamics365DataConnector.class, + visible = true) @JsonTypeName("Dynamics365") @Fluent public final class Dynamics365DataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.DYNAMICS365; + /* * Dynamics365 data connector properties. */ @JsonProperty(value = "properties") private Dynamics365DataConnectorProperties innerProperties; + /** + * Creates an instance of Dynamics365DataConnector class. + */ + public Dynamics365DataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Dynamics365DataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +72,7 @@ public Dynamics365DataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public Dynamics365DataConnectorDataTypes dataTypes() { @@ -49,7 +81,7 @@ public Dynamics365DataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the Dynamics365DataConnector object itself. */ @@ -63,7 +95,7 @@ public Dynamics365DataConnector withDataTypes(Dynamics365DataConnectorDataTypes /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +104,7 @@ public String 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. */ @@ -86,7 +118,7 @@ public Dynamics365DataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 0df0a2723965..ec2ca6341314 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for Dynamics365 data connector. */ +/** + * The available data types for Dynamics365 data connector. + */ @Fluent public final class Dynamics365DataConnectorDataTypes { /* @@ -17,9 +19,15 @@ public final class Dynamics365DataConnectorDataTypes { @JsonProperty(value = "dynamics365CdsActivities", required = true) 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() { @@ -28,7 +36,7 @@ public Dynamics365DataConnectorDataTypesDynamics365CdsActivities dynamics365CdsA /** * Set the dynamics365CdsActivities property: Common Data Service data type connection. - * + * * @param dynamics365CdsActivities the dynamics365CdsActivities value to set. * @return the Dynamics365DataConnectorDataTypes object itself. */ @@ -40,16 +48,14 @@ public Dynamics365DataConnectorDataTypes withDynamics365CdsActivities( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (dynamics365CdsActivities() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dynamics365CdsActivities in model" - + " Dynamics365DataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dynamics365CdsActivities in model Dynamics365DataConnectorDataTypes")); } else { dynamics365CdsActivities().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.java index d1ed289fd67c..284dfc9e44b5 100644 --- 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Common Data Service data type connection. */ +/** + * Common Data Service data type connection. + */ @Fluent public final class Dynamics365DataConnectorDataTypesDynamics365CdsActivities extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of Dynamics365DataConnectorDataTypesDynamics365CdsActivities class. + */ + public Dynamics365DataConnectorDataTypesDynamics365CdsActivities() { + } + + /** + * {@inheritDoc} + */ @Override public Dynamics365DataConnectorDataTypesDynamics365CdsActivities withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public Dynamics365DataConnectorDataTypesDynamics365CdsActivities withState(DataT /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 9b7dbc62e5dc..04110e9ae57e 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 @@ -7,18 +7,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The elevation token associated with the process. */ +/** + * The elevation token associated with the process. + */ public enum ElevationToken { - /** Enum value Default. */ + /** + * Enum value Default. + */ DEFAULT("Default"), - /** Enum value Full. */ + /** + * Enum value Full. + */ FULL("Full"), - /** Enum value Limited. */ + /** + * Enum value Limited. + */ LIMITED("Limited"); - /** The actual serialized value for a ElevationToken instance. */ + /** + * The actual serialized value for a ElevationToken instance. + */ private final String value; ElevationToken(String value) { @@ -27,7 +37,7 @@ public enum ElevationToken { /** * Parses a serialized value to a ElevationToken instance. - * + * * @param value the serialized value to parse. * @return the parsed ElevationToken object, or null if unable to parse. */ @@ -45,7 +55,9 @@ public static ElevationToken fromString(String value) { return null; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @JsonValue @Override public String toString() { 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..b5f9e1f34e8d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainBody.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Domain name to be enriched. + */ +@Fluent +public final class EnrichmentDomainBody { + /* + * The domain name + */ + @JsonProperty(value = "domain") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhois.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhois.java index 5b903538b5db..0f2cc1919292 100644 --- 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 @@ -7,53 +7,55 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of EnrichmentDomainWhois. */ +/** + * 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 index d75c0f24e472..61b5a0d2b907 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** An individual contact associated with this domain. */ +/** + * An individual contact associated with this domain. + */ @Fluent public final class EnrichmentDomainWhoisContact { /* @@ -71,9 +73,15 @@ public final class EnrichmentDomainWhoisContact { @JsonProperty(value = "email") private String email; + /** + * Creates an instance of EnrichmentDomainWhoisContact class. + */ + public EnrichmentDomainWhoisContact() { + } + /** * Get the name property: The name of this contact. - * + * * @return the name value. */ public String name() { @@ -82,7 +90,7 @@ public String name() { /** * Set the name property: The name of this contact. - * + * * @param name the name value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -93,7 +101,7 @@ public EnrichmentDomainWhoisContact withName(String name) { /** * Get the org property: The organization for this contact. - * + * * @return the org value. */ public String org() { @@ -102,7 +110,7 @@ public String org() { /** * Set the org property: The organization for this contact. - * + * * @param org the org value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -113,7 +121,7 @@ public EnrichmentDomainWhoisContact withOrg(String org) { /** * Get the street property: A list describing the street address for this contact. - * + * * @return the street value. */ public List street() { @@ -122,7 +130,7 @@ public List street() { /** * Set the street property: A list describing the street address for this contact. - * + * * @param street the street value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -133,7 +141,7 @@ public EnrichmentDomainWhoisContact withStreet(List street) { /** * Get the city property: The city for this contact. - * + * * @return the city value. */ public String city() { @@ -142,7 +150,7 @@ public String city() { /** * Set the city property: The city for this contact. - * + * * @param city the city value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -153,7 +161,7 @@ public EnrichmentDomainWhoisContact withCity(String city) { /** * Get the state property: The state for this contact. - * + * * @return the state value. */ public String state() { @@ -162,7 +170,7 @@ public String state() { /** * Set the state property: The state for this contact. - * + * * @param state the state value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -173,7 +181,7 @@ public EnrichmentDomainWhoisContact withState(String state) { /** * Get the postal property: The postal code for this contact. - * + * * @return the postal value. */ public String postal() { @@ -182,7 +190,7 @@ public String postal() { /** * Set the postal property: The postal code for this contact. - * + * * @param postal the postal value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -193,7 +201,7 @@ public EnrichmentDomainWhoisContact withPostal(String postal) { /** * Get the country property: The country for this contact. - * + * * @return the country value. */ public String country() { @@ -202,7 +210,7 @@ public String country() { /** * Set the country property: The country for this contact. - * + * * @param country the country value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -213,7 +221,7 @@ public EnrichmentDomainWhoisContact withCountry(String country) { /** * Get the phone property: The phone number for this contact. - * + * * @return the phone value. */ public String phone() { @@ -222,7 +230,7 @@ public String phone() { /** * Set the phone property: The phone number for this contact. - * + * * @param phone the phone value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -233,7 +241,7 @@ public EnrichmentDomainWhoisContact withPhone(String phone) { /** * Get the fax property: The fax number for this contact. - * + * * @return the fax value. */ public String fax() { @@ -242,7 +250,7 @@ public String fax() { /** * Set the fax property: The fax number for this contact. - * + * * @param fax the fax value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -253,7 +261,7 @@ public EnrichmentDomainWhoisContact withFax(String fax) { /** * Get the email property: The email address for this contact. - * + * * @return the email value. */ public String email() { @@ -262,7 +270,7 @@ public String email() { /** * Set the email property: The email address for this contact. - * + * * @param email the email value to set. * @return the EnrichmentDomainWhoisContact object itself. */ @@ -273,7 +281,7 @@ public EnrichmentDomainWhoisContact withEmail(String email) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContacts.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContacts.java index 869d7a774b30..3ada9b2cbabc 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The set of contacts associated with this domain. */ +/** + * The set of contacts associated with this domain. + */ @Fluent public final class EnrichmentDomainWhoisContacts { /* @@ -34,9 +36,15 @@ public final class EnrichmentDomainWhoisContacts { @JsonProperty(value = "tech") private EnrichmentDomainWhoisContact tech; + /** + * Creates an instance of EnrichmentDomainWhoisContacts class. + */ + public EnrichmentDomainWhoisContacts() { + } + /** * Get the admin property: The admin contact for this whois record. - * + * * @return the admin value. */ public EnrichmentDomainWhoisContact admin() { @@ -45,7 +53,7 @@ public EnrichmentDomainWhoisContact admin() { /** * Set the admin property: The admin contact for this whois record. - * + * * @param admin the admin value to set. * @return the EnrichmentDomainWhoisContacts object itself. */ @@ -56,7 +64,7 @@ public EnrichmentDomainWhoisContacts withAdmin(EnrichmentDomainWhoisContact admi /** * Get the billing property: The billing contact for this whois record. - * + * * @return the billing value. */ public EnrichmentDomainWhoisContact billing() { @@ -65,7 +73,7 @@ public EnrichmentDomainWhoisContact billing() { /** * Set the billing property: The billing contact for this whois record. - * + * * @param billing the billing value to set. * @return the EnrichmentDomainWhoisContacts object itself. */ @@ -76,7 +84,7 @@ public EnrichmentDomainWhoisContacts withBilling(EnrichmentDomainWhoisContact bi /** * Get the registrant property: The registrant contact for this whois record. - * + * * @return the registrant value. */ public EnrichmentDomainWhoisContact registrant() { @@ -85,7 +93,7 @@ public EnrichmentDomainWhoisContact registrant() { /** * Set the registrant property: The registrant contact for this whois record. - * + * * @param registrant the registrant value to set. * @return the EnrichmentDomainWhoisContacts object itself. */ @@ -96,7 +104,7 @@ public EnrichmentDomainWhoisContacts withRegistrant(EnrichmentDomainWhoisContact /** * Get the tech property: The technical contact for this whois record. - * + * * @return the tech value. */ public EnrichmentDomainWhoisContact tech() { @@ -105,7 +113,7 @@ public EnrichmentDomainWhoisContact tech() { /** * Set the tech property: The technical contact for this whois record. - * + * * @param tech the tech value to set. * @return the EnrichmentDomainWhoisContacts object itself. */ @@ -116,7 +124,7 @@ public EnrichmentDomainWhoisContacts withTech(EnrichmentDomainWhoisContact tech) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisDetails.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisDetails.java index 7a22dff870a6..9f55e29a1f21 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The whois record for a given domain. */ +/** + * The whois record for a given domain. + */ @Fluent public final class EnrichmentDomainWhoisDetails { /* @@ -35,9 +37,15 @@ public final class EnrichmentDomainWhoisDetails { @JsonProperty(value = "statuses") private List statuses; + /** + * Creates an instance of EnrichmentDomainWhoisDetails class. + */ + public EnrichmentDomainWhoisDetails() { + } + /** * Get the registrar property: The registrar associated with this domain. - * + * * @return the registrar value. */ public EnrichmentDomainWhoisRegistrarDetails registrar() { @@ -46,7 +54,7 @@ public EnrichmentDomainWhoisRegistrarDetails registrar() { /** * Set the registrar property: The registrar associated with this domain. - * + * * @param registrar the registrar value to set. * @return the EnrichmentDomainWhoisDetails object itself. */ @@ -57,7 +65,7 @@ public EnrichmentDomainWhoisDetails withRegistrar(EnrichmentDomainWhoisRegistrar /** * Get the contacts property: The set of contacts associated with this domain. - * + * * @return the contacts value. */ public EnrichmentDomainWhoisContacts contacts() { @@ -66,7 +74,7 @@ public EnrichmentDomainWhoisContacts contacts() { /** * Set the contacts property: The set of contacts associated with this domain. - * + * * @param contacts the contacts value to set. * @return the EnrichmentDomainWhoisDetails object itself. */ @@ -77,7 +85,7 @@ public EnrichmentDomainWhoisDetails withContacts(EnrichmentDomainWhoisContacts c /** * Get the nameServers property: A list of name servers associated with this domain. - * + * * @return the nameServers value. */ public List nameServers() { @@ -86,7 +94,7 @@ public List nameServers() { /** * Set the nameServers property: A list of name servers associated with this domain. - * + * * @param nameServers the nameServers value to set. * @return the EnrichmentDomainWhoisDetails object itself. */ @@ -97,7 +105,7 @@ public EnrichmentDomainWhoisDetails withNameServers(List nameServers) { /** * Get the statuses property: The set of status flags for this whois record. - * + * * @return the statuses value. */ public List statuses() { @@ -106,7 +114,7 @@ public List statuses() { /** * Set the statuses property: The set of status flags for this whois record. - * + * * @param statuses the statuses value to set. * @return the EnrichmentDomainWhoisDetails object itself. */ @@ -117,7 +125,7 @@ public EnrichmentDomainWhoisDetails withStatuses(List statuses) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisRegistrarDetails.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisRegistrarDetails.java index 545f2a28b66b..6189ea1a7b54 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The registrar associated with this domain. */ +/** + * The registrar associated with this domain. + */ @Fluent public final class EnrichmentDomainWhoisRegistrarDetails { /* @@ -46,9 +48,15 @@ public final class EnrichmentDomainWhoisRegistrarDetails { @JsonProperty(value = "whoisServer") private String whoisServer; + /** + * Creates an instance of EnrichmentDomainWhoisRegistrarDetails class. + */ + public EnrichmentDomainWhoisRegistrarDetails() { + } + /** * Get the name property: The name of this registrar. - * + * * @return the name value. */ public String name() { @@ -57,7 +65,7 @@ public String name() { /** * Set the name property: The name of this registrar. - * + * * @param name the name value to set. * @return the EnrichmentDomainWhoisRegistrarDetails object itself. */ @@ -68,7 +76,7 @@ public EnrichmentDomainWhoisRegistrarDetails withName(String name) { /** * Get the abuseContactEmail property: This registrar's abuse contact email. - * + * * @return the abuseContactEmail value. */ public String abuseContactEmail() { @@ -77,7 +85,7 @@ public String abuseContactEmail() { /** * Set the abuseContactEmail property: This registrar's abuse contact email. - * + * * @param abuseContactEmail the abuseContactEmail value to set. * @return the EnrichmentDomainWhoisRegistrarDetails object itself. */ @@ -88,7 +96,7 @@ public EnrichmentDomainWhoisRegistrarDetails withAbuseContactEmail(String abuseC /** * Get the abuseContactPhone property: This registrar's abuse contact phone number. - * + * * @return the abuseContactPhone value. */ public String abuseContactPhone() { @@ -97,7 +105,7 @@ public String abuseContactPhone() { /** * Set the abuseContactPhone property: This registrar's abuse contact phone number. - * + * * @param abuseContactPhone the abuseContactPhone value to set. * @return the EnrichmentDomainWhoisRegistrarDetails object itself. */ @@ -108,7 +116,7 @@ public EnrichmentDomainWhoisRegistrarDetails withAbuseContactPhone(String abuseC /** * Get the ianaId property: This registrar's Internet Assigned Numbers Authority id. - * + * * @return the ianaId value. */ public String ianaId() { @@ -117,7 +125,7 @@ public String ianaId() { /** * Set the ianaId property: This registrar's Internet Assigned Numbers Authority id. - * + * * @param ianaId the ianaId value to set. * @return the EnrichmentDomainWhoisRegistrarDetails object itself. */ @@ -128,7 +136,7 @@ public EnrichmentDomainWhoisRegistrarDetails withIanaId(String ianaId) { /** * Get the url property: This registrar's URL. - * + * * @return the url value. */ public String url() { @@ -137,7 +145,7 @@ public String url() { /** * Set the url property: This registrar's URL. - * + * * @param url the url value to set. * @return the EnrichmentDomainWhoisRegistrarDetails object itself. */ @@ -148,7 +156,7 @@ public EnrichmentDomainWhoisRegistrarDetails withUrl(String url) { /** * Get the whoisServer property: The hostname of this registrar's whois server. - * + * * @return the whoisServer value. */ public String whoisServer() { @@ -157,7 +165,7 @@ public String whoisServer() { /** * Set the whoisServer property: The hostname of this registrar's whois server. - * + * * @param whoisServer the whoisServer value to set. * @return the EnrichmentDomainWhoisRegistrarDetails object itself. */ @@ -168,7 +176,7 @@ public EnrichmentDomainWhoisRegistrarDetails withWhoisServer(String whoisServer) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpAddressBody.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpAddressBody.java new file mode 100644 index 000000000000..de45a1f7671e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpAddressBody.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address (v4 or v6) to be enriched. + */ +@Fluent +public final class EnrichmentIpAddressBody { + /* + * The dotted-decimal or colon-separated string representation of the IP address + */ + @JsonProperty(value = "ipAddress") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpGeodata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpGeodata.java index d8b2e8ec5925..47571be08f16 100644 --- 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 @@ -6,133 +6,135 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; -/** An immutable client-side representation of EnrichmentIpGeodata. */ +/** + * An immutable client-side representation of EnrichmentIpGeodata. + */ public interface EnrichmentIpGeodata { /** * Gets the asn property: The autonomous system number associated with this IP address. - * + * * @return the asn value. */ String asn(); /** * Gets the carrier property: The name of the carrier for this IP address. - * + * * @return the carrier value. */ String carrier(); /** * Gets the city property: The city this IP address is located in. - * + * * @return the city value. */ String city(); /** - * Gets the cityCf property: A numeric rating of confidence that the value in the 'city' field is correct, on a - * scale of 0-100. - * - * @return the cityCf value. + * 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 cityCf(); + 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 countryCf property: A numeric rating of confidence that the value in the 'country' field is correct on a - * scale of 0-100. - * - * @return the countryCf value. + * 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 countryCf(); + 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 stateCf property: A numeric rating of confidence that the value in the 'state' field is correct on a - * scale of 0-100. - * - * @return the stateCf value. + * 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 stateCf(); + 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..91ccb9b0b48b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for EnrichmentType. + */ +public final class EnrichmentType extends ExpandableStringEnum { + /** + * Static value main for EnrichmentType. + */ + 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. + */ + @JsonCreator + 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 index 182172f2a926..238d7594e5b4 100644 --- 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 @@ -8,11 +8,41 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Entities. */ +/** + * Resource collection API of Entities. + */ public interface Entities { + /** + * 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 identifier. + * @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 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. + */ + void runPlaybook(String resourceGroupName, String workspaceName, String entityIdentifier); + /** * 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. @@ -24,7 +54,7 @@ public interface Entities { /** * Gets all entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -37,129 +67,121 @@ 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. + * @return an entity along with {@link Response}. */ - Entity get(String resourceGroupName, String workspaceName, String entityId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an entity. */ - Response getWithResponse(String resourceGroupName, String workspaceName, String entityId, Context context); + Entity get(String resourceGroupName, String workspaceName, String entityId); /** * 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. + * @return the entity expansion result operation response along with {@link Response}. */ - EntityExpandResponse expand( - String resourceGroupName, String workspaceName, String entityId, EntityExpandParameters parameters); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the entity expansion result operation response. */ - Response expandWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityExpandParameters parameters, - Context context); + 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return insights and Activities for an entity along with {@link Response}. */ - GetQueriesResponse queries( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind); + Response queriesWithResponse(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind, Context context); /** * Get Insights and Activities for an entity. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityId entity ID. * @param kind The Kind parameter for queries. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Response}. + * @return insights and Activities for an entity. */ - Response queriesWithResponse( - String resourceGroupName, String workspaceName, String entityId, EntityItemQueryKind kind, Context context); + GetQueriesResponse queries(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind); /** * 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. + * @return the Get Insights result operation response along with {@link Response}. */ - EntityGetInsightsResponse getInsights( - String resourceGroupName, String workspaceName, String entityId, EntityGetInsightsParameters parameters); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the Get Insights result operation response. */ - Response getInsightsWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityGetInsightsParameters parameters, - Context context); + 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 index 29a184b1bde3..50b0ceb759d0 100644 --- 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 @@ -7,40 +7,38 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of EntitiesGetTimelines. */ +/** + * 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. + * @return the entity timeline result operation response along with {@link Response}. */ - EntityTimelineResponse list( - String resourceGroupName, String workspaceName, String entityId, EntityTimelineParameters parameters); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the entity timeline result operation response. */ - Response listWithResponse( - String resourceGroupName, - String workspaceName, - String entityId, - EntityTimelineParameters parameters, - Context context); + 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 index aa1daf59c56e..2a79559f39e5 100644 --- 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 @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of EntitiesRelations. */ +/** + * 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. @@ -24,7 +26,7 @@ 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. @@ -32,21 +34,14 @@ public interface EntitiesRelations { * @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. + * 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); + 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 664d22e8eae5..52e84e34e823 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 @@ -7,39 +7,48 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; -/** An immutable client-side representation of Entity. */ +/** + * An immutable client-side representation of Entity. + */ public interface Entity { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); + /** + * Gets the kind property: The kind of the entity. + * + * @return the kind value. + */ + EntityKindEnum 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.EntityInner object. - * + * * @return the inner object. */ EntityInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityAnalytics.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityAnalytics.java index 7ebdadd6fc3c..3a07eea8c484 100644 --- 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 @@ -8,31 +8,59 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityAnalyticsProperties; import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** Settings with single toggle. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Settings with single toggle. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = EntityAnalytics.class, visible = true) @JsonTypeName("EntityAnalytics") @Fluent public final class EntityAnalytics extends SettingsInner { + /* + * The kind of the setting + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private SettingKind kind = SettingKind.ENTITY_ANALYTICS; + /* * EntityAnalytics properties */ @JsonProperty(value = "properties") private EntityAnalyticsProperties innerProperties; + /** + * Creates an instance of EntityAnalytics class. + */ + public EntityAnalytics() { + } + + /** + * Get the kind property: The kind of the setting. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EntityAnalytics withEtag(String etag) { super.withEtag(etag); @@ -41,7 +69,7 @@ public EntityAnalytics withEtag(String etag) { /** * Get the entityProviders property: The relevant entity providers that are synced. - * + * * @return the entityProviders value. */ public List entityProviders() { @@ -50,7 +78,7 @@ public List entityProviders() { /** * Set the entityProviders property: The relevant entity providers that are synced. - * + * * @param entityProviders the entityProviders value to set. * @return the EntityAnalytics object itself. */ @@ -64,7 +92,7 @@ public EntityAnalytics withEntityProviders(List entityProviders /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 49d3c8f895a1..85fd6d782992 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Entity common property bag. */ +/** + * Entity common property bag. + */ @Immutable public class EntityCommonProperties { /* @@ -20,16 +22,21 @@ public class EntityCommonProperties { private Map additionalData; /* - * The graph item display name which is a short humanly readable description of the graph item instance. This - * property is optional and might be system generated. + * The graph item display name which is a short humanly readable description of the graph item instance. This property is optional and might be system generated. */ @JsonProperty(value = "friendlyName", access = JsonProperty.Access.WRITE_ONLY) private String friendlyName; + /** + * Creates an instance of EntityCommonProperties class. + */ + public EntityCommonProperties() { + } + /** * 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() { @@ -39,7 +46,7 @@ public Map 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() { @@ -48,7 +55,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityEdges.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityEdges.java index e925912285eb..9b5aa46b6d83 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The edge that connects the entity to the other entity. */ +/** + * The edge that connects the entity to the other entity. + */ @Fluent public final class EntityEdges { /* @@ -25,9 +27,15 @@ public final class EntityEdges { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map additionalData; + /** + * Creates an instance of EntityEdges class. + */ + public EntityEdges() { + } + /** * Get the targetEntityId property: The target entity Id. - * + * * @return the targetEntityId value. */ public String targetEntityId() { @@ -36,7 +44,7 @@ public String targetEntityId() { /** * Set the targetEntityId property: The target entity Id. - * + * * @param targetEntityId the targetEntityId value to set. * @return the EntityEdges object itself. */ @@ -48,7 +56,7 @@ public EntityEdges withTargetEntityId(String 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() { @@ -58,7 +66,7 @@ public Map additionalData() { /** * Set the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @param additionalData the additionalData value to set. * @return the EntityEdges object itself. */ @@ -69,7 +77,7 @@ public EntityEdges withAdditionalData(Map additionalData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandParameters.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandParameters.java index 8d0d6ec6ebdc..ae80ed42c5a1 100644 --- 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 @@ -9,7 +9,9 @@ import java.time.OffsetDateTime; import java.util.UUID; -/** The parameters required to execute an expand operation on the given entity. */ +/** + * The parameters required to execute an expand operation on the given entity. + */ @Fluent public final class EntityExpandParameters { /* @@ -30,9 +32,15 @@ public final class EntityExpandParameters { @JsonProperty(value = "startTime") 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() { @@ -41,7 +49,7 @@ public OffsetDateTime 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. */ @@ -52,7 +60,7 @@ public EntityExpandParameters withEndTime(OffsetDateTime endTime) { /** * Get the expansionId property: The Id of the expansion to perform. - * + * * @return the expansionId value. */ public UUID expansionId() { @@ -61,7 +69,7 @@ public UUID expansionId() { /** * Set the expansionId property: The Id of the expansion to perform. - * + * * @param expansionId the expansionId value to set. * @return the EntityExpandParameters object itself. */ @@ -72,7 +80,7 @@ public EntityExpandParameters withExpansionId(UUID expansionId) { /** * 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() { @@ -81,7 +89,7 @@ public OffsetDateTime 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. */ @@ -92,7 +100,7 @@ public EntityExpandParameters withStartTime(OffsetDateTime startTime) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponse.java index fb8e3981d534..4d0e179b191e 100644 --- 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 @@ -6,25 +6,27 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner; -/** An immutable client-side representation of EntityExpandResponse. */ +/** + * 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 index f8558de18c34..5e42f429c4d9 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The expansion result values. */ +/** + * The expansion result values. + */ @Fluent public final class EntityExpandResponseValue { /* @@ -24,9 +26,15 @@ public final class EntityExpandResponseValue { @JsonProperty(value = "edges") private List edges; + /** + * Creates an instance of EntityExpandResponseValue class. + */ + public EntityExpandResponseValue() { + } + /** * Get the entities property: Array of the expansion result entities. - * + * * @return the entities value. */ public List entities() { @@ -35,7 +43,7 @@ public List entities() { /** * Set the entities property: Array of the expansion result entities. - * + * * @param entities the entities value to set. * @return the EntityExpandResponseValue object itself. */ @@ -46,7 +54,7 @@ public EntityExpandResponseValue withEntities(List entities) { /** * Get the edges property: Array of edges that connects the entity to the list of entities. - * + * * @return the edges value. */ public List edges() { @@ -55,7 +63,7 @@ public List edges() { /** * Set the edges property: Array of edges that connects the entity to the list of entities. - * + * * @param edges the edges value to set. * @return the EntityExpandResponseValue object itself. */ @@ -66,7 +74,7 @@ public EntityExpandResponseValue withEdges(List edges) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityFieldMapping.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityFieldMapping.java index 0d2682840793..7dda9304f23c 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Map identifiers of a single entity. */ +/** + * Map identifiers of a single entity. + */ @Fluent public final class EntityFieldMapping { /* @@ -22,9 +24,15 @@ public final class EntityFieldMapping { @JsonProperty(value = "value") 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() { @@ -33,7 +41,7 @@ public String identifier() { /** * Set the identifier property: Alert V3 identifier. - * + * * @param identifier the identifier value to set. * @return the EntityFieldMapping object itself. */ @@ -44,7 +52,7 @@ public EntityFieldMapping withIdentifier(String identifier) { /** * Get the value property: The value of the identifier. - * + * * @return the value value. */ public String value() { @@ -53,7 +61,7 @@ public String value() { /** * Set the value property: The value of the identifier. - * + * * @param value the value value to set. * @return the EntityFieldMapping object itself. */ @@ -64,7 +72,7 @@ public EntityFieldMapping withValue(String value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsParameters.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsParameters.java index 04a3e0d4c530..4ac677bf19c4 100644 --- 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 @@ -11,7 +11,9 @@ import java.util.List; import java.util.UUID; -/** The parameters required to execute insights operation on the given entity. */ +/** + * The parameters required to execute insights operation on the given entity. + */ @Fluent public final class EntityGetInsightsParameters { /* @@ -38,9 +40,15 @@ public final class EntityGetInsightsParameters { @JsonProperty(value = "insightQueryIds") 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() { @@ -49,7 +57,7 @@ public OffsetDateTime 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. */ @@ -60,7 +68,7 @@ public EntityGetInsightsParameters withStartTime(OffsetDateTime startTime) { /** * Get the endTime property: The end timeline date, so the results returned are before this date. - * + * * @return the endTime value. */ public OffsetDateTime endTime() { @@ -69,7 +77,7 @@ public OffsetDateTime 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. */ @@ -81,7 +89,7 @@ public EntityGetInsightsParameters withEndTime(OffsetDateTime endTime) { /** * 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() { @@ -91,7 +99,7 @@ public Boolean 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. */ @@ -103,7 +111,7 @@ public EntityGetInsightsParameters withAddDefaultExtendedTimeRange(Boolean addDe /** * 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() { @@ -113,7 +121,7 @@ public List 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. */ @@ -124,21 +132,19 @@ public EntityGetInsightsParameters withInsightQueryIds(List insightQueryId /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (startTime() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startTime in model EntityGetInsightsParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property startTime in model EntityGetInsightsParameters")); } if (endTime() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endTime in model EntityGetInsightsParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property endTime in model EntityGetInsightsParameters")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsResponse.java index dbb22861ff01..c5ff4552d4c9 100644 --- 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 @@ -7,25 +7,27 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner; import java.util.List; -/** An immutable client-side representation of EntityGetInsightsResponse. */ +/** + * 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 index 15d19b7473a9..2215028f52eb 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Entity insight Item. */ +/** + * Entity insight Item. + */ @Fluent public final class EntityInsightItem { /* @@ -35,9 +37,15 @@ public final class EntityInsightItem { @JsonProperty(value = "chartQueryResults") private List chartQueryResults; + /** + * Creates an instance of EntityInsightItem class. + */ + public EntityInsightItem() { + } + /** * Get the queryId property: The query id of the insight. - * + * * @return the queryId value. */ public String queryId() { @@ -46,7 +54,7 @@ public String queryId() { /** * Set the queryId property: The query id of the insight. - * + * * @param queryId the queryId value to set. * @return the EntityInsightItem object itself. */ @@ -57,7 +65,7 @@ public EntityInsightItem withQueryId(String queryId) { /** * Get the queryTimeInterval property: The Time interval that the query actually executed on. - * + * * @return the queryTimeInterval value. */ public EntityInsightItemQueryTimeInterval queryTimeInterval() { @@ -66,7 +74,7 @@ public EntityInsightItemQueryTimeInterval queryTimeInterval() { /** * Set the queryTimeInterval property: The Time interval that the query actually executed on. - * + * * @param queryTimeInterval the queryTimeInterval value to set. * @return the EntityInsightItem object itself. */ @@ -77,7 +85,7 @@ public EntityInsightItem withQueryTimeInterval(EntityInsightItemQueryTimeInterva /** * Get the tableQueryResults property: Query results for table insights query. - * + * * @return the tableQueryResults value. */ public InsightsTableResult tableQueryResults() { @@ -86,7 +94,7 @@ public InsightsTableResult tableQueryResults() { /** * Set the tableQueryResults property: Query results for table insights query. - * + * * @param tableQueryResults the tableQueryResults value to set. * @return the EntityInsightItem object itself. */ @@ -97,7 +105,7 @@ public EntityInsightItem withTableQueryResults(InsightsTableResult tableQueryRes /** * Get the chartQueryResults property: Query results for table insights query. - * + * * @return the chartQueryResults value. */ public List chartQueryResults() { @@ -106,7 +114,7 @@ public List chartQueryResults() { /** * Set the chartQueryResults property: Query results for table insights query. - * + * * @param chartQueryResults the chartQueryResults value to set. * @return the EntityInsightItem object itself. */ @@ -117,7 +125,7 @@ public EntityInsightItem withChartQueryResults(List chartQu /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItemQueryTimeInterval.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItemQueryTimeInterval.java index e04c157d5dc6..9b571d736dad 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** The Time interval that the query actually executed on. */ +/** + * The Time interval that the query actually executed on. + */ @Fluent public final class EntityInsightItemQueryTimeInterval { /* @@ -23,9 +25,15 @@ public final class EntityInsightItemQueryTimeInterval { @JsonProperty(value = "endTime") private OffsetDateTime endTime; + /** + * Creates an instance of EntityInsightItemQueryTimeInterval class. + */ + public EntityInsightItemQueryTimeInterval() { + } + /** * Get the startTime property: Insight query start time. - * + * * @return the startTime value. */ public OffsetDateTime startTime() { @@ -34,7 +42,7 @@ public OffsetDateTime startTime() { /** * Set the startTime property: Insight query start time. - * + * * @param startTime the startTime value to set. * @return the EntityInsightItemQueryTimeInterval object itself. */ @@ -45,7 +53,7 @@ public EntityInsightItemQueryTimeInterval withStartTime(OffsetDateTime startTime /** * Get the endTime property: Insight query end time. - * + * * @return the endTime value. */ public OffsetDateTime endTime() { @@ -54,7 +62,7 @@ public OffsetDateTime endTime() { /** * Set the endTime property: Insight query end time. - * + * * @param endTime the endTime value to set. * @return the EntityInsightItemQueryTimeInterval object itself. */ @@ -65,7 +73,7 @@ public EntityInsightItemQueryTimeInterval withEndTime(OffsetDateTime endTime) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityItemQueryKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityItemQueryKind.java index 3759170c00e3..f4c060b01921 100644 --- 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 @@ -8,14 +8,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for EntityItemQueryKind. */ +/** + * Defines values for EntityItemQueryKind. + */ public final class EntityItemQueryKind extends ExpandableStringEnum { - /** Static value Insight for EntityItemQueryKind. */ + /** + * Static value Insight for EntityItemQueryKind. + */ 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. */ @@ -26,7 +39,7 @@ public static EntityItemQueryKind fromString(String name) { /** * Gets known EntityItemQueryKind values. - * + * * @return known EntityItemQueryKind values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKind.java deleted file mode 100644 index 5968f17a56cd..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKind.java +++ /dev/null @@ -1,98 +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 com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The kind of the entity. */ -public final class EntityKind extends ExpandableStringEnum { - /** Static value Account for EntityKind. */ - public static final EntityKind ACCOUNT = fromString("Account"); - - /** Static value Host for EntityKind. */ - public static final EntityKind HOST = fromString("Host"); - - /** Static value File for EntityKind. */ - public static final EntityKind FILE = fromString("File"); - - /** Static value AzureResource for EntityKind. */ - public static final EntityKind AZURE_RESOURCE = fromString("AzureResource"); - - /** Static value CloudApplication for EntityKind. */ - public static final EntityKind CLOUD_APPLICATION = fromString("CloudApplication"); - - /** Static value DnsResolution for EntityKind. */ - public static final EntityKind DNS_RESOLUTION = fromString("DnsResolution"); - - /** Static value FileHash for EntityKind. */ - public static final EntityKind FILE_HASH = fromString("FileHash"); - - /** Static value Ip for EntityKind. */ - public static final EntityKind IP = fromString("Ip"); - - /** Static value Malware for EntityKind. */ - public static final EntityKind MALWARE = fromString("Malware"); - - /** Static value Process for EntityKind. */ - public static final EntityKind PROCESS = fromString("Process"); - - /** Static value RegistryKey for EntityKind. */ - public static final EntityKind REGISTRY_KEY = fromString("RegistryKey"); - - /** Static value RegistryValue for EntityKind. */ - public static final EntityKind REGISTRY_VALUE = fromString("RegistryValue"); - - /** Static value SecurityGroup for EntityKind. */ - public static final EntityKind SECURITY_GROUP = fromString("SecurityGroup"); - - /** Static value Url for EntityKind. */ - public static final EntityKind URL = fromString("Url"); - - /** Static value IoTDevice for EntityKind. */ - public static final EntityKind IO_TDEVICE = fromString("IoTDevice"); - - /** Static value SecurityAlert for EntityKind. */ - public static final EntityKind SECURITY_ALERT = fromString("SecurityAlert"); - - /** Static value Bookmark for EntityKind. */ - public static final EntityKind BOOKMARK = fromString("Bookmark"); - - /** Static value MailCluster for EntityKind. */ - public static final EntityKind MAIL_CLUSTER = fromString("MailCluster"); - - /** Static value MailMessage for EntityKind. */ - public static final EntityKind MAIL_MESSAGE = fromString("MailMessage"); - - /** Static value Mailbox for EntityKind. */ - public static final EntityKind MAILBOX = fromString("Mailbox"); - - /** Static value SubmissionMail for EntityKind. */ - public static final EntityKind SUBMISSION_MAIL = fromString("SubmissionMail"); - - /** Static value Nic for EntityKind. */ - public static final EntityKind NIC = fromString("Nic"); - - /** - * Creates or finds a EntityKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding EntityKind. - */ - @JsonCreator - public static EntityKind fromString(String name) { - return fromString(name, EntityKind.class); - } - - /** - * Gets known EntityKind values. - * - * @return known EntityKind values. - */ - public static Collection values() { - return values(EntityKind.class); - } -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKindEnum.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKindEnum.java new file mode 100644 index 000000000000..c3b3dafd3169 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKindEnum.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The kind of the entity. + */ +public final class EntityKindEnum extends ExpandableStringEnum { + /** + * Static value Account for EntityKindEnum. + */ + public static final EntityKindEnum ACCOUNT = fromString("Account"); + + /** + * Static value Host for EntityKindEnum. + */ + public static final EntityKindEnum HOST = fromString("Host"); + + /** + * Static value File for EntityKindEnum. + */ + public static final EntityKindEnum FILE = fromString("File"); + + /** + * Static value AzureResource for EntityKindEnum. + */ + public static final EntityKindEnum AZURE_RESOURCE = fromString("AzureResource"); + + /** + * Static value CloudApplication for EntityKindEnum. + */ + public static final EntityKindEnum CLOUD_APPLICATION = fromString("CloudApplication"); + + /** + * Static value DnsResolution for EntityKindEnum. + */ + public static final EntityKindEnum DNS_RESOLUTION = fromString("DnsResolution"); + + /** + * Static value FileHash for EntityKindEnum. + */ + public static final EntityKindEnum FILE_HASH = fromString("FileHash"); + + /** + * Static value Ip for EntityKindEnum. + */ + public static final EntityKindEnum IP = fromString("Ip"); + + /** + * Static value Malware for EntityKindEnum. + */ + public static final EntityKindEnum MALWARE = fromString("Malware"); + + /** + * Static value Process for EntityKindEnum. + */ + public static final EntityKindEnum PROCESS = fromString("Process"); + + /** + * Static value RegistryKey for EntityKindEnum. + */ + public static final EntityKindEnum REGISTRY_KEY = fromString("RegistryKey"); + + /** + * Static value RegistryValue for EntityKindEnum. + */ + public static final EntityKindEnum REGISTRY_VALUE = fromString("RegistryValue"); + + /** + * Static value SecurityGroup for EntityKindEnum. + */ + public static final EntityKindEnum SECURITY_GROUP = fromString("SecurityGroup"); + + /** + * Static value Url for EntityKindEnum. + */ + public static final EntityKindEnum URL = fromString("Url"); + + /** + * Static value IoTDevice for EntityKindEnum. + */ + public static final EntityKindEnum IO_TDEVICE = fromString("IoTDevice"); + + /** + * Static value SecurityAlert for EntityKindEnum. + */ + public static final EntityKindEnum SECURITY_ALERT = fromString("SecurityAlert"); + + /** + * Static value Bookmark for EntityKindEnum. + */ + public static final EntityKindEnum BOOKMARK = fromString("Bookmark"); + + /** + * Static value MailCluster for EntityKindEnum. + */ + public static final EntityKindEnum MAIL_CLUSTER = fromString("MailCluster"); + + /** + * Static value MailMessage for EntityKindEnum. + */ + public static final EntityKindEnum MAIL_MESSAGE = fromString("MailMessage"); + + /** + * Static value Mailbox for EntityKindEnum. + */ + public static final EntityKindEnum MAILBOX = fromString("Mailbox"); + + /** + * Static value SubmissionMail for EntityKindEnum. + */ + public static final EntityKindEnum SUBMISSION_MAIL = fromString("SubmissionMail"); + + /** + * Static value Nic for EntityKindEnum. + */ + public static final EntityKindEnum NIC = fromString("Nic"); + + /** + * Creates a new instance of EntityKindEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EntityKindEnum() { + } + + /** + * Creates or finds a EntityKindEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityKindEnum. + */ + @JsonCreator + public static EntityKindEnum fromString(String name) { + return fromString(name, EntityKindEnum.class); + } + + /** + * Gets known EntityKindEnum values. + * + * @return known EntityKindEnum values. + */ + public static Collection values() { + return values(EntityKindEnum.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityList.java index 0e160998fea5..2d68dd9c6889 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the entities. */ +/** + * List of all the entities. + */ @Fluent public final class EntityList { /* @@ -25,9 +27,15 @@ public final class EntityList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of EntityList class. + */ + public EntityList() { + } + /** * Get the nextLink property: URL to fetch the next set of entities. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of entities. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of entities. - * + * * @param value the value value to set. * @return the EntityList object itself. */ @@ -56,14 +64,13 @@ public EntityList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model EntityList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EntityList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityManualTriggerRequestBody.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityManualTriggerRequestBody.java new file mode 100644 index 000000000000..ff67153fe169 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityManualTriggerRequestBody.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** + * Describes the request body for triggering a playbook on an entity. + */ +@Fluent +public final class EntityManualTriggerRequestBody { + /* + * Incident ARM id. + */ + @JsonProperty(value = "incidentArmId") + private String incidentArmId; + + /* + * The tenant id of the playbook resource. + */ + @JsonProperty(value = "tenantId") + private UUID tenantId; + + /* + * The resource id of the playbook resource. + */ + @JsonProperty(value = "logicAppsResourceId", required = true) + 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 UUID 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(UUID 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logicAppsResourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property logicAppsResourceId in model EntityManualTriggerRequestBody")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EntityManualTriggerRequestBody.class); +} 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 b5081a9937a3..bd78653226dc 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Single entity mapping for the alert rule. */ +/** + * Single entity mapping for the alert rule. + */ @Fluent public final class EntityMapping { /* @@ -23,9 +25,15 @@ public final class EntityMapping { @JsonProperty(value = "fieldMappings") private List fieldMappings; + /** + * Creates an instance of EntityMapping class. + */ + public EntityMapping() { + } + /** * Get the entityType property: The V3 type of the mapped entity. - * + * * @return the entityType value. */ public EntityMappingType entityType() { @@ -34,7 +42,7 @@ public EntityMappingType entityType() { /** * Set the entityType property: The V3 type of the mapped entity. - * + * * @param entityType the entityType value to set. * @return the EntityMapping object itself. */ @@ -45,7 +53,7 @@ public EntityMapping withEntityType(EntityMappingType entityType) { /** * Get the fieldMappings property: array of field mappings for the given entity mapping. - * + * * @return the fieldMappings value. */ public List fieldMappings() { @@ -54,7 +62,7 @@ public List fieldMappings() { /** * Set the fieldMappings property: array of field mappings for the given entity mapping. - * + * * @param fieldMappings the fieldMappings value to set. * @return the EntityMapping object itself. */ @@ -65,7 +73,7 @@ public EntityMapping withFieldMappings(List fieldMappings) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMappingType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMappingType.java index 5d33cc2b87a4..ff8b4227d70b 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 @@ -8,65 +8,112 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The V3 type of the mapped entity. */ +/** + * The V3 type of the mapped entity. + */ public final class EntityMappingType extends ExpandableStringEnum { - /** Static value Account for EntityMappingType. */ + /** + * Static value Account for EntityMappingType. + */ public static final EntityMappingType ACCOUNT = fromString("Account"); - /** Static value Host for EntityMappingType. */ + /** + * Static value Host for EntityMappingType. + */ public static final EntityMappingType HOST = fromString("Host"); - /** Static value IP for EntityMappingType. */ + /** + * Static value IP for EntityMappingType. + */ public static final EntityMappingType IP = fromString("IP"); - /** Static value Malware for EntityMappingType. */ + /** + * Static value Malware for EntityMappingType. + */ public static final EntityMappingType MALWARE = fromString("Malware"); - /** Static value File for EntityMappingType. */ + /** + * Static value File for EntityMappingType. + */ public static final EntityMappingType FILE = fromString("File"); - /** Static value Process for EntityMappingType. */ + /** + * Static value Process for EntityMappingType. + */ public static final EntityMappingType PROCESS = fromString("Process"); - /** Static value CloudApplication for EntityMappingType. */ + /** + * Static value CloudApplication for EntityMappingType. + */ public static final EntityMappingType CLOUD_APPLICATION = fromString("CloudApplication"); - /** Static value DNS for EntityMappingType. */ + /** + * Static value DNS for EntityMappingType. + */ public static final EntityMappingType DNS = fromString("DNS"); - /** Static value AzureResource for EntityMappingType. */ + /** + * Static value AzureResource for EntityMappingType. + */ public static final EntityMappingType AZURE_RESOURCE = fromString("AzureResource"); - /** Static value FileHash for EntityMappingType. */ + /** + * Static value FileHash for EntityMappingType. + */ public static final EntityMappingType FILE_HASH = fromString("FileHash"); - /** Static value RegistryKey for EntityMappingType. */ + /** + * Static value RegistryKey for EntityMappingType. + */ public static final EntityMappingType REGISTRY_KEY = fromString("RegistryKey"); - /** Static value RegistryValue for EntityMappingType. */ + /** + * Static value RegistryValue for EntityMappingType. + */ public static final EntityMappingType REGISTRY_VALUE = fromString("RegistryValue"); - /** Static value SecurityGroup for EntityMappingType. */ + /** + * Static value SecurityGroup for EntityMappingType. + */ public static final EntityMappingType SECURITY_GROUP = fromString("SecurityGroup"); - /** Static value URL for EntityMappingType. */ + /** + * Static value URL for EntityMappingType. + */ public static final EntityMappingType URL = fromString("URL"); - /** Static value Mailbox for EntityMappingType. */ + /** + * Static value Mailbox for EntityMappingType. + */ public static final EntityMappingType MAILBOX = fromString("Mailbox"); - /** Static value MailCluster for EntityMappingType. */ + /** + * Static value MailCluster for EntityMappingType. + */ public static final EntityMappingType MAIL_CLUSTER = fromString("MailCluster"); - /** Static value MailMessage for EntityMappingType. */ + /** + * Static value MailMessage for EntityMappingType. + */ public static final EntityMappingType MAIL_MESSAGE = fromString("MailMessage"); - /** Static value SubmissionMail for EntityMappingType. */ + /** + * Static value SubmissionMail for EntityMappingType. + */ public static final EntityMappingType SUBMISSION_MAIL = fromString("SubmissionMail"); + /** + * Creates a new instance of EntityMappingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EntityMappingType() { + } + /** * Creates or finds a EntityMappingType from its string representation. - * + * * @param name a name to look for. * @return the corresponding EntityMappingType. */ @@ -77,7 +124,7 @@ public static EntityMappingType fromString(String name) { /** * Gets known EntityMappingType values. - * + * * @return known EntityMappingType values. */ public static Collection values() { 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 index 3769c8ff2143..5a3fcd99687e 100644 --- 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The entity provider that is synced. */ +/** + * The entity provider that is synced. + */ public final class EntityProviders extends ExpandableStringEnum { - /** Static value ActiveDirectory for EntityProviders. */ + /** + * Static value ActiveDirectory for EntityProviders. + */ public static final EntityProviders ACTIVE_DIRECTORY = fromString("ActiveDirectory"); - /** Static value AzureActiveDirectory for EntityProviders. */ + /** + * Static value AzureActiveDirectory for EntityProviders. + */ 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. */ @@ -29,7 +44,7 @@ public static EntityProviders fromString(String name) { /** * Gets known EntityProviders values. - * + * * @return known EntityProviders values. */ public static Collection values() { 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 index d0f22a8e74b0..c8af82ebad14 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of EntityQueries. */ +/** + * Resource collection API of EntityQueries. + */ public interface EntityQueries { /** * Gets all entity queries. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface EntityQueries { /** * Gets all entity queries. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity query kind we want to fetch. @@ -34,96 +36,92 @@ public interface EntityQueries { * @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, EntityQueriesKind kind, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, EntityQueriesKind kind, + Context context); /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryId entity query ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an entity query along with {@link Response}. */ - EntityQuery get(String resourceGroupName, String workspaceName, String entityQueryId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an entity query. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String entityQueryId, Context context); + 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. + * @return specific entity query along with {@link Response}. */ - EntityQuery createOrUpdate( - String resourceGroupName, String workspaceName, String entityQueryId, CustomEntityQuery entityQuery); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return specific entity query. */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String entityQueryId, - CustomEntityQuery entityQuery, - Context context); + 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}. */ - void delete(String resourceGroupName, String workspaceName, String entityQueryId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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); + void delete(String resourceGroupName, String workspaceName, String entityQueryId); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueriesKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueriesKind.java index 9af86d0f151c..74db56b25ea3 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueriesKind.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueriesKind.java @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for EntityQueriesKind. */ +/** + * Defines values for EntityQueriesKind. + */ public final class EntityQueriesKind extends ExpandableStringEnum { - /** Static value Expansion for EntityQueriesKind. */ + /** + * Static value Expansion for EntityQueriesKind. + */ public static final EntityQueriesKind EXPANSION = fromString("Expansion"); - /** Static value Activity for EntityQueriesKind. */ + /** + * Static value Activity for EntityQueriesKind. + */ public static final EntityQueriesKind ACTIVITY = fromString("Activity"); + /** + * Creates a new instance of EntityQueriesKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EntityQueriesKind() { + } + /** * Creates or finds a EntityQueriesKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding EntityQueriesKind. */ @@ -29,7 +44,7 @@ public static EntityQueriesKind fromString(String name) { /** * Gets known EntityQueriesKind values. - * + * * @return known EntityQueriesKind values. */ public static Collection values() { 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 index 3b7459c1f213..ab477e271b05 100644 --- 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 @@ -7,46 +7,55 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; -/** An immutable client-side representation of EntityQuery. */ +/** + * An immutable client-side representation of EntityQuery. + */ public interface EntityQuery { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the kind property: the entity query kind. + * + * @return the kind value. + */ + EntityQueryKind kind(); + /** * 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 index edd51be3360f..e95fe05d6fdd 100644 --- 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 @@ -7,19 +7,25 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** An abstract Query item for entity. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = EntityQueryItem.class) +/** + * An abstract Query item for entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = EntityQueryItem.class, visible = true) @JsonTypeName("EntityQueryItem") -@JsonSubTypes({@JsonSubTypes.Type(name = "Insight", value = InsightQueryItem.class)}) +@JsonSubTypes({ @JsonSubTypes.Type(name = "Insight", value = InsightQueryItem.class) }) @Fluent public class EntityQueryItem { + /* + * The kind of the entity query + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityQueryKind kind; + /* * Query Template ARM ID */ @@ -38,9 +44,25 @@ public class EntityQueryItem { @JsonProperty(value = "type") private String type; + /** + * Creates an instance of EntityQueryItem class. + */ + public EntityQueryItem() { + this.kind = EntityQueryKind.fromString("EntityQueryItem"); + } + + /** + * 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() { @@ -49,7 +71,7 @@ public String id() { /** * Get the name property: Query Template ARM Name. - * + * * @return the name value. */ public String name() { @@ -58,7 +80,7 @@ public String name() { /** * Set the name property: Query Template ARM Name. - * + * * @param name the name value to set. * @return the EntityQueryItem object itself. */ @@ -69,7 +91,7 @@ public EntityQueryItem withName(String name) { /** * Get the type property: ARM Type. - * + * * @return the type value. */ public String type() { @@ -78,7 +100,7 @@ public String type() { /** * Set the type property: ARM Type. - * + * * @param type the type value to set. * @return the EntityQueryItem object itself. */ @@ -89,7 +111,7 @@ public EntityQueryItem withType(String type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemProperties.java index b1a3ce1e859b..29a99b7182c9 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** An properties abstract Query item for entity. */ +/** + * An properties abstract Query item for entity. + */ @Fluent public class EntityQueryItemProperties { /* @@ -35,9 +37,15 @@ public class EntityQueryItemProperties { @JsonProperty(value = "entitiesFilter") private Object entitiesFilter; + /** + * Creates an instance of EntityQueryItemProperties class. + */ + public EntityQueryItemProperties() { + } + /** * Get the dataTypes property: Data types for template. - * + * * @return the dataTypes value. */ public List dataTypes() { @@ -46,7 +54,7 @@ public List dataTypes() { /** * Set the dataTypes property: Data types for template. - * + * * @param dataTypes the dataTypes value to set. * @return the EntityQueryItemProperties object itself. */ @@ -57,7 +65,7 @@ public EntityQueryItemProperties withDataTypes(List> requiredInputFieldsSets() { @@ -86,7 +94,7 @@ public List> requiredInputFieldsSets() { /** * Set the requiredInputFieldsSets property: Data types for template. - * + * * @param requiredInputFieldsSets the requiredInputFieldsSets value to set. * @return the EntityQueryItemProperties object itself. */ @@ -97,7 +105,7 @@ public EntityQueryItemProperties withRequiredInputFieldsSets(List> /** * Get the entitiesFilter property: The query applied only to entities matching to all filters. - * + * * @return the entitiesFilter value. */ public Object entitiesFilter() { @@ -106,7 +114,7 @@ public Object 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. */ @@ -117,7 +125,7 @@ public EntityQueryItemProperties withEntitiesFilter(Object entitiesFilter) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemPropertiesDataTypesItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemPropertiesDataTypesItem.java index f5b1c7988945..619df8a7710e 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The EntityQueryItemPropertiesDataTypesItem model. */ +/** + * The EntityQueryItemPropertiesDataTypesItem model. + */ @Fluent public final class EntityQueryItemPropertiesDataTypesItem { /* @@ -16,9 +18,15 @@ public final class EntityQueryItemPropertiesDataTypesItem { @JsonProperty(value = "dataType") private String dataType; + /** + * Creates an instance of EntityQueryItemPropertiesDataTypesItem class. + */ + public EntityQueryItemPropertiesDataTypesItem() { + } + /** * Get the dataType property: Data type name. - * + * * @return the dataType value. */ public String dataType() { @@ -27,7 +35,7 @@ public String dataType() { /** * Set the dataType property: Data type name. - * + * * @param dataType the dataType value to set. * @return the EntityQueryItemPropertiesDataTypesItem object itself. */ @@ -38,7 +46,7 @@ public EntityQueryItemPropertiesDataTypesItem withDataType(String dataType) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryKind.java index 537821cbebab..eca7cc63a87d 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of the entity query. */ +/** + * The kind of the entity query. + */ public final class EntityQueryKind extends ExpandableStringEnum { - /** Static value Expansion for EntityQueryKind. */ + /** + * Static value Expansion for EntityQueryKind. + */ public static final EntityQueryKind EXPANSION = fromString("Expansion"); - /** Static value Insight for EntityQueryKind. */ + /** + * Static value Insight for EntityQueryKind. + */ public static final EntityQueryKind INSIGHT = fromString("Insight"); - /** Static value Activity for EntityQueryKind. */ + /** + * Static value Activity for EntityQueryKind. + */ 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. */ @@ -32,7 +49,7 @@ public static EntityQueryKind fromString(String name) { /** * Gets known EntityQueryKind values. - * + * * @return known EntityQueryKind values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryList.java index 28db9eb06460..8941f6f70688 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the entity queries. */ +/** + * List of all the entity queries. + */ @Fluent public final class EntityQueryList { /* @@ -25,9 +27,15 @@ public final class EntityQueryList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of EntityQueryList class. + */ + public EntityQueryList() { + } + /** * Get the nextLink property: URL to fetch the next set of entity queries. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of entity queries. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of entity queries. - * + * * @param value the value value to set. * @return the EntityQueryList object itself. */ @@ -56,14 +64,13 @@ public EntityQueryList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model EntityQueryList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EntityQueryList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplate.java index cb8a8e6b155e..59b88e225955 100644 --- 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 @@ -7,39 +7,48 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; -/** An immutable client-side representation of EntityQueryTemplate. */ +/** + * 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 entity query template kind. + * + * @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 index 21ce0db46791..488ca5ecb0b9 100644 --- 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 @@ -8,14 +8,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of the entity query template. */ +/** + * The kind of the entity query template. + */ public final class EntityQueryTemplateKind extends ExpandableStringEnum { - /** Static value Activity for EntityQueryTemplateKind. */ + /** + * Static value Activity for EntityQueryTemplateKind. + */ public static final EntityQueryTemplateKind ACTIVITY = fromString("Activity"); + /** + * 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. */ @@ -26,7 +39,7 @@ public static EntityQueryTemplateKind fromString(String name) { /** * Gets known EntityQueryTemplateKind values. - * + * * @return known EntityQueryTemplateKind values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateList.java index a767e8fea94d..6fff0637814e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the entity query templates. */ +/** + * List of all the entity query templates. + */ @Fluent public final class EntityQueryTemplateList { /* @@ -25,9 +27,15 @@ public final class EntityQueryTemplateList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of EntityQueryTemplateList class. + */ + public EntityQueryTemplateList() { + } + /** * Get the nextLink property: URL to fetch the next set of entity query templates. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of entity query templates. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of entity query templates. - * + * * @param value the value value to set. * @return the EntityQueryTemplateList object itself. */ @@ -56,14 +64,13 @@ public EntityQueryTemplateList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model EntityQueryTemplateList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EntityQueryTemplateList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplates.java index 4bddc9d19d91..27a99cae55f4 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of EntityQueryTemplates. */ +/** + * Resource collection API of EntityQueryTemplates. + */ public interface EntityQueryTemplates { /** * Gets all entity query templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface EntityQueryTemplates { /** * Gets all entity query templates. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param kind The entity template query kind we want to fetch. @@ -34,34 +36,34 @@ public interface EntityQueryTemplates { * @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, Constant88 kind, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, Constant124 kind, + Context context); /** * Gets an entity query. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param entityQueryTemplateId entity query template ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an entity query along with {@link Response}. */ - EntityQueryTemplate get(String resourceGroupName, String workspaceName, String entityQueryTemplateId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an entity query. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String entityQueryTemplateId, Context context); + EntityQueryTemplate get(String resourceGroupName, String workspaceName, String entityQueryTemplateId); } 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 index 28d08ca8e271..5f693c316568 100644 --- 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 @@ -7,35 +7,37 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of EntityRelations. */ +/** + * 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. + * @return an entity relation along with {@link Response}. */ - Relation getRelation(String resourceGroupName, String workspaceName, String entityId, String relationName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an entity relation. */ - Response getRelationWithResponse( - String resourceGroupName, String workspaceName, String entityId, String relationName, Context context); + 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 index fff8bc912310..bf392533d229 100644 --- 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 @@ -5,28 +5,50 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Entity timeline Item. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = EntityTimelineItem.class) +/** + * Entity timeline Item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = EntityTimelineItem.class, visible = true) @JsonTypeName("EntityTimelineItem") @JsonSubTypes({ @JsonSubTypes.Type(name = "Activity", value = ActivityTimelineItem.class), @JsonSubTypes.Type(name = "Bookmark", value = BookmarkTimelineItem.class), @JsonSubTypes.Type(name = "Anomaly", value = AnomalyTimelineItem.class), - @JsonSubTypes.Type(name = "SecurityAlert", value = SecurityAlertTimelineItem.class) -}) + @JsonSubTypes.Type(name = "SecurityAlert", value = SecurityAlertTimelineItem.class) }) @Immutable public class EntityTimelineItem { + /* + * The entity query kind type. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityTimelineKind kind; + + /** + * Creates an instance of EntityTimelineItem class. + */ + public EntityTimelineItem() { + this.kind = EntityTimelineKind.fromString("EntityTimelineItem"); + } + + /** + * Get the kind property: The entity query kind type. + * + * @return the kind value. + */ + public EntityTimelineKind kind() { + return this.kind; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineKind.java index e5a502f1acfb..d6e568adb964 100644 --- 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The entity query kind. */ +/** + * The entity query kind. + */ public final class EntityTimelineKind extends ExpandableStringEnum { - /** Static value Activity for EntityTimelineKind. */ + /** + * Static value Activity for EntityTimelineKind. + */ public static final EntityTimelineKind ACTIVITY = fromString("Activity"); - /** Static value Bookmark for EntityTimelineKind. */ + /** + * Static value Bookmark for EntityTimelineKind. + */ public static final EntityTimelineKind BOOKMARK = fromString("Bookmark"); - /** Static value SecurityAlert for EntityTimelineKind. */ + /** + * Static value SecurityAlert for EntityTimelineKind. + */ public static final EntityTimelineKind SECURITY_ALERT = fromString("SecurityAlert"); - /** Static value Anomaly for EntityTimelineKind. */ + /** + * Static value Anomaly for EntityTimelineKind. + */ 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. */ @@ -35,7 +54,7 @@ public static EntityTimelineKind fromString(String name) { /** * Gets known EntityTimelineKind values. - * + * * @return known EntityTimelineKind values. */ public static Collection values() { 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 index 5f024f5132c6..275d977dd916 100644 --- 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 @@ -10,7 +10,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** The parameters required to execute s timeline operation on the given entity. */ +/** + * The parameters required to execute s timeline operation on the given entity. + */ @Fluent public final class EntityTimelineParameters { /* @@ -37,9 +39,15 @@ public final class EntityTimelineParameters { @JsonProperty(value = "numberOfBucket") 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() { @@ -48,7 +56,7 @@ public List kinds() { /** * Set the kinds property: Array of timeline Item kinds. - * + * * @param kinds the kinds value to set. * @return the EntityTimelineParameters object itself. */ @@ -59,7 +67,7 @@ public EntityTimelineParameters withKinds(List kinds) { /** * Get the startTime property: The start timeline date, so the results returned are after this date. - * + * * @return the startTime value. */ public OffsetDateTime startTime() { @@ -68,7 +76,7 @@ public OffsetDateTime 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. */ @@ -79,7 +87,7 @@ public EntityTimelineParameters withStartTime(OffsetDateTime startTime) { /** * Get the endTime property: The end timeline date, so the results returned are before this date. - * + * * @return the endTime value. */ public OffsetDateTime endTime() { @@ -88,7 +96,7 @@ public OffsetDateTime 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. */ @@ -99,7 +107,7 @@ public EntityTimelineParameters withEndTime(OffsetDateTime endTime) { /** * Get the numberOfBucket property: The number of bucket for timeline queries aggregation. - * + * * @return the numberOfBucket value. */ public Integer numberOfBucket() { @@ -108,7 +116,7 @@ public Integer 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. */ @@ -119,21 +127,19 @@ public EntityTimelineParameters withNumberOfBucket(Integer numberOfBucket) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (startTime() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startTime in model EntityTimelineParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property startTime in model EntityTimelineParameters")); } if (endTime() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endTime in model EntityTimelineParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property endTime in model EntityTimelineParameters")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineResponse.java index f06f9e561d6b..302c9aa2d7f1 100644 --- 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 @@ -7,25 +7,27 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner; import java.util.List; -/** An immutable client-side representation of EntityTimelineResponse. */ +/** + * 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 index e18fee517f1d..42772206d18f 100644 --- 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 @@ -8,77 +8,132 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the entity. */ +/** + * The type of the entity. + */ public final class EntityType extends ExpandableStringEnum { - /** Static value Account for EntityType. */ + /** + * Static value Account for EntityType. + */ public static final EntityType ACCOUNT = fromString("Account"); - /** Static value Host for EntityType. */ + /** + * Static value Host for EntityType. + */ public static final EntityType HOST = fromString("Host"); - /** Static value File for EntityType. */ + /** + * Static value File for EntityType. + */ public static final EntityType FILE = fromString("File"); - /** Static value AzureResource for EntityType. */ + /** + * Static value AzureResource for EntityType. + */ public static final EntityType AZURE_RESOURCE = fromString("AzureResource"); - /** Static value CloudApplication for EntityType. */ + /** + * Static value CloudApplication for EntityType. + */ public static final EntityType CLOUD_APPLICATION = fromString("CloudApplication"); - /** Static value DNS for EntityType. */ + /** + * Static value DNS for EntityType. + */ public static final EntityType DNS = fromString("DNS"); - /** Static value FileHash for EntityType. */ + /** + * Static value FileHash for EntityType. + */ public static final EntityType FILE_HASH = fromString("FileHash"); - /** Static value IP for EntityType. */ + /** + * Static value IP for EntityType. + */ public static final EntityType IP = fromString("IP"); - /** Static value Malware for EntityType. */ + /** + * Static value Malware for EntityType. + */ public static final EntityType MALWARE = fromString("Malware"); - /** Static value Process for EntityType. */ + /** + * Static value Process for EntityType. + */ public static final EntityType PROCESS = fromString("Process"); - /** Static value RegistryKey for EntityType. */ + /** + * Static value RegistryKey for EntityType. + */ public static final EntityType REGISTRY_KEY = fromString("RegistryKey"); - /** Static value RegistryValue for EntityType. */ + /** + * Static value RegistryValue for EntityType. + */ public static final EntityType REGISTRY_VALUE = fromString("RegistryValue"); - /** Static value SecurityGroup for EntityType. */ + /** + * Static value SecurityGroup for EntityType. + */ public static final EntityType SECURITY_GROUP = fromString("SecurityGroup"); - /** Static value URL for EntityType. */ + /** + * Static value URL for EntityType. + */ public static final EntityType URL = fromString("URL"); - /** Static value IoTDevice for EntityType. */ + /** + * Static value IoTDevice for EntityType. + */ public static final EntityType IO_TDEVICE = fromString("IoTDevice"); - /** Static value SecurityAlert for EntityType. */ + /** + * Static value SecurityAlert for EntityType. + */ public static final EntityType SECURITY_ALERT = fromString("SecurityAlert"); - /** Static value HuntingBookmark for EntityType. */ + /** + * Static value HuntingBookmark for EntityType. + */ public static final EntityType HUNTING_BOOKMARK = fromString("HuntingBookmark"); - /** Static value MailCluster for EntityType. */ + /** + * Static value MailCluster for EntityType. + */ public static final EntityType MAIL_CLUSTER = fromString("MailCluster"); - /** Static value MailMessage for EntityType. */ + /** + * Static value MailMessage for EntityType. + */ public static final EntityType MAIL_MESSAGE = fromString("MailMessage"); - /** Static value Mailbox for EntityType. */ + /** + * Static value Mailbox for EntityType. + */ public static final EntityType MAILBOX = fromString("Mailbox"); - /** Static value SubmissionMail for EntityType. */ + /** + * Static value SubmissionMail for EntityType. + */ public static final EntityType SUBMISSION_MAIL = fromString("SubmissionMail"); - /** Static value Nic for EntityType. */ + /** + * Static value Nic for EntityType. + */ 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. */ @@ -89,7 +144,7 @@ public static EntityType fromString(String name) { /** * Gets known EntityType values. - * + * * @return known EntityType values. */ public static Collection values() { 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..5a74d0720f04 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Error.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error description for why a publication failed. + */ +@Fluent +public final class Error { + /* + * The member resource name for which the publication error occured + */ + @JsonProperty(value = "memberResourceName", required = true) + private String memberResourceName; + + /* + * The error message + */ + @JsonProperty(value = "errorMessage", required = true) + private String errorMessage; + + /** + * Creates an instance of Error class. + */ + public 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; + } + + /** + * Set the memberResourceName property: The member resource name for which the publication error occured. + * + * @param memberResourceName the memberResourceName value to set. + * @return the Error object itself. + */ + public Error withMemberResourceName(String memberResourceName) { + this.memberResourceName = memberResourceName; + return this; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: The error message. + * + * @param errorMessage the errorMessage value to set. + * @return the Error object itself. + */ + public Error withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (memberResourceName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property memberResourceName in model Error")); + } + if (errorMessage() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property errorMessage in model Error")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Error.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingAggregationKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingAggregationKind.java index 8849d5c4a7b9..dcde7e0ce32e 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The event grouping aggregation kinds. */ +/** + * The event grouping aggregation kinds. + */ public final class EventGroupingAggregationKind extends ExpandableStringEnum { - /** Static value SingleAlert for EventGroupingAggregationKind. */ + /** + * Static value SingleAlert for EventGroupingAggregationKind. + */ public static final EventGroupingAggregationKind SINGLE_ALERT = fromString("SingleAlert"); - /** Static value AlertPerResult for EventGroupingAggregationKind. */ + /** + * Static value AlertPerResult for EventGroupingAggregationKind. + */ public static final EventGroupingAggregationKind ALERT_PER_RESULT = fromString("AlertPerResult"); + /** + * Creates a new instance of EventGroupingAggregationKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EventGroupingAggregationKind() { + } + /** * Creates or finds a EventGroupingAggregationKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding EventGroupingAggregationKind. */ @@ -29,7 +44,7 @@ public static EventGroupingAggregationKind fromString(String name) { /** * Gets known EventGroupingAggregationKind values. - * + * * @return known EventGroupingAggregationKind values. */ public static Collection values() { 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 ed1b01e323bc..dc4a88659413 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Event grouping settings property bag. */ +/** + * Event grouping settings property bag. + */ @Fluent public final class EventGroupingSettings { /* @@ -16,9 +18,15 @@ public final class EventGroupingSettings { @JsonProperty(value = "aggregationKind") private EventGroupingAggregationKind aggregationKind; + /** + * Creates an instance of EventGroupingSettings class. + */ + public EventGroupingSettings() { + } + /** * Get the aggregationKind property: The event grouping aggregation kinds. - * + * * @return the aggregationKind value. */ public EventGroupingAggregationKind aggregationKind() { @@ -27,7 +35,7 @@ public EventGroupingAggregationKind aggregationKind() { /** * Set the aggregationKind property: The event grouping aggregation kinds. - * + * * @param aggregationKind the aggregationKind value to set. * @return the EventGroupingSettings object itself. */ @@ -38,7 +46,7 @@ public EventGroupingSettings withAggregationKind(EventGroupingAggregationKind ag /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionEntityQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionEntityQuery.java index 368b2563e16c..665b0570e124 100644 --- 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 @@ -8,31 +8,59 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; import com.azure.resourcemanager.securityinsights.fluent.models.ExpansionEntityQueriesProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** Represents Expansion entity query. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Expansion entity query. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ExpansionEntityQuery.class, visible = true) @JsonTypeName("Expansion") @Fluent public final class ExpansionEntityQuery extends EntityQueryInner { + /* + * the entity query kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityQueryKind kind = EntityQueryKind.EXPANSION; + /* * Expansion entity query properties */ @JsonProperty(value = "properties") private ExpansionEntityQueriesProperties innerProperties; + /** + * Creates an instance of ExpansionEntityQuery class. + */ + public ExpansionEntityQuery() { + } + + /** + * Get the kind property: the entity query kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ExpansionEntityQuery withEtag(String etag) { super.withEtag(etag); @@ -41,7 +69,7 @@ public ExpansionEntityQuery withEtag(String etag) { /** * Get the dataSources property: List of the data sources that are required to run the query. - * + * * @return the dataSources value. */ public List dataSources() { @@ -50,7 +78,7 @@ public List dataSources() { /** * Set the dataSources property: List of the data sources that are required to run the query. - * + * * @param dataSources the dataSources value to set. * @return the ExpansionEntityQuery object itself. */ @@ -64,7 +92,7 @@ public ExpansionEntityQuery withDataSources(List dataSources) { /** * Get the displayName property: The query display name. - * + * * @return the displayName value. */ public String displayName() { @@ -73,7 +101,7 @@ public String displayName() { /** * Set the displayName property: The query display name. - * + * * @param displayName the displayName value to set. * @return the ExpansionEntityQuery object itself. */ @@ -87,7 +115,7 @@ public ExpansionEntityQuery withDisplayName(String displayName) { /** * Get the inputEntityType property: The type of the query's source entity. - * + * * @return the inputEntityType value. */ public EntityType inputEntityType() { @@ -96,7 +124,7 @@ public EntityType inputEntityType() { /** * Set the inputEntityType property: The type of the query's source entity. - * + * * @param inputEntityType the inputEntityType value to set. * @return the ExpansionEntityQuery object itself. */ @@ -110,7 +138,7 @@ public ExpansionEntityQuery withInputEntityType(EntityType 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() { @@ -119,7 +147,7 @@ public List inputFields() { /** * Set the inputFields property: List of the fields of the source entity that are required to run the query. - * + * * @param inputFields the inputFields value to set. * @return the ExpansionEntityQuery object itself. */ @@ -133,7 +161,7 @@ public ExpansionEntityQuery withInputFields(List inputFields) { /** * Get the outputEntityTypes property: List of the desired output types to be constructed from the result. - * + * * @return the outputEntityTypes value. */ public List outputEntityTypes() { @@ -142,7 +170,7 @@ public List outputEntityTypes() { /** * Set the outputEntityTypes property: List of the desired output types to be constructed from the result. - * + * * @param outputEntityTypes the outputEntityTypes value to set. * @return the ExpansionEntityQuery object itself. */ @@ -156,7 +184,7 @@ public ExpansionEntityQuery withOutputEntityTypes(List outputEntityT /** * Get the queryTemplate property: The template query string to be parsed and formatted. - * + * * @return the queryTemplate value. */ public String queryTemplate() { @@ -165,7 +193,7 @@ public String queryTemplate() { /** * Set the queryTemplate property: The template query string to be parsed and formatted. - * + * * @param queryTemplate the queryTemplate value to set. * @return the ExpansionEntityQuery object itself. */ @@ -179,7 +207,7 @@ public ExpansionEntityQuery withQueryTemplate(String queryTemplate) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index a3620d7458fc..16cc09b47755 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Information of a specific aggregation in the expansion result. */ +/** + * Information of a specific aggregation in the expansion result. + */ @Fluent public final class ExpansionResultAggregation { /* @@ -33,11 +35,17 @@ public final class ExpansionResultAggregation { * The kind of the aggregated entity. */ @JsonProperty(value = "entityKind", required = true) - private EntityKind entityKind; + private EntityKindEnum entityKind; + + /** + * Creates an instance of ExpansionResultAggregation class. + */ + public ExpansionResultAggregation() { + } /** * Get the aggregationType property: The common type of the aggregation. (for e.g. entity field name). - * + * * @return the aggregationType value. */ public String aggregationType() { @@ -46,7 +54,7 @@ public String aggregationType() { /** * Set the aggregationType property: The common type of the aggregation. (for e.g. entity field name). - * + * * @param aggregationType the aggregationType value to set. * @return the ExpansionResultAggregation object itself. */ @@ -58,7 +66,7 @@ public ExpansionResultAggregation withAggregationType(String 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() { @@ -68,7 +76,7 @@ public int count() { /** * Set the count property: Total number of aggregations of the given kind (and aggregationType if given) in the * expansion result. - * + * * @param count the count value to set. * @return the ExpansionResultAggregation object itself. */ @@ -79,7 +87,7 @@ public ExpansionResultAggregation withCount(int count) { /** * Get the displayName property: The display name of the aggregation by type. - * + * * @return the displayName value. */ public String displayName() { @@ -88,7 +96,7 @@ public String displayName() { /** * Set the displayName property: The display name of the aggregation by type. - * + * * @param displayName the displayName value to set. * @return the ExpansionResultAggregation object itself. */ @@ -99,35 +107,34 @@ public ExpansionResultAggregation withDisplayName(String displayName) { /** * Get the entityKind property: The kind of the aggregated entity. - * + * * @return the entityKind value. */ - public EntityKind entityKind() { + public EntityKindEnum entityKind() { return this.entityKind; } /** * Set the entityKind property: The kind of the aggregated entity. - * + * * @param entityKind the entityKind value to set. * @return the ExpansionResultAggregation object itself. */ - public ExpansionResultAggregation withEntityKind(EntityKind entityKind) { + public ExpansionResultAggregation withEntityKind(EntityKindEnum entityKind) { this.entityKind = entityKind; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (entityKind() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property entityKind in model ExpansionResultAggregation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property entityKind in model ExpansionResultAggregation")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultsMetadata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultsMetadata.java index 79231d5f4fcd..5567f59da449 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Expansion result metadata. */ +/** + * Expansion result metadata. + */ @Fluent public final class ExpansionResultsMetadata { /* @@ -17,9 +19,15 @@ public final class ExpansionResultsMetadata { @JsonProperty(value = "aggregations") private List aggregations; + /** + * Creates an instance of ExpansionResultsMetadata class. + */ + public ExpansionResultsMetadata() { + } + /** * Get the aggregations property: Information of the aggregated nodes in the expansion result. - * + * * @return the aggregations value. */ public List aggregations() { @@ -28,7 +36,7 @@ public List aggregations() { /** * Set the aggregations property: Information of the aggregated nodes in the expansion result. - * + * * @param aggregations the aggregations value to set. * @return the ExpansionResultsMetadata object itself. */ @@ -39,7 +47,7 @@ public ExpansionResultsMetadata withAggregations(List fileHashEntityIds() { @@ -53,7 +79,7 @@ public List fileHashEntityIds() { /** * Get the fileName property: The file name without path (some alerts might not include path). - * + * * @return the fileName value. */ public String fileName() { @@ -62,7 +88,7 @@ public String fileName() { /** * Get the hostEntityId property: The Host entity id which the file belongs to. - * + * * @return the hostEntityId value. */ public String hostEntityId() { @@ -72,7 +98,7 @@ public String hostEntityId() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -82,7 +108,7 @@ public Map 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() { @@ -91,7 +117,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index b75ccaba87f1..81877d8de3ba 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The format of the file. */ +/** + * The format of the file. + */ public final class FileFormat extends ExpandableStringEnum { - /** Static value CSV for FileFormat. */ + /** + * Static value CSV for FileFormat. + */ public static final FileFormat CSV = fromString("CSV"); - /** Static value JSON for FileFormat. */ + /** + * Static value JSON for FileFormat. + */ public static final FileFormat JSON = fromString("JSON"); - /** Static value Unspecified for FileFormat. */ + /** + * Static value Unspecified for FileFormat. + */ 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. */ @@ -32,7 +49,7 @@ public static FileFormat fromString(String name) { /** * Gets known FileFormat values. - * + * * @return known FileFormat values. */ public static Collection values() { 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 60f2e72f165e..de7f34736e56 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 @@ -8,26 +8,47 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The hash algorithm type. */ +/** + * The hash algorithm type. + */ public final class FileHashAlgorithm extends ExpandableStringEnum { - /** Static value Unknown for FileHashAlgorithm. */ + /** + * Static value Unknown for FileHashAlgorithm. + */ public static final FileHashAlgorithm UNKNOWN = fromString("Unknown"); - /** Static value MD5 for FileHashAlgorithm. */ + /** + * Static value MD5 for FileHashAlgorithm. + */ public static final FileHashAlgorithm MD5 = fromString("MD5"); - /** Static value SHA1 for FileHashAlgorithm. */ + /** + * Static value SHA1 for FileHashAlgorithm. + */ public static final FileHashAlgorithm SHA1 = fromString("SHA1"); - /** Static value SHA256 for FileHashAlgorithm. */ + /** + * Static value SHA256 for FileHashAlgorithm. + */ public static final FileHashAlgorithm SHA256 = fromString("SHA256"); - /** Static value SHA256AC for FileHashAlgorithm. */ + /** + * Static value SHA256AC for FileHashAlgorithm. + */ public static final FileHashAlgorithm SHA256AC = fromString("SHA256AC"); + /** + * Creates a new instance of FileHashAlgorithm value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FileHashAlgorithm() { + } + /** * Creates or finds a FileHashAlgorithm from its string representation. - * + * * @param name a name to look for. * @return the corresponding FileHashAlgorithm. */ @@ -38,7 +59,7 @@ public static FileHashAlgorithm fromString(String name) { /** * Gets known FileHashAlgorithm values. - * + * * @return known FileHashAlgorithm values. */ public static Collection values() { 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 d6252ed9ffe6..304fb49cee57 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 @@ -4,28 +4,54 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.FileHashEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** Represents a file hash entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a file hash entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = FileHashEntity.class, visible = true) @JsonTypeName("FileHash") -@Fluent +@Immutable public final class FileHashEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.FILE_HASH; + /* * FileHash entity properties */ @JsonProperty(value = "properties") private FileHashEntityProperties innerProperties; + /** + * Creates an instance of FileHashEntity class. + */ + public FileHashEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: FileHash entity properties. - * + * * @return the innerProperties value. */ private FileHashEntityProperties innerProperties() { @@ -34,7 +60,7 @@ private FileHashEntityProperties innerProperties() { /** * Get the algorithm property: The hash algorithm type. - * + * * @return the algorithm value. */ public FileHashAlgorithm algorithm() { @@ -43,7 +69,7 @@ public FileHashAlgorithm algorithm() { /** * Get the hashValue property: The file hash value. - * + * * @return the hashValue value. */ public String hashValue() { @@ -53,7 +79,7 @@ public String hashValue() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -63,7 +89,7 @@ public Map 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() { @@ -72,7 +98,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index eba802fc7782..942644b81c78 100644 --- 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 @@ -10,53 +10,55 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of FileImport. */ +/** + * 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(); @@ -64,56 +66,56 @@ public interface FileImport { /** * 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(); @@ -121,7 +123,7 @@ public interface FileImport { /** * Gets the filesValidUntilTimeUtc property: The time the files associated with this import are deleted from the * storage account. - * + * * @return the filesValidUntilTimeUtc value. */ OffsetDateTime filesValidUntilTimeUtc(); @@ -129,113 +131,134 @@ public interface FileImport { /** * 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. */ + /** + * The entirety of the FileImport definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The FileImport definition stages. */ + + /** + * The FileImport definition stages. + */ interface DefinitionStages { - /** The first stage of the FileImport definition. */ + /** + * The first stage of the FileImport definition. + */ interface Blank extends WithParentResource { } - /** The stage of the FileImport definition allowing to specify parent resource. */ + + /** + * 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 { + 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ 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 index 0be57c4ae5d8..89d2e41d215b 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The content type of this file. */ +/** + * The content type of this file. + */ public final class FileImportContentType extends ExpandableStringEnum { - /** Static value BasicIndicator for FileImportContentType. */ + /** + * Static value BasicIndicator for FileImportContentType. + */ public static final FileImportContentType BASIC_INDICATOR = fromString("BasicIndicator"); - /** Static value StixIndicator for FileImportContentType. */ + /** + * Static value StixIndicator for FileImportContentType. + */ public static final FileImportContentType STIX_INDICATOR = fromString("StixIndicator"); - /** Static value Unspecified for FileImportContentType. */ + /** + * Static value Unspecified for FileImportContentType. + */ 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. */ @@ -32,7 +49,7 @@ public static FileImportContentType fromString(String name) { /** * Gets known FileImportContentType values. - * + * * @return known FileImportContentType values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportList.java index 5037750b2957..1460b7cf9609 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the file imports. */ +/** + * List all the file imports. + */ @Fluent public final class FileImportList { /* @@ -25,9 +27,15 @@ public final class FileImportList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of FileImportList class. + */ + public FileImportList() { + } + /** * Get the nextLink property: URL to fetch the next set of file imports. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of file imports. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of file imports. - * + * * @param value the value value to set. * @return the FileImportList object itself. */ @@ -56,14 +64,13 @@ public FileImportList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model FileImportList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model FileImportList")); } else { value().forEach(e -> e.validate()); } 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 index 865e69307352..a1b13651cb2d 100644 --- 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 @@ -8,32 +8,57 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The state of the file import. */ +/** + * The state of the file import. + */ public final class FileImportState extends ExpandableStringEnum { - /** Static value FatalError for FileImportState. */ + /** + * Static value FatalError for FileImportState. + */ public static final FileImportState FATAL_ERROR = fromString("FatalError"); - /** Static value Ingested for FileImportState. */ + /** + * Static value Ingested for FileImportState. + */ public static final FileImportState INGESTED = fromString("Ingested"); - /** Static value IngestedWithErrors for FileImportState. */ + /** + * Static value IngestedWithErrors for FileImportState. + */ public static final FileImportState INGESTED_WITH_ERRORS = fromString("IngestedWithErrors"); - /** Static value InProgress for FileImportState. */ + /** + * Static value InProgress for FileImportState. + */ public static final FileImportState IN_PROGRESS = fromString("InProgress"); - /** Static value Invalid for FileImportState. */ + /** + * Static value Invalid for FileImportState. + */ public static final FileImportState INVALID = fromString("Invalid"); - /** Static value WaitingForUpload for FileImportState. */ + /** + * Static value WaitingForUpload for FileImportState. + */ public static final FileImportState WAITING_FOR_UPLOAD = fromString("WaitingForUpload"); - /** Static value Unspecified for FileImportState. */ + /** + * Static value Unspecified for FileImportState. + */ 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. */ @@ -44,7 +69,7 @@ public static FileImportState fromString(String name) { /** * Gets known FileImportState values. - * + * * @return known FileImportState values. */ public static Collection values() { 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 index ae0a2d6348d2..d9c8a66435f7 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of FileImports. */ +/** + * Resource collection API of FileImports. + */ public interface FileImports { /** * 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. @@ -24,61 +26,55 @@ public interface FileImports { /** * 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. + * 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); + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, String skipToken, 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. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return a file import along with {@link Response}. */ - FileImport get(String resourceGroupName, String workspaceName, String fileImportId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return a file import. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String fileImportId, Context context); + 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. @@ -91,7 +87,7 @@ Response getWithResponse( /** * 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. @@ -105,7 +101,7 @@ Response getWithResponse( /** * 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. @@ -116,7 +112,7 @@ Response getWithResponse( /** * 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. @@ -128,7 +124,7 @@ Response getWithResponse( /** * 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. @@ -139,7 +135,7 @@ Response getWithResponse( /** * 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. @@ -151,7 +147,7 @@ Response getWithResponse( /** * Begins definition for a new FileImport resource. - * + * * @param name resource name. * @return the first stage of the new FileImport definition. */ 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 index 39027c4f608c..3e9ee05f3e78 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents a file. */ +/** + * Represents a file. + */ @Fluent public final class FileMetadata { /* @@ -40,9 +42,15 @@ public final class FileMetadata { @JsonProperty(value = "deleteStatus", access = JsonProperty.Access.WRITE_ONLY) 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() { @@ -51,7 +59,7 @@ public FileFormat fileFormat() { /** * Set the fileFormat property: The format of the file. - * + * * @param fileFormat the fileFormat value to set. * @return the FileMetadata object itself. */ @@ -62,7 +70,7 @@ public FileMetadata withFileFormat(FileFormat fileFormat) { /** * Get the fileName property: The name of the file. - * + * * @return the fileName value. */ public String fileName() { @@ -71,7 +79,7 @@ public String fileName() { /** * Set the fileName property: The name of the file. - * + * * @param fileName the fileName value to set. * @return the FileMetadata object itself. */ @@ -82,7 +90,7 @@ public FileMetadata withFileName(String fileName) { /** * Get the fileSize property: The size of the file. - * + * * @return the fileSize value. */ public Integer fileSize() { @@ -91,7 +99,7 @@ public Integer fileSize() { /** * Set the fileSize property: The size of the file. - * + * * @param fileSize the fileSize value to set. * @return the FileMetadata object itself. */ @@ -102,7 +110,7 @@ public FileMetadata withFileSize(Integer fileSize) { /** * Get the fileContentUri property: A URI with a valid SAS token to allow uploading / downloading the file. - * + * * @return the fileContentUri value. */ public String fileContentUri() { @@ -111,7 +119,7 @@ public String fileContentUri() { /** * Get the deleteStatus property: Indicates whether the file was deleted from the storage account. - * + * * @return the deleteStatus value. */ public DeleteStatus deleteStatus() { @@ -120,7 +128,7 @@ public DeleteStatus deleteStatus() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Flag.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Flag.java new file mode 100644 index 000000000000..e15c8520f83d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Flag.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The boolean value the metadata is for. + */ +public final class Flag extends ExpandableStringEnum { + /** + * Static value true for Flag. + */ + public static final Flag TRUE = fromString("true"); + + /** + * Static value false for Flag. + */ + 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. + */ + @JsonCreator + 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 792e517d8d10..8a85b96b5a64 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 @@ -8,32 +8,60 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; import com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents Fusion alert rule. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Fusion alert rule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = FusionAlertRule.class, visible = true) @JsonTypeName("Fusion") @Fluent public final class FusionAlertRule extends AlertRuleInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.FUSION; + /* * Fusion alert rule properties */ @JsonProperty(value = "properties") private FusionAlertRuleProperties innerProperties; + /** + * Creates an instance of FusionAlertRule class. + */ + public FusionAlertRule() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Fusion alert rule properties. - * + * * @return the innerProperties value. */ private FusionAlertRuleProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public FusionAlertRule withEtag(String etag) { super.withEtag(etag); @@ -42,7 +70,7 @@ public FusionAlertRule withEtag(String etag) { /** * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @return the alertRuleTemplateName value. */ public String alertRuleTemplateName() { @@ -51,7 +79,7 @@ public String alertRuleTemplateName() { /** * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @param alertRuleTemplateName the alertRuleTemplateName value to set. * @return the FusionAlertRule object itself. */ @@ -65,7 +93,7 @@ public FusionAlertRule withAlertRuleTemplateName(String alertRuleTemplateName) { /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -74,7 +102,7 @@ public String description() { /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -83,7 +111,7 @@ public String displayName() { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -92,7 +120,7 @@ public Boolean enabled() { /** * Set the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the FusionAlertRule object itself. */ @@ -106,7 +134,7 @@ public FusionAlertRule withEnabled(Boolean enabled) { /** * Get the sourceSettings property: Configuration for all supported source signals in fusion detection. - * + * * @return the sourceSettings value. */ public List sourceSettings() { @@ -115,7 +143,7 @@ public List 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. */ @@ -129,7 +157,7 @@ public FusionAlertRule withSourceSettings(List sourceSetti /** * Get the scenarioExclusionPatterns property: Configuration to exclude scenarios in fusion detection. - * + * * @return the scenarioExclusionPatterns value. */ public List scenarioExclusionPatterns() { @@ -138,12 +166,12 @@ public List 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) { + public FusionAlertRule + withScenarioExclusionPatterns(List scenarioExclusionPatterns) { if (this.innerProperties() == null) { this.innerProperties = new FusionAlertRuleProperties(); } @@ -153,7 +181,7 @@ public FusionAlertRule withScenarioExclusionPatterns( /** * Get the lastModifiedUtc property: The last time that this alert has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -162,7 +190,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -171,7 +199,7 @@ public AlertSeverity severity() { /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -180,16 +208,25 @@ public List 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(); + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 ce4da38707f0..bef9ccb32dc6 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 @@ -8,25 +8,55 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; import com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleTemplateProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents Fusion alert rule template. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Fusion alert rule template. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = FusionAlertRuleTemplate.class, + visible = true) @JsonTypeName("Fusion") @Fluent public final class FusionAlertRuleTemplate extends AlertRuleTemplateInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.FUSION; + /* * Fusion alert rule template properties */ @JsonProperty(value = "properties") private FusionAlertRuleTemplateProperties innerProperties; + /** + * Creates an instance of FusionAlertRuleTemplate class. + */ + public FusionAlertRuleTemplate() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Fusion alert rule template properties. - * + * * @return the innerProperties value. */ private FusionAlertRuleTemplateProperties innerProperties() { @@ -35,7 +65,7 @@ private FusionAlertRuleTemplateProperties innerProperties() { /** * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @return the alertRulesCreatedByTemplateCount value. */ public Integer alertRulesCreatedByTemplateCount() { @@ -44,7 +74,7 @@ public Integer 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. */ @@ -58,7 +88,7 @@ public FusionAlertRuleTemplate withAlertRulesCreatedByTemplateCount(Integer aler /** * Get the createdDateUtc property: The time that this alert rule template has been added. - * + * * @return the createdDateUtc value. */ public OffsetDateTime createdDateUtc() { @@ -67,7 +97,7 @@ public OffsetDateTime createdDateUtc() { /** * Get the lastUpdatedDateUtc property: The time that this alert rule template was last updated. - * + * * @return the lastUpdatedDateUtc value. */ public OffsetDateTime lastUpdatedDateUtc() { @@ -76,7 +106,7 @@ public OffsetDateTime lastUpdatedDateUtc() { /** * Get the description property: The description of the alert rule template. - * + * * @return the description value. */ public String description() { @@ -85,7 +115,7 @@ public String description() { /** * Set the description property: The description of the alert rule template. - * + * * @param description the description value to set. * @return the FusionAlertRuleTemplate object itself. */ @@ -99,7 +129,7 @@ public FusionAlertRuleTemplate withDescription(String description) { /** * Get the displayName property: The display name for alert rule template. - * + * * @return the displayName value. */ public String displayName() { @@ -108,7 +138,7 @@ public String displayName() { /** * Set the displayName property: The display name for alert rule template. - * + * * @param displayName the displayName value to set. * @return the FusionAlertRuleTemplate object itself. */ @@ -122,7 +152,7 @@ public FusionAlertRuleTemplate withDisplayName(String displayName) { /** * Get the requiredDataConnectors property: The required data connectors for this template. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -131,12 +161,12 @@ public List 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) { + public FusionAlertRuleTemplate + withRequiredDataConnectors(List requiredDataConnectors) { if (this.innerProperties() == null) { this.innerProperties = new FusionAlertRuleTemplateProperties(); } @@ -146,7 +176,7 @@ public FusionAlertRuleTemplate withRequiredDataConnectors( /** * Get the status property: The alert rule template status. - * + * * @return the status value. */ public TemplateStatus status() { @@ -155,7 +185,7 @@ public TemplateStatus status() { /** * Set the status property: The alert rule template status. - * + * * @param status the status value to set. * @return the FusionAlertRuleTemplate object itself. */ @@ -169,7 +199,7 @@ public FusionAlertRuleTemplate withStatus(TemplateStatus status) { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -178,7 +208,7 @@ public AlertSeverity 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. */ @@ -192,7 +222,7 @@ public FusionAlertRuleTemplate withSeverity(AlertSeverity severity) { /** * Get the tactics property: The tactics of the alert rule template. - * + * * @return the tactics value. */ public List tactics() { @@ -201,7 +231,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. */ @@ -215,7 +245,7 @@ public FusionAlertRuleTemplate withTactics(List tactics) { /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -224,7 +254,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the FusionAlertRuleTemplate object itself. */ @@ -236,9 +266,32 @@ public FusionAlertRuleTemplate 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 FusionAlertRuleTemplate object itself. + */ + public FusionAlertRuleTemplate withSubTechniques(List subTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleTemplateProperties(); + } + this.innerProperties().withSubTechniques(subTechniques); + return this; + } + /** * Get the sourceSettings property: All supported source signal configurations consumed in fusion detection. - * + * * @return the sourceSettings value. */ public List sourceSettings() { @@ -247,7 +300,7 @@ public List sourceSettings() { /** * Set the sourceSettings property: All supported source signal configurations consumed in fusion detection. - * + * * @param sourceSettings the sourceSettings value to set. * @return the FusionAlertRuleTemplate object itself. */ @@ -261,7 +314,7 @@ public FusionAlertRuleTemplate withSourceSettings(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() { @@ -41,7 +49,7 @@ public boolean 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. */ @@ -53,7 +61,7 @@ public FusionSourceSettings withEnabled(boolean enabled) { /** * 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() { @@ -63,7 +71,7 @@ public String 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. */ @@ -75,7 +83,7 @@ public FusionSourceSettings withSourceName(String sourceName) { /** * Get the sourceSubTypes property: Configuration for all source subtypes under this source signal consumed in * fusion detection. - * + * * @return the sourceSubTypes value. */ public List sourceSubTypes() { @@ -85,7 +93,7 @@ public List 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. */ @@ -96,13 +104,13 @@ public FusionSourceSettings withSourceSubTypes(List /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (sourceName() == null) { - throw LOGGER - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property sourceName in model FusionSourceSettings")); } if (sourceSubTypes() != null) { 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 index cdf5cd5f9269..5394e4f8b6a3 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents a supported source subtype configuration under a source signal in Fusion detection. */ +/** + * Represents a supported source subtype configuration under a source signal in Fusion detection. + */ @Fluent public final class FusionSourceSubTypeSetting { /* @@ -18,8 +20,7 @@ public final class FusionSourceSubTypeSetting { 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. + * The Name of the source subtype under a given source signal in Fusion detection. Refer to Fusion alert rule template for supported values. */ @JsonProperty(value = "sourceSubTypeName", required = true) private String sourceSubTypeName; @@ -36,10 +37,16 @@ public final class FusionSourceSubTypeSetting { @JsonProperty(value = "severityFilters", required = true) 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() { @@ -49,7 +56,7 @@ public boolean 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. */ @@ -61,7 +68,7 @@ public FusionSourceSubTypeSetting withEnabled(boolean enabled) { /** * 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() { @@ -71,7 +78,7 @@ public String 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. */ @@ -83,7 +90,7 @@ public FusionSourceSubTypeSetting withSourceSubTypeName(String 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() { @@ -92,7 +99,7 @@ public String sourceSubTypeDisplayName() { /** * Get the severityFilters property: Severity configuration for a source subtype consumed in fusion detection. - * + * * @return the severityFilters value. */ public FusionSubTypeSeverityFilter severityFilters() { @@ -101,7 +108,7 @@ public FusionSubTypeSeverityFilter 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. */ @@ -112,21 +119,19 @@ public FusionSourceSubTypeSetting withSeverityFilters(FusionSubTypeSeverityFilte /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (sourceSubTypeName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceSubTypeName in model FusionSourceSubTypeSetting")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceSubTypeName in model FusionSourceSubTypeSetting")); } if (severityFilters() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property severityFilters in model FusionSourceSubTypeSetting")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property severityFilters in model FusionSourceSubTypeSetting")); } else { severityFilters().validate(); } 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 index c6ae35c72337..bdc103ab7ee9 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents severity configuration for a source subtype consumed in Fusion detection. */ +/** + * Represents severity configuration for a source subtype consumed in Fusion detection. + */ @Fluent public final class FusionSubTypeSeverityFilter { /* @@ -23,9 +25,15 @@ public final class FusionSubTypeSeverityFilter { @JsonProperty(value = "filters") 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() { @@ -35,7 +43,7 @@ public Boolean 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() { @@ -45,7 +53,7 @@ public List 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. */ @@ -56,7 +64,7 @@ public FusionSubTypeSeverityFilter withFilters(List sourceSubTypes; + /** + * Creates an instance of FusionTemplateSourceSetting class. + */ + public FusionTemplateSourceSetting() { + } + /** * Get the sourceName property: The name of a source signal consumed in Fusion detection. - * + * * @return the sourceName value. */ public String sourceName() { @@ -35,7 +43,7 @@ public String sourceName() { /** * Set the sourceName property: The name of a source signal consumed in Fusion detection. - * + * * @param sourceName the sourceName value to set. * @return the FusionTemplateSourceSetting object itself. */ @@ -47,7 +55,7 @@ public FusionTemplateSourceSetting withSourceName(String sourceName) { /** * Get the sourceSubTypes property: All supported source subtypes under this source signal consumed in fusion * detection. - * + * * @return the sourceSubTypes value. */ public List sourceSubTypes() { @@ -57,7 +65,7 @@ public List sourceSubTypes() { /** * Set the sourceSubTypes property: All supported source subtypes under this source signal consumed in fusion * detection. - * + * * @param sourceSubTypes the sourceSubTypes value to set. * @return the FusionTemplateSourceSetting object itself. */ @@ -68,15 +76,14 @@ public FusionTemplateSourceSetting withSourceSubTypes(List e.validate()); 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 index 89bfdf241a52..44e552b0a4c7 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents a source subtype under a source signal consumed in Fusion detection. */ +/** + * Represents a source subtype under a source signal consumed in Fusion detection. + */ @Fluent public final class FusionTemplateSourceSubType { /* @@ -29,10 +31,16 @@ public final class FusionTemplateSourceSubType { @JsonProperty(value = "severityFilter", required = true) private FusionTemplateSubTypeSeverityFilter severityFilter; + /** + * Creates an instance of FusionTemplateSourceSubType class. + */ + public 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() { @@ -42,7 +50,7 @@ public String sourceSubTypeName() { /** * Set the sourceSubTypeName property: The name of source subtype under a source signal consumed in Fusion * detection. - * + * * @param sourceSubTypeName the sourceSubTypeName value to set. * @return the FusionTemplateSourceSubType object itself. */ @@ -54,7 +62,7 @@ public FusionTemplateSourceSubType withSourceSubTypeName(String sourceSubTypeNam /** * 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() { @@ -64,7 +72,7 @@ public String sourceSubTypeDisplayName() { /** * Get the severityFilter property: Severity configuration available for a source subtype consumed in fusion * detection. - * + * * @return the severityFilter value. */ public FusionTemplateSubTypeSeverityFilter severityFilter() { @@ -74,7 +82,7 @@ public FusionTemplateSubTypeSeverityFilter severityFilter() { /** * Set the severityFilter property: Severity configuration available for a source subtype consumed in fusion * detection. - * + * * @param severityFilter the severityFilter value to set. * @return the FusionTemplateSourceSubType object itself. */ @@ -85,21 +93,19 @@ public FusionTemplateSourceSubType withSeverityFilter(FusionTemplateSubTypeSever /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (sourceSubTypeName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceSubTypeName in model FusionTemplateSourceSubType")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceSubTypeName in model FusionTemplateSourceSubType")); } if (severityFilter() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property severityFilter in model FusionTemplateSourceSubType")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property severityFilter in model FusionTemplateSourceSubType")); } else { severityFilter().validate(); } 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 index ef8388621d5a..5794632d25f2 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents severity configurations available for a source subtype consumed in Fusion detection. */ +/** + * Represents severity configurations available for a source subtype consumed in Fusion detection. + */ @Fluent public final class FusionTemplateSubTypeSeverityFilter { /* @@ -23,10 +25,16 @@ public final class FusionTemplateSubTypeSeverityFilter { @JsonProperty(value = "severityFilters") private List severityFilters; + /** + * Creates an instance of FusionTemplateSubTypeSeverityFilter class. + */ + public 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() { @@ -36,7 +44,7 @@ public boolean isSupported() { /** * Set the isSupported property: Determines whether severity configuration is supported for this source subtype * consumed in Fusion detection. - * + * * @param isSupported the isSupported value to set. * @return the FusionTemplateSubTypeSeverityFilter object itself. */ @@ -48,7 +56,7 @@ public FusionTemplateSubTypeSeverityFilter withIsSupported(boolean 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() { @@ -58,7 +66,7 @@ public List severityFilters() { /** * Set the severityFilters property: List of all supported severities for this source subtype consumed in Fusion * detection. - * + * * @param severityFilters the severityFilters value to set. * @return the FusionTemplateSubTypeSeverityFilter object itself. */ @@ -69,7 +77,7 @@ public FusionTemplateSubTypeSeverityFilter withSeverityFilters(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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (projectId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property projectId in model GcpRequestProperties")); + } + if (subscriptionNames() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property subscriptionNames in model GcpRequestProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GcpRequestProperties.class); +} 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..a2f01b6b7c39 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GenericBlobSbsAuthModel.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** + * Model for API authentication for working with service bus or storage account. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "type", + defaultImpl = GenericBlobSbsAuthModel.class, + visible = true) +@JsonTypeName("ServiceBus") +@Fluent +public final class GenericBlobSbsAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private CcpAuthType type = CcpAuthType.SERVICE_BUS; + + /* + * Credentials for service bus namespace, keyvault uri for access key + */ + @JsonProperty(value = "credentialsConfig") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map credentialsConfig; + + /* + * Credentials for storage account, keyvault uri for access key + */ + @JsonProperty(value = "storageAccountCredentialsConfig") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GeoLocation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GeoLocation.java index 675f38adbbe9..849e79feeebe 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The geo-location context attached to the ip entity. */ +/** + * The geo-location context attached to the ip entity. + */ @Immutable public final class GeoLocation { /* @@ -35,17 +37,13 @@ public final class GeoLocation { 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. */ @JsonProperty(value = "latitude", access = JsonProperty.Access.WRITE_ONLY) private Double latitude; /* - * The latitude of the identified location, expressed as a floating point number with range of - 90 to 90, with - * positive numbers representing North and negative numbers representing South. Latitude and longitude are derived - * from the city or postal code. + * 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. */ @JsonProperty(value = "longitude", access = JsonProperty.Access.WRITE_ONLY) private Double longitude; @@ -56,9 +54,15 @@ public final class GeoLocation { @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private String state; + /** + * Creates an instance of GeoLocation class. + */ + public GeoLocation() { + } + /** * Get the asn property: Autonomous System Number. - * + * * @return the asn value. */ public Integer asn() { @@ -67,7 +71,7 @@ public Integer asn() { /** * Get the city property: City name. - * + * * @return the city value. */ public String city() { @@ -76,7 +80,7 @@ public String city() { /** * Get the countryCode property: The country code according to ISO 3166 format. - * + * * @return the countryCode value. */ public String countryCode() { @@ -86,7 +90,7 @@ public String countryCode() { /** * Get the countryName property: Country name according to ISO 3166 Alpha 2: the lowercase of the English Short * Name. - * + * * @return the countryName value. */ public String countryName() { @@ -94,10 +98,9 @@ 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. */ public Double latitude() { @@ -105,10 +108,9 @@ 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. */ public Double longitude() { @@ -117,7 +119,7 @@ public Double longitude() { /** * Get the state property: State name. - * + * * @return the state value. */ public String state() { @@ -126,7 +128,7 @@ public String state() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsError.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsError.java index cc444f69cd21..5ce25f586e03 100644 --- 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 @@ -8,14 +8,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** the query kind. */ +/** + * the query kind. + */ public final class GetInsightsError extends ExpandableStringEnum { - /** Static value Insight for GetInsightsError. */ + /** + * Static value Insight for GetInsightsError. + */ 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. */ @@ -26,7 +39,7 @@ public static GetInsightsError fromString(String name) { /** * Gets known GetInsightsError values. - * + * * @return known GetInsightsError values. */ public static Collection values() { 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 index 8717c6a073ff..c182add4f243 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** GetInsights Query Errors. */ +/** + * GetInsights Query Errors. + */ @Fluent public final class GetInsightsErrorKind { /* @@ -29,9 +31,15 @@ public final class GetInsightsErrorKind { @JsonProperty(value = "errorMessage", required = true) private String errorMessage; + /** + * Creates an instance of GetInsightsErrorKind class. + */ + public GetInsightsErrorKind() { + } + /** * Get the kind property: the query kind. - * + * * @return the kind value. */ public GetInsightsError kind() { @@ -40,7 +48,7 @@ public GetInsightsError kind() { /** * Set the kind property: the query kind. - * + * * @param kind the kind value to set. * @return the GetInsightsErrorKind object itself. */ @@ -51,7 +59,7 @@ public GetInsightsErrorKind withKind(GetInsightsError kind) { /** * Get the queryId property: the query id. - * + * * @return the queryId value. */ public String queryId() { @@ -60,7 +68,7 @@ public String queryId() { /** * Set the queryId property: the query id. - * + * * @param queryId the queryId value to set. * @return the GetInsightsErrorKind object itself. */ @@ -71,7 +79,7 @@ public GetInsightsErrorKind withQueryId(String queryId) { /** * Get the errorMessage property: the error message. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -80,7 +88,7 @@ public String errorMessage() { /** * Set the errorMessage property: the error message. - * + * * @param errorMessage the errorMessage value to set. * @return the GetInsightsErrorKind object itself. */ @@ -91,20 +99,18 @@ public GetInsightsErrorKind withErrorMessage(String errorMessage) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (kind() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property kind in model GetInsightsErrorKind")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property kind in model GetInsightsErrorKind")); } if (errorMessage() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property errorMessage in model GetInsightsErrorKind")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property errorMessage in model GetInsightsErrorKind")); } } 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 index c02767abf5e7..2d237262f8bb 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Get Insights result metadata. */ +/** + * Get Insights result metadata. + */ @Fluent public final class GetInsightsResultsMetadata { /* @@ -23,9 +25,15 @@ public final class GetInsightsResultsMetadata { @JsonProperty(value = "errors") private List errors; + /** + * Creates an instance of GetInsightsResultsMetadata class. + */ + public GetInsightsResultsMetadata() { + } + /** * Get the totalCount property: the total items found for the insights request. - * + * * @return the totalCount value. */ public int totalCount() { @@ -34,7 +42,7 @@ public int totalCount() { /** * Set the totalCount property: the total items found for the insights request. - * + * * @param totalCount the totalCount value to set. * @return the GetInsightsResultsMetadata object itself. */ @@ -45,7 +53,7 @@ public GetInsightsResultsMetadata withTotalCount(int totalCount) { /** * Get the errors property: information about the failed queries. - * + * * @return the errors value. */ public List errors() { @@ -54,7 +62,7 @@ public List errors() { /** * Set the errors property: information about the failed queries. - * + * * @param errors the errors value to set. * @return the GetInsightsResultsMetadata object itself. */ @@ -65,7 +73,7 @@ public GetInsightsResultsMetadata withErrors(List errors) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetQueriesResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetQueriesResponse.java index bb0a74c7e027..de3a0434e88b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetQueriesResponse.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetQueriesResponse.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.securityinsights.fluent.models.GetQueriesResponseInner; import java.util.List; -/** An immutable client-side representation of GetQueriesResponse. */ +/** + * An immutable client-side representation of GetQueriesResponse. + */ public interface GetQueriesResponse { /** * Gets the value property: The query result values. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.GetQueriesResponseInner object. - * + * * @return the inner object. */ GetQueriesResponseInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpGeodatas.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetRecommendations.java similarity index 65% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpGeodatas.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetRecommendations.java index c85e9c1ab375..6939c75d3a59 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IpGeodatas.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetRecommendations.java @@ -7,30 +7,32 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of IpGeodatas. */ -public interface IpGeodatas { +/** + * Resource collection API of GetRecommendations. + */ +public interface GetRecommendations { /** - * Get geodata for a single IP address. - * + * Gets a list of all recommendations. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ipAddress IP address (v4 or v6) to be enriched. + * @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 geodata for a single IP address. + * @return a list of all recommendations along with {@link Response}. */ - EnrichmentIpGeodata get(String resourceGroupName, String ipAddress); + Response listWithResponse(String resourceGroupName, String workspaceName, Context context); /** - * Get geodata for a single IP address. - * + * Gets a list of all recommendations. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ipAddress IP address (v4 or v6) to be enriched. - * @param context The context to associate with this operation. + * @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 geodata for a single IP address along with {@link Response}. + * @return a list of all recommendations. */ - Response getWithResponse(String resourceGroupName, String ipAddress, Context context); + RecommendationList list(String resourceGroupName, String workspaceName); } 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..db24a2119227 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of 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..e7875a857b83 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Gets.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.UUID; + +/** + * 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, + UUID 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, UUID 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..5a862a52d375 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubAuthModel.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = GitHubAuthModel.class, visible = true) +@JsonTypeName("GitHub") +@Fluent +public final class GitHubAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private CcpAuthType type = CcpAuthType.GIT_HUB; + + /* + * The GitHubApp auth installation id. + */ + @JsonProperty(value = "installationId") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubResourceInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubResourceInfo.java index 07ee2d932d26..4c94c361d538 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Resources created in GitHub repository. */ +/** + * Resources created in GitHub repository. + */ @Fluent public final class GitHubResourceInfo { /* @@ -16,9 +18,15 @@ public final class GitHubResourceInfo { @JsonProperty(value = "appInstallationId") private String appInstallationId; + /** + * Creates an instance of GitHubResourceInfo class. + */ + public GitHubResourceInfo() { + } + /** * Get the appInstallationId property: GitHub application installation id. - * + * * @return the appInstallationId value. */ public String appInstallationId() { @@ -27,7 +35,7 @@ public String appInstallationId() { /** * Set the appInstallationId property: GitHub application installation id. - * + * * @param appInstallationId the appInstallationId value to set. * @return the GitHubResourceInfo object itself. */ @@ -38,7 +46,7 @@ public GitHubResourceInfo withAppInstallationId(String appInstallationId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQueries.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQueries.java index a0f7e3b56450..30e5b302dbe3 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The graph query to show the current data status. */ +/** + * The graph query to show the current data status. + */ @Fluent public class GraphQueries { /* @@ -28,9 +30,15 @@ public class GraphQueries { @JsonProperty(value = "baseQuery") 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() { @@ -39,7 +47,7 @@ public String metricName() { /** * Set the metricName property: the metric that the query is checking. - * + * * @param metricName the metricName value to set. * @return the GraphQueries object itself. */ @@ -50,7 +58,7 @@ public GraphQueries withMetricName(String metricName) { /** * Get the legend property: The legend for the graph. - * + * * @return the legend value. */ public String legend() { @@ -59,7 +67,7 @@ public String legend() { /** * Set the legend property: The legend for the graph. - * + * * @param legend the legend value to set. * @return the GraphQueries object itself. */ @@ -70,7 +78,7 @@ public GraphQueries withLegend(String legend) { /** * Get the baseQuery property: The base query for the graph. - * + * * @return the baseQuery value. */ public String baseQuery() { @@ -79,7 +87,7 @@ public String baseQuery() { /** * Set the baseQuery property: The base query for the graph. - * + * * @param baseQuery the baseQuery value to set. * @return the GraphQueries object itself. */ @@ -90,7 +98,7 @@ public GraphQueries withBaseQuery(String baseQuery) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQuery.java new file mode 100644 index 000000000000..45ade8e6f9af --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQuery.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The graph query to show the volume of data arriving into the workspace over time. + */ +@Fluent +public final class GraphQuery { + /* + * Gets or sets the metric name that the query is checking. For example: 'Total data receive'. + */ + @JsonProperty(value = "metricName", required = true) + private String metricName; + + /* + * Gets or sets the legend for the graph. + */ + @JsonProperty(value = "legend", required = true) + 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. + */ + @JsonProperty(value = "baseQuery", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property metricName in model GraphQuery")); + } + if (legend() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property legend in model GraphQuery")); + } + if (baseQuery() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property baseQuery in model GraphQuery")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GraphQuery.class); +} 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 c6a5e97fd9ca..b67712a977b2 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 @@ -10,7 +10,9 @@ import java.time.Duration; import java.util.List; -/** Grouping configuration property bag. */ +/** + * Grouping configuration property bag. + */ @Fluent public final class GroupingConfiguration { /* @@ -32,15 +34,13 @@ public final class GroupingConfiguration { private Duration lookbackDuration; /* - * Grouping matching method. When method is Selected at least one of groupByEntities, groupByAlertDetails, - * groupByCustomDetails must be provided and not empty. + * Grouping matching method. When method is Selected at least one of groupByEntities, groupByAlertDetails, groupByCustomDetails must be provided and not empty. */ @JsonProperty(value = "matchingMethod", required = true) private MatchingMethod matchingMethod; /* - * A list of entity types to group by (when matchingMethod is Selected). Only entities defined in the current alert - * rule may be used. + * A list of entity types to group by (when matchingMethod is Selected). Only entities defined in the current alert rule may be used. */ @JsonProperty(value = "groupByEntities") private List groupByEntities; @@ -52,15 +52,20 @@ public final class GroupingConfiguration { private List groupByAlertDetails; /* - * A list of custom details keys to group by (when matchingMethod is Selected). Only keys defined in the current - * alert rule may be used. + * A list of custom details keys to group by (when matchingMethod is Selected). Only keys defined in the current alert rule may be used. */ @JsonProperty(value = "groupByCustomDetails") private List groupByCustomDetails; + /** + * Creates an instance of GroupingConfiguration class. + */ + public GroupingConfiguration() { + } + /** * Get the enabled property: Grouping enabled. - * + * * @return the enabled value. */ public boolean enabled() { @@ -69,7 +74,7 @@ public boolean enabled() { /** * Set the enabled property: Grouping enabled. - * + * * @param enabled the enabled value to set. * @return the GroupingConfiguration object itself. */ @@ -80,7 +85,7 @@ public GroupingConfiguration withEnabled(boolean enabled) { /** * Get the reopenClosedIncident property: Re-open closed matching incidents. - * + * * @return the reopenClosedIncident value. */ public boolean reopenClosedIncident() { @@ -89,7 +94,7 @@ public boolean reopenClosedIncident() { /** * Set the reopenClosedIncident property: Re-open closed matching incidents. - * + * * @param reopenClosedIncident the reopenClosedIncident value to set. * @return the GroupingConfiguration object itself. */ @@ -101,7 +106,7 @@ public GroupingConfiguration withReopenClosedIncident(boolean reopenClosedIncide /** * Get the lookbackDuration property: Limit the group to alerts created within the lookback duration (in ISO 8601 * duration format). - * + * * @return the lookbackDuration value. */ public Duration lookbackDuration() { @@ -111,7 +116,7 @@ public Duration lookbackDuration() { /** * Set the lookbackDuration property: Limit the group to alerts created within the lookback duration (in ISO 8601 * duration format). - * + * * @param lookbackDuration the lookbackDuration value to set. * @return the GroupingConfiguration object itself. */ @@ -123,7 +128,7 @@ public GroupingConfiguration withLookbackDuration(Duration lookbackDuration) { /** * Get the matchingMethod property: Grouping matching method. When method is Selected at least one of * groupByEntities, groupByAlertDetails, groupByCustomDetails must be provided and not empty. - * + * * @return the matchingMethod value. */ public MatchingMethod matchingMethod() { @@ -133,7 +138,7 @@ public MatchingMethod matchingMethod() { /** * Set the matchingMethod property: Grouping matching method. When method is Selected at least one of * groupByEntities, groupByAlertDetails, groupByCustomDetails must be provided and not empty. - * + * * @param matchingMethod the matchingMethod value to set. * @return the GroupingConfiguration object itself. */ @@ -145,7 +150,7 @@ public GroupingConfiguration withMatchingMethod(MatchingMethod matchingMethod) { /** * Get the groupByEntities property: A list of entity types to group by (when matchingMethod is Selected). Only * entities defined in the current alert rule may be used. - * + * * @return the groupByEntities value. */ public List groupByEntities() { @@ -155,7 +160,7 @@ public List groupByEntities() { /** * Set the groupByEntities property: A list of entity types to group by (when matchingMethod is Selected). Only * entities defined in the current alert rule may be used. - * + * * @param groupByEntities the groupByEntities value to set. * @return the GroupingConfiguration object itself. */ @@ -166,7 +171,7 @@ public GroupingConfiguration withGroupByEntities(List groupBy /** * Get the groupByAlertDetails property: A list of alert details to group by (when matchingMethod is Selected). - * + * * @return the groupByAlertDetails value. */ public List groupByAlertDetails() { @@ -175,7 +180,7 @@ public List groupByAlertDetails() { /** * Set the groupByAlertDetails property: A list of alert details to group by (when matchingMethod is Selected). - * + * * @param groupByAlertDetails the groupByAlertDetails value to set. * @return the GroupingConfiguration object itself. */ @@ -187,7 +192,7 @@ public GroupingConfiguration withGroupByAlertDetails(List groupByAl /** * Get the groupByCustomDetails property: A list of custom details keys to group by (when matchingMethod is * Selected). Only keys defined in the current alert rule may be used. - * + * * @return the groupByCustomDetails value. */ public List groupByCustomDetails() { @@ -197,7 +202,7 @@ public List groupByCustomDetails() { /** * Set the groupByCustomDetails property: A list of custom details keys to group by (when matchingMethod is * Selected). Only keys defined in the current alert rule may be used. - * + * * @param groupByCustomDetails the groupByCustomDetails value to set. * @return the GroupingConfiguration object itself. */ @@ -208,21 +213,19 @@ public GroupingConfiguration withGroupByCustomDetails(List groupByCustom /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (lookbackDuration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property lookbackDuration in model GroupingConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property lookbackDuration in model GroupingConfiguration")); } if (matchingMethod() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property matchingMethod in model GroupingConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property matchingMethod in model GroupingConfiguration")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HostEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HostEntity.java index 08e75c45b2b3..3e455d17e7c3 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 @@ -8,24 +8,50 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.HostEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** Represents a host entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a host entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = HostEntity.class, visible = true) @JsonTypeName("Host") @Fluent public final class HostEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.HOST; + /* * Host entity properties */ @JsonProperty(value = "properties") private HostEntityProperties innerProperties; + /** + * Creates an instance of HostEntity class. + */ + public HostEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Host entity properties. - * + * * @return the innerProperties value. */ private HostEntityProperties innerProperties() { @@ -34,7 +60,7 @@ private HostEntityProperties innerProperties() { /** * Get the azureId property: The azure resource id of the VM. - * + * * @return the azureId value. */ public String azureId() { @@ -44,7 +70,7 @@ public String azureId() { /** * Get the dnsDomain property: The DNS domain that this host belongs to. Should contain the compete DNS suffix for * the domain. - * + * * @return the dnsDomain value. */ public String dnsDomain() { @@ -53,7 +79,7 @@ public String dnsDomain() { /** * Get the hostname property: The hostname without the domain suffix. - * + * * @return the hostname value. */ public String hostname() { @@ -62,7 +88,7 @@ public String hostname() { /** * Get the isDomainJoined property: Determines whether this host belongs to a domain. - * + * * @return the isDomainJoined value. */ public Boolean isDomainJoined() { @@ -71,7 +97,7 @@ public Boolean isDomainJoined() { /** * Get the netBiosName property: The host name (pre-windows2000). - * + * * @return the netBiosName value. */ public String netBiosName() { @@ -80,7 +106,7 @@ public String netBiosName() { /** * Get the ntDomain property: The NT domain that this host belongs to. - * + * * @return the ntDomain value. */ public String ntDomain() { @@ -89,7 +115,7 @@ public String ntDomain() { /** * Get the omsAgentId property: The OMS agent id, if the host has OMS agent installed. - * + * * @return the omsAgentId value. */ public String omsAgentId() { @@ -98,7 +124,7 @@ public String omsAgentId() { /** * Get the osFamily property: The operating system type. - * + * * @return the osFamily value. */ public OSFamily osFamily() { @@ -107,7 +133,7 @@ public OSFamily osFamily() { /** * Set the osFamily property: The operating system type. - * + * * @param osFamily the osFamily value to set. * @return the HostEntity object itself. */ @@ -122,7 +148,7 @@ public HostEntity withOsFamily(OSFamily osFamily) { /** * Get the osVersion property: A free text representation of the operating system. This field is meant to hold * specific versions the are more fine grained than OSFamily or future values not supported by OSFamily enumeration. - * + * * @return the osVersion value. */ public String osVersion() { @@ -132,7 +158,7 @@ public String osVersion() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -142,7 +168,7 @@ public Map 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() { @@ -151,7 +177,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..1708e51b8dc5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HttpMethodVerb.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The HTTP method, default value GET. + */ +public final class HttpMethodVerb extends ExpandableStringEnum { + /** + * Static value GET for HttpMethodVerb. + */ + public static final HttpMethodVerb GET = fromString("GET"); + + /** + * Static value POST for HttpMethodVerb. + */ + public static final HttpMethodVerb POST = fromString("POST"); + + /** + * Static value PUT for HttpMethodVerb. + */ + public static final HttpMethodVerb PUT = fromString("PUT"); + + /** + * Static value DELETE for HttpMethodVerb. + */ + 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. + */ + @JsonCreator + 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/HttpsConfigurationType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HttpsConfigurationType.java new file mode 100644 index 000000000000..9473f0684de1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HttpsConfigurationType.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Represents the types of HTTPS configuration to connect to the SapControl service. + */ +public final class HttpsConfigurationType extends ExpandableStringEnum { + /** + * Static value HttpOnly for HttpsConfigurationType. + */ + public static final HttpsConfigurationType HTTP_ONLY = fromString("HttpOnly"); + + /** + * Static value HttpsWithSslVerification for HttpsConfigurationType. + */ + public static final HttpsConfigurationType HTTPS_WITH_SSL_VERIFICATION = fromString("HttpsWithSslVerification"); + + /** + * Static value HttpsWithoutSslVerification for HttpsConfigurationType. + */ + public static final HttpsConfigurationType HTTPS_WITHOUT_SSL_VERIFICATION + = fromString("HttpsWithoutSslVerification"); + + /** + * Creates a new instance of HttpsConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HttpsConfigurationType() { + } + + /** + * Creates or finds a HttpsConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpsConfigurationType. + */ + @JsonCreator + public static HttpsConfigurationType fromString(String name) { + return fromString(name, HttpsConfigurationType.class); + } + + /** + * Gets known HttpsConfigurationType values. + * + * @return known HttpsConfigurationType values. + */ + public static Collection values() { + return values(HttpsConfigurationType.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..16e7ad2fc19d --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..d37c134b2302 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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/HuntCommentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntCommentList.java new file mode 100644 index 000000000000..2c5c78f13ddf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntCommentList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of all hunt comments. + */ +@Fluent +public final class HuntCommentList { + /* + * URL to fetch the next set of hunt comments. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of hunt comments + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of HuntCommentList class. + */ + public HuntCommentList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of hunt comments. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of hunt comments. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of hunt comments. + * + * @param value the value value to set. + * @return the HuntCommentList object itself. + */ + public HuntCommentList 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 HuntCommentList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HuntCommentList.class); +} 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..248b93c5d3a8 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of HuntComments. + */ +public interface HuntComments { + /** + * 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 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 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/HuntList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntList.java new file mode 100644 index 000000000000..b86536b5bbfd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List all the hunts. + */ +@Fluent +public final class HuntList { + /* + * URL to fetch the next set of hunts. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of hunts. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of HuntList class. + */ + public HuntList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of hunts. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of hunts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of hunts. + * + * @param value the value value to set. + * @return the HuntList object itself. + */ + public HuntList 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 HuntList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HuntList.class); +} 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..12a93ed41668 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntOwner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** + * Describes a user that the hunt is assigned to. + */ +@Fluent +public final class HuntOwner { + /* + * The email of the user the hunt is assigned to. + */ + @JsonProperty(value = "email") + private String email; + + /* + * The name of the user the hunt is assigned to. + */ + @JsonProperty(value = "assignedTo") + private String assignedTo; + + /* + * The object id of the user the hunt is assigned to. + */ + @JsonProperty(value = "objectId") + private UUID objectId; + + /* + * The user principal name of the user the hunt is assigned to. + */ + @JsonProperty(value = "userPrincipalName") + private String userPrincipalName; + + /* + * The type of the owner the hunt is assigned to. + */ + @JsonProperty(value = "ownerType") + 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 UUID 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(UUID 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelation.java new file mode 100644 index 000000000000..3f684e33bcb8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelation.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 etag property: Etag of the azure resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the relatedResourceId property: The 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.WithEtag, 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 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 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.WithEtag, 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 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 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/HuntRelationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelationList.java new file mode 100644 index 000000000000..a83e9b5fe8ea --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelationList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of all the hunt relations. + */ +@Fluent +public final class HuntRelationList { + /* + * URL to fetch the next set of hunt relations. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of hunt relations + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of HuntRelationList class. + */ + public HuntRelationList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of hunt relations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of hunt relations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of hunt relations. + * + * @param value the value value to set. + * @return the HuntRelationList object itself. + */ + public HuntRelationList 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 HuntRelationList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HuntRelationList.class); +} 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..bcbd2e7f4375 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of HuntRelations. + */ +public interface HuntRelations { + /** + * 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 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 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 3ea294c0b3b5..e3982afadb44 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 @@ -8,26 +8,52 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.HuntingBookmarkProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** Represents a Hunting bookmark entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a Hunting bookmark entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = HuntingBookmark.class, visible = true) @JsonTypeName("Bookmark") @Fluent public final class HuntingBookmark extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.BOOKMARK; + /* * HuntingBookmark entity properties */ @JsonProperty(value = "properties") private HuntingBookmarkProperties innerProperties; + /** + * Creates an instance of HuntingBookmark class. + */ + public HuntingBookmark() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: HuntingBookmark entity properties. - * + * * @return the innerProperties value. */ private HuntingBookmarkProperties innerProperties() { @@ -36,7 +62,7 @@ private HuntingBookmarkProperties innerProperties() { /** * Get the created property: The time the bookmark was created. - * + * * @return the created value. */ public OffsetDateTime created() { @@ -45,7 +71,7 @@ public OffsetDateTime created() { /** * Set the created property: The time the bookmark was created. - * + * * @param created the created value to set. * @return the HuntingBookmark object itself. */ @@ -59,7 +85,7 @@ public HuntingBookmark withCreated(OffsetDateTime created) { /** * Get the createdBy property: Describes a user that created the bookmark. - * + * * @return the createdBy value. */ public UserInfo createdBy() { @@ -68,7 +94,7 @@ public UserInfo createdBy() { /** * Set the createdBy property: Describes a user that created the bookmark. - * + * * @param createdBy the createdBy value to set. * @return the HuntingBookmark object itself. */ @@ -82,7 +108,7 @@ public HuntingBookmark withCreatedBy(UserInfo createdBy) { /** * Get the displayName property: The display name of the bookmark. - * + * * @return the displayName value. */ public String displayName() { @@ -91,7 +117,7 @@ public String displayName() { /** * Set the displayName property: The display name of the bookmark. - * + * * @param displayName the displayName value to set. * @return the HuntingBookmark object itself. */ @@ -105,7 +131,7 @@ public HuntingBookmark withDisplayName(String displayName) { /** * Get the eventTime property: The time of the event. - * + * * @return the eventTime value. */ public OffsetDateTime eventTime() { @@ -114,7 +140,7 @@ public OffsetDateTime eventTime() { /** * Set the eventTime property: The time of the event. - * + * * @param eventTime the eventTime value to set. * @return the HuntingBookmark object itself. */ @@ -128,7 +154,7 @@ public HuntingBookmark withEventTime(OffsetDateTime eventTime) { /** * Get the labels property: List of labels relevant to this bookmark. - * + * * @return the labels value. */ public List labels() { @@ -137,7 +163,7 @@ public List labels() { /** * Set the labels property: List of labels relevant to this bookmark. - * + * * @param labels the labels value to set. * @return the HuntingBookmark object itself. */ @@ -151,7 +177,7 @@ public HuntingBookmark withLabels(List labels) { /** * Get the notes property: The notes of the bookmark. - * + * * @return the notes value. */ public String notes() { @@ -160,7 +186,7 @@ public String notes() { /** * Set the notes property: The notes of the bookmark. - * + * * @param notes the notes value to set. * @return the HuntingBookmark object itself. */ @@ -174,7 +200,7 @@ public HuntingBookmark withNotes(String notes) { /** * Get the query property: The query of the bookmark. - * + * * @return the query value. */ public String query() { @@ -183,7 +209,7 @@ public String query() { /** * Set the query property: The query of the bookmark. - * + * * @param query the query value to set. * @return the HuntingBookmark object itself. */ @@ -197,7 +223,7 @@ public HuntingBookmark withQuery(String query) { /** * Get the queryResult property: The query result of the bookmark. - * + * * @return the queryResult value. */ public String queryResult() { @@ -206,7 +232,7 @@ public String queryResult() { /** * Set the queryResult property: The query result of the bookmark. - * + * * @param queryResult the queryResult value to set. * @return the HuntingBookmark object itself. */ @@ -220,7 +246,7 @@ public HuntingBookmark withQueryResult(String queryResult) { /** * Get the updated property: The last time the bookmark was updated. - * + * * @return the updated value. */ public OffsetDateTime updated() { @@ -229,7 +255,7 @@ public OffsetDateTime updated() { /** * Set the updated property: The last time the bookmark was updated. - * + * * @param updated the updated value to set. * @return the HuntingBookmark object itself. */ @@ -243,7 +269,7 @@ public HuntingBookmark withUpdated(OffsetDateTime updated) { /** * Get the updatedBy property: Describes a user that updated the bookmark. - * + * * @return the updatedBy value. */ public UserInfo updatedBy() { @@ -252,7 +278,7 @@ public UserInfo updatedBy() { /** * Set the updatedBy property: Describes a user that updated the bookmark. - * + * * @param updatedBy the updatedBy value to set. * @return the HuntingBookmark object itself. */ @@ -266,7 +292,7 @@ public HuntingBookmark withUpdatedBy(UserInfo updatedBy) { /** * Get the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @return the incidentInfo value. */ public IncidentInfo incidentInfo() { @@ -275,7 +301,7 @@ public IncidentInfo incidentInfo() { /** * Set the incidentInfo property: Describes an incident that relates to bookmark. - * + * * @param incidentInfo the incidentInfo value to set. * @return the HuntingBookmark object itself. */ @@ -290,7 +316,7 @@ public HuntingBookmark withIncidentInfo(IncidentInfo incidentInfo) { /** * 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() { @@ -300,7 +326,7 @@ public Map 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() { @@ -309,7 +335,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..116f9c338106 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Hunts. + */ +public interface Hunts { + /** + * 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 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 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..af5c0522f122 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HypothesisStatus.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The hypothesis status of the hunt. + */ +public final class HypothesisStatus extends ExpandableStringEnum { + /** + * Static value Unknown for HypothesisStatus. + */ + public static final HypothesisStatus UNKNOWN = fromString("Unknown"); + + /** + * Static value Invalidated for HypothesisStatus. + */ + public static final HypothesisStatus INVALIDATED = fromString("Invalidated"); + + /** + * Static value Validated for HypothesisStatus. + */ + 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. + */ + @JsonCreator + 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..258538046890 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Identity.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an identity in Azure Security Insights. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = Identity.class, visible = true) +@JsonTypeName("Identity") +@Immutable +public final class Identity extends TIObjectInner { + /* + * The kind of the TI object + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private TIObjectKind kind = TIObjectKind.IDENTITY; + + /** + * Creates an instance of Identity class. + */ + public Identity() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + @Override + public TIObjectKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incident.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Incident.java index 2d051e853f0f..0e2dcb234b6f 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 @@ -12,605 +12,641 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of Incident. */ +/** + * An immutable client-side representation of Incident. + */ public interface Incident { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** - * Gets the additionalData property: Additional data on the incident. - * - * @return the additionalData value. - */ - IncidentAdditionalData additionalData(); - - /** - * Gets the classification property: The reason the incident was closed. - * - * @return the classification value. + * Gets the title property: The title of the incident. + * + * @return the title value. */ - IncidentClassification classification(); + String title(); /** - * Gets the classificationComment property: Describes the reason the incident was closed. - * - * @return the classificationComment value. + * Gets the description property: The description of the incident. + * + * @return the description value. */ - String classificationComment(); + String description(); /** - * Gets the classificationReason property: The classification reason the incident was closed with. - * - * @return the classificationReason value. + * Gets the severity property: The severity of the incident. + * + * @return the severity value. */ - IncidentClassificationReason classificationReason(); + IncidentSeverity severity(); /** - * Gets the createdTimeUtc property: The time the incident was created. - * - * @return the createdTimeUtc value. + * Gets the status property: The status of the incident. + * + * @return the status value. */ - OffsetDateTime createdTimeUtc(); + IncidentStatus status(); /** - * Gets the description property: The description of the incident. - * - * @return the description value. + * Gets the classification property: The reason the incident was closed. + * + * @return the classification value. */ - String description(); + IncidentClassification classification(); /** - * Gets the firstActivityTimeUtc property: The time of the first activity in the incident. - * - * @return the firstActivityTimeUtc value. + * Gets the classificationReason property: The classification reason the incident was closed with. + * + * @return the classificationReason value. */ - OffsetDateTime firstActivityTimeUtc(); + IncidentClassificationReason classificationReason(); /** - * Gets the incidentUrl property: The deep-link url to the incident in Azure portal. - * - * @return the incidentUrl value. + * Gets the classificationComment property: Describes the reason the incident was closed. + * + * @return the classificationComment value. */ - String incidentUrl(); + String classificationComment(); /** - * Gets the incidentNumber property: A sequential number. - * - * @return the incidentNumber value. + * Gets the owner property: Describes a user that the incident is assigned to. + * + * @return the owner value. */ - Integer incidentNumber(); + IncidentOwnerInfo owner(); /** * Gets the labels property: List of labels relevant to this incident. - * + * * @return the labels value. */ List labels(); /** - * Gets the providerName property: The name of the source provider that generated the incident. - * - * @return the providerName value. - */ - String providerName(); - - /** - * Gets the providerIncidentId property: The incident ID assigned by the incident provider. - * - * @return the providerIncidentId value. + * Gets the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @return the firstActivityTimeUtc value. */ - String providerIncidentId(); + OffsetDateTime firstActivityTimeUtc(); /** * Gets the lastActivityTimeUtc property: The time of the last activity in the incident. - * + * * @return the lastActivityTimeUtc value. */ OffsetDateTime lastActivityTimeUtc(); /** * Gets the lastModifiedTimeUtc property: The last time the incident was updated. - * + * * @return the lastModifiedTimeUtc value. */ OffsetDateTime lastModifiedTimeUtc(); /** - * Gets the owner property: Describes a user that the incident is assigned to. - * - * @return the owner value. + * Gets the createdTimeUtc property: The time the incident was created. + * + * @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. - * + * * @return the relatedAnalyticRuleIds value. */ List relatedAnalyticRuleIds(); /** - * Gets the severity property: The severity of the incident. - * - * @return the severity value. + * Gets the incidentUrl property: The deep-link url to the incident in Azure portal. + * + * @return the incidentUrl value. */ - IncidentSeverity severity(); + String incidentUrl(); /** - * Gets the status property: The status of the incident. - * - * @return the status value. + * Gets the providerName property: The name of the source provider that generated the incident. + * + * @return the providerName value. */ - IncidentStatus status(); + String providerName(); /** - * Gets the teamInformation property: Describes a team for the incident. - * - * @return the teamInformation value. + * Gets the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @return the providerIncidentId value. */ - TeamInformation teamInformation(); + String providerIncidentId(); /** - * Gets the title property: The title of the incident. - * - * @return the title value. + * Gets the teamInformation property: Describes a team for the incident. + * + * @return the teamInformation value. */ - String title(); + TeamInformation teamInformation(); /** * 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.IncidentInner object. - * + * * @return the inner object. */ IncidentInner innerModel(); - /** The entirety of the Incident definition. */ + /** + * The entirety of the Incident definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The Incident definition stages. */ + + /** + * The Incident definition stages. + */ interface DefinitionStages { - /** The first stage of the Incident definition. */ + /** + * The first stage of the Incident definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Incident definition allowing to specify parent resource. */ + + /** + * The stage of the Incident definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** * The stage of the Incident definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithEtag, - DefinitionStages.WithClassification, - DefinitionStages.WithClassificationComment, - DefinitionStages.WithClassificationReason, - DefinitionStages.WithDescription, - DefinitionStages.WithFirstActivityTimeUtc, - DefinitionStages.WithLabels, - DefinitionStages.WithProviderName, - DefinitionStages.WithProviderIncidentId, - DefinitionStages.WithLastActivityTimeUtc, - DefinitionStages.WithOwner, - DefinitionStages.WithSeverity, - DefinitionStages.WithStatus, - DefinitionStages.WithTeamInformation, - DefinitionStages.WithTitle { + 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. - * + * * @return the created resource. */ Incident create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Incident create(Context context); } - /** The stage of the Incident definition allowing to specify etag. */ + + /** + * The stage of the Incident definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the Incident definition allowing to specify classification. */ - interface WithClassification { - /** - * Specifies the classification property: The reason the incident was closed. - * - * @param classification The reason the incident was closed. - * @return the next definition stage. - */ - WithCreate withClassification(IncidentClassification classification); - } - /** The stage of the Incident definition allowing to specify classificationComment. */ - interface WithClassificationComment { - /** - * Specifies the classificationComment property: Describes the reason the incident was closed. - * - * @param classificationComment Describes the reason the incident was closed. - * @return the next definition stage. - */ - WithCreate withClassificationComment(String classificationComment); - } - /** The stage of the Incident definition allowing to specify classificationReason. */ - interface WithClassificationReason { + + /** + * The stage of the Incident definition allowing to specify title. + */ + interface WithTitle { /** - * Specifies the classificationReason property: The classification reason the incident was closed with. - * - * @param classificationReason The classification reason the incident was closed with. + * Specifies the title property: The title of the incident. + * + * @param title The title of the incident. * @return the next definition stage. */ - WithCreate withClassificationReason(IncidentClassificationReason classificationReason); + WithCreate withTitle(String title); } - /** The stage of the Incident definition allowing to specify description. */ + + /** + * The stage of the Incident definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: The description of the incident. - * + * * @param description The description of the incident. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the Incident definition allowing to specify firstActivityTimeUtc. */ - interface WithFirstActivityTimeUtc { + + /** + * The stage of the Incident definition allowing to specify severity. + */ + interface WithSeverity { /** - * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. - * - * @param firstActivityTimeUtc The time of the first activity in the incident. + * Specifies the severity property: The severity of the incident. + * + * @param severity The severity of the incident. * @return the next definition stage. */ - WithCreate withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); + WithCreate withSeverity(IncidentSeverity severity); } - /** The stage of the Incident definition allowing to specify labels. */ - interface WithLabels { + + /** + * The stage of the Incident definition allowing to specify status. + */ + interface WithStatus { /** - * Specifies the labels property: List of labels relevant to this incident. - * - * @param labels List of labels relevant to this incident. + * Specifies the status property: The status of the incident. + * + * @param status The status of the incident. * @return the next definition stage. */ - WithCreate withLabels(List labels); + WithCreate withStatus(IncidentStatus status); } - /** The stage of the Incident definition allowing to specify providerName. */ - interface WithProviderName { + + /** + * The stage of the Incident definition allowing to specify classification. + */ + interface WithClassification { /** - * Specifies the providerName property: The name of the source provider that generated the incident. - * - * @param providerName The name of the source provider that generated the incident. + * Specifies the classification property: The reason the incident was closed. + * + * @param classification The reason the incident was closed. * @return the next definition stage. */ - WithCreate withProviderName(String providerName); + WithCreate withClassification(IncidentClassification classification); } - /** The stage of the Incident definition allowing to specify providerIncidentId. */ - interface WithProviderIncidentId { + + /** + * The stage of the Incident definition allowing to specify classificationReason. + */ + interface WithClassificationReason { /** - * Specifies the providerIncidentId property: The incident ID assigned by the incident provider. - * - * @param providerIncidentId The incident ID assigned by the incident provider. + * Specifies the classificationReason property: The classification reason the incident was closed with. + * + * @param classificationReason The classification reason the incident was closed with. * @return the next definition stage. */ - WithCreate withProviderIncidentId(String providerIncidentId); + WithCreate withClassificationReason(IncidentClassificationReason classificationReason); } - /** The stage of the Incident definition allowing to specify lastActivityTimeUtc. */ - interface WithLastActivityTimeUtc { + + /** + * The stage of the Incident definition allowing to specify classificationComment. + */ + interface WithClassificationComment { /** - * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. - * - * @param lastActivityTimeUtc The time of the last activity in the incident. + * Specifies the classificationComment property: Describes the reason the incident was closed. + * + * @param classificationComment Describes the reason the incident was closed. * @return the next definition stage. */ - WithCreate withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); + WithCreate withClassificationComment(String classificationComment); } - /** The stage of the Incident definition allowing to specify owner. */ + + /** + * The stage of the Incident definition allowing to specify owner. + */ interface WithOwner { /** * Specifies the owner property: Describes a user that the incident is assigned to. - * + * * @param owner Describes a user that the incident is assigned to. * @return the next definition stage. */ WithCreate withOwner(IncidentOwnerInfo owner); } - /** The stage of the Incident definition allowing to specify severity. */ - interface WithSeverity { + + /** + * The stage of the Incident definition allowing to specify labels. + */ + interface WithLabels { /** - * Specifies the severity property: The severity of the incident. - * - * @param severity The severity of the incident. + * Specifies the labels property: List of labels relevant to this incident. + * + * @param labels List of labels relevant to this incident. * @return the next definition stage. */ - WithCreate withSeverity(IncidentSeverity severity); + WithCreate withLabels(List labels); } - /** The stage of the Incident definition allowing to specify status. */ - interface WithStatus { + + /** + * The stage of the Incident definition allowing to specify firstActivityTimeUtc. + */ + interface WithFirstActivityTimeUtc { /** - * Specifies the status property: The status of the incident. - * - * @param status The status of the incident. + * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @param firstActivityTimeUtc The time of the first activity in the incident. * @return the next definition stage. */ - WithCreate withStatus(IncidentStatus status); + WithCreate withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); } - /** The stage of the Incident definition allowing to specify teamInformation. */ - interface WithTeamInformation { + + /** + * The stage of the Incident definition allowing to specify lastActivityTimeUtc. + */ + interface WithLastActivityTimeUtc { /** - * Specifies the teamInformation property: Describes a team for the incident. - * - * @param teamInformation Describes a team for the incident. + * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @param lastActivityTimeUtc The time of the last activity in the incident. * @return the next definition stage. */ - WithCreate withTeamInformation(TeamInformationInner teamInformation); + WithCreate withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); } - /** The stage of the Incident definition allowing to specify title. */ - interface WithTitle { + + /** + * The stage of the Incident definition allowing to specify teamInformation. + */ + interface WithTeamInformation { /** - * Specifies the title property: The title of the incident. - * - * @param title The title of the incident. + * Specifies the teamInformation property: Describes a team for the incident. + * + * @param teamInformation Describes a team for the incident. * @return the next definition stage. */ - WithCreate withTitle(String title); + WithCreate withTeamInformation(TeamInformationInner teamInformation); } } + /** * Begins update for the Incident resource. - * + * * @return the stage of resource update. */ Incident.Update update(); - /** The template for Incident update. */ + /** + * The template for Incident update. + */ interface Update - extends UpdateStages.WithEtag, - UpdateStages.WithClassification, - UpdateStages.WithClassificationComment, - UpdateStages.WithClassificationReason, - UpdateStages.WithDescription, - UpdateStages.WithFirstActivityTimeUtc, - UpdateStages.WithLabels, - UpdateStages.WithProviderName, - UpdateStages.WithProviderIncidentId, - UpdateStages.WithLastActivityTimeUtc, - UpdateStages.WithOwner, - UpdateStages.WithSeverity, - UpdateStages.WithStatus, - UpdateStages.WithTeamInformation, - UpdateStages.WithTitle { + 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. - * + * * @return the updated resource. */ Incident apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Incident apply(Context context); } - /** The Incident update stages. */ + + /** + * The Incident update stages. + */ interface UpdateStages { - /** The stage of the Incident update allowing to specify etag. */ + /** + * The stage of the Incident update allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ Update withEtag(String etag); } - /** The stage of the Incident update allowing to specify classification. */ - interface WithClassification { - /** - * Specifies the classification property: The reason the incident was closed. - * - * @param classification The reason the incident was closed. - * @return the next definition stage. - */ - Update withClassification(IncidentClassification classification); - } - /** The stage of the Incident update allowing to specify classificationComment. */ - interface WithClassificationComment { - /** - * Specifies the classificationComment property: Describes the reason the incident was closed. - * - * @param classificationComment Describes the reason the incident was closed. - * @return the next definition stage. - */ - Update withClassificationComment(String classificationComment); - } - /** The stage of the Incident update allowing to specify classificationReason. */ - interface WithClassificationReason { + + /** + * The stage of the Incident update allowing to specify title. + */ + interface WithTitle { /** - * Specifies the classificationReason property: The classification reason the incident was closed with. - * - * @param classificationReason The classification reason the incident was closed with. + * Specifies the title property: The title of the incident. + * + * @param title The title of the incident. * @return the next definition stage. */ - Update withClassificationReason(IncidentClassificationReason classificationReason); + Update withTitle(String title); } - /** The stage of the Incident update allowing to specify description. */ + + /** + * The stage of the Incident update allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: The description of the incident. - * + * * @param description The description of the incident. * @return the next definition stage. */ Update withDescription(String description); } - /** The stage of the Incident update allowing to specify firstActivityTimeUtc. */ - interface WithFirstActivityTimeUtc { + + /** + * The stage of the Incident update allowing to specify severity. + */ + interface WithSeverity { /** - * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. - * - * @param firstActivityTimeUtc The time of the first activity in the incident. + * Specifies the severity property: The severity of the incident. + * + * @param severity The severity of the incident. * @return the next definition stage. */ - Update withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); + Update withSeverity(IncidentSeverity severity); } - /** The stage of the Incident update allowing to specify labels. */ - interface WithLabels { + + /** + * The stage of the Incident update allowing to specify status. + */ + interface WithStatus { /** - * Specifies the labels property: List of labels relevant to this incident. - * - * @param labels List of labels relevant to this incident. + * Specifies the status property: The status of the incident. + * + * @param status The status of the incident. * @return the next definition stage. */ - Update withLabels(List labels); + Update withStatus(IncidentStatus status); } - /** The stage of the Incident update allowing to specify providerName. */ - interface WithProviderName { + + /** + * The stage of the Incident update allowing to specify classification. + */ + interface WithClassification { /** - * Specifies the providerName property: The name of the source provider that generated the incident. - * - * @param providerName The name of the source provider that generated the incident. + * Specifies the classification property: The reason the incident was closed. + * + * @param classification The reason the incident was closed. * @return the next definition stage. */ - Update withProviderName(String providerName); + Update withClassification(IncidentClassification classification); } - /** The stage of the Incident update allowing to specify providerIncidentId. */ - interface WithProviderIncidentId { + + /** + * The stage of the Incident update allowing to specify classificationReason. + */ + interface WithClassificationReason { /** - * Specifies the providerIncidentId property: The incident ID assigned by the incident provider. - * - * @param providerIncidentId The incident ID assigned by the incident provider. + * Specifies the classificationReason property: The classification reason the incident was closed with. + * + * @param classificationReason The classification reason the incident was closed with. * @return the next definition stage. */ - Update withProviderIncidentId(String providerIncidentId); + Update withClassificationReason(IncidentClassificationReason classificationReason); } - /** The stage of the Incident update allowing to specify lastActivityTimeUtc. */ - interface WithLastActivityTimeUtc { + + /** + * The stage of the Incident update allowing to specify classificationComment. + */ + interface WithClassificationComment { /** - * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. - * - * @param lastActivityTimeUtc The time of the last activity in the incident. + * Specifies the classificationComment property: Describes the reason the incident was closed. + * + * @param classificationComment Describes the reason the incident was closed. * @return the next definition stage. */ - Update withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); + Update withClassificationComment(String classificationComment); } - /** The stage of the Incident update allowing to specify owner. */ + + /** + * The stage of the Incident update allowing to specify owner. + */ interface WithOwner { /** * Specifies the owner property: Describes a user that the incident is assigned to. - * + * * @param owner Describes a user that the incident is assigned to. * @return the next definition stage. */ Update withOwner(IncidentOwnerInfo owner); } - /** The stage of the Incident update allowing to specify severity. */ - interface WithSeverity { + + /** + * The stage of the Incident update allowing to specify labels. + */ + interface WithLabels { /** - * Specifies the severity property: The severity of the incident. - * - * @param severity The severity of the incident. + * Specifies the labels property: List of labels relevant to this incident. + * + * @param labels List of labels relevant to this incident. * @return the next definition stage. */ - Update withSeverity(IncidentSeverity severity); + Update withLabels(List labels); } - /** The stage of the Incident update allowing to specify status. */ - interface WithStatus { + + /** + * The stage of the Incident update allowing to specify firstActivityTimeUtc. + */ + interface WithFirstActivityTimeUtc { /** - * Specifies the status property: The status of the incident. - * - * @param status The status of the incident. + * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @param firstActivityTimeUtc The time of the first activity in the incident. * @return the next definition stage. */ - Update withStatus(IncidentStatus status); + Update withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); } - /** The stage of the Incident update allowing to specify teamInformation. */ - interface WithTeamInformation { + + /** + * The stage of the Incident update allowing to specify lastActivityTimeUtc. + */ + interface WithLastActivityTimeUtc { /** - * Specifies the teamInformation property: Describes a team for the incident. - * - * @param teamInformation Describes a team for the incident. + * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. + * + * @param lastActivityTimeUtc The time of the last activity in the incident. * @return the next definition stage. */ - Update withTeamInformation(TeamInformationInner teamInformation); + Update withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); } - /** The stage of the Incident update allowing to specify title. */ - interface WithTitle { + + /** + * The stage of the Incident update allowing to specify teamInformation. + */ + interface WithTeamInformation { /** - * Specifies the title property: The title of the incident. - * - * @param title The title of the incident. + * Specifies the teamInformation property: Describes a team for the incident. + * + * @param teamInformation Describes a team for the incident. * @return the next definition stage. */ - Update withTitle(String title); + Update withTeamInformation(TeamInformationInner teamInformation); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Incident refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -618,39 +654,30 @@ interface WithTitle { /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param teamProperties Team properties. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes team information. + * @return describes team information along with {@link Response}. */ - TeamInformation createTeam(TeamProperties teamProperties); + Response createTeamWithResponse(TeamInformationInner teamProperties, Context context); /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param teamProperties Team properties. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes team information along with {@link Response}. - */ - Response createTeamWithResponse(TeamProperties teamProperties, Context context); - - /** - * Gets all incident alerts. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident alerts. + * @return describes team information. */ - IncidentAlertList listAlerts(); + TeamInformation createTeam(TeamInformationInner teamProperties); /** * Gets all incident alerts. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -660,17 +687,17 @@ interface WithTitle { Response listAlertsWithResponse(Context context); /** - * Gets all incident bookmarks. - * + * Gets all incident alerts. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident bookmarks. + * @return all incident alerts. */ - IncidentBookmarkList listBookmarks(); + IncidentAlertList listAlerts(); /** * Gets all incident bookmarks. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -680,17 +707,17 @@ interface WithTitle { Response listBookmarksWithResponse(Context context); /** - * Gets all incident related entities. - * + * Gets all incident bookmarks. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident related entities. + * @return all incident bookmarks. */ - IncidentEntitiesResponse listEntities(); + IncidentBookmarkList listBookmarks(); /** * Gets all incident related entities. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -698,4 +725,13 @@ interface WithTitle { * @return all incident related entities along with {@link Response}. */ Response listEntitiesWithResponse(Context context); + + /** + * Gets all incident related entities. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident related entities. + */ + IncidentEntitiesResponse listEntities(); } 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 f86ce54b9f24..3aa53b16f3c2 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Incident additional data property bag. */ +/** + * Incident additional data property bag. + */ @Immutable public final class IncidentAdditionalData { /* @@ -35,12 +37,6 @@ public final class IncidentAdditionalData { @JsonProperty(value = "alertProductNames", access = JsonProperty.Access.WRITE_ONLY) private List alertProductNames; - /* - * The provider incident url to the incident in Microsoft 365 Defender portal - */ - @JsonProperty(value = "providerIncidentUrl", access = JsonProperty.Access.WRITE_ONLY) - private String providerIncidentUrl; - /* * The tactics associated with incident */ @@ -48,14 +44,26 @@ public final class IncidentAdditionalData { private List tactics; /* - * The techniques associated with incident's tactics' + * The techniques associated with incident's tactics */ @JsonProperty(value = "techniques", access = JsonProperty.Access.WRITE_ONLY) private List techniques; + /* + * The provider incident url to the incident in Microsoft 365 Defender portal + */ + @JsonProperty(value = "providerIncidentUrl", access = JsonProperty.Access.WRITE_ONLY) + private String providerIncidentUrl; + + /** + * Creates an instance of IncidentAdditionalData class. + */ + public IncidentAdditionalData() { + } + /** * Get the alertsCount property: The number of alerts in the incident. - * + * * @return the alertsCount value. */ public Integer alertsCount() { @@ -64,7 +72,7 @@ public Integer alertsCount() { /** * Get the bookmarksCount property: The number of bookmarks in the incident. - * + * * @return the bookmarksCount value. */ public Integer bookmarksCount() { @@ -73,7 +81,7 @@ public Integer bookmarksCount() { /** * Get the commentsCount property: The number of comments in the incident. - * + * * @return the commentsCount value. */ public Integer commentsCount() { @@ -82,25 +90,16 @@ public Integer commentsCount() { /** * Get the alertProductNames property: List of product names of alerts in the incident. - * + * * @return the alertProductNames value. */ public List alertProductNames() { return this.alertProductNames; } - /** - * Get the 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 tactics property: The tactics associated with incident. - * + * * @return the tactics value. */ public List tactics() { @@ -108,17 +107,26 @@ public List tactics() { } /** - * Get the techniques property: The techniques associated with incident's tactics'. - * + * 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAlertList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAlertList.java index afbf75330535..07c903080c0c 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 @@ -7,18 +7,20 @@ import com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner; import java.util.List; -/** An immutable client-side representation of IncidentAlertList. */ +/** + * An immutable client-side representation of IncidentAlertList. + */ public interface IncidentAlertList { /** * Gets the value property: Array of incident alerts. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner object. - * + * * @return the inner object. */ IncidentAlertListInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentBookmarkList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentBookmarkList.java index 8bcb3e64a075..317dafc7fae7 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 @@ -7,18 +7,20 @@ import com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner; import java.util.List; -/** An immutable client-side representation of IncidentBookmarkList. */ +/** + * An immutable client-side representation of IncidentBookmarkList. + */ public interface IncidentBookmarkList { /** * Gets the value property: Array of incident bookmarks. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner object. - * + * * @return the inner object. */ IncidentBookmarkListInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassification.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassification.java index 400aa8f0d0c4..a8ab4fc8ebe8 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The reason the incident was closed. */ +/** + * The reason the incident was closed. + */ public final class IncidentClassification extends ExpandableStringEnum { - /** Static value Undetermined for IncidentClassification. */ + /** + * Static value Undetermined for IncidentClassification. + */ public static final IncidentClassification UNDETERMINED = fromString("Undetermined"); - /** Static value TruePositive for IncidentClassification. */ + /** + * Static value TruePositive for IncidentClassification. + */ public static final IncidentClassification TRUE_POSITIVE = fromString("TruePositive"); - /** Static value BenignPositive for IncidentClassification. */ + /** + * Static value BenignPositive for IncidentClassification. + */ public static final IncidentClassification BENIGN_POSITIVE = fromString("BenignPositive"); - /** Static value FalsePositive for IncidentClassification. */ + /** + * Static value FalsePositive for IncidentClassification. + */ public static final IncidentClassification FALSE_POSITIVE = fromString("FalsePositive"); + /** + * Creates a new instance of IncidentClassification value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IncidentClassification() { + } + /** * Creates or finds a IncidentClassification from its string representation. - * + * * @param name a name to look for. * @return the corresponding IncidentClassification. */ @@ -35,7 +54,7 @@ public static IncidentClassification fromString(String name) { /** * Gets known IncidentClassification values. - * + * * @return known IncidentClassification values. */ public static Collection values() { 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 89ed586fd181..d58d6162492a 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The classification reason the incident was closed with. */ +/** + * The classification reason the incident was closed with. + */ public final class IncidentClassificationReason extends ExpandableStringEnum { - /** Static value SuspiciousActivity for IncidentClassificationReason. */ + /** + * Static value SuspiciousActivity for IncidentClassificationReason. + */ public static final IncidentClassificationReason SUSPICIOUS_ACTIVITY = fromString("SuspiciousActivity"); - /** Static value SuspiciousButExpected for IncidentClassificationReason. */ + /** + * Static value SuspiciousButExpected for IncidentClassificationReason. + */ public static final IncidentClassificationReason SUSPICIOUS_BUT_EXPECTED = fromString("SuspiciousButExpected"); - /** Static value IncorrectAlertLogic for IncidentClassificationReason. */ + /** + * Static value IncorrectAlertLogic for IncidentClassificationReason. + */ public static final IncidentClassificationReason INCORRECT_ALERT_LOGIC = fromString("IncorrectAlertLogic"); - /** Static value InaccurateData for IncidentClassificationReason. */ + /** + * Static value InaccurateData for IncidentClassificationReason. + */ public static final IncidentClassificationReason INACCURATE_DATA = fromString("InaccurateData"); + /** + * Creates a new instance of IncidentClassificationReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IncidentClassificationReason() { + } + /** * Creates or finds a IncidentClassificationReason from its string representation. - * + * * @param name a name to look for. * @return the corresponding IncidentClassificationReason. */ @@ -35,7 +54,7 @@ public static IncidentClassificationReason fromString(String name) { /** * Gets known IncidentClassificationReason values. - * + * * @return known IncidentClassificationReason values. */ public static Collection values() { 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 0385b56f71c1..2a5a616aefda 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 @@ -9,99 +9,111 @@ import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of IncidentComment. */ +/** + * An immutable client-side representation of IncidentComment. + */ public interface IncidentComment { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the message property: The comment message. + * + * @return the message value. + */ + String message(); + /** * Gets the createdTimeUtc property: The time the comment was created. - * + * * @return the createdTimeUtc value. */ OffsetDateTime createdTimeUtc(); /** * Gets the lastModifiedTimeUtc property: The time the comment was updated. - * + * * @return the lastModifiedTimeUtc value. */ OffsetDateTime lastModifiedTimeUtc(); - /** - * Gets the message property: The comment message. - * - * @return the message value. - */ - String message(); - /** * Gets the author property: Describes the client that created the comment. - * + * * @return the author value. */ ClientInfo author(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner object. - * + * * @return the inner object. */ IncidentCommentInner innerModel(); - /** The entirety of the IncidentComment definition. */ + /** + * The entirety of the IncidentComment definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The IncidentComment definition stages. */ + + /** + * The IncidentComment definition stages. + */ interface DefinitionStages { - /** The first stage of the IncidentComment definition. */ + /** + * The first stage of the IncidentComment definition. + */ interface Blank extends WithParentResource { } - /** The stage of the IncidentComment definition allowing to specify parent resource. */ + + /** + * The stage of the IncidentComment definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName, incidentId. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -109,6 +121,7 @@ interface WithParentResource { */ WithCreate withExistingIncident(String resourceGroupName, String workspaceName, String incidentId); } + /** * The stage of the IncidentComment definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -116,97 +129,115 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithMessage { /** * Executes the create request. - * + * * @return the created resource. */ IncidentComment create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ IncidentComment create(Context context); } - /** The stage of the IncidentComment definition allowing to specify etag. */ + + /** + * The stage of the IncidentComment definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the IncidentComment definition allowing to specify message. */ + + /** + * The stage of the IncidentComment definition allowing to specify message. + */ interface WithMessage { /** * Specifies the message property: The comment message. - * + * * @param message The comment message. * @return the next definition stage. */ WithCreate withMessage(String message); } } + /** * Begins update for the IncidentComment resource. - * + * * @return the stage of resource update. */ IncidentComment.Update update(); - /** The template for IncidentComment update. */ + /** + * The template for IncidentComment update. + */ interface Update extends UpdateStages.WithEtag, UpdateStages.WithMessage { /** * Executes the update request. - * + * * @return the updated resource. */ IncidentComment apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ IncidentComment apply(Context context); } - /** The IncidentComment update stages. */ + + /** + * The IncidentComment update stages. + */ interface UpdateStages { - /** The stage of the IncidentComment update allowing to specify etag. */ + /** + * The stage of the IncidentComment update allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ Update withEtag(String etag); } - /** The stage of the IncidentComment update allowing to specify message. */ + + /** + * The stage of the IncidentComment update allowing to specify message. + */ interface WithMessage { /** * Specifies the message property: The comment message. - * + * * @param message The comment message. * @return the next definition stage. */ Update withMessage(String message); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ IncidentComment refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentCommentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentCommentList.java index 2304ded52a75..9efd79ae211a 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/models/IncidentCommentList.java @@ -10,33 +10,32 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of incident comments. */ +/** + * The IncidentCommentList model. + */ @Fluent public final class IncidentCommentList { /* - * URL to fetch the next set of comments. + * The value property. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; + @JsonProperty(value = "value", required = true) + private List value; /* - * Array of comments. + * The nextLink property. */ - @JsonProperty(value = "value", required = true) - private List value; + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; /** - * Get the nextLink property: URL to fetch the next set of comments. - * - * @return the nextLink value. + * Creates an instance of IncidentCommentList class. */ - public String nextLink() { - return this.nextLink; + public IncidentCommentList() { } /** - * Get the value property: Array of comments. - * + * Get the value property: The value property. + * * @return the value value. */ public List value() { @@ -44,8 +43,8 @@ public List value() { } /** - * Set the value property: Array of comments. - * + * Set the value property: The value property. + * * @param value the value value to set. * @return the IncidentCommentList object itself. */ @@ -54,16 +53,24 @@ public IncidentCommentList withValue(List value) { return this; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model IncidentCommentList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model IncidentCommentList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComments.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComments.java index 3e39bb7cd39c..da1cb988f9dc 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of IncidentComments. */ +/** + * Resource collection API of IncidentComments. + */ public interface IncidentComments { /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -25,7 +27,7 @@ public interface IncidentComments { /** * Gets all incident comments. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -33,86 +35,79 @@ public interface IncidentComments { * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all incident comments as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String incidentId, - String filter, - String orderby, - Integer top, - String skipToken, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + String filter, String orderby, Integer top, String skipToken, Context context); /** * Gets an incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident comment. + * @return an incident comment along with {@link Response}. */ - IncidentComment get(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, Context context); /** * Gets an incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident comment along with {@link Response}. + * @return an incident comment. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context); + IncidentComment get(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); /** * Delete the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, Context context); /** * Delete the incident comment. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 incidentCommentId, Context context); + void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); /** * 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. @@ -123,7 +118,7 @@ Response deleteWithResponse( /** * 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. @@ -135,7 +130,7 @@ Response deleteWithResponse( /** * Delete the incident comment. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -145,7 +140,7 @@ Response deleteWithResponse( /** * Delete the incident comment. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -157,7 +152,7 @@ Response deleteWithResponse( /** * Begins definition for a new IncidentComment resource. - * + * * @param name resource name. * @return the first stage of the new IncidentComment definition. */ 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 3746be98a60a..f9ecadc8d66c 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Incident Configuration property bag. */ +/** + * Incident Configuration property bag. + */ @Fluent public final class IncidentConfiguration { /* @@ -22,9 +24,15 @@ public final class IncidentConfiguration { @JsonProperty(value = "groupingConfiguration") private GroupingConfiguration groupingConfiguration; + /** + * Creates an instance of IncidentConfiguration class. + */ + public IncidentConfiguration() { + } + /** * Get the createIncident property: Create incidents from alerts triggered by this analytics rule. - * + * * @return the createIncident value. */ public boolean createIncident() { @@ -33,7 +41,7 @@ public boolean createIncident() { /** * Set the createIncident property: Create incidents from alerts triggered by this analytics rule. - * + * * @param createIncident the createIncident value to set. * @return the IncidentConfiguration object itself. */ @@ -45,7 +53,7 @@ public IncidentConfiguration withCreateIncident(boolean createIncident) { /** * Get the groupingConfiguration property: Set how the alerts that are triggered by this analytics rule, are grouped * into incidents. - * + * * @return the groupingConfiguration value. */ public GroupingConfiguration groupingConfiguration() { @@ -55,7 +63,7 @@ public GroupingConfiguration groupingConfiguration() { /** * Set the groupingConfiguration property: Set how the alerts that are triggered by this analytics rule, are grouped * into incidents. - * + * * @param groupingConfiguration the groupingConfiguration value to set. * @return the IncidentConfiguration object itself. */ @@ -66,7 +74,7 @@ public IncidentConfiguration withGroupingConfiguration(GroupingConfiguration gro /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResponse.java index 4e3fdd26852c..ba4c6c1154fd 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 @@ -7,25 +7,27 @@ import com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner; import java.util.List; -/** An immutable client-side representation of IncidentEntitiesResponse. */ +/** + * An immutable client-side representation of IncidentEntitiesResponse. + */ public interface IncidentEntitiesResponse { /** * Gets the entities property: Array of the incident related entities. - * + * * @return the entities value. */ List entities(); /** * Gets the metadata property: The metadata from the incident related entities results. - * + * * @return the metadata value. */ List metadata(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner object. - * + * * @return the inner object. */ IncidentEntitiesResponseInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResultsMetadata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResultsMetadata.java index f282c15e2c9d..6b3e59f98c2c 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 @@ -8,72 +8,79 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Information of a specific aggregation in the incident related entities result. */ +/** + * Information of a specific aggregation in the incident related entities result. + */ @Fluent public final class IncidentEntitiesResultsMetadata { + /* + * The kind of the aggregated entity. + */ + @JsonProperty(value = "entityKind", required = true) + private EntityKindEnum entityKind; + /* * Total number of aggregations of the given kind in the incident related entities result. */ @JsonProperty(value = "count", required = true) private int count; - /* - * The kind of the aggregated entity. + /** + * Creates an instance of IncidentEntitiesResultsMetadata class. */ - @JsonProperty(value = "entityKind", required = true) - private EntityKind entityKind; + public IncidentEntitiesResultsMetadata() { + } /** - * Get the count property: Total number of aggregations of the given kind in the incident related entities result. - * - * @return the count value. + * Get the entityKind property: The kind of the aggregated entity. + * + * @return the entityKind value. */ - public int count() { - return this.count; + public EntityKindEnum entityKind() { + return this.entityKind; } /** - * 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. + * Set the entityKind property: The kind of the aggregated entity. + * + * @param entityKind the entityKind value to set. * @return the IncidentEntitiesResultsMetadata object itself. */ - public IncidentEntitiesResultsMetadata withCount(int count) { - this.count = count; + public IncidentEntitiesResultsMetadata withEntityKind(EntityKindEnum entityKind) { + this.entityKind = entityKind; return this; } /** - * Get the entityKind property: The kind of the aggregated entity. - * - * @return the entityKind value. + * Get the count property: Total number of aggregations of the given kind in the incident related entities result. + * + * @return the count value. */ - public EntityKind entityKind() { - return this.entityKind; + public int count() { + return this.count; } /** - * Set the entityKind property: The kind of the aggregated entity. - * - * @param entityKind the entityKind value to set. + * Set the count property: Total number of aggregations of the given kind in the incident related entities result. + * + * @param count the count value to set. * @return the IncidentEntitiesResultsMetadata object itself. */ - public IncidentEntitiesResultsMetadata withEntityKind(EntityKind entityKind) { - this.entityKind = entityKind; + public IncidentEntitiesResultsMetadata withCount(int count) { + this.count = count; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (entityKind() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property entityKind in model IncidentEntitiesResultsMetadata")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property entityKind in model IncidentEntitiesResultsMetadata")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentInfo.java index e8ee0d18e29b..e9c019afb7b5 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes related incident information for the bookmark. */ +/** + * Describes related incident information for the bookmark. + */ @Fluent public final class IncidentInfo { /* @@ -34,9 +36,15 @@ public final class IncidentInfo { @JsonProperty(value = "relationName") private String relationName; + /** + * Creates an instance of IncidentInfo class. + */ + public IncidentInfo() { + } + /** * Get the incidentId property: Incident Id. - * + * * @return the incidentId value. */ public String incidentId() { @@ -45,7 +53,7 @@ public String incidentId() { /** * Set the incidentId property: Incident Id. - * + * * @param incidentId the incidentId value to set. * @return the IncidentInfo object itself. */ @@ -56,7 +64,7 @@ public IncidentInfo withIncidentId(String incidentId) { /** * Get the severity property: The severity of the incident. - * + * * @return the severity value. */ public IncidentSeverity severity() { @@ -65,7 +73,7 @@ public IncidentSeverity severity() { /** * Set the severity property: The severity of the incident. - * + * * @param severity the severity value to set. * @return the IncidentInfo object itself. */ @@ -76,7 +84,7 @@ public IncidentInfo withSeverity(IncidentSeverity severity) { /** * Get the title property: The title of the incident. - * + * * @return the title value. */ public String title() { @@ -85,7 +93,7 @@ public String title() { /** * Set the title property: The title of the incident. - * + * * @param title the title value to set. * @return the IncidentInfo object itself. */ @@ -96,7 +104,7 @@ public IncidentInfo withTitle(String title) { /** * Get the relationName property: Relation Name. - * + * * @return the relationName value. */ public String relationName() { @@ -105,7 +113,7 @@ public String relationName() { /** * Set the relationName property: Relation Name. - * + * * @param relationName the relationName value to set. * @return the IncidentInfo object itself. */ @@ -116,7 +124,7 @@ public IncidentInfo withRelationName(String relationName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabel.java index c24c4a8522ea..eb617a0c0ca7 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents an incident label. */ +/** + * Represents an incident label. + */ @Fluent public final class IncidentLabel { /* @@ -23,9 +25,15 @@ public final class IncidentLabel { @JsonProperty(value = "labelType", access = JsonProperty.Access.WRITE_ONLY) private IncidentLabelType labelType; + /** + * Creates an instance of IncidentLabel class. + */ + public IncidentLabel() { + } + /** * Get the labelName property: The name of the label. - * + * * @return the labelName value. */ public String labelName() { @@ -34,7 +42,7 @@ public String labelName() { /** * Set the labelName property: The name of the label. - * + * * @param labelName the labelName value to set. * @return the IncidentLabel object itself. */ @@ -45,7 +53,7 @@ public IncidentLabel withLabelName(String labelName) { /** * Get the labelType property: The type of the label. - * + * * @return the labelType value. */ public IncidentLabelType labelType() { @@ -54,14 +62,13 @@ public IncidentLabelType labelType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (labelName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property labelName in model IncidentLabel")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property labelName in model IncidentLabel")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabelType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabelType.java index 19999e0261f6..644a4eb9100e 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the label. */ +/** + * The type of the label. + */ public final class IncidentLabelType extends ExpandableStringEnum { - /** Static value User for IncidentLabelType. */ + /** + * Static value User for IncidentLabelType. + */ public static final IncidentLabelType USER = fromString("User"); - /** Static value AutoAssigned for IncidentLabelType. */ + /** + * Static value AutoAssigned for IncidentLabelType. + */ public static final IncidentLabelType AUTO_ASSIGNED = fromString("AutoAssigned"); + /** + * Creates a new instance of IncidentLabelType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IncidentLabelType() { + } + /** * Creates or finds a IncidentLabelType from its string representation. - * + * * @param name a name to look for. * @return the corresponding IncidentLabelType. */ @@ -29,7 +44,7 @@ public static IncidentLabelType fromString(String name) { /** * Gets known IncidentLabelType values. - * + * * @return known IncidentLabelType values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentList.java index 11cec266205d..4cc0fa616b2b 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/models/IncidentList.java @@ -10,33 +10,32 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the incidents. */ +/** + * List all the incidents. + */ @Fluent public final class IncidentList { /* - * URL to fetch the next set of incidents. + * The value property. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; + @JsonProperty(value = "value", required = true) + private List value; /* - * Array of incidents. + * URL to fetch the next set of incidents. */ - @JsonProperty(value = "value", required = true) - private List value; + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; /** - * Get the nextLink property: URL to fetch the next set of incidents. - * - * @return the nextLink value. + * Creates an instance of IncidentList class. */ - public String nextLink() { - return this.nextLink; + public IncidentList() { } /** - * Get the value property: Array of incidents. - * + * Get the value property: The value property. + * * @return the value value. */ public List value() { @@ -44,8 +43,8 @@ public List value() { } /** - * Set the value property: Array of incidents. - * + * Set the value property: The value property. + * * @param value the value value to set. * @return the IncidentList object itself. */ @@ -54,16 +53,24 @@ public IncidentList withValue(List value) { return this; } + /** + * Get the nextLink property: URL to fetch the next set of incidents. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model IncidentList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model IncidentList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentOwnerInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentOwnerInfo.java index dee86cc22860..03a7fdcd11f6 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; -/** Information on the user an incident is assigned to. */ +/** + * Information on the user an incident is assigned to. + */ @Fluent public final class IncidentOwnerInfo { /* @@ -41,9 +43,15 @@ public final class IncidentOwnerInfo { @JsonProperty(value = "ownerType") private OwnerType ownerType; + /** + * Creates an instance of IncidentOwnerInfo class. + */ + public IncidentOwnerInfo() { + } + /** * Get the email property: The email of the user the incident is assigned to. - * + * * @return the email value. */ public String email() { @@ -52,7 +60,7 @@ public String email() { /** * Set the email property: The email of the user the incident is assigned to. - * + * * @param email the email value to set. * @return the IncidentOwnerInfo object itself. */ @@ -63,7 +71,7 @@ public IncidentOwnerInfo withEmail(String email) { /** * Get the assignedTo property: The name of the user the incident is assigned to. - * + * * @return the assignedTo value. */ public String assignedTo() { @@ -72,7 +80,7 @@ public String assignedTo() { /** * Set the assignedTo property: The name of the user the incident is assigned to. - * + * * @param assignedTo the assignedTo value to set. * @return the IncidentOwnerInfo object itself. */ @@ -83,7 +91,7 @@ public IncidentOwnerInfo withAssignedTo(String assignedTo) { /** * Get the objectId property: The object id of the user the incident is assigned to. - * + * * @return the objectId value. */ public UUID objectId() { @@ -92,7 +100,7 @@ public UUID objectId() { /** * Set the objectId property: The object id of the user the incident is assigned to. - * + * * @param objectId the objectId value to set. * @return the IncidentOwnerInfo object itself. */ @@ -103,7 +111,7 @@ public IncidentOwnerInfo withObjectId(UUID objectId) { /** * Get the userPrincipalName property: The user principal name of the user the incident is assigned to. - * + * * @return the userPrincipalName value. */ public String userPrincipalName() { @@ -112,7 +120,7 @@ public String userPrincipalName() { /** * Set the userPrincipalName property: The user principal name of the user the incident is assigned to. - * + * * @param userPrincipalName the userPrincipalName value to set. * @return the IncidentOwnerInfo object itself. */ @@ -123,7 +131,7 @@ public IncidentOwnerInfo withUserPrincipalName(String userPrincipalName) { /** * Get the ownerType property: The type of the owner the incident is assigned to. - * + * * @return the ownerType value. */ public OwnerType ownerType() { @@ -132,7 +140,7 @@ public OwnerType ownerType() { /** * Set the ownerType property: The type of the owner the incident is assigned to. - * + * * @param ownerType the ownerType value to set. * @return the IncidentOwnerInfo object itself. */ @@ -143,7 +151,7 @@ public IncidentOwnerInfo withOwnerType(OwnerType ownerType) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentProperties.java index 924ddce626e4..dfa6713bca96 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentProperties.java @@ -8,151 +8,153 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of IncidentProperties. */ +/** + * An immutable client-side representation of IncidentProperties. + */ public interface IncidentProperties { /** - * Gets the additionalData property: Additional data on the incident. - * - * @return the additionalData value. - */ - IncidentAdditionalData additionalData(); - - /** - * Gets the classification property: The reason the incident was closed. - * - * @return the classification value. + * Gets the title property: The title of the incident. + * + * @return the title value. */ - IncidentClassification classification(); + String title(); /** - * Gets the classificationComment property: Describes the reason the incident was closed. - * - * @return the classificationComment value. + * Gets the description property: The description of the incident. + * + * @return the description value. */ - String classificationComment(); + String description(); /** - * Gets the classificationReason property: The classification reason the incident was closed with. - * - * @return the classificationReason value. + * Gets the severity property: The severity of the incident. + * + * @return the severity value. */ - IncidentClassificationReason classificationReason(); + IncidentSeverity severity(); /** - * Gets the createdTimeUtc property: The time the incident was created. - * - * @return the createdTimeUtc value. + * Gets the status property: The status of the incident. + * + * @return the status value. */ - OffsetDateTime createdTimeUtc(); + IncidentStatus status(); /** - * Gets the description property: The description of the incident. - * - * @return the description value. + * Gets the classification property: The reason the incident was closed. + * + * @return the classification value. */ - String description(); + IncidentClassification classification(); /** - * Gets the firstActivityTimeUtc property: The time of the first activity in the incident. - * - * @return the firstActivityTimeUtc value. + * Gets the classificationReason property: The classification reason the incident was closed with. + * + * @return the classificationReason value. */ - OffsetDateTime firstActivityTimeUtc(); + IncidentClassificationReason classificationReason(); /** - * Gets the incidentUrl property: The deep-link url to the incident in Azure portal. - * - * @return the incidentUrl value. + * Gets the classificationComment property: Describes the reason the incident was closed. + * + * @return the classificationComment value. */ - String incidentUrl(); + String classificationComment(); /** - * Gets the incidentNumber property: A sequential number. - * - * @return the incidentNumber value. + * Gets the owner property: Describes a user that the incident is assigned to. + * + * @return the owner value. */ - Integer incidentNumber(); + IncidentOwnerInfo owner(); /** * Gets the labels property: List of labels relevant to this incident. - * + * * @return the labels value. */ List labels(); /** - * Gets the providerName property: The name of the source provider that generated the incident. - * - * @return the providerName value. - */ - String providerName(); - - /** - * Gets the providerIncidentId property: The incident ID assigned by the incident provider. - * - * @return the providerIncidentId value. + * Gets the firstActivityTimeUtc property: The time of the first activity in the incident. + * + * @return the firstActivityTimeUtc value. */ - String providerIncidentId(); + OffsetDateTime firstActivityTimeUtc(); /** * Gets the lastActivityTimeUtc property: The time of the last activity in the incident. - * + * * @return the lastActivityTimeUtc value. */ OffsetDateTime lastActivityTimeUtc(); /** * Gets the lastModifiedTimeUtc property: The last time the incident was updated. - * + * * @return the lastModifiedTimeUtc value. */ OffsetDateTime lastModifiedTimeUtc(); /** - * Gets the owner property: Describes a user that the incident is assigned to. - * - * @return the owner value. + * Gets the createdTimeUtc property: The time the incident was created. + * + * @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. - * + * * @return the relatedAnalyticRuleIds value. */ List relatedAnalyticRuleIds(); /** - * Gets the severity property: The severity of the incident. - * - * @return the severity value. + * Gets the incidentUrl property: The deep-link url to the incident in Azure portal. + * + * @return the incidentUrl value. */ - IncidentSeverity severity(); + String incidentUrl(); /** - * Gets the status property: The status of the incident. - * - * @return the status value. + * Gets the providerName property: The name of the source provider that generated the incident. + * + * @return the providerName value. */ - IncidentStatus status(); + String providerName(); /** - * Gets the teamInformation property: Describes a team for the incident. - * - * @return the teamInformation value. + * Gets the providerIncidentId property: The incident ID assigned by the incident provider. + * + * @return the providerIncidentId value. */ - TeamInformation teamInformation(); + String providerIncidentId(); /** - * Gets the title property: The title of the incident. - * - * @return the title value. + * Gets the teamInformation property: Describes a team for the incident. + * + * @return the teamInformation value. */ - String title(); + TeamInformation teamInformation(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentPropertiesInner object. - * + * * @return the inner object. */ IncidentPropertiesInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentPropertiesAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentPropertiesAction.java index 0278075d0b46..9431e39791b0 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The IncidentPropertiesAction model. */ +/** + * The IncidentPropertiesAction model. + */ @Fluent public final class IncidentPropertiesAction { /* @@ -53,9 +55,15 @@ public final class IncidentPropertiesAction { @JsonProperty(value = "labels") private List labels; + /** + * Creates an instance of IncidentPropertiesAction class. + */ + public IncidentPropertiesAction() { + } + /** * Get the severity property: The severity of the incident. - * + * * @return the severity value. */ public IncidentSeverity severity() { @@ -64,7 +72,7 @@ public IncidentSeverity severity() { /** * Set the severity property: The severity of the incident. - * + * * @param severity the severity value to set. * @return the IncidentPropertiesAction object itself. */ @@ -75,7 +83,7 @@ public IncidentPropertiesAction withSeverity(IncidentSeverity severity) { /** * Get the status property: The status of the incident. - * + * * @return the status value. */ public IncidentStatus status() { @@ -84,7 +92,7 @@ public IncidentStatus status() { /** * Set the status property: The status of the incident. - * + * * @param status the status value to set. * @return the IncidentPropertiesAction object itself. */ @@ -95,7 +103,7 @@ public IncidentPropertiesAction withStatus(IncidentStatus status) { /** * Get the classification property: The reason the incident was closed. - * + * * @return the classification value. */ public IncidentClassification classification() { @@ -104,7 +112,7 @@ public IncidentClassification classification() { /** * Set the classification property: The reason the incident was closed. - * + * * @param classification the classification value to set. * @return the IncidentPropertiesAction object itself. */ @@ -115,7 +123,7 @@ public IncidentPropertiesAction withClassification(IncidentClassification classi /** * Get the classificationReason property: The classification reason the incident was closed with. - * + * * @return the classificationReason value. */ public IncidentClassificationReason classificationReason() { @@ -124,7 +132,7 @@ public IncidentClassificationReason classificationReason() { /** * Set the classificationReason property: The classification reason the incident was closed with. - * + * * @param classificationReason the classificationReason value to set. * @return the IncidentPropertiesAction object itself. */ @@ -135,7 +143,7 @@ public IncidentPropertiesAction withClassificationReason(IncidentClassificationR /** * Get the classificationComment property: Describes the reason the incident was closed. - * + * * @return the classificationComment value. */ public String classificationComment() { @@ -144,7 +152,7 @@ public String classificationComment() { /** * Set the classificationComment property: Describes the reason the incident was closed. - * + * * @param classificationComment the classificationComment value to set. * @return the IncidentPropertiesAction object itself. */ @@ -155,7 +163,7 @@ public IncidentPropertiesAction withClassificationComment(String classificationC /** * Get the owner property: Information on the user an incident is assigned to. - * + * * @return the owner value. */ public IncidentOwnerInfo owner() { @@ -164,7 +172,7 @@ public IncidentOwnerInfo owner() { /** * Set the owner property: Information on the user an incident is assigned to. - * + * * @param owner the owner value to set. * @return the IncidentPropertiesAction object itself. */ @@ -175,7 +183,7 @@ public IncidentPropertiesAction withOwner(IncidentOwnerInfo owner) { /** * Get the labels property: List of labels to add to the incident. - * + * * @return the labels value. */ public List labels() { @@ -184,7 +192,7 @@ public List labels() { /** * Set the labels property: List of labels to add to the incident. - * + * * @param labels the labels value to set. * @return the IncidentPropertiesAction object itself. */ @@ -195,7 +203,7 @@ public IncidentPropertiesAction withLabels(List labels) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentRelations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentRelations.java index 078c2fce6eb8..d1d10a28481f 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 @@ -9,11 +9,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; -/** Resource collection API of IncidentRelations. */ +/** + * Resource collection API of IncidentRelations. + */ public interface IncidentRelations { /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -26,7 +28,7 @@ public interface IncidentRelations { /** * Gets all incident relations. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. @@ -34,118 +36,106 @@ public interface IncidentRelations { * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all incident relations as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String incidentId, - String filter, - String orderby, - Integer top, - String skipToken, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, String filter, + String orderby, Integer top, String skipToken, Context context); /** * Gets an incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident relation. + * @return an incident relation along with {@link Response}. */ - Relation get(String resourceGroupName, String workspaceName, String incidentId, String relationName); + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, Context context); /** * Gets an incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an incident relation along with {@link Response}. + * @return an incident relation. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context); + 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 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. + * @return represents a relation between two resources along with {@link Response}. */ - Relation createOrUpdate( - String resourceGroupName, String workspaceName, String incidentId, String relationName, RelationInner relation); + 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 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}. + * @return represents a relation between two resources. */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - String relationName, - RelationInner relation, - Context context); + Relation createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, String relationName, + RelationInner relation); /** * Delete the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, Context context); /** * Delete the incident relation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param relationName Relation Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 relationName, Context context); + void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName); } 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 4be03522b9c5..4115958ea1ea 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The severity of the incident. */ +/** + * The severity of the incident. + */ public final class IncidentSeverity extends ExpandableStringEnum { - /** Static value High for IncidentSeverity. */ + /** + * Static value High for IncidentSeverity. + */ public static final IncidentSeverity HIGH = fromString("High"); - /** Static value Medium for IncidentSeverity. */ + /** + * Static value Medium for IncidentSeverity. + */ public static final IncidentSeverity MEDIUM = fromString("Medium"); - /** Static value Low for IncidentSeverity. */ + /** + * Static value Low for IncidentSeverity. + */ public static final IncidentSeverity LOW = fromString("Low"); - /** Static value Informational for IncidentSeverity. */ + /** + * Static value Informational for IncidentSeverity. + */ public static final IncidentSeverity INFORMATIONAL = fromString("Informational"); + /** + * Creates a new instance of IncidentSeverity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IncidentSeverity() { + } + /** * Creates or finds a IncidentSeverity from its string representation. - * + * * @param name a name to look for. * @return the corresponding IncidentSeverity. */ @@ -35,7 +54,7 @@ public static IncidentSeverity fromString(String name) { /** * Gets known IncidentSeverity values. - * + * * @return known IncidentSeverity values. */ public static Collection values() { 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 7c4059c354f2..cb19d73cd68d 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The status of the incident. */ +/** + * The status of the incident. + */ public final class IncidentStatus extends ExpandableStringEnum { - /** Static value New for IncidentStatus. */ + /** + * Static value New for IncidentStatus. + */ public static final IncidentStatus NEW = fromString("New"); - /** Static value Active for IncidentStatus. */ + /** + * Static value Active for IncidentStatus. + */ public static final IncidentStatus ACTIVE = fromString("Active"); - /** Static value Closed for IncidentStatus. */ + /** + * Static value Closed for IncidentStatus. + */ public static final IncidentStatus CLOSED = fromString("Closed"); + /** + * Creates a new instance of IncidentStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IncidentStatus() { + } + /** * Creates or finds a IncidentStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding IncidentStatus. */ @@ -32,7 +49,7 @@ public static IncidentStatus fromString(String name) { /** * Gets known IncidentStatus values. - * + * * @return known IncidentStatus values. */ public static Collection values() { 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..4b2db5d3a392 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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 property. + * + * @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 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 property.. + * + * @param status The status property. + * @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 property.. + * + * @param status The status property. + * @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/IncidentTaskList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTaskList.java new file mode 100644 index 000000000000..78a5e67e8d27 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTaskList.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The IncidentTaskList model. + */ +@Fluent +public final class IncidentTaskList { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of IncidentTaskList class. + */ + public IncidentTaskList() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the IncidentTaskList object itself. + */ + public IncidentTaskList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the IncidentTaskList object itself. + */ + public IncidentTaskList 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()); + } + } +} 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..27ad26e9189a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTaskStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for IncidentTaskStatus. + */ +public final class IncidentTaskStatus extends ExpandableStringEnum { + /** + * Static value New for IncidentTaskStatus. + */ + public static final IncidentTaskStatus NEW = fromString("New"); + + /** + * Static value Completed for IncidentTaskStatus. + */ + 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. + */ + @JsonCreator + 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..6106480f83f6 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IncidentTasks. + */ +public interface IncidentTasks { + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentId Incident ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all incident 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 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 resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the 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 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 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 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 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 3a2710c7cad6..739f67ccda67 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 @@ -7,45 +7,44 @@ 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.TeamInformationInner; -/** Resource collection API of Incidents. */ +/** + * Resource collection API of Incidents. + */ public interface Incidents { /** * 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 incidentIdentifier parameter. + * @param requestBody The requestBody parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. + * @return any object along with {@link Response}. */ - Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier); + 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 incidentIdentifier parameter. - * @param requestBody The requestBody parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response}. + * @return any object. */ - Response runPlaybookWithResponse( - String resourceGroupName, - String workspaceName, - String incidentIdentifier, - ManualTriggerRequestBody requestBody, - Context context); + Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier); /** * 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. @@ -57,207 +56,197 @@ Response runPlaybookWithResponse( /** * 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. + * 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); + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, String skipToken, Context context); /** * Gets an incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an incident along with {@link Response}. */ - Incident get(String resourceGroupName, String workspaceName, String incidentId); + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Context context); /** * Gets an incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 along with {@link Response}. + * @return an incident. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context); + Incident get(String resourceGroupName, String workspaceName, String incidentId); /** * Delete the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String incidentId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Context context); /** * Delete the incident. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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, Context context); + void delete(String resourceGroupName, String workspaceName, String incidentId); /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param teamProperties Team properties. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes team information. + * @return describes team information along with {@link Response}. */ - TeamInformation createTeam( - String resourceGroupName, String workspaceName, String incidentId, TeamProperties teamProperties); + Response createTeamWithResponse(String resourceGroupName, String workspaceName, String incidentId, + TeamInformationInner teamProperties, Context context); /** * Creates a Microsoft team to investigate the incident by sharing information and insights between participants. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. * @param teamProperties Team properties. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes team information along with {@link Response}. + * @return describes team information. */ - Response createTeamWithResponse( - String resourceGroupName, - String workspaceName, - String incidentId, - TeamProperties teamProperties, - Context context); + TeamInformation createTeam(String resourceGroupName, String workspaceName, String incidentId, + TeamInformationInner teamProperties); /** * Gets all incident alerts. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident alerts. + * @return all incident alerts along with {@link Response}. */ - IncidentAlertList listAlerts(String resourceGroupName, String workspaceName, String incidentId); + Response listAlertsWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context); /** * Gets all incident alerts. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident alerts along with {@link Response}. + * @return all incident alerts. */ - Response listAlertsWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context); + IncidentAlertList listAlerts(String resourceGroupName, String workspaceName, String incidentId); /** * Gets all incident bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident bookmarks. + * @return all incident bookmarks along with {@link Response}. */ - IncidentBookmarkList listBookmarks(String resourceGroupName, String workspaceName, String incidentId); + Response listBookmarksWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context); /** * Gets all incident bookmarks. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident bookmarks along with {@link Response}. + * @return all incident bookmarks. */ - Response listBookmarksWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context); + IncidentBookmarkList listBookmarks(String resourceGroupName, String workspaceName, String incidentId); /** * Gets all incident related entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident related entities. + * @return all incident related entities along with {@link Response}. */ - IncidentEntitiesResponse listEntities(String resourceGroupName, String workspaceName, String incidentId); + Response listEntitiesWithResponse(String resourceGroupName, String workspaceName, + String incidentId, Context context); /** * Gets all incident related entities. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param incidentId Incident ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all incident related entities along with {@link Response}. + * @return all incident related entities. */ - Response listEntitiesWithResponse( - String resourceGroupName, String workspaceName, String incidentId, Context context); + IncidentEntitiesResponse listEntities(String resourceGroupName, String workspaceName, String incidentId); /** * Gets an incident. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -268,7 +257,7 @@ Response listEntitiesWithResponse( /** * Gets an incident. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -280,7 +269,7 @@ Response listEntitiesWithResponse( /** * Delete the incident. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -290,7 +279,7 @@ Response listEntitiesWithResponse( /** * Delete the incident. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -302,7 +291,7 @@ Response listEntitiesWithResponse( /** * Begins definition for a new Incident resource. - * + * * @param name resource name. * @return the first stage of the new Incident definition. */ 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..d088e69be68e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Indicator.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Represents an indicator in Azure Security Insights. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = Indicator.class, visible = true) +@JsonTypeName("Indicator") +@Fluent +public final class Indicator extends TIObjectInner { + /* + * The kind of the TI object + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private TIObjectKind kind = TIObjectKind.INDICATOR; + + /* + * The observables of this indicator + */ + @JsonProperty(value = "observables") + private List observables; + + /** + * Creates an instance of Indicator class. + */ + public 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; + } + + /** + * Set the observables property: The observables of this indicator. + * + * @param observables the observables value to set. + * @return the Indicator object itself. + */ + public Indicator withObservables(List observables) { + this.observables = observables; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (observables() != null) { + observables().forEach(e -> e.validate()); + } + } +} 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..31c8bc7503a9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IndicatorObservablesItem.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An observable of this indicator. + */ +@Fluent +public final class IndicatorObservablesItem { + /* + * The type of the observable of this indicator + */ + @JsonProperty(value = "type") + private String type; + + /* + * The value of the observable of this indicator + */ + @JsonProperty(value = "value") + private String value; + + /** + * Creates an instance of IndicatorObservablesItem class. + */ + public IndicatorObservablesItem() { + } + + /** + * Get the type property: The type of the observable of this indicator. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the observable of this indicator. + * + * @param type the type value to set. + * @return the IndicatorObservablesItem object itself. + */ + public IndicatorObservablesItem withType(String type) { + this.type = type; + return this; + } + + /** + * Get the value property: The value of the observable of this indicator. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the observable of this indicator. + * + * @param value the value value to set. + * @return the IndicatorObservablesItem object itself. + */ + public IndicatorObservablesItem withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionMode.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionMode.java index 7cb969486ee3..4a4066339dad 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Describes how to ingest the records in the file. */ +/** + * Describes how to ingest the records in the file. + */ public final class IngestionMode extends ExpandableStringEnum { - /** Static value IngestOnlyIfAllAreValid for IngestionMode. */ + /** + * Static value IngestOnlyIfAllAreValid for IngestionMode. + */ public static final IngestionMode INGEST_ONLY_IF_ALL_ARE_VALID = fromString("IngestOnlyIfAllAreValid"); - /** Static value IngestAnyValidRecords for IngestionMode. */ + /** + * Static value IngestAnyValidRecords for IngestionMode. + */ public static final IngestionMode INGEST_ANY_VALID_RECORDS = fromString("IngestAnyValidRecords"); - /** Static value Unspecified for IngestionMode. */ + /** + * Static value Unspecified for IngestionMode. + */ 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. */ @@ -32,7 +49,7 @@ public static IngestionMode fromString(String name) { /** * Gets known IngestionMode values. - * + * * @return known IngestionMode values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionType.java new file mode 100644 index 000000000000..a84f88bbd559 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Types of ingestion. + */ +public final class IngestionType extends ExpandableStringEnum { + /** + * Static value Full for IngestionType. + */ + public static final IngestionType FULL = fromString("Full"); + + /** + * Static value Incremental for IngestionType. + */ + public static final IngestionType INCREMENTAL = fromString("Incremental"); + + /** + * Creates a new instance of IngestionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IngestionType() { + } + + /** + * Creates or finds a IngestionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IngestionType. + */ + @JsonCreator + public static IngestionType fromString(String name) { + return fromString(name, IngestionType.class); + } + + /** + * Gets known IngestionType values. + * + * @return known IngestionType values. + */ + public static Collection values() { + return values(IngestionType.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 index 0efb0bc5aff8..3f93b447934f 100644 --- 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 @@ -6,23 +6,49 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Insight Query. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Insight Query. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = InsightQueryItem.class, visible = true) @JsonTypeName("Insight") @Fluent public final class InsightQueryItem extends EntityQueryItem { + /* + * The kind of the entity query + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityQueryKind kind = EntityQueryKind.INSIGHT; + /* * Properties bag for InsightQueryItem */ @JsonProperty(value = "properties") private InsightQueryItemProperties properties; + /** + * Creates an instance of InsightQueryItem class. + */ + public 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() { @@ -31,7 +57,7 @@ public InsightQueryItemProperties properties() { /** * Set the properties property: Properties bag for InsightQueryItem. - * + * * @param properties the properties value to set. * @return the InsightQueryItem object itself. */ @@ -40,14 +66,18 @@ public InsightQueryItem withProperties(InsightQueryItemProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public InsightQueryItem withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public InsightQueryItem withType(String type) { super.withType(type); @@ -56,7 +86,7 @@ public InsightQueryItem withType(String type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index e69737b5e3c8..021e654d1b4a 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents Insight Query. */ +/** + * Represents Insight Query. + */ @Fluent public final class InsightQueryItemProperties extends EntityQueryItemProperties { /* @@ -59,9 +61,15 @@ public final class InsightQueryItemProperties extends EntityQueryItemProperties @JsonProperty(value = "referenceTimeRange") private InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange; + /** + * Creates an instance of InsightQueryItemProperties class. + */ + public InsightQueryItemProperties() { + } + /** * Get the displayName property: The insight display name. - * + * * @return the displayName value. */ public String displayName() { @@ -70,7 +78,7 @@ public String displayName() { /** * Set the displayName property: The insight display name. - * + * * @param displayName the displayName value to set. * @return the InsightQueryItemProperties object itself. */ @@ -81,7 +89,7 @@ public InsightQueryItemProperties withDisplayName(String displayName) { /** * Get the description property: The insight description. - * + * * @return the description value. */ public String description() { @@ -90,7 +98,7 @@ public String description() { /** * Set the description property: The insight description. - * + * * @param description the description value to set. * @return the InsightQueryItemProperties object itself. */ @@ -101,7 +109,7 @@ public InsightQueryItemProperties withDescription(String description) { /** * Get the baseQuery property: The base query of the insight. - * + * * @return the baseQuery value. */ public String baseQuery() { @@ -110,7 +118,7 @@ public String baseQuery() { /** * Set the baseQuery property: The base query of the insight. - * + * * @param baseQuery the baseQuery value to set. * @return the InsightQueryItemProperties object itself. */ @@ -121,7 +129,7 @@ public InsightQueryItemProperties withBaseQuery(String baseQuery) { /** * Get the tableQuery property: The insight table query. - * + * * @return the tableQuery value. */ public InsightQueryItemPropertiesTableQuery tableQuery() { @@ -130,7 +138,7 @@ public InsightQueryItemPropertiesTableQuery tableQuery() { /** * Set the tableQuery property: The insight table query. - * + * * @param tableQuery the tableQuery value to set. * @return the InsightQueryItemProperties object itself. */ @@ -141,7 +149,7 @@ public InsightQueryItemProperties withTableQuery(InsightQueryItemPropertiesTable /** * Get the chartQuery property: The insight chart query. - * + * * @return the chartQuery value. */ public Object chartQuery() { @@ -150,7 +158,7 @@ public Object chartQuery() { /** * Set the chartQuery property: The insight chart query. - * + * * @param chartQuery the chartQuery value to set. * @return the InsightQueryItemProperties object itself. */ @@ -161,7 +169,7 @@ public InsightQueryItemProperties withChartQuery(Object chartQuery) { /** * Get the additionalQuery property: The activity query definitions. - * + * * @return the additionalQuery value. */ public InsightQueryItemPropertiesAdditionalQuery additionalQuery() { @@ -170,7 +178,7 @@ public InsightQueryItemPropertiesAdditionalQuery additionalQuery() { /** * Set the additionalQuery property: The activity query definitions. - * + * * @param additionalQuery the additionalQuery value to set. * @return the InsightQueryItemProperties object itself. */ @@ -181,7 +189,7 @@ public InsightQueryItemProperties withAdditionalQuery(InsightQueryItemProperties /** * Get the defaultTimeRange property: The insight chart query. - * + * * @return the defaultTimeRange value. */ public InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange() { @@ -190,19 +198,19 @@ public InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange() { /** * Set the defaultTimeRange property: The insight chart query. - * + * * @param defaultTimeRange the defaultTimeRange value to set. * @return the InsightQueryItemProperties object itself. */ - public InsightQueryItemProperties withDefaultTimeRange( - InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange) { + public InsightQueryItemProperties + withDefaultTimeRange(InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange) { this.defaultTimeRange = defaultTimeRange; return this; } /** * Get the referenceTimeRange property: The insight chart query. - * + * * @return the referenceTimeRange value. */ public InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange() { @@ -211,38 +219,46 @@ public InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange() { /** * Set the referenceTimeRange property: The insight chart query. - * + * * @param referenceTimeRange the referenceTimeRange value to set. * @return the InsightQueryItemProperties object itself. */ - public InsightQueryItemProperties withReferenceTimeRange( - InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange) { + public InsightQueryItemProperties + withReferenceTimeRange(InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange) { this.referenceTimeRange = referenceTimeRange; return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public InsightQueryItemProperties withDataTypes(List dataTypes) { super.withDataTypes(dataTypes); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public InsightQueryItemProperties withInputEntityType(EntityType inputEntityType) { super.withInputEntityType(inputEntityType); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public InsightQueryItemProperties withRequiredInputFieldsSets(List> requiredInputFieldsSets) { super.withRequiredInputFieldsSets(requiredInputFieldsSets); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public InsightQueryItemProperties withEntitiesFilter(Object entitiesFilter) { super.withEntitiesFilter(entitiesFilter); @@ -251,7 +267,7 @@ public InsightQueryItemProperties withEntitiesFilter(Object entitiesFilter) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index c9877e7f9273..afccd072df73 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The activity query definitions. */ +/** + * The activity query definitions. + */ @Fluent public final class InsightQueryItemPropertiesAdditionalQuery { /* @@ -22,9 +24,15 @@ public final class InsightQueryItemPropertiesAdditionalQuery { @JsonProperty(value = "text") private String text; + /** + * Creates an instance of InsightQueryItemPropertiesAdditionalQuery class. + */ + public InsightQueryItemPropertiesAdditionalQuery() { + } + /** * Get the query property: The insight query. - * + * * @return the query value. */ public String query() { @@ -33,7 +41,7 @@ public String query() { /** * Set the query property: The insight query. - * + * * @param query the query value to set. * @return the InsightQueryItemPropertiesAdditionalQuery object itself. */ @@ -44,7 +52,7 @@ public InsightQueryItemPropertiesAdditionalQuery withQuery(String query) { /** * Get the text property: The insight text. - * + * * @return the text value. */ public String text() { @@ -53,7 +61,7 @@ public String text() { /** * Set the text property: The insight text. - * + * * @param text the text value to set. * @return the InsightQueryItemPropertiesAdditionalQuery object itself. */ @@ -64,7 +72,7 @@ public InsightQueryItemPropertiesAdditionalQuery withText(String text) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesDefaultTimeRange.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesDefaultTimeRange.java index f870634fb199..e3c18ae464b0 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The insight chart query. */ +/** + * The insight chart query. + */ @Fluent public final class InsightQueryItemPropertiesDefaultTimeRange { /* @@ -22,9 +24,15 @@ public final class InsightQueryItemPropertiesDefaultTimeRange { @JsonProperty(value = "afterRange") private String afterRange; + /** + * Creates an instance of InsightQueryItemPropertiesDefaultTimeRange class. + */ + public InsightQueryItemPropertiesDefaultTimeRange() { + } + /** * Get the beforeRange property: The padding for the start time of the query. - * + * * @return the beforeRange value. */ public String beforeRange() { @@ -33,7 +41,7 @@ public String beforeRange() { /** * Set the beforeRange property: The padding for the start time of the query. - * + * * @param beforeRange the beforeRange value to set. * @return the InsightQueryItemPropertiesDefaultTimeRange object itself. */ @@ -44,7 +52,7 @@ public InsightQueryItemPropertiesDefaultTimeRange withBeforeRange(String beforeR /** * Get the afterRange property: The padding for the end time of the query. - * + * * @return the afterRange value. */ public String afterRange() { @@ -53,7 +61,7 @@ public String afterRange() { /** * Set the afterRange property: The padding for the end time of the query. - * + * * @param afterRange the afterRange value to set. * @return the InsightQueryItemPropertiesDefaultTimeRange object itself. */ @@ -64,7 +72,7 @@ public InsightQueryItemPropertiesDefaultTimeRange withAfterRange(String afterRan /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesReferenceTimeRange.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesReferenceTimeRange.java index 6dd0b8e28f15..ed5d910383ab 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The insight chart query. */ +/** + * The insight chart query. + */ @Fluent public final class InsightQueryItemPropertiesReferenceTimeRange { /* @@ -16,9 +18,15 @@ public final class InsightQueryItemPropertiesReferenceTimeRange { @JsonProperty(value = "beforeRange") private String beforeRange; + /** + * Creates an instance of InsightQueryItemPropertiesReferenceTimeRange class. + */ + public InsightQueryItemPropertiesReferenceTimeRange() { + } + /** * Get the beforeRange property: Additional query time for looking back. - * + * * @return the beforeRange value. */ public String beforeRange() { @@ -27,7 +35,7 @@ public String beforeRange() { /** * Set the beforeRange property: Additional query time for looking back. - * + * * @param beforeRange the beforeRange value to set. * @return the InsightQueryItemPropertiesReferenceTimeRange object itself. */ @@ -38,7 +46,7 @@ public InsightQueryItemPropertiesReferenceTimeRange withBeforeRange(String befor /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQuery.java index 3c889abbed88..4425af2e0610 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The insight table query. */ +/** + * The insight table query. + */ @Fluent public final class InsightQueryItemPropertiesTableQuery { /* @@ -23,9 +25,15 @@ public final class InsightQueryItemPropertiesTableQuery { @JsonProperty(value = "queriesDefinitions") private List queriesDefinitions; + /** + * Creates an instance of InsightQueryItemPropertiesTableQuery class. + */ + public InsightQueryItemPropertiesTableQuery() { + } + /** * Get the columnsDefinitions property: List of insight column definitions. - * + * * @return the columnsDefinitions value. */ public List columnsDefinitions() { @@ -34,19 +42,19 @@ public List columnsD /** * Set the columnsDefinitions property: List of insight column definitions. - * + * * @param columnsDefinitions the columnsDefinitions value to set. * @return the InsightQueryItemPropertiesTableQuery object itself. */ - public InsightQueryItemPropertiesTableQuery withColumnsDefinitions( - List columnsDefinitions) { + public InsightQueryItemPropertiesTableQuery + withColumnsDefinitions(List columnsDefinitions) { this.columnsDefinitions = columnsDefinitions; return this; } /** * Get the queriesDefinitions property: List of insight queries definitions. - * + * * @return the queriesDefinitions value. */ public List queriesDefinitions() { @@ -55,19 +63,19 @@ public List queriesD /** * Set the queriesDefinitions property: List of insight queries definitions. - * + * * @param queriesDefinitions the queriesDefinitions value to set. * @return the InsightQueryItemPropertiesTableQuery object itself. */ - public InsightQueryItemPropertiesTableQuery withQueriesDefinitions( - List queriesDefinitions) { + public InsightQueryItemPropertiesTableQuery + withQueriesDefinitions(List queriesDefinitions) { this.queriesDefinitions = queriesDefinitions; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index f9428faa609a..b2dbb1e06ee1 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem model. */ +/** + * The InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem model. + */ @Fluent public final class InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem { /* @@ -28,9 +30,15 @@ public final class InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem { @JsonProperty(value = "supportDeepLink") private Boolean supportDeepLink; + /** + * Creates an instance of InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem class. + */ + public InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem() { + } + /** * Get the headerProperty property: Insight column header. - * + * * @return the headerProperty value. */ public String headerProperty() { @@ -39,7 +47,7 @@ public String headerProperty() { /** * Set the headerProperty property: Insight column header. - * + * * @param headerProperty the headerProperty value to set. * @return the InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem object itself. */ @@ -50,7 +58,7 @@ public InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem withHeaderProp /** * Get the outputType property: Insights Column type. - * + * * @return the outputType value. */ public OutputType outputType() { @@ -59,7 +67,7 @@ public OutputType outputType() { /** * Set the outputType property: Insights Column type. - * + * * @param outputType the outputType value to set. * @return the InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem object itself. */ @@ -70,7 +78,7 @@ public InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem withOutputType /** * Get the supportDeepLink property: Is query supports deep-link. - * + * * @return the supportDeepLink value. */ public Boolean supportDeepLink() { @@ -79,7 +87,7 @@ public Boolean supportDeepLink() { /** * Set the supportDeepLink property: Is query supports deep-link. - * + * * @param supportDeepLink the supportDeepLink value to set. * @return the InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem object itself. */ @@ -90,7 +98,7 @@ public InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem withSupportDee /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.java index ea811b7bdc9a..ae0dd171b964 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem model. */ +/** + * The InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem model. + */ @Fluent public final class InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem { /* @@ -35,9 +37,15 @@ public final class InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem { @JsonProperty(value = "linkColumnsDefinitions") private List linkColumnsDefinitions; + /** + * Creates an instance of InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem class. + */ + public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem() { + } + /** * Get the filter property: Insight column header. - * + * * @return the filter value. */ public String filter() { @@ -46,7 +54,7 @@ public String filter() { /** * Set the filter property: Insight column header. - * + * * @param filter the filter value to set. * @return the InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem object itself. */ @@ -57,7 +65,7 @@ public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem withFilter(Str /** * Get the summarize property: Insight column header. - * + * * @return the summarize value. */ public String summarize() { @@ -66,7 +74,7 @@ public String summarize() { /** * Set the summarize property: Insight column header. - * + * * @param summarize the summarize value to set. * @return the InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem object itself. */ @@ -77,7 +85,7 @@ public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem withSummarize( /** * Get the project property: Insight column header. - * + * * @return the project value. */ public String project() { @@ -86,7 +94,7 @@ public String project() { /** * Set the project property: Insight column header. - * + * * @param project the project value to set. * @return the InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem object itself. */ @@ -97,7 +105,7 @@ public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem withProject(St /** * Get the linkColumnsDefinitions property: Insight column header. - * + * * @return the linkColumnsDefinitions value. */ public List linkColumnsDefinitions() { @@ -106,7 +114,7 @@ public List> rows; + /** + * Creates an instance of InsightsTableResult class. + */ + public InsightsTableResult() { + } + /** * Get the columns property: Columns Metadata of the table. - * + * * @return the columns value. */ public List columns() { @@ -34,7 +42,7 @@ public List columns() { /** * Set the columns property: Columns Metadata of the table. - * + * * @param columns the columns value to set. * @return the InsightsTableResult object itself. */ @@ -45,7 +53,7 @@ public InsightsTableResult withColumns(List colu /** * Get the rows property: Rows data of the table. - * + * * @return the rows value. */ public List> rows() { @@ -54,7 +62,7 @@ public List> rows() { /** * Set the rows property: Rows data of the table. - * + * * @param rows the rows value to set. * @return the InsightsTableResult object itself. */ @@ -65,7 +73,7 @@ public InsightsTableResult withRows(List> rows) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResultColumnsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResultColumnsItem.java index 486e7914039c..dafb58dddce6 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The InsightsTableResultColumnsItem model. */ +/** + * The InsightsTableResultColumnsItem model. + */ @Fluent public final class InsightsTableResultColumnsItem { /* @@ -22,9 +24,15 @@ public final class InsightsTableResultColumnsItem { @JsonProperty(value = "name") private String name; + /** + * Creates an instance of InsightsTableResultColumnsItem class. + */ + public InsightsTableResultColumnsItem() { + } + /** * Get the type property: the type of the colum. - * + * * @return the type value. */ public String type() { @@ -33,7 +41,7 @@ public String type() { /** * Set the type property: the type of the colum. - * + * * @param type the type value to set. * @return the InsightsTableResultColumnsItem object itself. */ @@ -44,7 +52,7 @@ public InsightsTableResultColumnsItem withType(String type) { /** * Get the name property: the name of the colum. - * + * * @return the name value. */ public String name() { @@ -53,7 +61,7 @@ public String name() { /** * Set the name property: the name of the colum. - * + * * @param name the name value to set. * @return the InsightsTableResultColumnsItem object itself. */ @@ -64,7 +72,7 @@ public InsightsTableResultColumnsItem withName(String name) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStep.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStep.java new file mode 100644 index 000000000000..0c401c4da272 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStep.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Instruction steps to enable the connector. + */ +@Fluent +public final class InstructionStep { + /* + * Gets or sets the instruction step title. + */ + @JsonProperty(value = "title") + private String title; + + /* + * Gets or sets the instruction step description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Gets or sets the instruction step details. + */ + @JsonProperty(value = "instructions") + private List instructions; + + /* + * Gets or sets the inner instruction steps details. + * Foe Example: instruction step 1 might contain inner instruction steps: [instruction step 1.1, instruction step 1.2]. + */ + @JsonProperty(value = "innerSteps") + 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. + * Foe 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. + * Foe 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instructions() != null) { + instructions().forEach(e -> e.validate()); + } + if (innerSteps() != null) { + innerSteps().forEach(e -> e.validate()); + } + } +} 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..00cc677d1b31 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepDetails.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Instruction step details, to be displayed in the Instructions steps section in the connector's page in Sentinel + * Portal. + */ +@Fluent +public final class InstructionStepDetails { + /* + * Gets or sets the instruction type parameters settings. + */ + @JsonProperty(value = "parameters", required = true) + private Object parameters; + + /* + * Gets or sets the instruction type name. + */ + @JsonProperty(value = "type", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property parameters in model InstructionStepDetails")); + } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model InstructionStepDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InstructionStepDetails.class); +} 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 index 227c38863a55..40ed7c916b87 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Instruction steps to enable the connector. */ +/** + * Instruction steps to enable the connector. + */ @Fluent public class InstructionSteps { /* @@ -29,9 +31,15 @@ public class InstructionSteps { @JsonProperty(value = "instructions") 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() { @@ -40,7 +48,7 @@ public String title() { /** * Set the title property: Instruction step title. - * + * * @param title the title value to set. * @return the InstructionSteps object itself. */ @@ -51,7 +59,7 @@ public InstructionSteps withTitle(String title) { /** * Get the description property: Instruction step description. - * + * * @return the description value. */ public String description() { @@ -60,7 +68,7 @@ public String description() { /** * Set the description property: Instruction step description. - * + * * @param description the description value to set. * @return the InstructionSteps object itself. */ @@ -71,7 +79,7 @@ public InstructionSteps withDescription(String description) { /** * Get the instructions property: Instruction step details. - * + * * @return the instructions value. */ public List instructions() { @@ -80,7 +88,7 @@ public List instructions() { /** * Set the instructions property: Instruction step details. - * + * * @param instructions the instructions value to set. * @return the InstructionSteps object itself. */ @@ -91,7 +99,7 @@ public InstructionSteps withInstructions(List /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepsInstructionsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepsInstructionsItem.java index 45cf764a6a76..3390333c169f 100644 --- 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 @@ -6,17 +6,29 @@ import com.azure.core.annotation.Fluent; -/** The InstructionStepsInstructionsItem model. */ +/** + * The InstructionStepsInstructionsItem model. + */ @Fluent public final class InstructionStepsInstructionsItem extends ConnectorInstructionModelBase { - /** {@inheritDoc} */ + /** + * Creates an instance of InstructionStepsInstructionsItem class. + */ + public InstructionStepsInstructionsItem() { + } + + /** + * {@inheritDoc} + */ @Override public InstructionStepsInstructionsItem withParameters(Object parameters) { super.withParameters(parameters); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public InstructionStepsInstructionsItem withType(SettingType type) { super.withType(type); @@ -25,7 +37,7 @@ public InstructionStepsInstructionsItem withType(SettingType type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index cf5ebc9db245..d630ca267bc7 100644 --- 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 @@ -7,23 +7,49 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.IoTCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents IoT requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents IoT requirements check request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = IoTCheckRequirements.class, visible = true) @JsonTypeName("IOT") @Fluent public final class IoTCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.IOT; + /* * IoT requirements check properties. */ @JsonProperty(value = "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. */ private IoTCheckRequirementsProperties innerProperties() { @@ -32,7 +58,7 @@ private IoTCheckRequirementsProperties innerProperties() { /** * Get the subscriptionId property: The subscription id to connect to, and get the data from. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -41,7 +67,7 @@ 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 IoTCheckRequirements object itself. */ @@ -55,7 +81,7 @@ public IoTCheckRequirements withSubscriptionId(String subscriptionId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 787fff5098c3..3e50c92a71f4 100644 --- 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.IoTDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents IoT data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents IoT data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = IoTDataConnector.class, visible = true) @JsonTypeName("IOT") @Fluent public final class IoTDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.IOT; + /* * IoT data connector properties. */ @JsonProperty(value = "properties") private IoTDataConnectorProperties innerProperties; + /** + * Creates an instance of IoTDataConnector class. + */ + public IoTDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public IoTDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public IoTDataConnector withEtag(String etag) { /** * Get the subscriptionId property: The subscription id to connect to, and get the data from. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -49,7 +77,7 @@ 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 IoTDataConnector object itself. */ @@ -63,7 +91,7 @@ public IoTDataConnector withSubscriptionId(String subscriptionId) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -72,7 +100,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the IoTDataConnector object itself. */ @@ -86,7 +114,7 @@ public IoTDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 06ab4d1c051d..b8f679925709 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 @@ -8,26 +8,52 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.IoTDeviceEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; import java.util.Map; import java.util.UUID; -/** Represents an IoT device entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents an IoT device entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = IoTDeviceEntity.class, visible = true) @JsonTypeName("IoTDevice") @Fluent public final class IoTDeviceEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.IO_TDEVICE; + /* * IoTDevice entity properties */ @JsonProperty(value = "properties") private IoTDeviceEntityProperties innerProperties; + /** + * Creates an instance of IoTDeviceEntity class. + */ + public IoTDeviceEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: IoTDevice entity properties. - * + * * @return the innerProperties value. */ private IoTDeviceEntityProperties innerProperties() { @@ -36,7 +62,7 @@ private IoTDeviceEntityProperties innerProperties() { /** * Get the deviceId property: The ID of the IoT Device in the IoT Hub. - * + * * @return the deviceId value. */ public String deviceId() { @@ -45,7 +71,7 @@ public String deviceId() { /** * Get the deviceName property: The friendly name of the device. - * + * * @return the deviceName value. */ public String deviceName() { @@ -54,7 +80,7 @@ public String deviceName() { /** * Get the source property: The source of the device. - * + * * @return the source value. */ public String source() { @@ -63,7 +89,7 @@ public String source() { /** * Get the iotSecurityAgentId property: The ID of the security agent running on the device. - * + * * @return the iotSecurityAgentId value. */ public UUID iotSecurityAgentId() { @@ -72,7 +98,7 @@ public UUID iotSecurityAgentId() { /** * Get the deviceType property: The type of the device. - * + * * @return the deviceType value. */ public String deviceType() { @@ -81,7 +107,7 @@ public String deviceType() { /** * Get the vendor property: The vendor of the device. - * + * * @return the vendor value. */ public String vendor() { @@ -90,7 +116,7 @@ public String vendor() { /** * Get the edgeId property: The ID of the edge device. - * + * * @return the edgeId value. */ public String edgeId() { @@ -99,7 +125,7 @@ public String edgeId() { /** * Get the macAddress property: The MAC address of the device. - * + * * @return the macAddress value. */ public String macAddress() { @@ -108,7 +134,7 @@ public String macAddress() { /** * Get the model property: The model of the device. - * + * * @return the model value. */ public String model() { @@ -117,7 +143,7 @@ public String model() { /** * Get the serialNumber property: The serial number of the device. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -126,7 +152,7 @@ public String serialNumber() { /** * Get the firmwareVersion property: The firmware version of the device. - * + * * @return the firmwareVersion value. */ public String firmwareVersion() { @@ -135,7 +161,7 @@ public String firmwareVersion() { /** * Get the operatingSystem property: The operating system of the device. - * + * * @return the operatingSystem value. */ public String operatingSystem() { @@ -144,7 +170,7 @@ public String operatingSystem() { /** * Get the iotHubEntityId property: The AzureResource entity id of the IoT Hub. - * + * * @return the iotHubEntityId value. */ public String iotHubEntityId() { @@ -153,7 +179,7 @@ public String iotHubEntityId() { /** * Get the hostEntityId property: The Host entity id of this device. - * + * * @return the hostEntityId value. */ public String hostEntityId() { @@ -162,7 +188,7 @@ public String hostEntityId() { /** * Get the ipAddressEntityId property: The IP entity if of this device. - * + * * @return the ipAddressEntityId value. */ public String ipAddressEntityId() { @@ -171,7 +197,7 @@ public String ipAddressEntityId() { /** * Get the threatIntelligence property: A list of TI contexts attached to the IoTDevice entity. - * + * * @return the threatIntelligence value. */ public List threatIntelligence() { @@ -180,7 +206,7 @@ public List threatIntelligence() { /** * Get the protocols property: A list of protocols of the IoTDevice entity. - * + * * @return the protocols value. */ public List protocols() { @@ -189,7 +215,7 @@ public List protocols() { /** * Get the owners property: A list of owners of the IoTDevice entity. - * + * * @return the owners value. */ public List owners() { @@ -198,7 +224,7 @@ public List owners() { /** * Get the nicEntityIds property: A list of Nic entity ids of the IoTDevice entity. - * + * * @return the nicEntityIds value. */ public List nicEntityIds() { @@ -207,7 +233,7 @@ public List nicEntityIds() { /** * Get the site property: The site of the device. - * + * * @return the site value. */ public String site() { @@ -216,7 +242,7 @@ public String site() { /** * Get the zone property: The zone location of the device within a site. - * + * * @return the zone value. */ public String zone() { @@ -225,7 +251,7 @@ public String zone() { /** * Get the sensor property: The sensor the device is monitored by. - * + * * @return the sensor value. */ public String sensor() { @@ -234,7 +260,7 @@ public String sensor() { /** * Get the deviceSubType property: The subType of the device ('PLC', 'HMI', 'EWS', etc.). - * + * * @return the deviceSubType value. */ public String deviceSubType() { @@ -243,7 +269,7 @@ public String deviceSubType() { /** * Get the importance property: Device importance, determines if the device classified as 'crown jewel'. - * + * * @return the importance value. */ public DeviceImportance importance() { @@ -252,7 +278,7 @@ public DeviceImportance importance() { /** * Set the importance property: Device importance, determines if the device classified as 'crown jewel'. - * + * * @param importance the importance value to set. * @return the IoTDeviceEntity object itself. */ @@ -266,7 +292,7 @@ public IoTDeviceEntity withImportance(DeviceImportance importance) { /** * Get the purdueLayer property: The Purdue Layer of the device. - * + * * @return the purdueLayer value. */ public String purdueLayer() { @@ -275,7 +301,7 @@ public String purdueLayer() { /** * Get the isAuthorized property: Determines whether the device classified as authorized device. - * + * * @return the isAuthorized value. */ public Boolean isAuthorized() { @@ -284,7 +310,7 @@ public Boolean isAuthorized() { /** * Get the isProgramming property: Determines whether the device classified as programming device. - * + * * @return the isProgramming value. */ public Boolean isProgramming() { @@ -293,7 +319,7 @@ public Boolean isProgramming() { /** * Get the isScanner property: Is the device classified as a scanner device. - * + * * @return the isScanner value. */ public Boolean isScanner() { @@ -303,7 +329,7 @@ public Boolean isScanner() { /** * 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() { @@ -313,7 +339,7 @@ public Map 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() { @@ -322,7 +348,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 beeac5a11a60..a8f11b44b7ae 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 @@ -4,29 +4,55 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.IpEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; import java.util.Map; -/** Represents an ip entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents an ip entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = IpEntity.class, visible = true) @JsonTypeName("Ip") -@Fluent +@Immutable public final class IpEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.IP; + /* * Ip entity properties */ @JsonProperty(value = "properties") private IpEntityProperties innerProperties; + /** + * Creates an instance of IpEntity class. + */ + public IpEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Ip entity properties. - * + * * @return the innerProperties value. */ private IpEntityProperties innerProperties() { @@ -35,7 +61,7 @@ private IpEntityProperties innerProperties() { /** * Get the address property: The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6). - * + * * @return the address value. */ public String address() { @@ -44,7 +70,7 @@ public String address() { /** * Get the location property: The geo-location context attached to the ip entity. - * + * * @return the location value. */ public GeoLocation location() { @@ -53,7 +79,7 @@ public GeoLocation location() { /** * Get the threatIntelligence property: A list of TI contexts attached to the ip entity. - * + * * @return the threatIntelligence value. */ public List threatIntelligence() { @@ -63,7 +89,7 @@ public List threatIntelligence() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -73,7 +99,7 @@ public Map 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() { @@ -82,7 +108,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..a2a5a25fe1fa --- /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) AutoRest 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. + */ + ProvisioningState 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..5e1fba4e759c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobItem.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An entity describing the publish status of a content item. + */ +@Fluent +public final class JobItem { + /* + * The resource id of the content item + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Status of the item publication + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * The time the item publishing was completed + */ + @JsonProperty(value = "executionTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime executionTime; + + /* + * The list of error descriptions if the item publication fails. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * Creates an instance of JobItem class. + */ + public JobItem() { + } + + /** + * 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 JobItem object itself. + */ + public JobItem withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * 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; + } + + /** + * Set the errors property: The list of error descriptions if the item publication fails. + * + * @param errors the errors value to set. + * @return the JobItem object itself. + */ + public JobItem withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobList.java new file mode 100644 index 000000000000..bbfcb53ac512 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.JobInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of all the jobs. + */ +@Fluent +public final class JobList { + /* + * URL to fetch the next set of jobs. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of jobs. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of JobList class. + */ + public JobList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of jobs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of jobs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of jobs. + * + * @param value the value value to set. + * @return the JobList object itself. + */ + public JobList 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 JobList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JobList.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..3f7a67eccf34 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JwtAuthModel.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** + * Model for API authentication with JWT. Simple exchange between user name + password to access token. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = JwtAuthModel.class, visible = true) +@JsonTypeName("JwtToken") +@Fluent +public final class JwtAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private CcpAuthType type = CcpAuthType.JWT_TOKEN; + + /* + * Token endpoint to request JWT + */ + @JsonProperty(value = "tokenEndpoint", required = true) + 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`. + */ + @JsonProperty(value = "userName", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map username; + + /* + * The password + */ + @JsonProperty(value = "password", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map password; + + /* + * The custom query parameter we want to add once we send request to token endpoint. + */ + @JsonProperty(value = "queryParameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map queryParameters; + + /* + * The custom headers we want to add once we send request to token endpoint. + */ + @JsonProperty(value = "headers") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map headers; + + /* + * Flag indicating whether we want to send the user name and password to token endpoint in the headers. + */ + @JsonProperty(value = "isCredentialsInHeaders") + 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). + */ + @JsonProperty(value = "isJsonRequest") + private Boolean isJsonRequest; + + /* + * Request timeout in seconds. + */ + @JsonProperty(value = "requestTimeoutInSeconds") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (tokenEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tokenEndpoint in model JwtAuthModel")); + } + if (username() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property username in model JwtAuthModel")); + } + if (password() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property password in model JwtAuthModel")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JwtAuthModel.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/KeyVaultAuthenticationMode.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/KeyVaultAuthenticationMode.java new file mode 100644 index 000000000000..17b4ac6b194e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/KeyVaultAuthenticationMode.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type for authentication identity to key vault. + */ +public final class KeyVaultAuthenticationMode extends ExpandableStringEnum { + /** + * Static value ManagedIdentity for KeyVaultAuthenticationMode. + */ + public static final KeyVaultAuthenticationMode MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** + * Static value ServicePrincipal for KeyVaultAuthenticationMode. + */ + public static final KeyVaultAuthenticationMode SERVICE_PRINCIPAL = fromString("ServicePrincipal"); + + /** + * Creates a new instance of KeyVaultAuthenticationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyVaultAuthenticationMode() { + } + + /** + * Creates or finds a KeyVaultAuthenticationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyVaultAuthenticationMode. + */ + @JsonCreator + public static KeyVaultAuthenticationMode fromString(String name) { + return fromString(name, KeyVaultAuthenticationMode.class); + } + + /** + * Gets known KeyVaultAuthenticationMode values. + * + * @return known KeyVaultAuthenticationMode values. + */ + public static Collection values() { + return values(KeyVaultAuthenticationMode.class); + } +} 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 ff0016d01c52..430fb17835bc 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 @@ -8,53 +8,92 @@ import com.fasterxml.jackson.annotation.JsonCreator; 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. */ + /** + * Static value Unknown for KillChainIntent. + */ public static final KillChainIntent UNKNOWN = fromString("Unknown"); - /** Static value Probing for KillChainIntent. */ + /** + * Static value Probing for KillChainIntent. + */ public static final KillChainIntent PROBING = fromString("Probing"); - /** Static value Exploitation for KillChainIntent. */ + /** + * Static value Exploitation for KillChainIntent. + */ public static final KillChainIntent EXPLOITATION = fromString("Exploitation"); - /** Static value Persistence for KillChainIntent. */ + /** + * Static value Persistence for KillChainIntent. + */ public static final KillChainIntent PERSISTENCE = fromString("Persistence"); - /** Static value PrivilegeEscalation for KillChainIntent. */ + /** + * Static value PrivilegeEscalation for KillChainIntent. + */ public static final KillChainIntent PRIVILEGE_ESCALATION = fromString("PrivilegeEscalation"); - /** Static value DefenseEvasion for KillChainIntent. */ + /** + * Static value DefenseEvasion for KillChainIntent. + */ public static final KillChainIntent DEFENSE_EVASION = fromString("DefenseEvasion"); - /** Static value CredentialAccess for KillChainIntent. */ + /** + * Static value CredentialAccess for KillChainIntent. + */ public static final KillChainIntent CREDENTIAL_ACCESS = fromString("CredentialAccess"); - /** Static value Discovery for KillChainIntent. */ + /** + * Static value Discovery for KillChainIntent. + */ public static final KillChainIntent DISCOVERY = fromString("Discovery"); - /** Static value LateralMovement for KillChainIntent. */ + /** + * Static value LateralMovement for KillChainIntent. + */ public static final KillChainIntent LATERAL_MOVEMENT = fromString("LateralMovement"); - /** Static value Execution for KillChainIntent. */ + /** + * Static value Execution for KillChainIntent. + */ public static final KillChainIntent EXECUTION = fromString("Execution"); - /** Static value Collection for KillChainIntent. */ + /** + * Static value Collection for KillChainIntent. + */ public static final KillChainIntent COLLECTION = fromString("Collection"); - /** Static value Exfiltration for KillChainIntent. */ + /** + * Static value Exfiltration for KillChainIntent. + */ public static final KillChainIntent EXFILTRATION = fromString("Exfiltration"); - /** Static value CommandAndControl for KillChainIntent. */ + /** + * Static value CommandAndControl for KillChainIntent. + */ public static final KillChainIntent COMMAND_AND_CONTROL = fromString("CommandAndControl"); - /** Static value Impact for KillChainIntent. */ + /** + * Static value Impact for KillChainIntent. + */ public static final KillChainIntent IMPACT = fromString("Impact"); + /** + * Creates a new instance of KillChainIntent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KillChainIntent() { + } + /** * Creates or finds a KillChainIntent from its string representation. - * + * * @param name a name to look for. * @return the corresponding KillChainIntent. */ @@ -65,7 +104,7 @@ public static KillChainIntent fromString(String name) { /** * Gets known KillChainIntent values. - * + * * @return known KillChainIntent values. */ public static Collection values() { 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 index b8879fab665f..b6e24b5ee79e 100644 --- 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 @@ -8,62 +8,107 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of content the metadata is for. */ +/** + * The kind of content the metadata is for. + */ public final class Kind extends ExpandableStringEnum { - /** Static value DataConnector for Kind. */ + /** + * Static value DataConnector for Kind. + */ public static final Kind DATA_CONNECTOR = fromString("DataConnector"); - /** Static value DataType for Kind. */ + /** + * Static value DataType for Kind. + */ public static final Kind DATA_TYPE = fromString("DataType"); - /** Static value Workbook for Kind. */ + /** + * Static value Workbook for Kind. + */ public static final Kind WORKBOOK = fromString("Workbook"); - /** Static value WorkbookTemplate for Kind. */ + /** + * Static value WorkbookTemplate for Kind. + */ public static final Kind WORKBOOK_TEMPLATE = fromString("WorkbookTemplate"); - /** Static value Playbook for Kind. */ + /** + * Static value Playbook for Kind. + */ public static final Kind PLAYBOOK = fromString("Playbook"); - /** Static value PlaybookTemplate for Kind. */ + /** + * Static value PlaybookTemplate for Kind. + */ public static final Kind PLAYBOOK_TEMPLATE = fromString("PlaybookTemplate"); - /** Static value AnalyticsRuleTemplate for Kind. */ + /** + * Static value AnalyticsRuleTemplate for Kind. + */ public static final Kind ANALYTICS_RULE_TEMPLATE = fromString("AnalyticsRuleTemplate"); - /** Static value AnalyticsRule for Kind. */ + /** + * Static value AnalyticsRule for Kind. + */ public static final Kind ANALYTICS_RULE = fromString("AnalyticsRule"); - /** Static value HuntingQuery for Kind. */ + /** + * Static value HuntingQuery for Kind. + */ public static final Kind HUNTING_QUERY = fromString("HuntingQuery"); - /** Static value InvestigationQuery for Kind. */ + /** + * Static value InvestigationQuery for Kind. + */ public static final Kind INVESTIGATION_QUERY = fromString("InvestigationQuery"); - /** Static value Parser for Kind. */ + /** + * Static value Parser for Kind. + */ public static final Kind PARSER = fromString("Parser"); - /** Static value Watchlist for Kind. */ + /** + * Static value Watchlist for Kind. + */ public static final Kind WATCHLIST = fromString("Watchlist"); - /** Static value WatchlistTemplate for Kind. */ + /** + * Static value WatchlistTemplate for Kind. + */ public static final Kind WATCHLIST_TEMPLATE = fromString("WatchlistTemplate"); - /** Static value Solution for Kind. */ + /** + * Static value Solution for Kind. + */ public static final Kind SOLUTION = fromString("Solution"); - /** Static value AzureFunction for Kind. */ + /** + * Static value AzureFunction for Kind. + */ public static final Kind AZURE_FUNCTION = fromString("AzureFunction"); - /** Static value LogicAppsCustomConnector for Kind. */ + /** + * Static value LogicAppsCustomConnector for Kind. + */ public static final Kind LOGIC_APPS_CUSTOM_CONNECTOR = fromString("LogicAppsCustomConnector"); - /** Static value AutomationRule for Kind. */ + /** + * Static value AutomationRule for Kind. + */ public static final Kind AUTOMATION_RULE = fromString("AutomationRule"); + /** + * 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. */ @@ -74,7 +119,7 @@ public static Kind fromString(String name) { /** * Gets known Kind values. - * + * * @return known Kind values. */ public static Collection values() { 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 index ee71cb19cfb9..a2efc82c7921 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Data type for last data received. */ +/** + * Data type for last data received. + */ @Fluent public class LastDataReceivedDataType { /* @@ -22,10 +24,16 @@ public class LastDataReceivedDataType { @JsonProperty(value = "lastDataReceivedQuery") 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() { @@ -35,7 +43,7 @@ public String 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. */ @@ -46,7 +54,7 @@ public LastDataReceivedDataType withName(String name) { /** * Get the lastDataReceivedQuery property: Query for indicate last data received. - * + * * @return the lastDataReceivedQuery value. */ public String lastDataReceivedQuery() { @@ -55,7 +63,7 @@ public String lastDataReceivedQuery() { /** * Set the lastDataReceivedQuery property: Query for indicate last data received. - * + * * @param lastDataReceivedQuery the lastDataReceivedQuery value to set. * @return the LastDataReceivedDataType object itself. */ @@ -66,7 +74,7 @@ public LastDataReceivedDataType withLastDataReceivedQuery(String lastDataReceive /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ListActionKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ListActionKind.java new file mode 100644 index 000000000000..e36e938377f4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ListActionKind.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The kind of the action. + */ +public final class ListActionKind extends ExpandableStringEnum { + /** + * Static value LockUser for ListActionKind. + */ + public static final ListActionKind LOCK_USER = fromString("LockUser"); + + /** + * Static value UnlockUser for ListActionKind. + */ + public static final ListActionKind UNLOCK_USER = fromString("UnlockUser"); + + /** + * Creates a new instance of ListActionKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ListActionKind() { + } + + /** + * Creates or finds a ListActionKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ListActionKind. + */ + @JsonCreator + public static ListActionKind fromString(String name) { + return fromString(name, ListActionKind.class); + } + + /** + * Gets known ListActionKind values. + * + * @return known ListActionKind values. + */ + public static Collection values() { + return values(ListActionKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ListActionsResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ListActionsResponse.java new file mode 100644 index 000000000000..7caa83eaaebe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ListActionsResponse.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List all actions for a system to perform. + */ +@Fluent +public final class ListActionsResponse { + /* + * Array of actions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to fetch the next page of actions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of ListActionsResponse class. + */ + public ListActionsResponse() { + } + + /** + * Get the value property: Array of actions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of actions. + * + * @param value the value value to set. + * @return the ListActionsResponse object itself. + */ + public ListActionsResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to fetch the next page of actions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to fetch the next page of actions. + * + * @param nextLink the nextLink value to set. + * @return the ListActionsResponse object itself. + */ + public ListActionsResponse 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) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ListActionsResponse")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ListActionsResponse.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LockUserAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LockUserAction.java new file mode 100644 index 000000000000..d34c76fe792f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LockUserAction.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents lock user action. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = LockUserAction.class, visible = true) +@JsonTypeName("LockUser") +@Fluent +public final class LockUserAction extends ActionInner { + /* + * The actions kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ListActionKind kind = ListActionKind.LOCK_USER; + + /* + * The user to lock + */ + @JsonProperty(value = "user") + private String user; + + /* + * The reason of the failure of the action. Empty if the action is successful. + */ + @JsonProperty(value = "failureReason") + private String failureReason; + + /** + * Creates an instance of LockUserAction class. + */ + public LockUserAction() { + } + + /** + * Get the kind property: The actions kind. + * + * @return the kind value. + */ + @Override + public ListActionKind kind() { + return this.kind; + } + + /** + * Get the user property: The user to lock. + * + * @return the user value. + */ + public String user() { + return this.user; + } + + /** + * Set the user property: The user to lock. + * + * @param user the user value to set. + * @return the LockUserAction object itself. + */ + public LockUserAction withUser(String user) { + this.user = user; + return this; + } + + /** + * Get the failureReason property: The reason of the failure of the action. Empty if the action is successful. + * + * @return the failureReason value. + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set the failureReason property: The reason of the failure of the action. Empty if the action is successful. + * + * @param failureReason the failureReason value to set. + * @return the LockUserAction object itself. + */ + public LockUserAction withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Log.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Log.java new file mode 100644 index 000000000000..14b381e91e27 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Log.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a log. + */ +@Fluent +public final class Log { + /* + * Types of logs and tables. + */ + @JsonProperty(value = "type", required = true) + private LogType type; + + /* + * Types of ingestion. + */ + @JsonProperty(value = "ingestionType") + private IngestionType ingestionType; + + /* + * Types of log status. + */ + @JsonProperty(value = "status") + private LogStatusType status; + + /* + * The schedule interval in seconds. + */ + @JsonProperty(value = "scheduleInterval") + private Integer scheduleInterval; + + /* + * The bulk size for the log. + */ + @JsonProperty(value = "bulkSize") + private Integer bulkSize; + + /* + * The filters for the log. + */ + @JsonProperty(value = "filters") + private List filters; + + /** + * Creates an instance of Log class. + */ + public Log() { + } + + /** + * Get the type property: Types of logs and tables. + * + * @return the type value. + */ + public LogType type() { + return this.type; + } + + /** + * Set the type property: Types of logs and tables. + * + * @param type the type value to set. + * @return the Log object itself. + */ + public Log withType(LogType type) { + this.type = type; + return this; + } + + /** + * Get the ingestionType property: Types of ingestion. + * + * @return the ingestionType value. + */ + public IngestionType ingestionType() { + return this.ingestionType; + } + + /** + * Set the ingestionType property: Types of ingestion. + * + * @param ingestionType the ingestionType value to set. + * @return the Log object itself. + */ + public Log withIngestionType(IngestionType ingestionType) { + this.ingestionType = ingestionType; + return this; + } + + /** + * Get the status property: Types of log status. + * + * @return the status value. + */ + public LogStatusType status() { + return this.status; + } + + /** + * Set the status property: Types of log status. + * + * @param status the status value to set. + * @return the Log object itself. + */ + public Log withStatus(LogStatusType status) { + this.status = status; + return this; + } + + /** + * Get the scheduleInterval property: The schedule interval in seconds. + * + * @return the scheduleInterval value. + */ + public Integer scheduleInterval() { + return this.scheduleInterval; + } + + /** + * Set the scheduleInterval property: The schedule interval in seconds. + * + * @param scheduleInterval the scheduleInterval value to set. + * @return the Log object itself. + */ + public Log withScheduleInterval(Integer scheduleInterval) { + this.scheduleInterval = scheduleInterval; + return this; + } + + /** + * Get the bulkSize property: The bulk size for the log. + * + * @return the bulkSize value. + */ + public Integer bulkSize() { + return this.bulkSize; + } + + /** + * Set the bulkSize property: The bulk size for the log. + * + * @param bulkSize the bulkSize value to set. + * @return the Log object itself. + */ + public Log withBulkSize(Integer bulkSize) { + this.bulkSize = bulkSize; + return this; + } + + /** + * Get the filters property: The filters for the log. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: The filters for the log. + * + * @param filters the filters value to set. + * @return the Log object itself. + */ + public Log withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property type in model Log")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Log.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LogStatusType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LogStatusType.java new file mode 100644 index 000000000000..ffa27c6bcc9f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LogStatusType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Types of log status. + */ +public final class LogStatusType extends ExpandableStringEnum { + /** + * Static value Enabled for LogStatusType. + */ + public static final LogStatusType ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for LogStatusType. + */ + public static final LogStatusType DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of LogStatusType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogStatusType() { + } + + /** + * Creates or finds a LogStatusType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogStatusType. + */ + @JsonCreator + public static LogStatusType fromString(String name) { + return fromString(name, LogStatusType.class); + } + + /** + * Gets known LogStatusType values. + * + * @return known LogStatusType values. + */ + public static Collection values() { + return values(LogStatusType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LogType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LogType.java new file mode 100644 index 000000000000..086931f1cefa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LogType.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Types of logs and tables. + */ +public final class LogType extends ExpandableStringEnum { + /** + * Static value AbapAuditLog for LogType. + */ + public static final LogType ABAP_AUDIT_LOG = fromString("AbapAuditLog"); + + /** + * Static value AbapJobLog for LogType. + */ + public static final LogType ABAP_JOB_LOG = fromString("AbapJobLog"); + + /** + * Static value AbapSpoolLog for LogType. + */ + public static final LogType ABAP_SPOOL_LOG = fromString("AbapSpoolLog"); + + /** + * Static value AbapSpoolOutputLog for LogType. + */ + public static final LogType ABAP_SPOOL_OUTPUT_LOG = fromString("AbapSpoolOutputLog"); + + /** + * Static value AbapChangeDocsLog for LogType. + */ + public static final LogType ABAP_CHANGE_DOCS_LOG = fromString("AbapChangeDocsLog"); + + /** + * Static value AbapAppLog for LogType. + */ + public static final LogType ABAP_APP_LOG = fromString("AbapAppLog"); + + /** + * Static value AbapWorkflowLog for LogType. + */ + public static final LogType ABAP_WORKFLOW_LOG = fromString("AbapWorkflowLog"); + + /** + * Static value AbapCrLog for LogType. + */ + public static final LogType ABAP_CR_LOG = fromString("AbapCrLog"); + + /** + * Static value AbapTableDataLog for LogType. + */ + public static final LogType ABAP_TABLE_DATA_LOG = fromString("AbapTableDataLog"); + + /** + * Static value AbapFilesLogs for LogType. + */ + public static final LogType ABAP_FILES_LOGS = fromString("AbapFilesLogs"); + + /** + * Static value JavaFilesLogs for LogType. + */ + public static final LogType JAVA_FILES_LOGS = fromString("JavaFilesLogs"); + + /** + * Static value AGRTCODES for LogType. + */ + public static final LogType AGRTCODES = fromString("AGRTCODES"); + + /** + * Static value USR01 for LogType. + */ + public static final LogType USR01 = fromString("USR01"); + + /** + * Static value USR02 for LogType. + */ + public static final LogType USR02 = fromString("USR02"); + + /** + * Static value AGR1251 for LogType. + */ + public static final LogType AGR1251 = fromString("AGR1251"); + + /** + * Static value AGRUSERS for LogType. + */ + public static final LogType AGRUSERS = fromString("AGRUSERS"); + + /** + * Static value AGRPROF for LogType. + */ + public static final LogType AGRPROF = fromString("AGRPROF"); + + /** + * Static value UST04 for LogType. + */ + public static final LogType UST04 = fromString("UST04"); + + /** + * Static value USR21 for LogType. + */ + public static final LogType USR21 = fromString("USR21"); + + /** + * Static value ADR6 for LogType. + */ + public static final LogType ADR6 = fromString("ADR6"); + + /** + * Static value ADCP for LogType. + */ + public static final LogType ADCP = fromString("ADCP"); + + /** + * Static value USR05 for LogType. + */ + public static final LogType USR05 = fromString("USR05"); + + /** + * Static value USGRPUSER for LogType. + */ + public static final LogType USGRPUSER = fromString("USGRPUSER"); + + /** + * Static value USERADDR for LogType. + */ + public static final LogType USERADDR = fromString("USERADDR"); + + /** + * Static value DEVACCESS for LogType. + */ + public static final LogType DEVACCESS = fromString("DEVACCESS"); + + /** + * Static value AGRDEFINE for LogType. + */ + public static final LogType AGRDEFINE = fromString("AGRDEFINE"); + + /** + * Static value PAHI for LogType. + */ + public static final LogType PAHI = fromString("PAHI"); + + /** + * Static value AGRAGRS for LogType. + */ + public static final LogType AGRAGRS = fromString("AGRAGRS"); + + /** + * Static value USRSTAMP for LogType. + */ + public static final LogType USRSTAMP = fromString("USRSTAMP"); + + /** + * Static value AGRFLAGS for LogType. + */ + public static final LogType AGRFLAGS = fromString("AGRFLAGS"); + + /** + * Static value SNCSYSACL for LogType. + */ + public static final LogType SNCSYSACL = fromString("SNCSYSACL"); + + /** + * Static value USRACL for LogType. + */ + public static final LogType USRACL = fromString("USRACL"); + + /** + * Creates a new instance of LogType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogType() { + } + + /** + * Creates or finds a LogType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogType. + */ + @JsonCreator + public static LogType fromString(String name) { + return fromString(name, LogType.class); + } + + /** + * Gets known LogType values. + * + * @return known LogType values. + */ + public static Collection values() { + return values(LogType.class); + } +} 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 index 9538371ea2c4..7c29cee23d13 100644 --- 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 @@ -8,32 +8,64 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; import com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents MLBehaviorAnalytics alert rule. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MLBehaviorAnalytics alert rule. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = MLBehaviorAnalyticsAlertRule.class, + visible = true) @JsonTypeName("MLBehaviorAnalytics") @Fluent public final class MLBehaviorAnalyticsAlertRule extends AlertRuleInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.MLBEHAVIOR_ANALYTICS; + /* * MLBehaviorAnalytics alert rule properties */ @JsonProperty(value = "properties") private MLBehaviorAnalyticsAlertRuleProperties innerProperties; + /** + * Creates an instance of MLBehaviorAnalyticsAlertRule class. + */ + public MLBehaviorAnalyticsAlertRule() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MLBehaviorAnalyticsAlertRule withEtag(String etag) { super.withEtag(etag); @@ -42,7 +74,7 @@ public MLBehaviorAnalyticsAlertRule withEtag(String etag) { /** * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @return the alertRuleTemplateName value. */ public String alertRuleTemplateName() { @@ -51,7 +83,7 @@ public String 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. */ @@ -65,7 +97,7 @@ public MLBehaviorAnalyticsAlertRule withAlertRuleTemplateName(String alertRuleTe /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -74,7 +106,7 @@ public String description() { /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -83,7 +115,7 @@ public String displayName() { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -92,7 +124,7 @@ public Boolean 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. */ @@ -106,7 +138,7 @@ public MLBehaviorAnalyticsAlertRule withEnabled(Boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this alert rule has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -115,7 +147,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -124,7 +156,7 @@ public AlertSeverity severity() { /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -133,16 +165,25 @@ public List 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(); + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 3dc6cb43070c..195fd1ad1463 100644 --- 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 @@ -8,25 +8,55 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; import com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleTemplateProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents MLBehaviorAnalytics alert rule template. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MLBehaviorAnalytics alert rule template. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = MLBehaviorAnalyticsAlertRuleTemplate.class, + visible = true) @JsonTypeName("MLBehaviorAnalytics") @Fluent public final class MLBehaviorAnalyticsAlertRuleTemplate extends AlertRuleTemplateInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.MLBEHAVIOR_ANALYTICS; + /* * MLBehaviorAnalytics alert rule template properties. */ @JsonProperty(value = "properties") private MLBehaviorAnalyticsAlertRuleTemplateProperties innerProperties; + /** + * Creates an instance of MLBehaviorAnalyticsAlertRuleTemplate class. + */ + public MLBehaviorAnalyticsAlertRuleTemplate() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @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() { @@ -35,7 +65,7 @@ private MLBehaviorAnalyticsAlertRuleTemplateProperties innerProperties() { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -44,7 +74,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity for alerts created by this alert rule. - * + * * @param severity the severity value to set. * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. */ @@ -58,7 +88,7 @@ public MLBehaviorAnalyticsAlertRuleTemplate withSeverity(AlertSeverity severity) /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -67,7 +97,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the alert rule. - * + * * @param tactics the tactics value to set. * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. */ @@ -81,7 +111,7 @@ public MLBehaviorAnalyticsAlertRuleTemplate withTactics(List tacti /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -90,7 +120,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. */ @@ -104,7 +134,7 @@ public MLBehaviorAnalyticsAlertRuleTemplate withTechniques(List techniqu /** * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @return the alertRulesCreatedByTemplateCount value. */ public Integer alertRulesCreatedByTemplateCount() { @@ -113,12 +143,12 @@ public Integer alertRulesCreatedByTemplateCount() { /** * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. */ - public MLBehaviorAnalyticsAlertRuleTemplate withAlertRulesCreatedByTemplateCount( - Integer alertRulesCreatedByTemplateCount) { + public MLBehaviorAnalyticsAlertRuleTemplate + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { if (this.innerProperties() == null) { this.innerProperties = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); } @@ -128,7 +158,7 @@ public MLBehaviorAnalyticsAlertRuleTemplate withAlertRulesCreatedByTemplateCount /** * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. - * + * * @return the lastUpdatedDateUtc value. */ public OffsetDateTime lastUpdatedDateUtc() { @@ -137,7 +167,7 @@ public OffsetDateTime lastUpdatedDateUtc() { /** * Get the createdDateUtc property: The time that this alert rule template has been added. - * + * * @return the createdDateUtc value. */ public OffsetDateTime createdDateUtc() { @@ -146,7 +176,7 @@ public OffsetDateTime createdDateUtc() { /** * Get the description property: The description of the alert rule template. - * + * * @return the description value. */ public String description() { @@ -155,7 +185,7 @@ public String description() { /** * Set the description property: The description of the alert rule template. - * + * * @param description the description value to set. * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. */ @@ -169,7 +199,7 @@ public MLBehaviorAnalyticsAlertRuleTemplate withDescription(String description) /** * Get the displayName property: The display name for alert rule template. - * + * * @return the displayName value. */ public String displayName() { @@ -178,7 +208,7 @@ public String displayName() { /** * Set the displayName property: The display name for alert rule template. - * + * * @param displayName the displayName value to set. * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. */ @@ -192,7 +222,7 @@ public MLBehaviorAnalyticsAlertRuleTemplate withDisplayName(String displayName) /** * Get the requiredDataConnectors property: The required data sources for this template. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -201,12 +231,12 @@ public List requiredDataConnectors() { /** * Set the requiredDataConnectors property: The required data sources for this template. - * + * * @param requiredDataConnectors the requiredDataConnectors value to set. * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. */ - public MLBehaviorAnalyticsAlertRuleTemplate withRequiredDataConnectors( - List requiredDataConnectors) { + public MLBehaviorAnalyticsAlertRuleTemplate + withRequiredDataConnectors(List requiredDataConnectors) { if (this.innerProperties() == null) { this.innerProperties = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); } @@ -216,7 +246,7 @@ public MLBehaviorAnalyticsAlertRuleTemplate withRequiredDataConnectors( /** * Get the status property: The alert rule template status. - * + * * @return the status value. */ public TemplateStatus status() { @@ -225,7 +255,7 @@ public TemplateStatus status() { /** * Set the status property: The alert rule template status. - * + * * @param status the status value to set. * @return the MLBehaviorAnalyticsAlertRuleTemplate object itself. */ @@ -239,7 +269,7 @@ public MLBehaviorAnalyticsAlertRuleTemplate withStatus(TemplateStatus status) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 1f8aeca643cc..d6bb37319f96 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 @@ -4,30 +4,56 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.MailClusterEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** Represents a mail cluster entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a mail cluster entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MailClusterEntity.class, visible = true) @JsonTypeName("MailCluster") -@Fluent +@Immutable public final class MailClusterEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.MAIL_CLUSTER; + /* * Mail cluster entity properties */ @JsonProperty(value = "properties") private MailClusterEntityProperties innerProperties; + /** + * Creates an instance of MailClusterEntity class. + */ + public MailClusterEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Mail cluster entity properties. - * + * * @return the innerProperties value. */ private MailClusterEntityProperties innerProperties() { @@ -36,7 +62,7 @@ private MailClusterEntityProperties innerProperties() { /** * Get the networkMessageIds property: The mail message IDs that are part of the mail cluster. - * + * * @return the networkMessageIds value. */ public List networkMessageIds() { @@ -45,7 +71,7 @@ public List networkMessageIds() { /** * Get the countByDeliveryStatus property: Count of mail messages by DeliveryStatus string representation. - * + * * @return the countByDeliveryStatus value. */ public Object countByDeliveryStatus() { @@ -54,7 +80,7 @@ public Object countByDeliveryStatus() { /** * Get the countByThreatType property: Count of mail messages by ThreatType string representation. - * + * * @return the countByThreatType value. */ public Object countByThreatType() { @@ -63,7 +89,7 @@ public Object countByThreatType() { /** * Get the countByProtectionStatus property: Count of mail messages by ProtectionStatus string representation. - * + * * @return the countByProtectionStatus value. */ public Object countByProtectionStatus() { @@ -72,7 +98,7 @@ public Object countByProtectionStatus() { /** * Get the threats property: The threats of mail messages that are part of the mail cluster. - * + * * @return the threats value. */ public List threats() { @@ -81,7 +107,7 @@ public List threats() { /** * Get the query property: The query that was used to identify the messages of the mail cluster. - * + * * @return the query value. */ public String query() { @@ -90,7 +116,7 @@ public String query() { /** * Get the queryTime property: The query time. - * + * * @return the queryTime value. */ public OffsetDateTime queryTime() { @@ -99,7 +125,7 @@ public OffsetDateTime queryTime() { /** * Get the mailCount property: The number of mail messages that are part of the mail cluster. - * + * * @return the mailCount value. */ public Integer mailCount() { @@ -108,7 +134,7 @@ public Integer mailCount() { /** * Get the isVolumeAnomaly property: Is this a volume anomaly mail cluster. - * + * * @return the isVolumeAnomaly value. */ public Boolean isVolumeAnomaly() { @@ -117,7 +143,7 @@ public Boolean isVolumeAnomaly() { /** * Get the source property: The source of the mail cluster (default is 'O365 ATP'). - * + * * @return the source value. */ public String source() { @@ -126,7 +152,7 @@ public String source() { /** * Get the clusterSourceIdentifier property: The id of the cluster source. - * + * * @return the clusterSourceIdentifier value. */ public String clusterSourceIdentifier() { @@ -135,7 +161,7 @@ public String clusterSourceIdentifier() { /** * Get the clusterSourceType property: The type of the cluster source. - * + * * @return the clusterSourceType value. */ public String clusterSourceType() { @@ -144,7 +170,7 @@ public String clusterSourceType() { /** * Get the clusterQueryStartTime property: The cluster query start time. - * + * * @return the clusterQueryStartTime value. */ public OffsetDateTime clusterQueryStartTime() { @@ -153,7 +179,7 @@ public OffsetDateTime clusterQueryStartTime() { /** * Get the clusterQueryEndTime property: The cluster query end time. - * + * * @return the clusterQueryEndTime value. */ public OffsetDateTime clusterQueryEndTime() { @@ -162,7 +188,7 @@ public OffsetDateTime clusterQueryEndTime() { /** * Get the clusterGroup property: The cluster group. - * + * * @return the clusterGroup value. */ public String clusterGroup() { @@ -172,7 +198,7 @@ public String clusterGroup() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -182,7 +208,7 @@ public Map 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() { @@ -191,7 +217,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 8d4c01ef2b89..13a1b7779830 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 @@ -8,6 +8,7 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.MailMessageEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; @@ -15,20 +16,45 @@ import java.util.Map; import java.util.UUID; -/** Represents a mail message entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a mail message entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MailMessageEntity.class, visible = true) @JsonTypeName("MailMessage") @Fluent public final class MailMessageEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.MAIL_MESSAGE; + /* * Mail message entity properties */ @JsonProperty(value = "properties") private MailMessageEntityProperties innerProperties; + /** + * Creates an instance of MailMessageEntity class. + */ + public MailMessageEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Mail message entity properties. - * + * * @return the innerProperties value. */ private MailMessageEntityProperties innerProperties() { @@ -37,7 +63,7 @@ private MailMessageEntityProperties innerProperties() { /** * Get the fileEntityIds property: The File entity ids of this mail message's attachments. - * + * * @return the fileEntityIds value. */ public List fileEntityIds() { @@ -47,7 +73,7 @@ public List fileEntityIds() { /** * Get the recipient property: The recipient of this mail message. Note that in case of multiple recipients the mail * message is forked and each copy has one recipient. - * + * * @return the recipient value. */ public String recipient() { @@ -56,7 +82,7 @@ public String recipient() { /** * Get the urls property: The Urls contained in this mail message. - * + * * @return the urls value. */ public List urls() { @@ -65,7 +91,7 @@ public List urls() { /** * Get the threats property: The threats of this mail message. - * + * * @return the threats value. */ public List threats() { @@ -74,7 +100,7 @@ public List threats() { /** * Get the p1Sender property: The p1 sender's email address. - * + * * @return the p1Sender value. */ public String p1Sender() { @@ -83,7 +109,7 @@ public String p1Sender() { /** * Get the p1SenderDisplayName property: The p1 sender's display name. - * + * * @return the p1SenderDisplayName value. */ public String p1SenderDisplayName() { @@ -92,7 +118,7 @@ public String p1SenderDisplayName() { /** * Get the p1SenderDomain property: The p1 sender's domain. - * + * * @return the p1SenderDomain value. */ public String p1SenderDomain() { @@ -101,7 +127,7 @@ public String p1SenderDomain() { /** * Get the senderIp property: The sender's IP address. - * + * * @return the senderIp value. */ public String senderIp() { @@ -110,7 +136,7 @@ public String senderIp() { /** * Get the p2Sender property: The p2 sender's email address. - * + * * @return the p2Sender value. */ public String p2Sender() { @@ -119,7 +145,7 @@ public String p2Sender() { /** * Get the p2SenderDisplayName property: The p2 sender's display name. - * + * * @return the p2SenderDisplayName value. */ public String p2SenderDisplayName() { @@ -128,7 +154,7 @@ public String p2SenderDisplayName() { /** * Get the p2SenderDomain property: The p2 sender's domain. - * + * * @return the p2SenderDomain value. */ public String p2SenderDomain() { @@ -137,7 +163,7 @@ public String p2SenderDomain() { /** * Get the receiveDate property: The receive date of this message. - * + * * @return the receiveDate value. */ public OffsetDateTime receiveDate() { @@ -146,7 +172,7 @@ public OffsetDateTime receiveDate() { /** * Get the networkMessageId property: The network message id of this mail message. - * + * * @return the networkMessageId value. */ public UUID networkMessageId() { @@ -155,7 +181,7 @@ public UUID networkMessageId() { /** * Get the internetMessageId property: The internet message id of this mail message. - * + * * @return the internetMessageId value. */ public String internetMessageId() { @@ -164,7 +190,7 @@ public String internetMessageId() { /** * Get the subject property: The subject of this mail message. - * + * * @return the subject value. */ public String subject() { @@ -173,7 +199,7 @@ public String subject() { /** * Get the language property: The language of this mail message. - * + * * @return the language value. */ public String language() { @@ -182,7 +208,7 @@ public String language() { /** * Get the threatDetectionMethods property: The threat detection methods. - * + * * @return the threatDetectionMethods value. */ public List threatDetectionMethods() { @@ -191,7 +217,7 @@ public List threatDetectionMethods() { /** * Get the bodyFingerprintBin1 property: The bodyFingerprintBin1. - * + * * @return the bodyFingerprintBin1 value. */ public Integer bodyFingerprintBin1() { @@ -200,7 +226,7 @@ public Integer bodyFingerprintBin1() { /** * Set the bodyFingerprintBin1 property: The bodyFingerprintBin1. - * + * * @param bodyFingerprintBin1 the bodyFingerprintBin1 value to set. * @return the MailMessageEntity object itself. */ @@ -214,7 +240,7 @@ public MailMessageEntity withBodyFingerprintBin1(Integer bodyFingerprintBin1) { /** * Get the bodyFingerprintBin2 property: The bodyFingerprintBin2. - * + * * @return the bodyFingerprintBin2 value. */ public Integer bodyFingerprintBin2() { @@ -223,7 +249,7 @@ public Integer bodyFingerprintBin2() { /** * Set the bodyFingerprintBin2 property: The bodyFingerprintBin2. - * + * * @param bodyFingerprintBin2 the bodyFingerprintBin2 value to set. * @return the MailMessageEntity object itself. */ @@ -237,7 +263,7 @@ public MailMessageEntity withBodyFingerprintBin2(Integer bodyFingerprintBin2) { /** * Get the bodyFingerprintBin3 property: The bodyFingerprintBin3. - * + * * @return the bodyFingerprintBin3 value. */ public Integer bodyFingerprintBin3() { @@ -246,7 +272,7 @@ public Integer bodyFingerprintBin3() { /** * Set the bodyFingerprintBin3 property: The bodyFingerprintBin3. - * + * * @param bodyFingerprintBin3 the bodyFingerprintBin3 value to set. * @return the MailMessageEntity object itself. */ @@ -260,7 +286,7 @@ public MailMessageEntity withBodyFingerprintBin3(Integer bodyFingerprintBin3) { /** * Get the bodyFingerprintBin4 property: The bodyFingerprintBin4. - * + * * @return the bodyFingerprintBin4 value. */ public Integer bodyFingerprintBin4() { @@ -269,7 +295,7 @@ public Integer bodyFingerprintBin4() { /** * Set the bodyFingerprintBin4 property: The bodyFingerprintBin4. - * + * * @param bodyFingerprintBin4 the bodyFingerprintBin4 value to set. * @return the MailMessageEntity object itself. */ @@ -283,7 +309,7 @@ public MailMessageEntity withBodyFingerprintBin4(Integer bodyFingerprintBin4) { /** * Get the bodyFingerprintBin5 property: The bodyFingerprintBin5. - * + * * @return the bodyFingerprintBin5 value. */ public Integer bodyFingerprintBin5() { @@ -292,7 +318,7 @@ public Integer bodyFingerprintBin5() { /** * Set the bodyFingerprintBin5 property: The bodyFingerprintBin5. - * + * * @param bodyFingerprintBin5 the bodyFingerprintBin5 value to set. * @return the MailMessageEntity object itself. */ @@ -306,7 +332,7 @@ public MailMessageEntity withBodyFingerprintBin5(Integer bodyFingerprintBin5) { /** * Get the antispamDirection property: The directionality of this mail message. - * + * * @return the antispamDirection value. */ public AntispamMailDirection antispamDirection() { @@ -315,7 +341,7 @@ public AntispamMailDirection antispamDirection() { /** * Set the antispamDirection property: The directionality of this mail message. - * + * * @param antispamDirection the antispamDirection value to set. * @return the MailMessageEntity object itself. */ @@ -329,7 +355,7 @@ public MailMessageEntity withAntispamDirection(AntispamMailDirection antispamDir /** * Get the deliveryAction property: The delivery action of this mail message like Delivered, Blocked, Replaced etc. - * + * * @return the deliveryAction value. */ public DeliveryAction deliveryAction() { @@ -338,7 +364,7 @@ public DeliveryAction 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. */ @@ -352,7 +378,7 @@ public MailMessageEntity withDeliveryAction(DeliveryAction deliveryAction) { /** * Get the deliveryLocation property: The delivery location of this mail message like Inbox, JunkFolder etc. - * + * * @return the deliveryLocation value. */ public DeliveryLocation deliveryLocation() { @@ -361,7 +387,7 @@ public DeliveryLocation 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. */ @@ -376,7 +402,7 @@ public MailMessageEntity withDeliveryLocation(DeliveryLocation deliveryLocation) /** * 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() { @@ -386,7 +412,7 @@ public Map 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() { @@ -395,7 +421,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 9441ac626ef0..aa5b90151b58 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 @@ -4,29 +4,55 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.MailboxEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; import java.util.UUID; -/** Represents a mailbox entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a mailbox entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MailboxEntity.class, visible = true) @JsonTypeName("Mailbox") -@Fluent +@Immutable public final class MailboxEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.MAILBOX; + /* * Mailbox entity properties */ @JsonProperty(value = "properties") private MailboxEntityProperties innerProperties; + /** + * Creates an instance of MailboxEntity class. + */ + public MailboxEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Mailbox entity properties. - * + * * @return the innerProperties value. */ private MailboxEntityProperties innerProperties() { @@ -35,7 +61,7 @@ private MailboxEntityProperties innerProperties() { /** * Get the mailboxPrimaryAddress property: The mailbox's primary address. - * + * * @return the mailboxPrimaryAddress value. */ public String mailboxPrimaryAddress() { @@ -44,7 +70,7 @@ public String mailboxPrimaryAddress() { /** * Get the displayName property: The mailbox's display name. - * + * * @return the displayName value. */ public String displayName() { @@ -53,7 +79,7 @@ public String displayName() { /** * Get the upn property: The mailbox's UPN. - * + * * @return the upn value. */ public String upn() { @@ -63,7 +89,7 @@ public String upn() { /** * Get the externalDirectoryObjectId property: The AzureAD identifier of mailbox. Similar to AadUserId in account * entity but this property is specific to mailbox object on office side. - * + * * @return the externalDirectoryObjectId value. */ public UUID externalDirectoryObjectId() { @@ -73,7 +99,7 @@ public UUID externalDirectoryObjectId() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -83,7 +109,7 @@ public Map 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() { @@ -92,7 +118,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 efcd2bbb952b..ba2d5f3abcc2 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 @@ -4,29 +4,55 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.MalwareEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; import java.util.Map; -/** Represents a malware entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a malware entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MalwareEntity.class, visible = true) @JsonTypeName("Malware") -@Fluent +@Immutable public final class MalwareEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.MALWARE; + /* * File entity properties */ @JsonProperty(value = "properties") private MalwareEntityProperties innerProperties; + /** + * Creates an instance of MalwareEntity class. + */ + public MalwareEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: File entity properties. - * + * * @return the innerProperties value. */ private MalwareEntityProperties innerProperties() { @@ -35,7 +61,7 @@ private MalwareEntityProperties innerProperties() { /** * Get the category property: The malware category by the vendor, e.g. Trojan. - * + * * @return the category value. */ public String category() { @@ -44,7 +70,7 @@ public String category() { /** * Get the fileEntityIds property: List of linked file entity identifiers on which the malware was found. - * + * * @return the fileEntityIds value. */ public List fileEntityIds() { @@ -53,7 +79,7 @@ public List fileEntityIds() { /** * Get the malwareName property: The malware name by the vendor, e.g. Win32/Toga!rfn. - * + * * @return the malwareName value. */ public String malwareName() { @@ -62,7 +88,7 @@ public String malwareName() { /** * Get the processEntityIds property: List of linked process entity identifiers on which the malware was found. - * + * * @return the processEntityIds value. */ public List processEntityIds() { @@ -72,7 +98,7 @@ public List processEntityIds() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -82,7 +108,7 @@ public Map 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() { @@ -91,7 +117,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index ab2433df85a5..f5a60797d2f1 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; -/** The ManualTriggerRequestBody model. */ +/** + * The ManualTriggerRequestBody model. + */ @Fluent public final class ManualTriggerRequestBody { /* @@ -24,9 +26,15 @@ public final class ManualTriggerRequestBody { @JsonProperty(value = "logicAppsResourceId", required = true) private String logicAppsResourceId; + /** + * Creates an instance of ManualTriggerRequestBody class. + */ + public ManualTriggerRequestBody() { + } + /** * Get the tenantId property: The tenantId property. - * + * * @return the tenantId value. */ public UUID tenantId() { @@ -35,7 +43,7 @@ public UUID tenantId() { /** * Set the tenantId property: The tenantId property. - * + * * @param tenantId the tenantId value to set. * @return the ManualTriggerRequestBody object itself. */ @@ -46,7 +54,7 @@ public ManualTriggerRequestBody withTenantId(UUID tenantId) { /** * Get the logicAppsResourceId property: The logicAppsResourceId property. - * + * * @return the logicAppsResourceId value. */ public String logicAppsResourceId() { @@ -55,7 +63,7 @@ public String logicAppsResourceId() { /** * Set the logicAppsResourceId property: The logicAppsResourceId property. - * + * * @param logicAppsResourceId the logicAppsResourceId value to set. * @return the ManualTriggerRequestBody object itself. */ @@ -66,15 +74,14 @@ public ManualTriggerRequestBody withLogicAppsResourceId(String logicAppsResource /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (logicAppsResourceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property logicAppsResourceId in model ManualTriggerRequestBody")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property logicAppsResourceId in model ManualTriggerRequestBody")); } } 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 412bb642d81e..c1823b358023 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 @@ -13,18 +13,33 @@ * groupByCustomDetails must be provided and not empty. */ public final class MatchingMethod extends ExpandableStringEnum { - /** Static value AllEntities for MatchingMethod. */ + /** + * Static value AllEntities for MatchingMethod. + */ public static final MatchingMethod ALL_ENTITIES = fromString("AllEntities"); - /** Static value AnyAlert for MatchingMethod. */ + /** + * Static value AnyAlert for MatchingMethod. + */ public static final MatchingMethod ANY_ALERT = fromString("AnyAlert"); - /** Static value Selected for MatchingMethod. */ + /** + * Static value Selected for MatchingMethod. + */ public static final MatchingMethod SELECTED = fromString("Selected"); + /** + * Creates a new instance of MatchingMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MatchingMethod() { + } + /** * Creates or finds a MatchingMethod from its string representation. - * + * * @param name a name to look for. * @return the corresponding MatchingMethod. */ @@ -35,7 +50,7 @@ public static MatchingMethod fromString(String name) { /** * Gets known MatchingMethod values. - * + * * @return known MatchingMethod values. */ public static Collection values() { 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 index bf543c75aaaf..7278c6ac6740 100644 --- 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 @@ -7,32 +7,81 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.McasCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents MCAS (Microsoft Cloud App Security) requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MCAS (Microsoft Cloud App Security) requirements check request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = McasCheckRequirements.class, visible = true) @JsonTypeName("MicrosoftCloudAppSecurity") @Fluent public final class McasCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_CLOUD_APP_SECURITY; + /* * MCAS (Microsoft Cloud App Security) requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 4849da973db9..6e5cbda4bd77 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.McasDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents MCAS (Microsoft Cloud App Security) data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MCAS (Microsoft Cloud App Security) data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = McasDataConnector.class, visible = true) @JsonTypeName("MicrosoftCloudAppSecurity") @Fluent public final class McasDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_CLOUD_APP_SECURITY; + /* * MCAS (Microsoft Cloud App Security) data connector properties. */ @JsonProperty(value = "properties") private McasDataConnectorProperties innerProperties; + /** + * Creates an instance of McasDataConnector class. + */ + public McasDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + /** * Get the innerProperties property: MCAS (Microsoft Cloud App Security) data connector properties. - * + * * @return the innerProperties value. */ private McasDataConnectorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public McasDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public McasDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public McasDataConnectorDataTypes dataTypes() { @@ -49,7 +77,7 @@ public McasDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the McasDataConnector object itself. */ @@ -63,7 +91,7 @@ public McasDataConnector withDataTypes(McasDataConnectorDataTypes dataTypes) { /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +100,7 @@ public String 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. */ @@ -86,7 +114,7 @@ public McasDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 ced242cf519f..ec128ff45072 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for MCAS (Microsoft Cloud App Security) data connector. */ +/** + * The available data types for MCAS (Microsoft Cloud App Security) data connector. + */ @Fluent public final class McasDataConnectorDataTypes extends AlertsDataTypeOfDataConnector { /* @@ -16,9 +18,15 @@ public final class McasDataConnectorDataTypes extends AlertsDataTypeOfDataConnec @JsonProperty(value = "discoveryLogs") private DataConnectorDataTypeCommon discoveryLogs; + /** + * Creates an instance of McasDataConnectorDataTypes class. + */ + public McasDataConnectorDataTypes() { + } + /** * Get the discoveryLogs property: Discovery log data type connection. - * + * * @return the discoveryLogs value. */ public DataConnectorDataTypeCommon discoveryLogs() { @@ -27,7 +35,7 @@ public DataConnectorDataTypeCommon discoveryLogs() { /** * Set the discoveryLogs property: Discovery log data type connection. - * + * * @param discoveryLogs the discoveryLogs value to set. * @return the McasDataConnectorDataTypes object itself. */ @@ -36,7 +44,9 @@ public McasDataConnectorDataTypes withDiscoveryLogs(DataConnectorDataTypeCommon return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public McasDataConnectorDataTypes withAlerts(DataConnectorDataTypeCommon alerts) { super.withAlerts(alerts); @@ -45,7 +55,7 @@ public McasDataConnectorDataTypes withAlerts(DataConnectorDataTypeCommon alerts) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 97b1be834a33..4a54d53900fd 100644 --- 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 @@ -7,33 +7,82 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.MdatpCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents MDATP (Microsoft Defender Advanced Threat Protection) requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MDATP (Microsoft Defender Advanced Threat Protection) requirements check request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MdatpCheckRequirements.class, visible = true) @JsonTypeName("MicrosoftDefenderAdvancedThreatProtection") @Fluent public final class MdatpCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION; + /* * MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 be4c5abc500b..505e81d657bb 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 @@ -8,31 +8,59 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.MdatpDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents MDATP (Microsoft Defender Advanced Threat Protection) data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MDATP (Microsoft Defender Advanced Threat Protection) data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MdatpDataConnector.class, visible = true) @JsonTypeName("MicrosoftDefenderAdvancedThreatProtection") @Fluent public final class MdatpDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION; + /* * MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. */ @JsonProperty(value = "properties") private MdatpDataConnectorProperties innerProperties; + /** + * Creates an instance of MdatpDataConnector class. + */ + public MdatpDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + /** * Get the innerProperties property: MDATP (Microsoft Defender Advanced Threat Protection) data connector * properties. - * + * * @return the innerProperties value. */ private MdatpDataConnectorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MdatpDataConnector withEtag(String etag) { super.withEtag(etag); @@ -41,7 +69,7 @@ public MdatpDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -50,7 +78,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the MdatpDataConnector object itself. */ @@ -64,7 +92,7 @@ public MdatpDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -73,7 +101,7 @@ public String tenantId() { /** * Set the tenantId property: The tenant id to connect to, and get the data from. - * + * * @param tenantId the tenantId value to set. * @return the MdatpDataConnector object itself. */ @@ -87,7 +115,7 @@ public MdatpDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 568297b27c57..0132ecea29dd 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Publisher or creator of the content item. */ +/** + * Publisher or creator of the content item. + */ @Fluent public final class MetadataAuthor { /* @@ -28,9 +30,15 @@ public final class MetadataAuthor { @JsonProperty(value = "link") 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() { @@ -39,7 +47,7 @@ public String name() { /** * Set the name property: Name of the author. Company or person. - * + * * @param name the name value to set. * @return the MetadataAuthor object itself. */ @@ -50,7 +58,7 @@ public MetadataAuthor withName(String name) { /** * Get the email property: Email of author contact. - * + * * @return the email value. */ public String email() { @@ -59,7 +67,7 @@ public String email() { /** * Set the email property: Email of author contact. - * + * * @param email the email value to set. * @return the MetadataAuthor object itself. */ @@ -70,7 +78,7 @@ public MetadataAuthor withEmail(String email) { /** * Get the link property: Link for author/vendor page. - * + * * @return the link value. */ public String link() { @@ -79,7 +87,7 @@ public String link() { /** * Set the link property: Link for author/vendor page. - * + * * @param link the link value to set. * @return the MetadataAuthor object itself. */ @@ -90,7 +98,7 @@ public MetadataAuthor withLink(String link) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataCategories.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataCategories.java index d2101c1cc1cf..47d4611cd4d1 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** ies for the solution content item. */ +/** + * ies for the solution content item. + */ @Fluent public final class MetadataCategories { /* @@ -23,9 +25,15 @@ public final class MetadataCategories { @JsonProperty(value = "verticals") 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() { @@ -34,7 +42,7 @@ public List domains() { /** * Set the domains property: domain for the solution content item. - * + * * @param domains the domains value to set. * @return the MetadataCategories object itself. */ @@ -45,7 +53,7 @@ public MetadataCategories withDomains(List domains) { /** * Get the verticals property: Industry verticals for the solution content item. - * + * * @return the verticals value. */ public List verticals() { @@ -54,7 +62,7 @@ public List verticals() { /** * Set the verticals property: Industry verticals for the solution content item. - * + * * @param verticals the verticals value to set. * @return the MetadataCategories object itself. */ @@ -65,7 +73,7 @@ public MetadataCategories withVerticals(List verticals) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencies.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencies.java index 0fcabe6da5cd..0f41ff6562fb 100644 --- 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 @@ -28,8 +28,7 @@ public final class MetadataDependencies { 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. + * Version of the the content item we depend on. Can be blank, * or missing to indicate any version fulfills the dependency. If version does not match our defined numeric format then an exact match is required. */ @JsonProperty(value = "version") private String version; @@ -52,9 +51,15 @@ public final class MetadataDependencies { @JsonProperty(value = "criteria") 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() { @@ -63,7 +68,7 @@ public String 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. */ @@ -74,7 +79,7 @@ public MetadataDependencies withContentId(String contentId) { /** * Get the kind property: Type of the content item we depend on. - * + * * @return the kind value. */ public Kind kind() { @@ -83,7 +88,7 @@ public Kind 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. */ @@ -96,7 +101,7 @@ public MetadataDependencies withKind(Kind kind) { * 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() { @@ -107,7 +112,7 @@ public String 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. */ @@ -118,7 +123,7 @@ public MetadataDependencies withVersion(String version) { /** * Get the name property: Name of the content item. - * + * * @return the name value. */ public String name() { @@ -127,7 +132,7 @@ public String name() { /** * Set the name property: Name of the content item. - * + * * @param name the name value to set. * @return the MetadataDependencies object itself. */ @@ -138,7 +143,7 @@ public MetadataDependencies withName(String name) { /** * Get the operator property: Operator used for list of dependencies in criteria array. - * + * * @return the operator value. */ public Operator operator() { @@ -147,7 +152,7 @@ public Operator 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. */ @@ -158,7 +163,7 @@ public MetadataDependencies withOperator(Operator operator) { /** * 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() { @@ -167,7 +172,7 @@ public List 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. */ @@ -178,7 +183,7 @@ public MetadataDependencies withCriteria(List criteria) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataList.java index a5a93f7aa39f..cb7f582c7ec0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the metadata. */ +/** + * List of all the metadata. + */ @Fluent public final class MetadataList { /* @@ -25,9 +27,15 @@ public final class MetadataList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** + * Creates an instance of MetadataList class. + */ + public MetadataList() { + } + /** * Get the value property: Array of metadata. - * + * * @return the value value. */ public List value() { @@ -36,7 +44,7 @@ public List value() { /** * Set the value property: Array of metadata. - * + * * @param value the value value to set. * @return the MetadataList object itself. */ @@ -47,7 +55,7 @@ public MetadataList withValue(List value) { /** * Get the nextLink property: URL to fetch the next page of metadata. - * + * * @return the nextLink value. */ public String nextLink() { @@ -56,14 +64,13 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model MetadataList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model MetadataList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataModel.java index 392d45ae5499..0a1d7ff5a2dc 100644 --- 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 @@ -10,39 +10,41 @@ import java.time.LocalDate; import java.util.List; -/** An immutable client-side representation of MetadataModel. */ +/** + * 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(); @@ -51,7 +53,7 @@ public interface MetadataModel { * 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(); @@ -59,7 +61,7 @@ public interface MetadataModel { /** * 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(); @@ -68,35 +70,35 @@ public interface MetadataModel { * Gets the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version * checks. - * + * * @return the version value. */ String version(); /** * Gets the kind property: The kind of content the metadata is for. - * + * * @return the kind value. */ - Kind kind(); + 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(); @@ -105,42 +107,42 @@ public interface MetadataModel { * Gets the dependencies property: Dependencies for the content item, what other content items it requires to work. * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an * id/kind/version can be supplied or operator/criteria for complex formats. - * + * * @return the dependencies value. */ MetadataDependencies dependencies(); /** * Gets the categories property: Categories for the solution content item. - * + * * @return the categories value. */ MetadataCategories categories(); /** * Gets the providers property: Providers for the solution content item. - * + * * @return the providers value. */ List providers(); /** * Gets the firstPublishDate property: first publish date solution content item. - * + * * @return the firstPublishDate value. */ LocalDate firstPublishDate(); /** * Gets the lastPublishDate property: last publish date for the solution content item. - * + * * @return the lastPublishDate value. */ LocalDate lastPublishDate(); /** * Gets the customVersion property: The custom version of the content. A optional free text. - * + * * @return the customVersion value. */ String customVersion(); @@ -148,21 +150,21 @@ public interface MetadataModel { /** * 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(); @@ -170,14 +172,14 @@ public interface MetadataModel { /** * 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(); @@ -185,587 +187,697 @@ public interface MetadataModel { /** * 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. */ + /** + * The entirety of the MetadataModel definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The MetadataModel definition stages. */ + + /** + * The MetadataModel definition stages. + */ interface DefinitionStages { - /** The first stage of the MetadataModel definition. */ + /** + * The first stage of the MetadataModel definition. + */ interface Blank extends WithParentResource { } - /** The stage of the MetadataModel definition allowing to specify parent resource. */ + + /** + * The stage of the MetadataModel definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** * The stage of the MetadataModel definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithEtag, - DefinitionStages.WithContentId, - DefinitionStages.WithParentId, - DefinitionStages.WithVersion, - DefinitionStages.WithKind, - DefinitionStages.WithSource, - DefinitionStages.WithAuthor, - DefinitionStages.WithSupport, - DefinitionStages.WithDependencies, - DefinitionStages.WithCategories, - DefinitionStages.WithProviders, - DefinitionStages.WithFirstPublishDate, - DefinitionStages.WithLastPublishDate, - DefinitionStages.WithCustomVersion, - DefinitionStages.WithContentSchemaVersion, - DefinitionStages.WithIcon, - DefinitionStages.WithThreatAnalysisTactics, - DefinitionStages.WithThreatAnalysisTechniques, - DefinitionStages.WithPreviewImages, - DefinitionStages.WithPreviewImagesDark { + 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. */ + + /** + * 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. */ + + /** + * The stage of the MetadataModel definition allowing to specify contentId. + */ interface WithContentId { /** * Specifies the contentId property: Static ID for the content. Used to identify dependencies and content * from solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic for * user-created. This is the resource name. - * + * * @param contentId Static ID for the content. Used to identify dependencies and content from solutions or - * community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This - * is the resource name. + * community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is + * the resource name. * @return the next definition stage. */ WithCreate withContentId(String contentId); } - /** The stage of the MetadataModel definition allowing to specify parentId. */ + + /** + * 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). + * 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. */ + + /** + * 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. + * 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. */ + + /** + * The stage of the MetadataModel definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: The kind of content the metadata is for.. - * + * * @param kind The kind of content the metadata is for. * @return the next definition stage. */ - WithCreate withKind(Kind kind); + WithCreate withKind(String kind); } - /** The stage of the MetadataModel definition allowing to specify source. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * The stage of the MetadataModel definition allowing to specify firstPublishDate. + */ interface WithFirstPublishDate { /** * Specifies the firstPublishDate property: first publish date solution content item. - * + * * @param firstPublishDate first publish date solution content item. * @return the next definition stage. */ WithCreate withFirstPublishDate(LocalDate firstPublishDate); } - /** The stage of the MetadataModel definition allowing to specify lastPublishDate. */ + + /** + * The stage of the MetadataModel definition allowing to specify lastPublishDate. + */ interface WithLastPublishDate { /** * Specifies the lastPublishDate property: last publish date for the solution content item. - * + * * @param lastPublishDate last publish date for the solution content item. * @return the next definition stage. */ WithCreate withLastPublishDate(LocalDate lastPublishDate); } - /** The stage of the MetadataModel definition allowing to specify customVersion. */ + + /** + * 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. */ + + /** + * 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. + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. + * tactics being used. * @return the next definition stage. */ WithCreate withThreatAnalysisTechniques(List threatAnalysisTechniques); } - /** The stage of the MetadataModel definition allowing to specify previewImages. */ + + /** + * 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. */ + + /** + * 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. + * 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. */ + /** + * 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 { + 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. */ + + /** + * The MetadataModel update stages. + */ interface UpdateStages { - /** The stage of the MetadataModel update allowing to specify etag. */ + /** + * 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. */ + + /** + * The stage of the MetadataModel update allowing to specify contentId. + */ interface WithContentId { /** * Specifies the contentId property: Static ID for the content. Used to identify dependencies and content * from solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic for * user-created. This is the resource name. - * + * * @param contentId Static ID for the content. Used to identify dependencies and content from solutions or - * community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This - * is the resource name. + * community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is + * the resource name. * @return the next definition stage. */ Update withContentId(String contentId); } - /** The stage of the MetadataModel update allowing to specify parentId. */ + + /** + * 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). + * 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. */ + + /** + * 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. + * 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. */ + + /** + * The stage of the MetadataModel update allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: The kind of content the metadata is for.. - * + * * @param kind The kind of content the metadata is for. * @return the next definition stage. */ - Update withKind(Kind kind); + Update withKind(String kind); } - /** The stage of the MetadataModel update allowing to specify source. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * The stage of the MetadataModel update allowing to specify firstPublishDate. + */ interface WithFirstPublishDate { /** * Specifies the firstPublishDate property: first publish date solution content item. - * + * * @param firstPublishDate first publish date solution content item. * @return the next definition stage. */ Update withFirstPublishDate(LocalDate firstPublishDate); } - /** The stage of the MetadataModel update allowing to specify lastPublishDate. */ + + /** + * The stage of the MetadataModel update allowing to specify lastPublishDate. + */ interface WithLastPublishDate { /** * Specifies the lastPublishDate property: last publish date for the solution content item. - * + * * @param lastPublishDate last publish date for the solution content item. * @return the next definition stage. */ Update withLastPublishDate(LocalDate lastPublishDate); } - /** The stage of the MetadataModel update allowing to specify customVersion. */ + + /** + * 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. */ + + /** + * 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. + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. + * tactics being used. * @return the next definition stage. */ Update withThreatAnalysisTechniques(List threatAnalysisTechniques); } - /** The stage of the MetadataModel update allowing to specify previewImages. */ + + /** + * 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. */ + + /** + * 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. + * 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. */ 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 index 7556f02585fb..f8a515197848 100644 --- 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 @@ -10,7 +10,9 @@ import java.time.LocalDate; import java.util.List; -/** Metadata patch request body. */ +/** + * Metadata patch request body. + */ @Fluent public final class MetadataPatch extends ResourceWithEtag { /* @@ -19,16 +21,24 @@ public final class MetadataPatch extends ResourceWithEtag { @JsonProperty(value = "properties") private MetadataPropertiesPatch innerProperties; + /** + * 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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MetadataPatch withEtag(String etag) { super.withEtag(etag); @@ -39,7 +49,7 @@ public MetadataPatch withEtag(String etag) { * 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() { @@ -50,7 +60,7 @@ public String contentId() { * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the * resource name. - * + * * @param contentId the contentId value to set. * @return the MetadataPatch object itself. */ @@ -65,7 +75,7 @@ public MetadataPatch withContentId(String contentId) { /** * 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() { @@ -75,7 +85,7 @@ public String 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. */ @@ -91,7 +101,7 @@ public MetadataPatch withParentId(String parentId) { * 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() { @@ -102,7 +112,7 @@ public String 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. */ @@ -116,20 +126,20 @@ public MetadataPatch withVersion(String version) { /** * Get the kind property: The kind of content the metadata is for. - * + * * @return the kind value. */ - public Kind kind() { + 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(Kind kind) { + public MetadataPatch withKind(String kind) { if (this.innerProperties() == null) { this.innerProperties = new MetadataPropertiesPatch(); } @@ -139,7 +149,7 @@ public MetadataPatch withKind(Kind kind) { /** * Get the source property: Source of the content. This is where/how it was created. - * + * * @return the source value. */ public MetadataSource source() { @@ -148,7 +158,7 @@ public MetadataSource 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. */ @@ -162,7 +172,7 @@ public MetadataPatch withSource(MetadataSource source) { /** * Get the author property: The creator of the content item. - * + * * @return the author value. */ public MetadataAuthor author() { @@ -171,7 +181,7 @@ public MetadataAuthor author() { /** * Set the author property: The creator of the content item. - * + * * @param author the author value to set. * @return the MetadataPatch object itself. */ @@ -185,7 +195,7 @@ public MetadataPatch withAuthor(MetadataAuthor author) { /** * Get the support property: Support information for the metadata - type, name, contact information. - * + * * @return the support value. */ public MetadataSupport support() { @@ -194,7 +204,7 @@ public MetadataSupport 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. */ @@ -210,7 +220,7 @@ public MetadataPatch withSupport(MetadataSupport 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() { @@ -221,7 +231,7 @@ public MetadataDependencies 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. */ @@ -235,7 +245,7 @@ public MetadataPatch withDependencies(MetadataDependencies dependencies) { /** * Get the categories property: Categories for the solution content item. - * + * * @return the categories value. */ public MetadataCategories categories() { @@ -244,7 +254,7 @@ public MetadataCategories categories() { /** * Set the categories property: Categories for the solution content item. - * + * * @param categories the categories value to set. * @return the MetadataPatch object itself. */ @@ -258,7 +268,7 @@ public MetadataPatch withCategories(MetadataCategories categories) { /** * Get the providers property: Providers for the solution content item. - * + * * @return the providers value. */ public List providers() { @@ -267,7 +277,7 @@ public List providers() { /** * Set the providers property: Providers for the solution content item. - * + * * @param providers the providers value to set. * @return the MetadataPatch object itself. */ @@ -281,7 +291,7 @@ public MetadataPatch withProviders(List providers) { /** * Get the firstPublishDate property: first publish date solution content item. - * + * * @return the firstPublishDate value. */ public LocalDate firstPublishDate() { @@ -290,7 +300,7 @@ public LocalDate firstPublishDate() { /** * Set the firstPublishDate property: first publish date solution content item. - * + * * @param firstPublishDate the firstPublishDate value to set. * @return the MetadataPatch object itself. */ @@ -304,7 +314,7 @@ public MetadataPatch withFirstPublishDate(LocalDate firstPublishDate) { /** * Get the lastPublishDate property: last publish date for the solution content item. - * + * * @return the lastPublishDate value. */ public LocalDate lastPublishDate() { @@ -313,7 +323,7 @@ public LocalDate lastPublishDate() { /** * Set the lastPublishDate property: last publish date for the solution content item. - * + * * @param lastPublishDate the lastPublishDate value to set. * @return the MetadataPatch object itself. */ @@ -327,7 +337,7 @@ public MetadataPatch withLastPublishDate(LocalDate lastPublishDate) { /** * Get the customVersion property: The custom version of the content. A optional free text. - * + * * @return the customVersion value. */ public String customVersion() { @@ -336,7 +346,7 @@ public String 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. */ @@ -351,7 +361,7 @@ public MetadataPatch withCustomVersion(String 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() { @@ -361,7 +371,7 @@ public String 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. */ @@ -375,7 +385,7 @@ public MetadataPatch withContentSchemaVersion(String contentSchemaVersion) { /** * Get the icon property: the icon identifier. this id can later be fetched from the solution template. - * + * * @return the icon value. */ public String icon() { @@ -384,7 +394,7 @@ public String 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. */ @@ -398,7 +408,7 @@ public MetadataPatch withIcon(String icon) { /** * Get the threatAnalysisTactics property: the tactics the resource covers. - * + * * @return the threatAnalysisTactics value. */ public List threatAnalysisTactics() { @@ -407,7 +417,7 @@ public List threatAnalysisTactics() { /** * Set the threatAnalysisTactics property: the tactics the resource covers. - * + * * @param threatAnalysisTactics the threatAnalysisTactics value to set. * @return the MetadataPatch object itself. */ @@ -422,7 +432,7 @@ public MetadataPatch withThreatAnalysisTactics(List threatAnalysisTactic /** * 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() { @@ -432,7 +442,7 @@ public List 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. */ @@ -446,7 +456,7 @@ public MetadataPatch withThreatAnalysisTechniques(List threatAnalysisTec /** * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. - * + * * @return the previewImages value. */ public List previewImages() { @@ -455,7 +465,7 @@ public List 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. */ @@ -470,7 +480,7 @@ public MetadataPatch withPreviewImages(List 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() { @@ -480,7 +490,7 @@ public List 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. */ @@ -494,7 +504,7 @@ public MetadataPatch withPreviewImagesDark(List previewImagesDark) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 41a206a6dccf..1efd4146de87 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The original source of the content item, where it comes from. */ +/** + * The original source of the content item, where it comes from. + */ @Fluent public final class MetadataSource { /* @@ -29,9 +31,15 @@ public final class MetadataSource { @JsonProperty(value = "sourceId") 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() { @@ -40,7 +48,7 @@ public SourceKind kind() { /** * Set the kind property: Source type of the content. - * + * * @param kind the kind value to set. * @return the MetadataSource object itself. */ @@ -51,7 +59,7 @@ public MetadataSource withKind(SourceKind kind) { /** * 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() { @@ -60,7 +68,7 @@ public String 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. */ @@ -71,7 +79,7 @@ public MetadataSource withName(String name) { /** * Get the sourceId property: ID of the content source. The solution ID, workspace ID, etc. - * + * * @return the sourceId value. */ public String sourceId() { @@ -80,7 +88,7 @@ public String 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. */ @@ -91,14 +99,13 @@ public MetadataSource withSourceId(String sourceId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (kind() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property kind in model MetadataSource")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property kind in model MetadataSource")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSupport.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSupport.java index a25d51b568be..23b9613d0569 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Support information for the content item. */ +/** + * Support information for the content item. + */ @Fluent public final class MetadataSupport { /* @@ -35,9 +37,15 @@ public final class MetadataSupport { @JsonProperty(value = "link") 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() { @@ -46,7 +54,7 @@ public SupportTier tier() { /** * Set the tier property: Type of support for content item. - * + * * @param tier the tier value to set. * @return the MetadataSupport object itself. */ @@ -57,7 +65,7 @@ public MetadataSupport withTier(SupportTier tier) { /** * Get the name property: Name of the support contact. Company or person. - * + * * @return the name value. */ public String name() { @@ -66,7 +74,7 @@ public String 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. */ @@ -77,7 +85,7 @@ public MetadataSupport withName(String name) { /** * Get the email property: Email of support contact. - * + * * @return the email value. */ public String email() { @@ -86,7 +94,7 @@ public String email() { /** * Set the email property: Email of support contact. - * + * * @param email the email value to set. * @return the MetadataSupport object itself. */ @@ -97,7 +105,7 @@ public MetadataSupport withEmail(String email) { /** * Get the link property: Link for support help, like to support page to open a ticket etc. - * + * * @return the link value. */ public String link() { @@ -106,7 +114,7 @@ public String 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. */ @@ -117,14 +125,13 @@ public MetadataSupport withLink(String link) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (tier() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property tier in model MetadataSupport")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tier in model MetadataSupport")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Metadatas.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Metadatas.java index b8be150a2a19..02864767ddff 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Metadatas. */ +/** + * Resource collection API of Metadatas. + */ public interface Metadatas { /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,87 +26,81 @@ public interface Metadatas { /** * List of all metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @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. + * 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); + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, Integer skip, Context context); /** * Get a Metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param metadataName The Metadata name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return a Metadata along with {@link Response}. */ - MetadataModel get(String resourceGroupName, String workspaceName, String metadataName); + 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 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}. + * @return a Metadata. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String metadataName, Context context); + 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 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}. */ - void delete(String resourceGroupName, String workspaceName, String metadataName); + 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 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); + void delete(String resourceGroupName, String workspaceName, String metadataName); /** * 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. @@ -115,7 +111,7 @@ Response deleteWithResponse( /** * 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. @@ -127,7 +123,7 @@ Response deleteWithResponse( /** * 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. @@ -137,7 +133,7 @@ Response deleteWithResponse( /** * 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. @@ -149,7 +145,7 @@ Response deleteWithResponse( /** * Begins definition for a new MetadataModel resource. - * + * * @param name resource name. * @return the first stage of the new MetadataModel definition. */ 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..0ae13903db29 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionCheckRequirements.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionCheckRequirementsProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents MicrosoftPurviewInformationProtection requirements check request. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = MicrosoftPurviewInformationProtectionCheckRequirements.class, + visible = true) +@JsonTypeName("MicrosoftPurviewInformationProtection") +@Fluent +public final class MicrosoftPurviewInformationProtectionCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_PURVIEW_INFORMATION_PROTECTION; + + /* + * MicrosoftPurviewInformationProtection requirements check properties. + */ + @JsonProperty(value = "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. + */ + private 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypes.java new file mode 100644 index 000000000000..b2b07bc6b591 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypes.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The available data types for Microsoft Purview Information Protection data connector. + */ +@Fluent +public final class MicrosoftPurviewInformationProtectionConnectorDataTypes { + /* + * Logs data type. + */ + @JsonProperty(value = "logs", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logs() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property logs in model MicrosoftPurviewInformationProtectionConnectorDataTypes")); + } else { + logs().validate(); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(MicrosoftPurviewInformationProtectionConnectorDataTypes.class); +} 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..4b215c20853f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypesLogs.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; + +/** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionDataConnector.java new file mode 100644 index 000000000000..64b31eef11e7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionDataConnector.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents Microsoft Purview Information Protection data connector. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = MicrosoftPurviewInformationProtectionDataConnector.class, + visible = true) +@JsonTypeName("MicrosoftPurviewInformationProtection") +@Fluent +public final class MicrosoftPurviewInformationProtectionDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_PURVIEW_INFORMATION_PROTECTION; + + /* + * Microsoft Purview Information Protection data connector properties. + */ + @JsonProperty(value = "properties") + private MicrosoftPurviewInformationProtectionDataConnectorProperties innerProperties; + + /** + * Creates an instance of MicrosoftPurviewInformationProtectionDataConnector class. + */ + public MicrosoftPurviewInformationProtectionDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; + } + + /** + * {@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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRule.java index 201a74e0f4e1..2f4d2ccc942e 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 @@ -8,32 +8,64 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftSecurityIncidentCreationAlertRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents MicrosoftSecurityIncidentCreation rule. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MicrosoftSecurityIncidentCreation rule. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = MicrosoftSecurityIncidentCreationAlertRule.class, + visible = true) @JsonTypeName("MicrosoftSecurityIncidentCreation") @Fluent public final class MicrosoftSecurityIncidentCreationAlertRule extends AlertRuleInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.MICROSOFT_SECURITY_INCIDENT_CREATION; + /* * MicrosoftSecurityIncidentCreation rule properties */ @JsonProperty(value = "properties") private MicrosoftSecurityIncidentCreationAlertRuleProperties innerProperties; + /** + * Creates an instance of MicrosoftSecurityIncidentCreationAlertRule class. + */ + public MicrosoftSecurityIncidentCreationAlertRule() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + /** * Get the innerProperties property: MicrosoftSecurityIncidentCreation rule properties. - * + * * @return the innerProperties value. */ private MicrosoftSecurityIncidentCreationAlertRuleProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftSecurityIncidentCreationAlertRule withEtag(String etag) { super.withEtag(etag); @@ -42,7 +74,7 @@ public MicrosoftSecurityIncidentCreationAlertRule withEtag(String etag) { /** * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @return the alertRuleTemplateName value. */ public String alertRuleTemplateName() { @@ -51,7 +83,7 @@ public String alertRuleTemplateName() { /** * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @param alertRuleTemplateName the alertRuleTemplateName value to set. * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. */ @@ -65,7 +97,7 @@ public MicrosoftSecurityIncidentCreationAlertRule withAlertRuleTemplateName(Stri /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -74,7 +106,7 @@ public String description() { /** * Set the description property: The description of the alert rule. - * + * * @param description the description value to set. * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. */ @@ -88,7 +120,7 @@ public MicrosoftSecurityIncidentCreationAlertRule withDescription(String descrip /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -97,7 +129,7 @@ public String displayName() { /** * Set the displayName property: The display name for alerts created by this alert rule. - * + * * @param displayName the displayName value to set. * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. */ @@ -111,7 +143,7 @@ public MicrosoftSecurityIncidentCreationAlertRule withDisplayName(String display /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -120,7 +152,7 @@ public Boolean enabled() { /** * Set the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. */ @@ -134,7 +166,7 @@ public MicrosoftSecurityIncidentCreationAlertRule withEnabled(Boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this alert has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -143,7 +175,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. - * + * * @return the displayNamesFilter value. */ public List displayNamesFilter() { @@ -152,7 +184,7 @@ public List displayNamesFilter() { /** * Set the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. - * + * * @param displayNamesFilter the displayNamesFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. */ @@ -166,7 +198,7 @@ public MicrosoftSecurityIncidentCreationAlertRule withDisplayNamesFilter(List displayNamesExcludeFilter() { @@ -175,12 +207,12 @@ public List displayNamesExcludeFilter() { /** * Set the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. - * + * * @param displayNamesExcludeFilter the displayNamesExcludeFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. */ - public MicrosoftSecurityIncidentCreationAlertRule withDisplayNamesExcludeFilter( - List displayNamesExcludeFilter) { + public MicrosoftSecurityIncidentCreationAlertRule + withDisplayNamesExcludeFilter(List displayNamesExcludeFilter) { if (this.innerProperties() == null) { this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleProperties(); } @@ -190,7 +222,7 @@ public MicrosoftSecurityIncidentCreationAlertRule withDisplayNamesExcludeFilter( /** * Get the productFilter property: The alerts' productName on which the cases will be generated. - * + * * @return the productFilter value. */ public MicrosoftSecurityProductName productFilter() { @@ -199,7 +231,7 @@ public MicrosoftSecurityProductName productFilter() { /** * Set the productFilter property: The alerts' productName on which the cases will be generated. - * + * * @param productFilter the productFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. */ @@ -213,7 +245,7 @@ public MicrosoftSecurityIncidentCreationAlertRule withProductFilter(MicrosoftSec /** * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. - * + * * @return the severitiesFilter value. */ public List severitiesFilter() { @@ -222,7 +254,7 @@ public List severitiesFilter() { /** * Set the severitiesFilter property: the alerts' severities on which the cases will be generated. - * + * * @param severitiesFilter the severitiesFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRule object itself. */ @@ -236,7 +268,7 @@ public MicrosoftSecurityIncidentCreationAlertRule withSeveritiesFilter(List severitiesFilter; + /** + * Creates an instance of MicrosoftSecurityIncidentCreationAlertRuleCommonProperties class. + */ + public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties() { + } + /** * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. - * + * * @return the displayNamesFilter value. */ public List displayNamesFilter() { @@ -47,19 +55,19 @@ public List displayNamesFilter() { /** * Set the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. - * + * * @param displayNamesFilter the displayNamesFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withDisplayNamesFilter( - List displayNamesFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties + withDisplayNamesFilter(List displayNamesFilter) { this.displayNamesFilter = displayNamesFilter; return this; } /** * Get the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. - * + * * @return the displayNamesExcludeFilter value. */ public List displayNamesExcludeFilter() { @@ -68,19 +76,19 @@ public List displayNamesExcludeFilter() { /** * Set the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. - * + * * @param displayNamesExcludeFilter the displayNamesExcludeFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withDisplayNamesExcludeFilter( - List displayNamesExcludeFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties + withDisplayNamesExcludeFilter(List displayNamesExcludeFilter) { this.displayNamesExcludeFilter = displayNamesExcludeFilter; return this; } /** * Get the productFilter property: The alerts' productName on which the cases will be generated. - * + * * @return the productFilter value. */ public MicrosoftSecurityProductName productFilter() { @@ -89,19 +97,19 @@ public MicrosoftSecurityProductName productFilter() { /** * Set the productFilter property: The alerts' productName on which the cases will be generated. - * + * * @param productFilter the productFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withProductFilter( - MicrosoftSecurityProductName productFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties + withProductFilter(MicrosoftSecurityProductName productFilter) { this.productFilter = productFilter; return this; } /** * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. - * + * * @return the severitiesFilter value. */ public List severitiesFilter() { @@ -110,31 +118,29 @@ public List severitiesFilter() { /** * Set the severitiesFilter property: the alerts' severities on which the cases will be generated. - * + * * @param severitiesFilter the severitiesFilter value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withSeveritiesFilter( - List severitiesFilter) { + public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties + withSeveritiesFilter(List severitiesFilter) { this.severitiesFilter = severitiesFilter; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (productFilter() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property productFilter in model" - + " MicrosoftSecurityIncidentCreationAlertRuleCommonProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property productFilter in model MicrosoftSecurityIncidentCreationAlertRuleCommonProperties")); } } - private static final ClientLogger LOGGER = - new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.class); + private static final ClientLogger LOGGER + = new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.class); } 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 d908982016d7..0856e3db0a2c 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 @@ -8,25 +8,55 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents MicrosoftSecurityIncidentCreation rule template. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MicrosoftSecurityIncidentCreation rule template. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = MicrosoftSecurityIncidentCreationAlertRuleTemplate.class, + visible = true) @JsonTypeName("MicrosoftSecurityIncidentCreation") @Fluent public final class MicrosoftSecurityIncidentCreationAlertRuleTemplate extends AlertRuleTemplateInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.MICROSOFT_SECURITY_INCIDENT_CREATION; + /* * MicrosoftSecurityIncidentCreation rule template properties */ @JsonProperty(value = "properties") private MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties innerProperties; + /** + * Creates an instance of MicrosoftSecurityIncidentCreationAlertRuleTemplate class. + */ + public MicrosoftSecurityIncidentCreationAlertRuleTemplate() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + /** * Get the innerProperties property: MicrosoftSecurityIncidentCreation rule template properties. - * + * * @return the innerProperties value. */ private MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties innerProperties() { @@ -35,7 +65,7 @@ private MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties innerProper /** * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. - * + * * @return the displayNamesFilter value. */ public List displayNamesFilter() { @@ -44,7 +74,7 @@ public List 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. */ @@ -58,7 +88,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDisplayNamesFilter /** * Get the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. - * + * * @return the displayNamesExcludeFilter value. */ public List displayNamesExcludeFilter() { @@ -67,12 +97,12 @@ public List 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) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplate + withDisplayNamesExcludeFilter(List displayNamesExcludeFilter) { if (this.innerProperties() == null) { this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); } @@ -82,7 +112,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDisplayNamesExclud /** * Get the productFilter property: The alerts' productName on which the cases will be generated. - * + * * @return the productFilter value. */ public MicrosoftSecurityProductName productFilter() { @@ -91,12 +121,12 @@ public MicrosoftSecurityProductName 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) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplate + withProductFilter(MicrosoftSecurityProductName productFilter) { if (this.innerProperties() == null) { this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); } @@ -106,7 +136,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate withProductFilter( /** * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. - * + * * @return the severitiesFilter value. */ public List severitiesFilter() { @@ -115,12 +145,12 @@ public List 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) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplate + withSeveritiesFilter(List severitiesFilter) { if (this.innerProperties() == null) { this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); } @@ -130,7 +160,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate withSeveritiesFilter( /** * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @return the alertRulesCreatedByTemplateCount value. */ public Integer alertRulesCreatedByTemplateCount() { @@ -139,12 +169,12 @@ public Integer alertRulesCreatedByTemplateCount() { /** * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplate withAlertRulesCreatedByTemplateCount( - Integer alertRulesCreatedByTemplateCount) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplate + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { if (this.innerProperties() == null) { this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); } @@ -154,7 +184,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate withAlertRulesCreatedB /** * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. - * + * * @return the lastUpdatedDateUtc value. */ public OffsetDateTime lastUpdatedDateUtc() { @@ -163,7 +193,7 @@ public OffsetDateTime lastUpdatedDateUtc() { /** * Get the createdDateUtc property: The time that this alert rule template has been added. - * + * * @return the createdDateUtc value. */ public OffsetDateTime createdDateUtc() { @@ -172,7 +202,7 @@ public OffsetDateTime createdDateUtc() { /** * Get the description property: The description of the alert rule template. - * + * * @return the description value. */ public String description() { @@ -181,7 +211,7 @@ public String description() { /** * Set the description property: The description of the alert rule template. - * + * * @param description the description value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. */ @@ -195,7 +225,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDescription(String /** * Get the displayName property: The display name for alert rule template. - * + * * @return the displayName value. */ public String displayName() { @@ -204,7 +234,7 @@ public String displayName() { /** * Set the displayName property: The display name for alert rule template. - * + * * @param displayName the displayName value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. */ @@ -218,7 +248,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDisplayName(String /** * Get the requiredDataConnectors property: The required data sources for this template. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -227,12 +257,12 @@ public List requiredDataConnectors() { /** * Set the requiredDataConnectors property: The required data sources for this template. - * + * * @param requiredDataConnectors the requiredDataConnectors value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplate withRequiredDataConnectors( - List requiredDataConnectors) { + public MicrosoftSecurityIncidentCreationAlertRuleTemplate + withRequiredDataConnectors(List requiredDataConnectors) { if (this.innerProperties() == null) { this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); } @@ -242,7 +272,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate withRequiredDataConnec /** * Get the status property: The alert rule template status. - * + * * @return the status value. */ public TemplateStatus status() { @@ -251,7 +281,7 @@ public TemplateStatus status() { /** * Set the status property: The alert rule template status. - * + * * @param status the status value to set. * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. */ @@ -265,7 +295,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate withStatus(TemplateSta /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 d6958d5cf48a..00e370eecde4 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 @@ -8,38 +8,63 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The alerts' productName on which the cases will be generated. */ +/** + * The alerts' productName on which the cases will be generated. + */ public final class MicrosoftSecurityProductName extends ExpandableStringEnum { - /** Static value Microsoft Cloud App Security for MicrosoftSecurityProductName. */ - public static final MicrosoftSecurityProductName MICROSOFT_CLOUD_APP_SECURITY = - fromString("Microsoft Cloud App Security"); + /** + * Static value Microsoft Cloud App Security for MicrosoftSecurityProductName. + */ + public static final MicrosoftSecurityProductName MICROSOFT_CLOUD_APP_SECURITY + = fromString("Microsoft Cloud App Security"); - /** Static value Azure Security Center for MicrosoftSecurityProductName. */ + /** + * Static value Azure Security Center for MicrosoftSecurityProductName. + */ public static final MicrosoftSecurityProductName AZURE_SECURITY_CENTER = fromString("Azure Security Center"); - /** Static value Azure Advanced Threat Protection for MicrosoftSecurityProductName. */ - public static final MicrosoftSecurityProductName AZURE_ADVANCED_THREAT_PROTECTION = - fromString("Azure Advanced Threat Protection"); + /** + * Static value Azure Advanced Threat Protection for MicrosoftSecurityProductName. + */ + public static final MicrosoftSecurityProductName AZURE_ADVANCED_THREAT_PROTECTION + = fromString("Azure Advanced Threat Protection"); + + /** + * Static value Azure Active Directory Identity Protection for MicrosoftSecurityProductName. + */ + public static final MicrosoftSecurityProductName AZURE_ACTIVE_DIRECTORY_IDENTITY_PROTECTION + = fromString("Azure Active Directory Identity Protection"); - /** Static value Azure Active Directory Identity Protection for MicrosoftSecurityProductName. */ - public static final MicrosoftSecurityProductName AZURE_ACTIVE_DIRECTORY_IDENTITY_PROTECTION = - fromString("Azure Active Directory Identity Protection"); + /** + * Static value Azure Security Center for IoT for MicrosoftSecurityProductName. + */ + public static final MicrosoftSecurityProductName AZURE_SECURITY_CENTER_FOR_IOT + = fromString("Azure Security Center for IoT"); - /** Static value Azure Security Center for IoT for MicrosoftSecurityProductName. */ - public static final MicrosoftSecurityProductName AZURE_SECURITY_CENTER_FOR_IOT = - fromString("Azure Security Center for IoT"); + /** + * Static value Office 365 Advanced Threat Protection for MicrosoftSecurityProductName. + */ + public static final MicrosoftSecurityProductName OFFICE_365_ADVANCED_THREAT_PROTECTION + = fromString("Office 365 Advanced Threat Protection"); - /** Static value Office 365 Advanced Threat Protection for MicrosoftSecurityProductName. */ - public static final MicrosoftSecurityProductName OFFICE_365_ADVANCED_THREAT_PROTECTION = - fromString("Office 365 Advanced Threat Protection"); + /** + * Static value Microsoft Defender Advanced Threat Protection for MicrosoftSecurityProductName. + */ + public static final MicrosoftSecurityProductName MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION + = fromString("Microsoft Defender Advanced Threat Protection"); - /** Static value Microsoft Defender Advanced Threat Protection for MicrosoftSecurityProductName. */ - public static final MicrosoftSecurityProductName MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION = - fromString("Microsoft Defender Advanced Threat Protection"); + /** + * Creates a new instance of MicrosoftSecurityProductName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MicrosoftSecurityProductName() { + } /** * Creates or finds a MicrosoftSecurityProductName from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftSecurityProductName. */ @@ -50,7 +75,7 @@ public static MicrosoftSecurityProductName fromString(String name) { /** * Gets known MicrosoftSecurityProductName values. - * + * * @return known MicrosoftSecurityProductName values. */ public static Collection values() { 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..1e39f70619e2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Mode.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The current mode of the workspace manager configuration. + */ +public final class Mode extends ExpandableStringEnum { + /** + * Static value Enabled for Mode. + */ + public static final Mode ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for Mode. + */ + 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. + */ + @JsonCreator + 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/MstiCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiCheckRequirements.java index 95cb0a532898..34f4b5978e7f 100644 --- 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 @@ -7,32 +7,81 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.MstiCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Microsoft Threat Intelligence requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Microsoft Threat Intelligence requirements check request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MstiCheckRequirements.class, visible = true) @JsonTypeName("MicrosoftThreatIntelligence") @Fluent public final class MstiCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_THREAT_INTELLIGENCE; + /* * Microsoft Threat Intelligence requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 55c79f1bebab..904440694b35 100644 --- 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.MstiDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Microsoft Threat Intelligence data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Microsoft Threat Intelligence data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MstiDataConnector.class, visible = true) @JsonTypeName("MicrosoftThreatIntelligence") @Fluent public final class MstiDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_THREAT_INTELLIGENCE; + /* * Microsoft Threat Intelligence data connector properties. */ @JsonProperty(value = "properties") private MstiDataConnectorProperties innerProperties; + /** + * Creates an instance of MstiDataConnector class. + */ + public MstiDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MstiDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public MstiDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public MstiDataConnectorDataTypes dataTypes() { @@ -49,7 +77,7 @@ public MstiDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the MstiDataConnector object itself. */ @@ -63,7 +91,7 @@ public MstiDataConnector withDataTypes(MstiDataConnectorDataTypes dataTypes) { /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +100,7 @@ public String 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. */ @@ -86,7 +114,7 @@ public MstiDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 2c1077694cfd..3c09aebf6696 100644 --- 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 @@ -8,15 +8,11 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for Microsoft Threat Intelligence Platforms data connector. */ +/** + * The available data types for Microsoft Threat Intelligence Platforms data connector. + */ @Fluent public final class MstiDataConnectorDataTypes { - /* - * Data type for Microsoft Threat Intelligence Platforms data connector. - */ - @JsonProperty(value = "bingSafetyPhishingURL", required = true) - private MstiDataConnectorDataTypesBingSafetyPhishingUrl bingSafetyPhishingUrl; - /* * Data type for Microsoft Threat Intelligence Platforms data connector. */ @@ -24,30 +20,15 @@ public final class MstiDataConnectorDataTypes { private MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed microsoftEmergingThreatFeed; /** - * Get the bingSafetyPhishingUrl property: Data type for Microsoft Threat Intelligence Platforms data connector. - * - * @return the bingSafetyPhishingUrl value. - */ - public MstiDataConnectorDataTypesBingSafetyPhishingUrl bingSafetyPhishingUrl() { - return this.bingSafetyPhishingUrl; - } - - /** - * Set the bingSafetyPhishingUrl property: Data type for Microsoft Threat Intelligence Platforms data connector. - * - * @param bingSafetyPhishingUrl the bingSafetyPhishingUrl value to set. - * @return the MstiDataConnectorDataTypes object itself. + * Creates an instance of MstiDataConnectorDataTypes class. */ - public MstiDataConnectorDataTypes withBingSafetyPhishingUrl( - MstiDataConnectorDataTypesBingSafetyPhishingUrl bingSafetyPhishingUrl) { - this.bingSafetyPhishingUrl = bingSafetyPhishingUrl; - return this; + public MstiDataConnectorDataTypes() { } /** * Get the microsoftEmergingThreatFeed property: Data type for Microsoft Threat Intelligence Platforms data * connector. - * + * * @return the microsoftEmergingThreatFeed value. */ public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed microsoftEmergingThreatFeed() { @@ -57,7 +38,7 @@ public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed microsoftEmergingTh /** * 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. */ @@ -69,23 +50,14 @@ public MstiDataConnectorDataTypes withMicrosoftEmergingThreatFeed( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (bingSafetyPhishingUrl() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property bingSafetyPhishingUrl in model MstiDataConnectorDataTypes")); - } else { - bingSafetyPhishingUrl().validate(); - } if (microsoftEmergingThreatFeed() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property microsoftEmergingThreatFeed in model MstiDataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property microsoftEmergingThreatFeed in model MstiDataConnectorDataTypes")); } else { microsoftEmergingThreatFeed().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesBingSafetyPhishingUrl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesBingSafetyPhishingUrl.java deleted file mode 100644 index 3eee77b51ac3..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesBingSafetyPhishingUrl.java +++ /dev/null @@ -1,65 +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.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Data type for Microsoft Threat Intelligence Platforms data connector. */ -@Fluent -public final class MstiDataConnectorDataTypesBingSafetyPhishingUrl extends DataConnectorDataTypeCommon { - /* - * lookback period - */ - @JsonProperty(value = "lookbackPeriod", required = true) - private String lookbackPeriod; - - /** - * Get the lookbackPeriod property: lookback period. - * - * @return the lookbackPeriod value. - */ - public String lookbackPeriod() { - return this.lookbackPeriod; - } - - /** - * Set the lookbackPeriod property: lookback period. - * - * @param lookbackPeriod the lookbackPeriod value to set. - * @return the MstiDataConnectorDataTypesBingSafetyPhishingUrl object itself. - */ - public MstiDataConnectorDataTypesBingSafetyPhishingUrl withLookbackPeriod(String lookbackPeriod) { - this.lookbackPeriod = lookbackPeriod; - return this; - } - - /** {@inheritDoc} */ - @Override - public MstiDataConnectorDataTypesBingSafetyPhishingUrl withState(DataTypeState state) { - super.withState(state); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (lookbackPeriod() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property lookbackPeriod in model" - + " MstiDataConnectorDataTypesBingSafetyPhishingUrl")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(MstiDataConnectorDataTypesBingSafetyPhishingUrl.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 index 29ab116cee8f..98a3619346ff 100644 --- 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 @@ -8,18 +8,26 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Data type for Microsoft Threat Intelligence Platforms data connector. */ +/** + * Data type for Microsoft Threat Intelligence Platforms data connector. + */ @Fluent public final class MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed extends DataConnectorDataTypeCommon { /* - * lookback period + * The lookback period for the feed to be imported. */ @JsonProperty(value = "lookbackPeriod", required = true) private String lookbackPeriod; /** - * Get the lookbackPeriod property: lookback period. - * + * 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 String lookbackPeriod() { @@ -27,8 +35,8 @@ public String lookbackPeriod() { } /** - * Set the lookbackPeriod property: lookback period. - * + * 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. */ @@ -37,7 +45,9 @@ public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed withLookbackPeriod( return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed withState(DataTypeState state) { super.withState(state); @@ -46,21 +56,19 @@ public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed withState(DataTypeS /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (lookbackPeriod() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property lookbackPeriod in model" - + " MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property lookbackPeriod in model MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed")); } } - private static final ClientLogger LOGGER = - new ClientLogger(MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.class); + private static final ClientLogger LOGGER + = new ClientLogger(MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.class); } 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 index 074527921be7..48d3678e4888 100644 --- 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 @@ -7,32 +7,81 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.MtpCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents MTP (Microsoft Threat Protection) requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MTP (Microsoft Threat Protection) requirements check request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MtpCheckRequirements.class, visible = true) @JsonTypeName("MicrosoftThreatProtection") @Fluent public final class MtpCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_THREAT_PROTECTION; + /* * MTP (Microsoft Threat Protection) requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 8c6b30014f43..7da2b6d1d850 100644 --- 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.MtpDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents MTP (Microsoft Threat Protection) data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents MTP (Microsoft Threat Protection) data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = MtpDataConnector.class, visible = true) @JsonTypeName("MicrosoftThreatProtection") @Fluent public final class MtpDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_THREAT_PROTECTION; + /* * MTP (Microsoft Threat Protection) data connector properties. */ @JsonProperty(value = "properties") private MtpDataConnectorProperties innerProperties; + /** + * Creates an instance of MtpDataConnector class. + */ + public MtpDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MtpDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public MtpDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public MtpDataConnectorDataTypes dataTypes() { @@ -49,7 +77,7 @@ public MtpDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the MtpDataConnector object itself. */ @@ -61,9 +89,32 @@ public MtpDataConnector withDataTypes(MtpDataConnectorDataTypes 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() { @@ -72,7 +123,7 @@ public String 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. */ @@ -86,7 +137,7 @@ public MtpDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 27fa2a5c2d9b..cd4820a21f31 100644 --- 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 @@ -8,18 +8,32 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for Microsoft Threat Protection Platforms data connector. */ +/** + * The available data types for Microsoft Threat Protection Platforms data connector. + */ @Fluent public final class MtpDataConnectorDataTypes { /* - * Data type for Microsoft Threat Protection Platforms data connector. + * Incidents data type for Microsoft Threat Protection Platforms data connector. */ @JsonProperty(value = "incidents", required = true) private MtpDataConnectorDataTypesIncidents incidents; + /* + * Alerts data type for Microsoft Threat Protection Platforms data connector. + */ + @JsonProperty(value = "alerts") + private MtpDataConnectorDataTypesAlerts alerts; + /** - * Get the incidents property: Data type for Microsoft Threat Protection Platforms data connector. - * + * 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() { @@ -27,8 +41,8 @@ public MtpDataConnectorDataTypesIncidents incidents() { } /** - * Set the incidents property: Data type for Microsoft Threat Protection Platforms data connector. - * + * 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. */ @@ -37,20 +51,42 @@ public MtpDataConnectorDataTypes withIncidents(MtpDataConnectorDataTypesIncident 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (incidents() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property incidents in model MtpDataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property incidents in model MtpDataConnectorDataTypes")); } else { incidents().validate(); } + if (alerts() != null) { + alerts().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(MtpDataConnectorDataTypes.class); 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..c1a08362424f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypesAlerts.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; + +/** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypesIncidents.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpDataConnectorDataTypesIncidents.java index 0b347d9db7b6..8795f37f72b2 100644 --- 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Data type for Microsoft Threat Protection Platforms data connector. */ +/** + * Incidents data type for Microsoft Threat Protection Platforms data connector. + */ @Fluent public final class MtpDataConnectorDataTypesIncidents extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of MtpDataConnectorDataTypesIncidents class. + */ + public MtpDataConnectorDataTypesIncidents() { + } + + /** + * {@inheritDoc} + */ @Override public MtpDataConnectorDataTypesIncidents withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public MtpDataConnectorDataTypesIncidents withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..1a9e0c3b00eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpFilteredProviders.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents the connector's Filtered providers. + */ +@Fluent +public final class MtpFilteredProviders { + /* + * 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. + */ + @JsonProperty(value = "alerts", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alerts() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property alerts in model MtpFilteredProviders")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MtpFilteredProviders.class); +} 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..073c9b62f139 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpProvider.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The available data providers. + */ +public final class MtpProvider extends ExpandableStringEnum { + /** + * Static value microsoftDefenderForCloudApps for MtpProvider. + */ + public static final MtpProvider MICROSOFT_DEFENDER_FOR_CLOUD_APPS = fromString("microsoftDefenderForCloudApps"); + + /** + * Static value microsoftDefenderForIdentity for MtpProvider. + */ + 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. + */ + @JsonCreator + 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 index 26326e8ddb92..daae0955c3bc 100644 --- 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 @@ -4,29 +4,55 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.NicEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; import java.util.Map; -/** Represents an network interface entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents an network interface entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = NicEntity.class, visible = true) @JsonTypeName("Nic") -@Fluent +@Immutable public final class NicEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.NIC; + /* * Network interface entity properties */ @JsonProperty(value = "properties") private NicEntityProperties innerProperties; + /** + * Creates an instance of NicEntity class. + */ + public NicEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @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() { @@ -35,7 +61,7 @@ private NicEntityProperties innerProperties() { /** * Get the macAddress property: The MAC address of this network interface. - * + * * @return the macAddress value. */ public String macAddress() { @@ -44,7 +70,7 @@ public String macAddress() { /** * Get the ipAddressEntityId property: The IP entity id of this network interface. - * + * * @return the ipAddressEntityId value. */ public String ipAddressEntityId() { @@ -53,7 +79,7 @@ public String ipAddressEntityId() { /** * Get the vlans property: A list of VLANs of the network interface entity. - * + * * @return the vlans value. */ public List vlans() { @@ -63,7 +89,7 @@ public List 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() { @@ -73,7 +99,7 @@ public Map 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() { @@ -82,7 +108,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..78d76baec480 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NoneAuthModel.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for API authentication with no authentication method - public API. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = NoneAuthModel.class, visible = true) +@JsonTypeName("None") +@Immutable +public final class NoneAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRule.java index 7a23f7a2b182..630055e9cf27 100644 --- 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 @@ -8,6 +8,7 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; import com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; @@ -15,27 +16,54 @@ import java.util.List; import java.util.Map; -/** Represents NRT alert rule. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents NRT alert rule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = NrtAlertRule.class, visible = true) @JsonTypeName("NRT") @Fluent public final class NrtAlertRule extends AlertRuleInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.NRT; + /* * NRT alert rule properties */ @JsonProperty(value = "properties") private NrtAlertRuleProperties innerProperties; + /** + * Creates an instance of NrtAlertRule class. + */ + public NrtAlertRule() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public NrtAlertRule withEtag(String etag) { super.withEtag(etag); @@ -44,7 +72,7 @@ public NrtAlertRule withEtag(String etag) { /** * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @return the alertRuleTemplateName value. */ public String alertRuleTemplateName() { @@ -53,7 +81,7 @@ public String 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. */ @@ -68,7 +96,7 @@ public NrtAlertRule withAlertRuleTemplateName(String alertRuleTemplateName) { /** * 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() { @@ -78,7 +106,7 @@ public String 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. */ @@ -92,7 +120,7 @@ public NrtAlertRule withTemplateVersion(String templateVersion) { /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -101,7 +129,7 @@ public String description() { /** * Set the description property: The description of the alert rule. - * + * * @param description the description value to set. * @return the NrtAlertRule object itself. */ @@ -115,7 +143,7 @@ public NrtAlertRule withDescription(String description) { /** * Get the query property: The query that creates alerts for this rule. - * + * * @return the query value. */ public String query() { @@ -124,7 +152,7 @@ public String 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. */ @@ -138,7 +166,7 @@ public NrtAlertRule withQuery(String query) { /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -147,7 +175,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the alert rule. - * + * * @param tactics the tactics value to set. * @return the NrtAlertRule object itself. */ @@ -161,7 +189,7 @@ public NrtAlertRule withTactics(List tactics) { /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -170,7 +198,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the NrtAlertRule object itself. */ @@ -182,9 +210,32 @@ public NrtAlertRule 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 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() { @@ -193,7 +244,7 @@ public String 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. */ @@ -207,7 +258,7 @@ public NrtAlertRule withDisplayName(String displayName) { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -216,7 +267,7 @@ public Boolean 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. */ @@ -230,7 +281,7 @@ public NrtAlertRule withEnabled(Boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this alert rule has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -240,7 +291,7 @@ public OffsetDateTime 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() { @@ -250,7 +301,7 @@ public Duration 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. */ @@ -265,7 +316,7 @@ public NrtAlertRule withSuppressionDuration(Duration suppressionDuration) { /** * Get the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or * disabled. - * + * * @return the suppressionEnabled value. */ public Boolean suppressionEnabled() { @@ -275,7 +326,7 @@ public Boolean 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. */ @@ -289,7 +340,7 @@ public NrtAlertRule withSuppressionEnabled(Boolean suppressionEnabled) { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -298,7 +349,7 @@ public AlertSeverity 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. */ @@ -313,7 +364,7 @@ public NrtAlertRule withSeverity(AlertSeverity severity) { /** * 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() { @@ -323,7 +374,7 @@ public IncidentConfiguration 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. */ @@ -337,7 +388,7 @@ public NrtAlertRule withIncidentConfiguration(IncidentConfiguration incidentConf /** * 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() { @@ -346,7 +397,7 @@ public Map 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. */ @@ -360,7 +411,7 @@ public NrtAlertRule withCustomDetails(Map customDetails) { /** * Get the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @return the entityMappings value. */ public List entityMappings() { @@ -369,7 +420,7 @@ public List 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. */ @@ -383,7 +434,7 @@ public NrtAlertRule withEntityMappings(List entityMappings) { /** * Get the alertDetailsOverride property: The alert details override settings. - * + * * @return the alertDetailsOverride value. */ public AlertDetailsOverride alertDetailsOverride() { @@ -392,7 +443,7 @@ public AlertDetailsOverride alertDetailsOverride() { /** * Set the alertDetailsOverride property: The alert details override settings. - * + * * @param alertDetailsOverride the alertDetailsOverride value to set. * @return the NrtAlertRule object itself. */ @@ -406,7 +457,7 @@ public NrtAlertRule withAlertDetailsOverride(AlertDetailsOverride alertDetailsOv /** * Get the eventGroupingSettings property: The event grouping settings. - * + * * @return the eventGroupingSettings value. */ public EventGroupingSettings eventGroupingSettings() { @@ -415,7 +466,7 @@ public EventGroupingSettings eventGroupingSettings() { /** * Set the eventGroupingSettings property: The event grouping settings. - * + * * @param eventGroupingSettings the eventGroupingSettings value to set. * @return the NrtAlertRule object itself. */ @@ -427,9 +478,32 @@ public NrtAlertRule withEventGroupingSettings(EventGroupingSettings eventGroupin 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 551cb9589235..4d0a6a46053d 100644 --- 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 @@ -8,26 +8,52 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; import com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleTemplateProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** Represents NRT alert rule template. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents NRT alert rule template. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = NrtAlertRuleTemplate.class, visible = true) @JsonTypeName("NRT") @Fluent public final class NrtAlertRuleTemplate extends AlertRuleTemplateInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.NRT; + /* * NRT alert rule template properties */ @JsonProperty(value = "properties") private NrtAlertRuleTemplateProperties innerProperties; + /** + * Creates an instance of NrtAlertRuleTemplate class. + */ + public NrtAlertRuleTemplate() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @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() { @@ -36,7 +62,7 @@ private NrtAlertRuleTemplateProperties innerProperties() { /** * Get the query property: The query that creates alerts for this rule. - * + * * @return the query value. */ public String query() { @@ -45,7 +71,7 @@ public String query() { /** * Set the query property: The query that creates alerts for this rule. - * + * * @param query the query value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -59,7 +85,7 @@ public NrtAlertRuleTemplate withQuery(String query) { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -68,7 +94,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity for alerts created by this alert rule. - * + * * @param severity the severity value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -83,7 +109,7 @@ public NrtAlertRuleTemplate withSeverity(AlertSeverity 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() { @@ -93,7 +119,7 @@ public String version() { /** * Set the version property: The version of this template - in format <a.b.c>, where all are numbers. For * example <1.0.2>. - * + * * @param version the version value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -107,7 +133,7 @@ public NrtAlertRuleTemplate withVersion(String 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() { @@ -116,7 +142,7 @@ public Map customDetails() { /** * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. - * + * * @param customDetails the customDetails value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -130,7 +156,7 @@ public NrtAlertRuleTemplate withCustomDetails(Map customDetails) /** * Get the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @return the entityMappings value. */ public List entityMappings() { @@ -139,7 +165,7 @@ public List entityMappings() { /** * Set the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @param entityMappings the entityMappings value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -153,7 +179,7 @@ public NrtAlertRuleTemplate withEntityMappings(List entityMapping /** * Get the alertDetailsOverride property: The alert details override settings. - * + * * @return the alertDetailsOverride value. */ public AlertDetailsOverride alertDetailsOverride() { @@ -162,7 +188,7 @@ public AlertDetailsOverride alertDetailsOverride() { /** * Set the alertDetailsOverride property: The alert details override settings. - * + * * @param alertDetailsOverride the alertDetailsOverride value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -176,7 +202,7 @@ public NrtAlertRuleTemplate withAlertDetailsOverride(AlertDetailsOverride alertD /** * Get the eventGroupingSettings property: The event grouping settings. - * + * * @return the eventGroupingSettings value. */ public EventGroupingSettings eventGroupingSettings() { @@ -185,7 +211,7 @@ public EventGroupingSettings eventGroupingSettings() { /** * Set the eventGroupingSettings property: The event grouping settings. - * + * * @param eventGroupingSettings the eventGroupingSettings value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -197,9 +223,32 @@ public NrtAlertRuleTemplate withEventGroupingSettings(EventGroupingSettings even 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 NrtAlertRuleTemplate object itself. + */ + public NrtAlertRuleTemplate withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleTemplateProperties(); + } + this.innerProperties().withSentinelEntitiesMappings(sentinelEntitiesMappings); + return this; + } + /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -208,7 +257,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the alert rule. - * + * * @param tactics the tactics value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -222,7 +271,7 @@ public NrtAlertRuleTemplate withTactics(List tactics) { /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -231,7 +280,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -245,7 +294,7 @@ public NrtAlertRuleTemplate withTechniques(List techniques) { /** * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @return the alertRulesCreatedByTemplateCount value. */ public Integer alertRulesCreatedByTemplateCount() { @@ -254,7 +303,7 @@ public Integer alertRulesCreatedByTemplateCount() { /** * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -268,7 +317,7 @@ public NrtAlertRuleTemplate withAlertRulesCreatedByTemplateCount(Integer alertRu /** * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. - * + * * @return the lastUpdatedDateUtc value. */ public OffsetDateTime lastUpdatedDateUtc() { @@ -277,7 +326,7 @@ public OffsetDateTime lastUpdatedDateUtc() { /** * Get the createdDateUtc property: The time that this alert rule template has been added. - * + * * @return the createdDateUtc value. */ public OffsetDateTime createdDateUtc() { @@ -286,7 +335,7 @@ public OffsetDateTime createdDateUtc() { /** * Get the description property: The description of the alert rule template. - * + * * @return the description value. */ public String description() { @@ -295,7 +344,7 @@ public String description() { /** * Set the description property: The description of the alert rule template. - * + * * @param description the description value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -309,7 +358,7 @@ public NrtAlertRuleTemplate withDescription(String description) { /** * Get the displayName property: The display name for alert rule template. - * + * * @return the displayName value. */ public String displayName() { @@ -318,7 +367,7 @@ public String displayName() { /** * Set the displayName property: The display name for alert rule template. - * + * * @param displayName the displayName value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -332,7 +381,7 @@ public NrtAlertRuleTemplate withDisplayName(String displayName) { /** * Get the requiredDataConnectors property: The required data sources for this template. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -341,7 +390,7 @@ public List requiredDataConnectors() { /** * Set the requiredDataConnectors property: The required data sources for this template. - * + * * @param requiredDataConnectors the requiredDataConnectors value to set. * @return the NrtAlertRuleTemplate object itself. */ @@ -355,7 +404,7 @@ public NrtAlertRuleTemplate withRequiredDataConnectors(List tokenEndpointHeaders; + + /* + * The token endpoint query parameters. + */ + @JsonProperty(value = "tokenEndpointQueryParameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tokenEndpointQueryParameters; + + /* + * The authorization endpoint. + */ + @JsonProperty(value = "authorizationEndpoint") + private String authorizationEndpoint; + + /* + * The authorization endpoint headers. + */ + @JsonProperty(value = "authorizationEndpointHeaders") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map authorizationEndpointHeaders; + + /* + * The authorization endpoint query parameters. + */ + @JsonProperty(value = "authorizationEndpointQueryParameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map authorizationEndpointQueryParameters; + + /* + * A value indicating whether it's a JWT flow. + */ + @JsonProperty(value = "isJwtBearerFlow") + private Boolean isJwtBearerFlow; + + /* + * Access token prepend. Default is 'Bearer'. + */ + @JsonProperty(value = "accessTokenPrepend") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (clientSecret() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property clientSecret in model OAuthModel")); + } + if (clientId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property clientId in model OAuthModel")); + } + if (grantType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property grantType in model OAuthModel")); + } + if (tokenEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tokenEndpoint in model OAuthModel")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OAuthModel.class); +} 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 5c890d9ee63d..67b862c73c5e 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 @@ -7,24 +7,38 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The operating system type. */ +/** + * The operating system type. + */ public enum OSFamily { - /** Enum value Linux. */ + /** + * Enum value Linux. + */ LINUX("Linux"), - /** Enum value Windows. */ + /** + * Enum value Windows. + */ WINDOWS("Windows"), - /** Enum value Android. */ + /** + * Enum value Android. + */ ANDROID("Android"), - /** Enum value IOS. */ + /** + * Enum value IOS. + */ IOS("IOS"), - /** Enum value Unknown. */ + /** + * Enum value Unknown. + */ UNKNOWN("Unknown"); - /** The actual serialized value for a OSFamily instance. */ + /** + * The actual serialized value for a OSFamily instance. + */ private final String value; OSFamily(String value) { @@ -33,7 +47,7 @@ public enum OSFamily { /** * Parses a serialized value to a OSFamily instance. - * + * * @param value the serialized value to parse. * @return the parsed OSFamily object, or null if unable to parse. */ @@ -51,7 +65,9 @@ public static OSFamily fromString(String value) { return null; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @JsonValue @Override public String toString() { 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 index 8ed7cfef085e..6320c83be9ec 100644 --- 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 @@ -7,32 +7,85 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Office365 Project requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Office365 Project requirements check request. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = Office365ProjectCheckRequirements.class, + visible = true) @JsonTypeName("Office365Project") @Fluent public final class Office365ProjectCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.OFFICE365PROJECT; + /* * Office365 Project requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index bafc9102b1dd..524942d97022 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for Office Microsoft Project data connector. */ +/** + * The available data types for Office Microsoft Project data connector. + */ @Fluent public final class Office365ProjectConnectorDataTypes { /* @@ -17,9 +19,15 @@ public final class Office365ProjectConnectorDataTypes { @JsonProperty(value = "logs", required = true) 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() { @@ -28,7 +36,7 @@ public Office365ProjectConnectorDataTypesLogs logs() { /** * Set the logs property: Logs data type. - * + * * @param logs the logs value to set. * @return the Office365ProjectConnectorDataTypes object itself. */ @@ -39,15 +47,14 @@ public Office365ProjectConnectorDataTypes withLogs(Office365ProjectConnectorData /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (logs() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property logs in model Office365ProjectConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property logs in model Office365ProjectConnectorDataTypes")); } else { logs().validate(); } 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 index 80908337be80..ad64e92e384c 100644 --- 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Logs data type. */ +/** + * Logs data type. + */ @Fluent public final class Office365ProjectConnectorDataTypesLogs extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of Office365ProjectConnectorDataTypesLogs class. + */ + public Office365ProjectConnectorDataTypesLogs() { + } + + /** + * {@inheritDoc} + */ @Override public Office365ProjectConnectorDataTypesLogs withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public Office365ProjectConnectorDataTypesLogs withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 7665b6940195..56d64cde7262 100644 --- 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 @@ -8,30 +8,62 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Office Microsoft Project data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Office Microsoft Project data connector. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = Office365ProjectDataConnector.class, + visible = true) @JsonTypeName("Office365Project") @Fluent public final class Office365ProjectDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.OFFICE365PROJECT; + /* * Office Microsoft Project data connector properties. */ @JsonProperty(value = "properties") private Office365ProjectDataConnectorProperties innerProperties; + /** + * Creates an instance of Office365ProjectDataConnector class. + */ + public Office365ProjectDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Office365ProjectDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +72,7 @@ public Office365ProjectDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public Office365ProjectConnectorDataTypes dataTypes() { @@ -49,7 +81,7 @@ public Office365ProjectConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the Office365ProjectDataConnector object itself. */ @@ -63,7 +95,7 @@ public Office365ProjectDataConnector withDataTypes(Office365ProjectConnectorData /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +104,7 @@ public String 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. */ @@ -86,7 +118,7 @@ public Office365ProjectDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 25d2ff4c15b4..410bc23c2e4b 100644 --- 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 @@ -7,33 +7,86 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.OfficeAtpCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents OfficeATP (Office 365 Advanced Threat Protection) requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents OfficeATP (Office 365 Advanced Threat Protection) requirements check request. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = OfficeAtpCheckRequirements.class, + visible = true) @JsonTypeName("OfficeATP") @Fluent public final class OfficeAtpCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.OFFICE_ATP; + /* * OfficeATP (Office 365 Advanced Threat Protection) requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 2a339d8590fd..060cdaf3fe8e 100644 --- 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.OfficeAtpDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents OfficeATP (Office 365 Advanced Threat Protection) data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents OfficeATP (Office 365 Advanced Threat Protection) data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = OfficeAtpDataConnector.class, visible = true) @JsonTypeName("OfficeATP") @Fluent public final class OfficeAtpDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.OFFICE_ATP; + /* * OfficeATP (Office 365 Advanced Threat Protection) data connector properties. */ @JsonProperty(value = "properties") private OfficeAtpDataConnectorProperties innerProperties; + /** + * Creates an instance of OfficeAtpDataConnector class. + */ + public OfficeAtpDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OfficeAtpDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public OfficeAtpDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -49,7 +77,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the OfficeAtpDataConnector object itself. */ @@ -63,7 +91,7 @@ public OfficeAtpDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTy /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +100,7 @@ public String 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. */ @@ -86,7 +114,7 @@ public OfficeAtpDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 537732e3a122..0deb4f0b42c9 100644 --- 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 @@ -7,53 +7,55 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; -/** An immutable client-side representation of OfficeConsent. */ +/** + * An immutable client-side representation of OfficeConsent. + */ public interface OfficeConsent { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the tenantId property: The tenantId of the Office365 with the consent. - * + * * @return the tenantId value. */ String tenantId(); /** * Gets the consentId property: Help to easily cascade among the data layers. - * + * * @return the consentId value. */ String consentId(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner object. - * + * * @return the inner object. */ OfficeConsentInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsentList.java index c82170f9180d..965b8a847f56 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsentList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsentList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the office365 consents. */ +/** + * List of all the office365 consents. + */ @Fluent public final class OfficeConsentList { /* @@ -25,9 +27,15 @@ public final class OfficeConsentList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of OfficeConsentList class. + */ + public OfficeConsentList() { + } + /** * Get the nextLink property: URL to fetch the next set of office consents. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of the consents. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of the consents. - * + * * @param value the value value to set. * @return the OfficeConsentList object itself. */ @@ -56,14 +64,13 @@ public OfficeConsentList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model OfficeConsentList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OfficeConsentList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsents.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsents.java index ed83191305b5..3dedf73cf76e 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of OfficeConsents. */ +/** + * Resource collection API of OfficeConsents. + */ public interface OfficeConsents { /** * Gets all office365 consents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface OfficeConsents { /** * Gets all office365 consents. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -37,56 +39,56 @@ 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. + * @return an office365 consent along with {@link Response}. */ - OfficeConsent get(String resourceGroupName, String workspaceName, String consentId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an office365 consent. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String consentId, Context context); + 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}. */ - void delete(String resourceGroupName, String workspaceName, String consentId); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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); + void delete(String resourceGroupName, String workspaceName, String consentId); } 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 2fb508346db8..4b975fc566b6 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.OfficeDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents office data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents office data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = OfficeDataConnector.class, visible = true) @JsonTypeName("Office365") @Fluent public final class OfficeDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.OFFICE365; + /* * Office data connector properties. */ @JsonProperty(value = "properties") private OfficeDataConnectorProperties innerProperties; + /** + * Creates an instance of OfficeDataConnector class. + */ + public OfficeDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Office data connector properties. - * + * * @return the innerProperties value. */ private OfficeDataConnectorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OfficeDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public OfficeDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public OfficeDataConnectorDataTypes dataTypes() { @@ -49,7 +77,7 @@ public OfficeDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the OfficeDataConnector object itself. */ @@ -63,7 +91,7 @@ public OfficeDataConnector withDataTypes(OfficeDataConnectorDataTypes dataTypes) /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +100,7 @@ public String tenantId() { /** * Set the tenantId property: The tenant id to connect to, and get the data from. - * + * * @param tenantId the tenantId value to set. * @return the OfficeDataConnector object itself. */ @@ -86,7 +114,7 @@ public OfficeDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 f96e94afc749..50caa96a6585 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for office data connector. */ +/** + * The available data types for office data connector. + */ @Fluent public final class OfficeDataConnectorDataTypes { /* @@ -29,9 +31,15 @@ public final class OfficeDataConnectorDataTypes { @JsonProperty(value = "teams", required = true) private OfficeDataConnectorDataTypesTeams teams; + /** + * Creates an instance of OfficeDataConnectorDataTypes class. + */ + public OfficeDataConnectorDataTypes() { + } + /** * Get the exchange property: Exchange data type connection. - * + * * @return the exchange value. */ public OfficeDataConnectorDataTypesExchange exchange() { @@ -40,7 +48,7 @@ public OfficeDataConnectorDataTypesExchange exchange() { /** * Set the exchange property: Exchange data type connection. - * + * * @param exchange the exchange value to set. * @return the OfficeDataConnectorDataTypes object itself. */ @@ -51,7 +59,7 @@ public OfficeDataConnectorDataTypes withExchange(OfficeDataConnectorDataTypesExc /** * Get the sharePoint property: SharePoint data type connection. - * + * * @return the sharePoint value. */ public OfficeDataConnectorDataTypesSharePoint sharePoint() { @@ -60,7 +68,7 @@ public OfficeDataConnectorDataTypesSharePoint sharePoint() { /** * Set the sharePoint property: SharePoint data type connection. - * + * * @param sharePoint the sharePoint value to set. * @return the OfficeDataConnectorDataTypes object itself. */ @@ -71,7 +79,7 @@ public OfficeDataConnectorDataTypes withSharePoint(OfficeDataConnectorDataTypesS /** * Get the teams property: Teams data type connection. - * + * * @return the teams value. */ public OfficeDataConnectorDataTypesTeams teams() { @@ -80,7 +88,7 @@ public OfficeDataConnectorDataTypesTeams teams() { /** * Set the teams property: Teams data type connection. - * + * * @param teams the teams value to set. * @return the OfficeDataConnectorDataTypes object itself. */ @@ -91,31 +99,28 @@ public OfficeDataConnectorDataTypes withTeams(OfficeDataConnectorDataTypesTeams /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (exchange() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property exchange in model OfficeDataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property exchange in model OfficeDataConnectorDataTypes")); } else { exchange().validate(); } if (sharePoint() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sharePoint in model OfficeDataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sharePoint in model OfficeDataConnectorDataTypes")); } else { sharePoint().validate(); } if (teams() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property teams in model OfficeDataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property teams in model OfficeDataConnectorDataTypes")); } else { teams().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesExchange.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesExchange.java index f4bb9c178fe0..eaad27f09736 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Exchange data type connection. */ +/** + * Exchange data type connection. + */ @Fluent public final class OfficeDataConnectorDataTypesExchange extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of OfficeDataConnectorDataTypesExchange class. + */ + public OfficeDataConnectorDataTypesExchange() { + } + + /** + * {@inheritDoc} + */ @Override public OfficeDataConnectorDataTypesExchange withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public OfficeDataConnectorDataTypesExchange withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 85b62eaef4d0..1ce9f86c0c65 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** SharePoint data type connection. */ +/** + * SharePoint data type connection. + */ @Fluent public final class OfficeDataConnectorDataTypesSharePoint extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of OfficeDataConnectorDataTypesSharePoint class. + */ + public OfficeDataConnectorDataTypesSharePoint() { + } + + /** + * {@inheritDoc} + */ @Override public OfficeDataConnectorDataTypesSharePoint withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public OfficeDataConnectorDataTypesSharePoint withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 a16d1b5ddc04..c726816b8590 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Teams data type connection. */ +/** + * Teams data type connection. + */ @Fluent public final class OfficeDataConnectorDataTypesTeams extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of OfficeDataConnectorDataTypesTeams class. + */ + public OfficeDataConnectorDataTypesTeams() { + } + + /** + * {@inheritDoc} + */ @Override public OfficeDataConnectorDataTypesTeams withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public OfficeDataConnectorDataTypesTeams withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 0572876278d1..139277930a92 100644 --- 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 @@ -7,32 +7,85 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.OfficeIrmCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents OfficeIRM (Microsoft Insider Risk Management) requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents OfficeIRM (Microsoft Insider Risk Management) requirements check request. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = OfficeIrmCheckRequirements.class, + visible = true) @JsonTypeName("OfficeIRM") @Fluent public final class OfficeIrmCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.OFFICE_IRM; + /* * OfficeIRM (Microsoft Insider Risk Management) requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 0a26b9e45492..292e0deef85a 100644 --- 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 @@ -8,30 +8,58 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.OfficeIrmDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents OfficeIRM (Microsoft Insider Risk Management) data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents OfficeIRM (Microsoft Insider Risk Management) data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = OfficeIrmDataConnector.class, visible = true) @JsonTypeName("OfficeIRM") @Fluent public final class OfficeIrmDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.OFFICE_IRM; + /* * OfficeIRM (Microsoft Insider Risk Management) data connector properties. */ @JsonProperty(value = "properties") private OfficeIrmDataConnectorProperties innerProperties; + /** + * Creates an instance of OfficeIrmDataConnector class. + */ + public OfficeIrmDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OfficeIrmDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +68,7 @@ public OfficeIrmDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public AlertsDataTypeOfDataConnector dataTypes() { @@ -49,7 +77,7 @@ public AlertsDataTypeOfDataConnector dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the OfficeIrmDataConnector object itself. */ @@ -63,7 +91,7 @@ public OfficeIrmDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTy /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +100,7 @@ public String 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. */ @@ -86,7 +114,7 @@ public OfficeIrmDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 8e52f4d91bb2..ae5a24fff60e 100644 --- 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 @@ -7,32 +7,85 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBICheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Office PowerBI requirements check request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Office PowerBI requirements check request. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = OfficePowerBICheckRequirements.class, + visible = true) @JsonTypeName("OfficePowerBI") @Fluent public final class OfficePowerBICheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.OFFICE_POWER_BI; + /* * Office Power BI requirements check properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 42b1400cfcf4..3985c83a0f5a 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for Office Microsoft PowerBI data connector. */ +/** + * The available data types for Office Microsoft PowerBI data connector. + */ @Fluent public final class OfficePowerBIConnectorDataTypes { /* @@ -17,9 +19,15 @@ public final class OfficePowerBIConnectorDataTypes { @JsonProperty(value = "logs", required = true) 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() { @@ -28,7 +36,7 @@ public OfficePowerBIConnectorDataTypesLogs logs() { /** * Set the logs property: Logs data type. - * + * * @param logs the logs value to set. * @return the OfficePowerBIConnectorDataTypes object itself. */ @@ -39,15 +47,14 @@ public OfficePowerBIConnectorDataTypes withLogs(OfficePowerBIConnectorDataTypesL /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (logs() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property logs in model OfficePowerBIConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property logs in model OfficePowerBIConnectorDataTypes")); } else { logs().validate(); } 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 index 0e71c0fd1cad..9a5fea1f02c8 100644 --- 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Logs data type. */ +/** + * Logs data type. + */ @Fluent public final class OfficePowerBIConnectorDataTypesLogs extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of OfficePowerBIConnectorDataTypesLogs class. + */ + public OfficePowerBIConnectorDataTypesLogs() { + } + + /** + * {@inheritDoc} + */ @Override public OfficePowerBIConnectorDataTypesLogs withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public OfficePowerBIConnectorDataTypesLogs withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 2c7496612394..535b9442b5b0 100644 --- 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 @@ -8,30 +8,62 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBIDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents Office Microsoft PowerBI data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Office Microsoft PowerBI data connector. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = OfficePowerBIDataConnector.class, + visible = true) @JsonTypeName("OfficePowerBI") @Fluent public final class OfficePowerBIDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.OFFICE_POWER_BI; + /* * Office Microsoft PowerBI data connector properties. */ @JsonProperty(value = "properties") private OfficePowerBIDataConnectorProperties innerProperties; + /** + * Creates an instance of OfficePowerBIDataConnector class. + */ + public OfficePowerBIDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OfficePowerBIDataConnector withEtag(String etag) { super.withEtag(etag); @@ -40,7 +72,7 @@ public OfficePowerBIDataConnector withEtag(String etag) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public OfficePowerBIConnectorDataTypes dataTypes() { @@ -49,7 +81,7 @@ public OfficePowerBIConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the OfficePowerBIDataConnector object itself. */ @@ -63,7 +95,7 @@ public OfficePowerBIDataConnector withDataTypes(OfficePowerBIConnectorDataTypes /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -72,7 +104,7 @@ public String 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. */ @@ -86,7 +118,7 @@ public OfficePowerBIDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 add782a2afc1..fcd5d4b35357 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 @@ -6,39 +6,41 @@ import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** * Gets the display property: Properties of the operation. - * + * * @return the display value. */ OperationDisplay display(); /** * Gets the name property: Name of the operation. - * + * * @return the name value. */ String name(); /** * Gets the origin property: The origin of the operation. - * + * * @return the origin value. */ String origin(); /** * Gets the isDataAction property: Indicates whether the operation is a data action. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationDisplay.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationDisplay.java index 54967890e46e..a05431d5a6f1 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Properties of the operation. */ +/** + * Properties of the operation. + */ @Fluent public final class OperationDisplay { /* @@ -34,9 +36,15 @@ public final class OperationDisplay { @JsonProperty(value = "resource") private String resource; + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + /** * Get the description property: Description of the operation. - * + * * @return the description value. */ public String description() { @@ -45,7 +53,7 @@ public String description() { /** * Set the description property: Description of the operation. - * + * * @param description the description value to set. * @return the OperationDisplay object itself. */ @@ -56,7 +64,7 @@ public OperationDisplay withDescription(String description) { /** * Get the operation property: Operation name. - * + * * @return the operation value. */ public String operation() { @@ -65,7 +73,7 @@ public String operation() { /** * Set the operation property: Operation name. - * + * * @param operation the operation value to set. * @return the OperationDisplay object itself. */ @@ -76,7 +84,7 @@ public OperationDisplay withOperation(String operation) { /** * Get the provider property: Provider name. - * + * * @return the provider value. */ public String provider() { @@ -85,7 +93,7 @@ public String provider() { /** * Set the provider property: Provider name. - * + * * @param provider the provider value to set. * @return the OperationDisplay object itself. */ @@ -96,7 +104,7 @@ public OperationDisplay withProvider(String provider) { /** * Get the resource property: Resource name. - * + * * @return the resource value. */ public String resource() { @@ -105,7 +113,7 @@ public String resource() { /** * Set the resource property: Resource name. - * + * * @param resource the resource value to set. * @return the OperationDisplay object itself. */ @@ -116,7 +124,7 @@ public OperationDisplay withResource(String resource) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operations.java index cb4d4d82cf5c..f92ab1d23c79 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operations.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operations.java @@ -7,27 +7,29 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available in the SecurityInsights RP as paginated response with {@link - * PagedIterable}. + * @return lists the operations available in the SecurityInsights RP as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * Lists all operations available Azure Security Insights Resource Provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available in the SecurityInsights RP as paginated response with {@link - * PagedIterable}. + * @return lists the operations available in the SecurityInsights RP as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationsList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationsList.java index 47df47f99519..ed1168a10210 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/models/OperationsList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Lists the operations available in the SecurityInsights RP. */ +/** + * Lists the operations available in the SecurityInsights RP. + */ @Fluent public final class OperationsList { /* @@ -25,9 +27,15 @@ public final class OperationsList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of OperationsList class. + */ + public OperationsList() { + } + /** * Get the nextLink property: URL to fetch the next set of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of operations. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of operations. - * + * * @param value the value value to set. * @return the OperationsList object itself. */ @@ -56,14 +64,13 @@ public OperationsList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model OperationsList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationsList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operator.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operator.java index 77aafbf0cf2b..8f7bfa2438c6 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operator.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Operator.java @@ -8,17 +8,152 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Operator used for list of dependencies in criteria array. */ +/** + * Represents an operator in a ConditionClause. + */ public final class Operator extends ExpandableStringEnum { - /** Static value AND for Operator. */ - public static final Operator AND = fromString("AND"); + /** + * Static value Equals for Operator. + */ + public static final Operator EQUALS = fromString("Equals"); + + /** + * Static value NotEquals for Operator. + */ + public static final Operator NOT_EQUALS = fromString("NotEquals"); + + /** + * Static value LessThan for Operator. + */ + public static final Operator LESS_THAN = fromString("LessThan"); + + /** + * Static value LessThanEqual for Operator. + */ + public static final Operator LESS_THAN_EQUAL = fromString("LessThanEqual"); + + /** + * Static value GreaterThan for Operator. + */ + public static final Operator GREATER_THAN = fromString("GreaterThan"); + + /** + * Static value GreaterThanEqual for Operator. + */ + public static final Operator GREATER_THAN_EQUAL = fromString("GreaterThanEqual"); + + /** + * Static value StringContains for Operator. + */ + public static final Operator STRING_CONTAINS = fromString("StringContains"); + + /** + * Static value StringNotContains for Operator. + */ + public static final Operator STRING_NOT_CONTAINS = fromString("StringNotContains"); + + /** + * Static value StringStartsWith for Operator. + */ + public static final Operator STRING_STARTS_WITH = fromString("StringStartsWith"); + + /** + * Static value StringNotStartsWith for Operator. + */ + public static final Operator STRING_NOT_STARTS_WITH = fromString("StringNotStartsWith"); + + /** + * Static value StringEndsWith for Operator. + */ + public static final Operator STRING_ENDS_WITH = fromString("StringEndsWith"); + + /** + * Static value StringNotEndsWith for Operator. + */ + public static final Operator STRING_NOT_ENDS_WITH = fromString("StringNotEndsWith"); + + /** + * Static value StringIsEmpty for Operator. + */ + public static final Operator STRING_IS_EMPTY = fromString("StringIsEmpty"); + + /** + * Static value IsNull for Operator. + */ + public static final Operator IS_NULL = fromString("IsNull"); + + /** + * Static value IsTrue for Operator. + */ + public static final Operator IS_TRUE = fromString("IsTrue"); + + /** + * Static value IsFalse for Operator. + */ + public static final Operator IS_FALSE = fromString("IsFalse"); + + /** + * Static value ArrayContains for Operator. + */ + public static final Operator ARRAY_CONTAINS = fromString("ArrayContains"); + + /** + * Static value ArrayNotContains for Operator. + */ + public static final Operator ARRAY_NOT_CONTAINS = fromString("ArrayNotContains"); + + /** + * Static value OnOrAfterRelative for Operator. + */ + public static final Operator ON_OR_AFTER_RELATIVE = fromString("OnOrAfterRelative"); + + /** + * Static value AfterRelative for Operator. + */ + public static final Operator AFTER_RELATIVE = fromString("AfterRelative"); + + /** + * Static value OnOrBeforeRelative for Operator. + */ + public static final Operator ON_OR_BEFORE_RELATIVE = fromString("OnOrBeforeRelative"); + + /** + * Static value BeforeRelative for Operator. + */ + public static final Operator BEFORE_RELATIVE = fromString("BeforeRelative"); + + /** + * Static value OnOrAfterAbsolute for Operator. + */ + public static final Operator ON_OR_AFTER_ABSOLUTE = fromString("OnOrAfterAbsolute"); + + /** + * Static value AfterAbsolute for Operator. + */ + public static final Operator AFTER_ABSOLUTE = fromString("AfterAbsolute"); + + /** + * Static value OnOrBeforeAbsolute for Operator. + */ + public static final Operator ON_OR_BEFORE_ABSOLUTE = fromString("OnOrBeforeAbsolute"); + + /** + * Static value BeforeAbsolute for Operator. + */ + public static final Operator BEFORE_ABSOLUTE = fromString("BeforeAbsolute"); - /** Static value OR for Operator. */ - public static final Operator OR = fromString("OR"); + /** + * 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. */ @@ -29,7 +164,7 @@ public static Operator fromString(String name) { /** * Gets known Operator values. - * + * * @return known Operator values. */ public static Collection values() { 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..d3c098f34649 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OracleAuthModel.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for API authentication for Oracle. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = OracleAuthModel.class, visible = true) +@JsonTypeName("Oracle") +@Fluent +public final class OracleAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private CcpAuthType type = CcpAuthType.ORACLE; + + /* + * Oracle tenant ID + */ + @JsonProperty(value = "tenantId", required = true) + private String tenantId; + + /* + * Oracle user ID + */ + @JsonProperty(value = "userId", required = true) + private String userId; + + /* + * Public Fingerprint + */ + @JsonProperty(value = "publicFingerprint", required = true) + private String publicFingerprint; + + /* + * Content of the PRM file + */ + @JsonProperty(value = "pemFile", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (tenantId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tenantId in model OracleAuthModel")); + } + if (userId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property userId in model OracleAuthModel")); + } + if (publicFingerprint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publicFingerprint in model OracleAuthModel")); + } + if (pemFile() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property pemFile in model OracleAuthModel")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OracleAuthModel.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OutputType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OutputType.java index 6fff09628529..01910332d080 100644 --- 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Insights Column type. */ +/** + * Insights Column type. + */ public final class OutputType extends ExpandableStringEnum { - /** Static value Number for OutputType. */ + /** + * Static value Number for OutputType. + */ public static final OutputType NUMBER = fromString("Number"); - /** Static value String for OutputType. */ + /** + * Static value String for OutputType. + */ public static final OutputType STRING = fromString("String"); - /** Static value Date for OutputType. */ + /** + * Static value Date for OutputType. + */ public static final OutputType DATE = fromString("Date"); - /** Static value Entity for OutputType. */ + /** + * Static value Entity for OutputType. + */ 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. */ @@ -35,7 +54,7 @@ public static OutputType fromString(String name) { /** * Gets known OutputType values. - * + * * @return known OutputType values. */ public static Collection values() { 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 8bb128054032..b3a51345be54 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; 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. */ + /** + * Static value Unknown for OwnerType. + */ public static final OwnerType UNKNOWN = fromString("Unknown"); - /** Static value User for OwnerType. */ + /** + * Static value User for OwnerType. + */ public static final OwnerType USER = fromString("User"); - /** Static value Group for OwnerType. */ + /** + * Static value Group for OwnerType. + */ public static final OwnerType GROUP = fromString("Group"); + /** + * Creates a new instance of OwnerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OwnerType() { + } + /** * Creates or finds a OwnerType from its string representation. - * + * * @param name a name to look for. * @return the corresponding OwnerType. */ @@ -32,7 +49,7 @@ public static OwnerType fromString(String name) { /** * Gets known OwnerType values. - * + * * @return known OwnerType values. */ public static Collection values() { 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..369d8291c651 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageBaseProperties.java @@ -0,0 +1,647 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** + * Describes package properties. + */ +@Fluent +public class PackageBaseProperties { + /* + * The content id of the package + */ + @JsonProperty(value = "contentId") + private String contentId; + + /* + * Unique ID for the content. It should be generated based on the contentId, contentKind and the contentVersion of the package + */ + @JsonProperty(value = "contentProductId") + private String contentProductId; + + /* + * The package kind + */ + @JsonProperty(value = "contentKind") + private PackageKind contentKind; + + /* + * The version of the content schema. + */ + @JsonProperty(value = "contentSchemaVersion") + private String contentSchemaVersion; + + /* + * Flag indicates if this is a newly published package. + */ + @JsonProperty(value = "isNew") + private Flag isNew; + + /* + * Flag indicates if this package is in preview. + */ + @JsonProperty(value = "isPreview") + private Flag isPreview; + + /* + * Flag indicates if this package is among the featured list. + */ + @JsonProperty(value = "isFeatured") + private Flag isFeatured; + + /* + * Flag indicates if this template is deprecated + */ + @JsonProperty(value = "isDeprecated") + private Flag isDeprecated; + + /* + * the latest version number of the package + */ + @JsonProperty(value = "version") + private String version; + + /* + * The display name of the package + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The description of the package + */ + @JsonProperty(value = "description") + private String description; + + /* + * The publisher display name of the package + */ + @JsonProperty(value = "publisherDisplayName") + private String publisherDisplayName; + + /* + * The source of the package + */ + @JsonProperty(value = "source") + private MetadataSource source; + + /* + * The author of the package + */ + @JsonProperty(value = "author") + private MetadataAuthor author; + + /* + * The support tier of the package + */ + @JsonProperty(value = "support") + private MetadataSupport support; + + /* + * The support tier of the package + */ + @JsonProperty(value = "dependencies") + private MetadataDependencies dependencies; + + /* + * Providers for the package item + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * first publish date package item + */ + @JsonProperty(value = "firstPublishDate") + private LocalDate firstPublishDate; + + /* + * last publish date for the package item + */ + @JsonProperty(value = "lastPublishDate") + private LocalDate lastPublishDate; + + /* + * The categories of the package + */ + @JsonProperty(value = "categories") + private MetadataCategories categories; + + /* + * the tactics the resource covers + */ + @JsonProperty(value = "threatAnalysisTactics") + private List threatAnalysisTactics; + + /* + * the techniques the resource covers, these have to be aligned with the tactics being used + */ + @JsonProperty(value = "threatAnalysisTechniques") + private List threatAnalysisTechniques; + + /* + * the icon identifier. this id can later be fetched from the content metadata + */ + @JsonProperty(value = "icon") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (author() != null) { + author().validate(); + } + if (support() != null) { + support().validate(); + } + if (dependencies() != null) { + dependencies().validate(); + } + if (categories() != null) { + categories().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/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..f129ab859d27 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageKind.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The package kind. + */ +public final class PackageKind extends ExpandableStringEnum { + /** + * Static value Solution for PackageKind. + */ + public static final PackageKind SOLUTION = fromString("Solution"); + + /** + * Static value Standalone for PackageKind. + */ + 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. + */ + @JsonCreator + 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/PackageList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageList.java new file mode 100644 index 000000000000..ebc61575fcf6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List available packages. + */ +@Fluent +public final class PackageList { + /* + * URL to fetch the next set of packages. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of packages. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of PackageList class. + */ + public PackageList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of packages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of packages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of packages. + * + * @param value the value value to set. + * @return the PackageList object itself. + */ + public PackageList 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 PackageList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PackageList.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..eae436700459 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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 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 index ba4232af432e..47e88061e6c4 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Permission provider scope. */ +/** + * Permission provider scope. + */ public final class PermissionProviderScope extends ExpandableStringEnum { - /** Static value ResourceGroup for PermissionProviderScope. */ + /** + * Static value ResourceGroup for PermissionProviderScope. + */ public static final PermissionProviderScope RESOURCE_GROUP = fromString("ResourceGroup"); - /** Static value Subscription for PermissionProviderScope. */ + /** + * Static value Subscription for PermissionProviderScope. + */ public static final PermissionProviderScope SUBSCRIPTION = fromString("Subscription"); - /** Static value Workspace for PermissionProviderScope. */ + /** + * Static value Workspace for PermissionProviderScope. + */ 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. */ @@ -32,7 +49,7 @@ public static PermissionProviderScope fromString(String name) { /** * Gets known PermissionProviderScope values. - * + * * @return known PermissionProviderScope values. */ public static Collection values() { 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 index cfeebee1b045..115d0dec49fa 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Permissions required for the connector. */ +/** + * Permissions required for the connector. + */ @Fluent public final class Permissions { /* @@ -23,9 +25,15 @@ public final class Permissions { @JsonProperty(value = "customs") 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() { @@ -34,7 +42,7 @@ public List resourceProvider() { /** * Set the resourceProvider property: Resource provider permissions required for the connector. - * + * * @param resourceProvider the resourceProvider value to set. * @return the Permissions object itself. */ @@ -45,7 +53,7 @@ public Permissions withResourceProvider(List re /** * Get the customs property: Customs permissions required for the connector. - * + * * @return the customs value. */ public List customs() { @@ -54,7 +62,7 @@ public List customs() { /** * Set the customs property: Customs permissions required for the connector. - * + * * @param customs the customs value to set. * @return the Permissions object itself. */ @@ -65,7 +73,7 @@ public Permissions withCustoms(List customs) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsCustomsItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsCustomsItem.java index 943909826a2e..0940a1a500c0 100644 --- 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 @@ -6,17 +6,29 @@ import com.azure.core.annotation.Fluent; -/** The PermissionsCustomsItem model. */ +/** + * The PermissionsCustomsItem model. + */ @Fluent public final class PermissionsCustomsItem extends Customs { - /** {@inheritDoc} */ + /** + * Creates an instance of PermissionsCustomsItem class. + */ + public PermissionsCustomsItem() { + } + + /** + * {@inheritDoc} + */ @Override public PermissionsCustomsItem withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PermissionsCustomsItem withDescription(String description) { super.withDescription(description); @@ -25,7 +37,7 @@ public PermissionsCustomsItem withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index d2db9072abc2..2bf56532f89f 100644 --- 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 @@ -6,38 +6,56 @@ import com.azure.core.annotation.Fluent; -/** The PermissionsResourceProviderItem model. */ +/** + * The PermissionsResourceProviderItem model. + */ @Fluent public final class PermissionsResourceProviderItem extends ResourceProvider { - /** {@inheritDoc} */ + /** + * Creates an instance of PermissionsResourceProviderItem class. + */ + public PermissionsResourceProviderItem() { + } + + /** + * {@inheritDoc} + */ @Override public PermissionsResourceProviderItem withProvider(ProviderName provider) { super.withProvider(provider); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PermissionsResourceProviderItem withPermissionsDisplayText(String permissionsDisplayText) { super.withPermissionsDisplayText(permissionsDisplayText); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PermissionsResourceProviderItem withProviderDisplayName(String providerDisplayName) { super.withProviderDisplayName(providerDisplayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PermissionsResourceProviderItem withScope(PermissionProviderScope scope) { super.withScope(scope); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PermissionsResourceProviderItem withRequiredPermissions(RequiredPermissions requiredPermissions) { super.withRequiredPermissions(requiredPermissions); @@ -46,7 +64,7 @@ public PermissionsResourceProviderItem withRequiredPermissions(RequiredPermissio /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 9d85ffb7802b..b7ffbc7eae01 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 @@ -5,16 +5,19 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; -/** The PlaybookActionProperties model. */ +/** + * The PlaybookActionProperties model. + */ @Fluent public final class PlaybookActionProperties { /* * The resource id of the playbook resource. */ - @JsonProperty(value = "logicAppResourceId") + @JsonProperty(value = "logicAppResourceId", required = true) private String logicAppResourceId; /* @@ -23,9 +26,15 @@ public final class PlaybookActionProperties { @JsonProperty(value = "tenantId") private UUID tenantId; + /** + * Creates an instance of PlaybookActionProperties class. + */ + public PlaybookActionProperties() { + } + /** * Get the logicAppResourceId property: The resource id of the playbook resource. - * + * * @return the logicAppResourceId value. */ public String logicAppResourceId() { @@ -34,7 +43,7 @@ public String logicAppResourceId() { /** * Set the logicAppResourceId property: The resource id of the playbook resource. - * + * * @param logicAppResourceId the logicAppResourceId value to set. * @return the PlaybookActionProperties object itself. */ @@ -45,7 +54,7 @@ public PlaybookActionProperties withLogicAppResourceId(String logicAppResourceId /** * Get the tenantId property: The tenant id of the playbook resource. - * + * * @return the tenantId value. */ public UUID tenantId() { @@ -54,7 +63,7 @@ public UUID tenantId() { /** * Set the tenantId property: The tenant id of the playbook resource. - * + * * @param tenantId the tenantId value to set. * @return the PlaybookActionProperties object itself. */ @@ -65,9 +74,16 @@ public PlaybookActionProperties withTenantId(UUID tenantId) { /** * 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 PlaybookActionProperties")); + } } + + private static final ClientLogger LOGGER = new ClientLogger(PlaybookActionProperties.class); } 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 index e62fa3c41717..e9dc4885d23d 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The polling frequency for the TAXII server. */ +/** + * The polling frequency for the TAXII server. + */ public final class PollingFrequency extends ExpandableStringEnum { - /** Static value OnceAMinute for PollingFrequency. */ + /** + * Static value OnceAMinute for PollingFrequency. + */ public static final PollingFrequency ONCE_AMINUTE = fromString("OnceAMinute"); - /** Static value OnceAnHour for PollingFrequency. */ + /** + * Static value OnceAnHour for PollingFrequency. + */ public static final PollingFrequency ONCE_AN_HOUR = fromString("OnceAnHour"); - /** Static value OnceADay for PollingFrequency. */ + /** + * Static value OnceADay for PollingFrequency. + */ 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. */ @@ -32,7 +49,7 @@ public static PollingFrequency fromString(String name) { /** * Gets known PollingFrequency values. - * + * * @return known PollingFrequency values. */ public static Collection values() { 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 1d192d71c851..87ffa4091b9a 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 @@ -8,25 +8,51 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.ProcessEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.Map; -/** Represents a process entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a process entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ProcessEntity.class, visible = true) @JsonTypeName("Process") @Fluent public final class ProcessEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.PROCESS; + /* * Process entity properties */ @JsonProperty(value = "properties") private ProcessEntityProperties innerProperties; + /** + * Creates an instance of ProcessEntity class. + */ + public ProcessEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Process entity properties. - * + * * @return the innerProperties value. */ private ProcessEntityProperties innerProperties() { @@ -35,7 +61,7 @@ private ProcessEntityProperties innerProperties() { /** * Get the accountEntityId property: The account entity id running the processes. - * + * * @return the accountEntityId value. */ public String accountEntityId() { @@ -44,7 +70,7 @@ public String accountEntityId() { /** * Get the commandLine property: The command line used to create the process. - * + * * @return the commandLine value. */ public String commandLine() { @@ -53,7 +79,7 @@ public String commandLine() { /** * Get the creationTimeUtc property: The time when the process started to run. - * + * * @return the creationTimeUtc value. */ public OffsetDateTime creationTimeUtc() { @@ -62,7 +88,7 @@ public OffsetDateTime creationTimeUtc() { /** * Get the elevationToken property: The elevation token associated with the process. - * + * * @return the elevationToken value. */ public ElevationToken elevationToken() { @@ -71,7 +97,7 @@ public ElevationToken elevationToken() { /** * Set the elevationToken property: The elevation token associated with the process. - * + * * @param elevationToken the elevationToken value to set. * @return the ProcessEntity object itself. */ @@ -85,7 +111,7 @@ public ProcessEntity withElevationToken(ElevationToken elevationToken) { /** * Get the hostEntityId property: The host entity id on which the process was running. - * + * * @return the hostEntityId value. */ public String hostEntityId() { @@ -94,7 +120,7 @@ public String hostEntityId() { /** * Get the hostLogonSessionEntityId property: The session entity id in which the process was running. - * + * * @return the hostLogonSessionEntityId value. */ public String hostLogonSessionEntityId() { @@ -103,7 +129,7 @@ public String hostLogonSessionEntityId() { /** * Get the imageFileEntityId property: Image file entity id. - * + * * @return the imageFileEntityId value. */ public String imageFileEntityId() { @@ -112,7 +138,7 @@ public String imageFileEntityId() { /** * Get the parentProcessEntityId property: The parent process entity id. - * + * * @return the parentProcessEntityId value. */ public String parentProcessEntityId() { @@ -121,7 +147,7 @@ public String parentProcessEntityId() { /** * Get the processId property: The process ID. - * + * * @return the processId value. */ public String processId() { @@ -131,7 +157,7 @@ public String processId() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -141,7 +167,7 @@ public Map 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() { @@ -150,7 +176,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageAdditionalProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageAdditionalProperties.java new file mode 100644 index 000000000000..8d78b17d92cc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageAdditionalProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * product package additional properties. + */ +@Fluent +public class ProductPackageAdditionalProperties { + /* + * The version of the installed package, null or absent means not installed. + */ + @JsonProperty(value = "installedVersion") + private String installedVersion; + + /* + * The metadata resource id. + */ + @JsonProperty(value = "metadataResourceId") + private String metadataResourceId; + + /* + * The json of the ARM template to deploy. Expandable. + */ + @JsonProperty(value = "packagedContent") + private Object packagedContent; + + /** + * Creates an instance of ProductPackageAdditionalProperties class. + */ + public ProductPackageAdditionalProperties() { + } + + /** + * 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; + } + + /** + * Set the installedVersion property: The version of the installed package, null or absent means not installed. + * + * @param installedVersion the installedVersion value to set. + * @return the ProductPackageAdditionalProperties object itself. + */ + public ProductPackageAdditionalProperties withInstalledVersion(String installedVersion) { + this.installedVersion = installedVersion; + return this; + } + + /** + * Get the metadataResourceId property: The metadata resource id. + * + * @return the metadataResourceId value. + */ + public String metadataResourceId() { + return this.metadataResourceId; + } + + /** + * Set the metadataResourceId property: The metadata resource id. + * + * @param metadataResourceId the metadataResourceId value to set. + * @return the ProductPackageAdditionalProperties object itself. + */ + public ProductPackageAdditionalProperties withMetadataResourceId(String metadataResourceId) { + this.metadataResourceId = metadataResourceId; + return this; + } + + /** + * Get the packagedContent property: The json of the ARM template to deploy. Expandable. + * + * @return the packagedContent value. + */ + public Object packagedContent() { + return this.packagedContent; + } + + /** + * Set the packagedContent property: The json of the ARM template to deploy. Expandable. + * + * @param packagedContent the packagedContent value to set. + * @return the ProductPackageAdditionalProperties object itself. + */ + public ProductPackageAdditionalProperties withPackagedContent(Object packagedContent) { + this.packagedContent = packagedContent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageList.java new file mode 100644 index 000000000000..65d62f2d98c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List available packages. + */ +@Fluent +public final class ProductPackageList { + /* + * URL to fetch the next set of packages. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of packages. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of ProductPackageList class. + */ + public ProductPackageList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of packages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of packages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of packages. + * + * @param value the value value to set. + * @return the ProductPackageList object itself. + */ + public ProductPackageList 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 ProductPackageList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProductPackageList.class); +} 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..c220653449d2 --- /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) AutoRest 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 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 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 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/ProductPackageOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageOperations.java new file mode 100644 index 000000000000..ba71acc841ed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageOperations.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ProductPackageOperations. + */ +public interface ProductPackageOperations { + /** + * 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 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 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/ProductPackages.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackages.java new file mode 100644 index 000000000000..a52f2172b40a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackages.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ProductPackages. + */ +public interface ProductPackages { + /** + * 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 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 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 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, 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 index ead1ce681b97..da3f477009de 100644 --- 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 @@ -8,115 +8,117 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; -/** Resource collection API of ProductSettings. */ +/** + * Resource collection API of ProductSettings. + */ public interface ProductSettings { /** * List of all the settings. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return list of all the settings along with {@link Response}. */ - SettingList list(String resourceGroupName, String workspaceName); + Response listWithResponse(String resourceGroupName, String workspaceName, Context context); /** * List of all the settings. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Response}. + * @return list of all the settings. */ - Response listWithResponse(String resourceGroupName, String workspaceName, Context context); + SettingList list(String resourceGroupName, String workspaceName); /** * 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. + * @return a setting along with {@link Response}. */ - Settings get(String resourceGroupName, String workspaceName, String settingsName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return a setting. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String settingsName, Context context); + Settings get(String resourceGroupName, String workspaceName, String settingsName); /** * Delete setting of the product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param settingsName The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String settingsName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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); + void delete(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. + * @return the Setting along with {@link Response}. */ - Settings update(String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return the Setting. */ - Response updateWithResponse( - String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings, Context context); + Settings update(String resourceGroupName, String workspaceName, String settingsName, SettingsInner settings); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateAdditionalProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateAdditionalProperties.java new file mode 100644 index 000000000000..1a0a6d637dc3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateAdditionalProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * additional properties of product template. + */ +@Fluent +public class ProductTemplateAdditionalProperties { + /* + * The json of the ARM template to deploy + */ + @JsonProperty(value = "packagedContent") + private Object packagedContent; + + /** + * Creates an instance of ProductTemplateAdditionalProperties class. + */ + public ProductTemplateAdditionalProperties() { + } + + /** + * Get the packagedContent property: The json of the ARM template to deploy. + * + * @return the packagedContent value. + */ + public Object packagedContent() { + return this.packagedContent; + } + + /** + * Set the packagedContent property: The json of the ARM template to deploy. + * + * @param packagedContent the packagedContent value to set. + * @return the ProductTemplateAdditionalProperties object itself. + */ + public ProductTemplateAdditionalProperties withPackagedContent(Object packagedContent) { + this.packagedContent = packagedContent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateList.java new file mode 100644 index 000000000000..55668a19d383 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of all the template. + */ +@Fluent +public final class ProductTemplateList { + /* + * Array of templates. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URL to fetch the next page of template. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of ProductTemplateList class. + */ + public ProductTemplateList() { + } + + /** + * Get the value property: Array of templates. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of templates. + * + * @param value the value value to set. + * @return the ProductTemplateList object itself. + */ + public ProductTemplateList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to fetch the next page of template. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ProductTemplateList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProductTemplateList.class); +} 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..b170063131d0 --- /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) AutoRest 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 packagedContent property: The json of the ARM template to deploy. + * + * @return the packagedContent value. + */ + Object packagedContent(); + + /** + * 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 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/DomainWhois.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateOperations.java similarity index 61% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DomainWhois.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateOperations.java index 56380b6e2f98..48589ed54c9b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DomainWhois.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateOperations.java @@ -7,30 +7,35 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of DomainWhois. */ -public interface DomainWhois { +/** + * Resource collection API of ProductTemplateOperations. + */ +public interface ProductTemplateOperations { /** - * Get whois information for a single domain name. - * + * Gets a template by its identifier. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param domain Domain name to be enriched. + * @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 whois information for a single domain name. + * @return a template by its identifier along with {@link Response}. */ - EnrichmentDomainWhois get(String resourceGroupName, String domain); + Response getWithResponse(String resourceGroupName, String workspaceName, String templateId, + Context context); /** - * Get whois information for a single domain name. - * + * Gets a template by its identifier. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param domain Domain name to be enriched. - * @param context The context to associate with this operation. + * @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 whois information for a single domain name along with {@link Response}. + * @return a template by its identifier. */ - Response getWithResponse(String resourceGroupName, String domain, Context context); + ProductTemplateModel get(String resourceGroupName, String workspaceName, String templateId); } 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..bc97d127f467 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplates.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ProductTemplates. + */ +public interface ProductTemplates { + /** + * 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 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 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 dc048782a94f..dc25b922a36b 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 @@ -6,23 +6,53 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an automation rule condition that evaluates an array property's value change. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "conditionType") +/** + * Describes an automation rule condition that evaluates an array property's value change. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "conditionType", + defaultImpl = PropertyArrayChangedConditionProperties.class, + visible = true) @JsonTypeName("PropertyArrayChanged") @Fluent public final class PropertyArrayChangedConditionProperties extends AutomationRuleCondition { + /* + * The conditionType property. + */ + @JsonTypeId + @JsonProperty(value = "conditionType", required = true) + private ConditionType conditionType = ConditionType.PROPERTY_ARRAY_CHANGED; + /* * The conditionProperties property. */ @JsonProperty(value = "conditionProperties") private AutomationRulePropertyArrayChangedValuesCondition conditionProperties; + /** + * Creates an instance of PropertyArrayChangedConditionProperties class. + */ + public PropertyArrayChangedConditionProperties() { + } + + /** + * 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 AutomationRulePropertyArrayChangedValuesCondition conditionProperties() { @@ -31,19 +61,19 @@ public AutomationRulePropertyArrayChangedValuesCondition conditionProperties() { /** * Set the conditionProperties property: The conditionProperties property. - * + * * @param conditionProperties the conditionProperties value to set. * @return the PropertyArrayChangedConditionProperties object itself. */ - public PropertyArrayChangedConditionProperties withConditionProperties( - AutomationRulePropertyArrayChangedValuesCondition conditionProperties) { + public PropertyArrayChangedConditionProperties + withConditionProperties(AutomationRulePropertyArrayChangedValuesCondition conditionProperties) { this.conditionProperties = conditionProperties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index a508d41ec873..365875c0aa7e 100644 --- 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 @@ -6,23 +6,53 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an automation rule condition that evaluates an array property's value. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "conditionType") +/** + * Describes an automation rule condition that evaluates an array property's value. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "conditionType", + defaultImpl = PropertyArrayConditionProperties.class, + visible = true) @JsonTypeName("PropertyArray") @Fluent public final class PropertyArrayConditionProperties extends AutomationRuleCondition { + /* + * The conditionType property. + */ + @JsonTypeId + @JsonProperty(value = "conditionType", required = true) + private ConditionType conditionType = ConditionType.PROPERTY_ARRAY; + /* * The conditionProperties property. */ @JsonProperty(value = "conditionProperties") 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() { @@ -31,19 +61,19 @@ public AutomationRulePropertyArrayValuesCondition 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) { + public PropertyArrayConditionProperties + withConditionProperties(AutomationRulePropertyArrayValuesCondition conditionProperties) { this.conditionProperties = conditionProperties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 22470af86a46..ab4daaf32767 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 @@ -6,23 +6,53 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an automation rule condition that evaluates a property's value change. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "conditionType") +/** + * Describes an automation rule condition that evaluates a property's value change. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "conditionType", + defaultImpl = PropertyChangedConditionProperties.class, + visible = true) @JsonTypeName("PropertyChanged") @Fluent public final class PropertyChangedConditionProperties extends AutomationRuleCondition { + /* + * The conditionType property. + */ + @JsonTypeId + @JsonProperty(value = "conditionType", required = true) + private ConditionType conditionType = ConditionType.PROPERTY_CHANGED; + /* * The conditionProperties property. */ @JsonProperty(value = "conditionProperties") private AutomationRulePropertyValuesChangedCondition conditionProperties; + /** + * Creates an instance of PropertyChangedConditionProperties class. + */ + public PropertyChangedConditionProperties() { + } + + /** + * 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 AutomationRulePropertyValuesChangedCondition conditionProperties() { @@ -31,19 +61,19 @@ public AutomationRulePropertyValuesChangedCondition conditionProperties() { /** * Set the conditionProperties property: The conditionProperties property. - * + * * @param conditionProperties the conditionProperties value to set. * @return the PropertyChangedConditionProperties object itself. */ - public PropertyChangedConditionProperties withConditionProperties( - AutomationRulePropertyValuesChangedCondition conditionProperties) { + public PropertyChangedConditionProperties + withConditionProperties(AutomationRulePropertyValuesChangedCondition conditionProperties) { this.conditionProperties = conditionProperties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 7c641a0bca1e..17f708dfb91c 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 @@ -6,23 +6,53 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an automation rule condition that evaluates a property's value. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "conditionType") +/** + * Describes an automation rule condition that evaluates a property's value. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "conditionType", + defaultImpl = PropertyConditionProperties.class, + visible = true) @JsonTypeName("Property") @Fluent public final class PropertyConditionProperties extends AutomationRuleCondition { + /* + * The conditionType property. + */ + @JsonTypeId + @JsonProperty(value = "conditionType", required = true) + private ConditionType conditionType = ConditionType.PROPERTY; + /* * The conditionProperties property. */ @JsonProperty(value = "conditionProperties") private AutomationRulePropertyValuesCondition conditionProperties; + /** + * Creates an instance of PropertyConditionProperties class. + */ + public PropertyConditionProperties() { + } + + /** + * 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 AutomationRulePropertyValuesCondition conditionProperties() { @@ -31,19 +61,19 @@ public AutomationRulePropertyValuesCondition conditionProperties() { /** * Set the conditionProperties property: The conditionProperties property. - * + * * @param conditionProperties the conditionProperties value to set. * @return the PropertyConditionProperties object itself. */ - public PropertyConditionProperties withConditionProperties( - AutomationRulePropertyValuesCondition conditionProperties) { + public PropertyConditionProperties + withConditionProperties(AutomationRulePropertyValuesCondition conditionProperties) { this.conditionProperties = conditionProperties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index a365b42e5c16..d9aef864d31b 100644 --- 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 @@ -8,35 +8,58 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Provider name. */ +/** + * Provider name. + */ public final class ProviderName extends ExpandableStringEnum { - /** Static value Microsoft.OperationalInsights/solutions for ProviderName. */ - public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS = - fromString("Microsoft.OperationalInsights/solutions"); + /** + * Static value Microsoft.OperationalInsights/solutions for ProviderName. + */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS + = fromString("Microsoft.OperationalInsights/solutions"); + + /** + * Static value Microsoft.OperationalInsights/workspaces for ProviderName. + */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES + = fromString("Microsoft.OperationalInsights/workspaces"); - /** Static value Microsoft.OperationalInsights/workspaces for ProviderName. */ - public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES = - fromString("Microsoft.OperationalInsights/workspaces"); + /** + * Static value Microsoft.OperationalInsights/workspaces/datasources for ProviderName. + */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_DATASOURCES + = fromString("Microsoft.OperationalInsights/workspaces/datasources"); - /** Static value Microsoft.OperationalInsights/workspaces/datasources for ProviderName. */ - public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_DATASOURCES = - fromString("Microsoft.OperationalInsights/workspaces/datasources"); + /** + * Static value microsoft.aadiam/diagnosticSettings for ProviderName. + */ + public static final ProviderName MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS + = fromString("microsoft.aadiam/diagnosticSettings"); - /** Static value microsoft.aadiam/diagnosticSettings for ProviderName. */ - public static final ProviderName MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS = - fromString("microsoft.aadiam/diagnosticSettings"); + /** + * Static value Microsoft.OperationalInsights/workspaces/sharedKeys for ProviderName. + */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS + = fromString("Microsoft.OperationalInsights/workspaces/sharedKeys"); - /** Static value Microsoft.OperationalInsights/workspaces/sharedKeys for ProviderName. */ - public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS = - fromString("Microsoft.OperationalInsights/workspaces/sharedKeys"); + /** + * Static value Microsoft.Authorization/policyAssignments for ProviderName. + */ + public static final ProviderName MICROSOFT_AUTHORIZATION_POLICY_ASSIGNMENTS + = fromString("Microsoft.Authorization/policyAssignments"); - /** Static value Microsoft.Authorization/policyAssignments for ProviderName. */ - 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. */ @@ -47,7 +70,7 @@ public static ProviderName fromString(String name) { /** * Gets known ProviderName values. - * + * * @return known ProviderName values. */ public static Collection values() { 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..0a6c5b38d587 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderPermissionsScope.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The scope on which the user should have permissions, in order to be able to create connections. + */ +public final class ProviderPermissionsScope extends ExpandableStringEnum { + /** + * Static value Subscription for ProviderPermissionsScope. + */ + public static final ProviderPermissionsScope SUBSCRIPTION = fromString("Subscription"); + + /** + * Static value ResourceGroup for ProviderPermissionsScope. + */ + public static final ProviderPermissionsScope RESOURCE_GROUP = fromString("ResourceGroup"); + + /** + * Static value Workspace for ProviderPermissionsScope. + */ + 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. + */ + @JsonCreator + 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..d1f32108b0d3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProvisioningState.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The triggered analytics rule run provisioning state. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Accepted for ProvisioningState. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value InProgress for ProvisioningState. + */ + public static final ProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + 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. + */ + @JsonCreator + 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..472386af5850 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequest.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information regarding pull request for protected branches. + */ +@Immutable +public final class PullRequest { + /* + * URL of pull request + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /* + * State of the pull request + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /** + * Creates an instance of PullRequest class. + */ + public 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 State state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Query.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Query.java new file mode 100644 index 000000000000..03d392b190e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Query.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.QueryProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a query to run on the TI objects in the workspace. + */ +@Fluent +public final class Query { + /* + * Query properties + */ + @JsonProperty(value = "properties") + private QueryProperties innerProperties; + + /** + * Creates an instance of Query class. + */ + public Query() { + } + + /** + * 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 Query object itself. + */ + public Query withCondition(ConditionProperties condition) { + if (this.innerProperties() == null) { + this.innerProperties = new QueryProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryAutoGenerated.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryAutoGenerated.java new file mode 100644 index 000000000000..0261caa218f7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryAutoGenerated.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a query to run on the TI objects in the workspace. + */ +@Fluent +public final class QueryAutoGenerated { + /* + * Represents a condition used to query for TI objects. + */ + @JsonProperty(value = "condition") + private QueryCondition condition; + + /* + * Specifies how to sort the query results. + */ + @JsonProperty(value = "sortBy") + private QuerySortBy sortBy; + + /* + * Represents the maximum size of the page that will be returned from the query API. + */ + @JsonProperty(value = "maxPageSize") + private Integer maxPageSize; + + /* + * Represents the minimum size of the page that will be returned from the query API. + */ + @JsonProperty(value = "minPageSize") + private Integer minPageSize; + + /** + * Creates an instance of QueryAutoGenerated class. + */ + public QueryAutoGenerated() { + } + + /** + * 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 QueryAutoGenerated object itself. + */ + public QueryAutoGenerated 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 QueryAutoGenerated object itself. + */ + public QueryAutoGenerated 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 QueryAutoGenerated object itself. + */ + public QueryAutoGenerated 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 QueryAutoGenerated object itself. + */ + public QueryAutoGenerated withMinPageSize(Integer minPageSize) { + this.minPageSize = minPageSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (condition() != null) { + condition().validate(); + } + if (sortBy() != null) { + sortBy().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleTemplateProperties.java index e20070c785ad..047fc8ef7a47 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleTemplateProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryBasedAlertRuleTemplateProperties.java @@ -10,7 +10,9 @@ import java.util.List; import java.util.Map; -/** Query based alert rule template base property bag. */ +/** + * Query based alert rule template base property bag. + */ @Fluent public class QueryBasedAlertRuleTemplateProperties { /* @@ -56,9 +58,21 @@ public class QueryBasedAlertRuleTemplateProperties { @JsonProperty(value = "eventGroupingSettings") private EventGroupingSettings eventGroupingSettings; + /* + * Array of the sentinel entity mappings of the alert rule + */ + @JsonProperty(value = "sentinelEntitiesMappings") + private List sentinelEntitiesMappings; + + /** + * Creates an instance of QueryBasedAlertRuleTemplateProperties class. + */ + public QueryBasedAlertRuleTemplateProperties() { + } + /** * Get the query property: The query that creates alerts for this rule. - * + * * @return the query value. */ public String query() { @@ -67,7 +81,7 @@ public String query() { /** * Set the query property: The query that creates alerts for this rule. - * + * * @param query the query value to set. * @return the QueryBasedAlertRuleTemplateProperties object itself. */ @@ -78,7 +92,7 @@ public QueryBasedAlertRuleTemplateProperties withQuery(String query) { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -87,7 +101,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity for alerts created by this alert rule. - * + * * @param severity the severity value to set. * @return the QueryBasedAlertRuleTemplateProperties object itself. */ @@ -99,7 +113,7 @@ public QueryBasedAlertRuleTemplateProperties withSeverity(AlertSeverity 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() { @@ -109,7 +123,7 @@ public String version() { /** * Set the version property: The version of this template - in format <a.b.c>, where all are numbers. For * example <1.0.2>. - * + * * @param version the version value to set. * @return the QueryBasedAlertRuleTemplateProperties object itself. */ @@ -120,7 +134,7 @@ public QueryBasedAlertRuleTemplateProperties withVersion(String 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() { @@ -129,7 +143,7 @@ public Map customDetails() { /** * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. - * + * * @param customDetails the customDetails value to set. * @return the QueryBasedAlertRuleTemplateProperties object itself. */ @@ -140,7 +154,7 @@ public QueryBasedAlertRuleTemplateProperties withCustomDetails(Map entityMappings() { @@ -149,7 +163,7 @@ public List entityMappings() { /** * Set the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @param entityMappings the entityMappings value to set. * @return the QueryBasedAlertRuleTemplateProperties object itself. */ @@ -160,7 +174,7 @@ public QueryBasedAlertRuleTemplateProperties withEntityMappings(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 QueryBasedAlertRuleTemplateProperties object itself. + */ + public QueryBasedAlertRuleTemplateProperties + withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + this.sentinelEntitiesMappings = sentinelEntitiesMappings; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -214,5 +249,8 @@ public void validate() { if (eventGroupingSettings() != null) { eventGroupingSettings().validate(); } + if (sentinelEntitiesMappings() != null) { + sentinelEntitiesMappings().forEach(e -> e.validate()); + } } } 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..5b9a9a8c6eee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryCondition.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents a condition used to query for TI objects. + */ +@Fluent +public final class QueryCondition { + /* + * The STIX type for the objects returned by this query. + */ + @JsonProperty(value = "stixObjectType") + private String stixObjectType; + + /* + * The list of clauses to be evaluated in disjunction or conjunction base on the specified top level connective operator. + */ + @JsonProperty(value = "clauses", required = true) + private List clauses; + + /* + * The top level connective operator for this condition. + */ + @JsonProperty(value = "conditionConnective") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clauses() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property clauses in model QueryCondition")); + } else { + clauses().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(QueryCondition.class); +} 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..ceac4c74aad3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QuerySortBy.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies how to sort the query results. + */ +@Fluent +public final class QuerySortBy { + /* + * The direction to sort the results by. + */ + @JsonProperty(value = "direction") + private SortingDirection direction; + + /* + * Represents the field to sort the results by. + */ + @JsonProperty(value = "field") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Recommendation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Recommendation.java new file mode 100644 index 000000000000..a4e1cf43660d --- /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) AutoRest 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/RecommendationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationList.java new file mode 100644 index 000000000000..36eb6af45678 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationList.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationListInner; +import java.util.List; + +/** + * An immutable client-side representation of RecommendationList. + */ +public interface RecommendationList { + /** + * Gets the value property: An list of recommendations. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.RecommendationListInner object. + * + * @return the inner object. + */ + RecommendationListInner 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..13171d426d1a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatch.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Recommendation Fields to update. + */ +@Fluent +public final class RecommendationPatch { + /* + * Recommendation Fields Properties to update. + */ + @JsonProperty(value = "properties") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatchProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatchProperties.java new file mode 100644 index 000000000000..bba3f4ef4e4a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatchProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Recommendation Fields Properties to update. + */ +@Fluent +public final class RecommendationPatchProperties { + /* + * State of the recommendation. + */ + @JsonProperty(value = "state") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendedSuggestion.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendedSuggestion.java new file mode 100644 index 000000000000..f543f5897122 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendedSuggestion.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * What suggestions should be taken to complete the recommendation. + */ +@Fluent +public final class RecommendedSuggestion { + /* + * Id of the suggestion type. + */ + @JsonProperty(value = "suggestionTypeId", required = true) + private String suggestionTypeId; + + /* + * Title of the suggestion. + */ + @JsonProperty(value = "title", required = true) + private String title; + + /* + * Description of the suggestion. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * Action of the suggestion. + */ + @JsonProperty(value = "action", required = true) + private String action; + + /* + * Collection of additional properties for the suggestion. + */ + @JsonProperty(value = "additionalProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalProperties; + + /** + * Creates an instance of RecommendedSuggestion class. + */ + public RecommendedSuggestion() { + } + + /** + * Get the suggestionTypeId property: Id of the suggestion type. + * + * @return the suggestionTypeId value. + */ + public String suggestionTypeId() { + return this.suggestionTypeId; + } + + /** + * Set the suggestionTypeId property: Id of the suggestion type. + * + * @param suggestionTypeId the suggestionTypeId value to set. + * @return the RecommendedSuggestion object itself. + */ + public RecommendedSuggestion withSuggestionTypeId(String suggestionTypeId) { + this.suggestionTypeId = suggestionTypeId; + return this; + } + + /** + * Get the title property: Title of the suggestion. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Title of the suggestion. + * + * @param title the title value to set. + * @return the RecommendedSuggestion object itself. + */ + public RecommendedSuggestion withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Description of the suggestion. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the suggestion. + * + * @param description the description value to set. + * @return the RecommendedSuggestion object itself. + */ + public RecommendedSuggestion withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the action property: Action of the suggestion. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: Action of the suggestion. + * + * @param action the action value to set. + * @return the RecommendedSuggestion object itself. + */ + public RecommendedSuggestion withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the additionalProperties property: Collection of additional properties for the suggestion. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Collection of additional properties for the suggestion. + * + * @param additionalProperties the additionalProperties value to set. + * @return the RecommendedSuggestion object itself. + */ + public RecommendedSuggestion withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (suggestionTypeId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property suggestionTypeId in model RecommendedSuggestion")); + } + if (title() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property title in model RecommendedSuggestion")); + } + if (description() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property description in model RecommendedSuggestion")); + } + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model RecommendedSuggestion")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RecommendedSuggestion.class); +} 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..c7aa042c6a7b --- /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) AutoRest 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..47e5620309a4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Reevaluates.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.UUID; + +/** + * 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, + UUID 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, UUID 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 0b533e8cddbb..4337a4c4b438 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 @@ -8,41 +8,72 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** the hive that holds the registry key. */ +/** + * the hive that holds the registry key. + */ public final class RegistryHive extends ExpandableStringEnum { - /** Static value HKEY_LOCAL_MACHINE for RegistryHive. */ + /** + * Static value HKEY_LOCAL_MACHINE for RegistryHive. + */ public static final RegistryHive HKEY_LOCAL_MACHINE = fromString("HKEY_LOCAL_MACHINE"); - /** Static value HKEY_CLASSES_ROOT for RegistryHive. */ + /** + * Static value HKEY_CLASSES_ROOT for RegistryHive. + */ public static final RegistryHive HKEY_CLASSES_ROOT = fromString("HKEY_CLASSES_ROOT"); - /** Static value HKEY_CURRENT_CONFIG for RegistryHive. */ + /** + * Static value HKEY_CURRENT_CONFIG for RegistryHive. + */ public static final RegistryHive HKEY_CURRENT_CONFIG = fromString("HKEY_CURRENT_CONFIG"); - /** Static value HKEY_USERS for RegistryHive. */ + /** + * Static value HKEY_USERS for RegistryHive. + */ public static final RegistryHive HKEY_USERS = fromString("HKEY_USERS"); - /** Static value HKEY_CURRENT_USER_LOCAL_SETTINGS for RegistryHive. */ + /** + * Static value HKEY_CURRENT_USER_LOCAL_SETTINGS for RegistryHive. + */ public static final RegistryHive HKEY_CURRENT_USER_LOCAL_SETTINGS = fromString("HKEY_CURRENT_USER_LOCAL_SETTINGS"); - /** Static value HKEY_PERFORMANCE_DATA for RegistryHive. */ + /** + * Static value HKEY_PERFORMANCE_DATA for RegistryHive. + */ public static final RegistryHive HKEY_PERFORMANCE_DATA = fromString("HKEY_PERFORMANCE_DATA"); - /** Static value HKEY_PERFORMANCE_NLSTEXT for RegistryHive. */ + /** + * Static value HKEY_PERFORMANCE_NLSTEXT for RegistryHive. + */ public static final RegistryHive HKEY_PERFORMANCE_NLSTEXT = fromString("HKEY_PERFORMANCE_NLSTEXT"); - /** Static value HKEY_PERFORMANCE_TEXT for RegistryHive. */ + /** + * Static value HKEY_PERFORMANCE_TEXT for RegistryHive. + */ public static final RegistryHive HKEY_PERFORMANCE_TEXT = fromString("HKEY_PERFORMANCE_TEXT"); - /** Static value HKEY_A for RegistryHive. */ + /** + * Static value HKEY_A for RegistryHive. + */ public static final RegistryHive HKEY_A = fromString("HKEY_A"); - /** Static value HKEY_CURRENT_USER for RegistryHive. */ + /** + * Static value HKEY_CURRENT_USER for RegistryHive. + */ public static final RegistryHive HKEY_CURRENT_USER = fromString("HKEY_CURRENT_USER"); + /** + * Creates a new instance of RegistryHive value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RegistryHive() { + } + /** * Creates or finds a RegistryHive from its string representation. - * + * * @param name a name to look for. * @return the corresponding RegistryHive. */ @@ -53,7 +84,7 @@ public static RegistryHive fromString(String name) { /** * Gets known RegistryHive values. - * + * * @return known RegistryHive values. */ public static Collection values() { 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 116afd6feb60..f8d25372f7e3 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 @@ -4,28 +4,54 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.RegistryKeyEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** Represents a registry key entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a registry key entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = RegistryKeyEntity.class, visible = true) @JsonTypeName("RegistryKey") -@Fluent +@Immutable public final class RegistryKeyEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.REGISTRY_KEY; + /* * RegistryKey entity properties */ @JsonProperty(value = "properties") private RegistryKeyEntityProperties innerProperties; + /** + * Creates an instance of RegistryKeyEntity class. + */ + public RegistryKeyEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: RegistryKey entity properties. - * + * * @return the innerProperties value. */ private RegistryKeyEntityProperties innerProperties() { @@ -34,7 +60,7 @@ private RegistryKeyEntityProperties innerProperties() { /** * Get the hive property: the hive that holds the registry key. - * + * * @return the hive value. */ public RegistryHive hive() { @@ -43,7 +69,7 @@ public RegistryHive hive() { /** * Get the key property: The registry key path. - * + * * @return the key value. */ public String key() { @@ -53,7 +79,7 @@ public String key() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -63,7 +89,7 @@ public Map 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() { @@ -72,7 +98,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 8121d653cb19..5fbb5e194d43 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 @@ -4,28 +4,54 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.RegistryValueEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** Represents a registry value entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a registry value entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = RegistryValueEntity.class, visible = true) @JsonTypeName("RegistryValue") -@Fluent +@Immutable public final class RegistryValueEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.REGISTRY_VALUE; + /* * RegistryKey entity properties */ @JsonProperty(value = "properties") private RegistryValueEntityProperties innerProperties; + /** + * Creates an instance of RegistryValueEntity class. + */ + public RegistryValueEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: RegistryKey entity properties. - * + * * @return the innerProperties value. */ private RegistryValueEntityProperties innerProperties() { @@ -34,7 +60,7 @@ private RegistryValueEntityProperties innerProperties() { /** * Get the keyEntityId property: The registry key entity id. - * + * * @return the keyEntityId value. */ public String keyEntityId() { @@ -43,7 +69,7 @@ public String keyEntityId() { /** * Get the valueData property: String formatted representation of the value data. - * + * * @return the valueData value. */ public String valueData() { @@ -52,7 +78,7 @@ public String valueData() { /** * Get the valueName property: The registry value name. - * + * * @return the valueName value. */ public String valueName() { @@ -62,7 +88,7 @@ public String valueName() { /** * Get the valueType property: Specifies the data types to use when storing values in the registry, or identifies * the data type of a value in the registry. - * + * * @return the valueType value. */ public RegistryValueKind valueType() { @@ -72,7 +98,7 @@ public RegistryValueKind valueType() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -82,7 +108,7 @@ public Map 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() { @@ -91,7 +117,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 7f214d1bf04f..27d1370f9468 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 @@ -13,33 +13,58 @@ * registry. */ public final class RegistryValueKind extends ExpandableStringEnum { - /** Static value None for RegistryValueKind. */ + /** + * Static value None for RegistryValueKind. + */ public static final RegistryValueKind NONE = fromString("None"); - /** Static value Unknown for RegistryValueKind. */ + /** + * Static value Unknown for RegistryValueKind. + */ public static final RegistryValueKind UNKNOWN = fromString("Unknown"); - /** Static value String for RegistryValueKind. */ + /** + * Static value String for RegistryValueKind. + */ public static final RegistryValueKind STRING = fromString("String"); - /** Static value ExpandString for RegistryValueKind. */ + /** + * Static value ExpandString for RegistryValueKind. + */ public static final RegistryValueKind EXPAND_STRING = fromString("ExpandString"); - /** Static value Binary for RegistryValueKind. */ + /** + * Static value Binary for RegistryValueKind. + */ public static final RegistryValueKind BINARY = fromString("Binary"); - /** Static value DWord for RegistryValueKind. */ + /** + * Static value DWord for RegistryValueKind. + */ public static final RegistryValueKind DWORD = fromString("DWord"); - /** Static value MultiString for RegistryValueKind. */ + /** + * Static value MultiString for RegistryValueKind. + */ public static final RegistryValueKind MULTI_STRING = fromString("MultiString"); - /** Static value QWord for RegistryValueKind. */ + /** + * Static value QWord for RegistryValueKind. + */ public static final RegistryValueKind QWORD = fromString("QWord"); + /** + * Creates a new instance of RegistryValueKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RegistryValueKind() { + } + /** * Creates or finds a RegistryValueKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding RegistryValueKind. */ @@ -50,7 +75,7 @@ public static RegistryValueKind fromString(String name) { /** * Gets known RegistryValueKind values. - * + * * @return known RegistryValueKind values. */ public static Collection values() { 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 7e14109d67f6..d3761d34913e 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 @@ -8,99 +8,111 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; -/** An immutable client-side representation of Relation. */ +/** + * An immutable client-side representation of Relation. + */ public interface Relation { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the relatedResourceId property: The resource ID of the related resource. - * + * * @return the relatedResourceId value. */ String relatedResourceId(); /** * Gets the relatedResourceName property: The name of the related resource. - * + * * @return the relatedResourceName value. */ String relatedResourceName(); /** * Gets the relatedResourceType property: The resource type of the related resource. - * + * * @return the relatedResourceType value. */ String relatedResourceType(); /** * Gets the relatedResourceKind property: The resource kind of the related resource. - * + * * @return the relatedResourceKind value. */ String relatedResourceKind(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.RelationInner object. - * + * * @return the inner object. */ RelationInner innerModel(); - /** The entirety of the Relation definition. */ + /** + * The entirety of the Relation definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The Relation definition stages. */ + + /** + * The Relation definition stages. + */ interface DefinitionStages { - /** The first stage of the Relation definition. */ + /** + * The first stage of the Relation definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Relation definition allowing to specify parent resource. */ + + /** + * The stage of the Relation definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName, bookmarkId. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param bookmarkId Bookmark ID. @@ -108,6 +120,7 @@ interface WithParentResource { */ WithCreate withExistingBookmark(String resourceGroupName, String workspaceName, String bookmarkId); } + /** * The stage of the Relation definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. @@ -115,97 +128,115 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithRelatedResourceId { /** * Executes the create request. - * + * * @return the created resource. */ Relation create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Relation create(Context context); } - /** The stage of the Relation definition allowing to specify etag. */ + + /** + * The stage of the Relation definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the Relation definition allowing to specify relatedResourceId. */ + + /** + * The stage of the Relation definition allowing to specify relatedResourceId. + */ interface WithRelatedResourceId { /** * Specifies the relatedResourceId property: The resource ID of the related resource. - * + * * @param relatedResourceId The resource ID of the related resource. * @return the next definition stage. */ WithCreate withRelatedResourceId(String relatedResourceId); } } + /** * Begins update for the Relation resource. - * + * * @return the stage of resource update. */ Relation.Update update(); - /** The template for Relation update. */ + /** + * The template for Relation update. + */ interface Update extends UpdateStages.WithEtag, UpdateStages.WithRelatedResourceId { /** * Executes the update request. - * + * * @return the updated resource. */ Relation apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Relation apply(Context context); } - /** The Relation update stages. */ + + /** + * The Relation update stages. + */ interface UpdateStages { - /** The stage of the Relation update allowing to specify etag. */ + /** + * The stage of the Relation update allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ Update withEtag(String etag); } - /** The stage of the Relation update allowing to specify relatedResourceId. */ + + /** + * The stage of the Relation update allowing to specify relatedResourceId. + */ interface WithRelatedResourceId { /** * Specifies the relatedResourceId property: The resource ID of the related resource. - * + * * @param relatedResourceId The resource ID of the related resource. * @return the next definition stage. */ Update withRelatedResourceId(String relatedResourceId); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Relation refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationList.java index 7c2e13d40225..934cb49ead96 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/models/RelationList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of relations. */ +/** + * List of relations. + */ @Fluent public final class RelationList { /* @@ -25,9 +27,15 @@ public final class RelationList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of RelationList class. + */ + public RelationList() { + } + /** * Get the nextLink property: URL to fetch the next set of relations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of relations. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of relations. - * + * * @param value the value value to set. * @return the RelationList object itself. */ @@ -56,14 +64,13 @@ public RelationList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model RelationList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model RelationList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relationship.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relationship.java new file mode 100644 index 000000000000..512a0b9464c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relationship.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a relationship in Azure Security Insights. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = Relationship.class, visible = true) +@JsonTypeName("Relationship") +@Immutable +public final class Relationship extends TIObjectInner { + /* + * The kind of the TI object + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private TIObjectKind kind = TIObjectKind.RELATIONSHIP; + + /** + * Creates an instance of Relationship class. + */ + public Relationship() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + @Override + public TIObjectKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationshipHint.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationshipHint.java new file mode 100644 index 000000000000..cc34d093f5ee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationshipHint.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object used to help follow relationships from this object to other STIX objects. + */ +@Fluent +public final class RelationshipHint { + /* + * The fieldName property. + */ + @JsonProperty(value = "fieldName") + private String fieldName; + + /* + * The source property. + */ + @JsonProperty(value = "source") + private String source; + + /** + * Creates an instance of RelationshipHint class. + */ + public RelationshipHint() { + } + + /** + * Get the fieldName property: The fieldName property. + * + * @return the fieldName value. + */ + public String fieldName() { + return this.fieldName; + } + + /** + * Set the fieldName property: The fieldName property. + * + * @param fieldName the fieldName value to set. + * @return the RelationshipHint object itself. + */ + public RelationshipHint withFieldName(String fieldName) { + this.fieldName = fieldName; + return this; + } + + /** + * Get the source property: The source property. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: The source property. + * + * @param source the source value to set. + * @return the RelationshipHint object itself. + */ + public RelationshipHint withSource(String source) { + this.source = source; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repo.java index 8510709ca5b3..bb24a0b70167 100644 --- 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 @@ -7,32 +7,41 @@ import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; import java.util.List; -/** An immutable client-side representation of Repo. */ +/** + * 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/RepoList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoList.java index 02aaa874b88d..8ca8a1e579c9 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the source controls. */ +/** + * List all the source controls. + */ @Fluent public final class RepoList { /* @@ -25,9 +27,15 @@ public final class RepoList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of RepoList class. + */ + public RepoList() { + } + /** * Get the nextLink property: URL to fetch the next set of repositories. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of repositories. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of repositories. - * + * * @param value the value value to set. * @return the RepoList object itself. */ @@ -56,13 +64,13 @@ public RepoList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property value in model RepoList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model RepoList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoType.java index dcb33e87b257..b3391475bdb8 100644 --- 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of repository. */ +/** + * The type of repository. + */ public final class RepoType extends ExpandableStringEnum { - /** Static value Github for RepoType. */ + /** + * Static value Github for RepoType. + */ public static final RepoType GITHUB = fromString("Github"); - /** Static value DevOps for RepoType. */ - public static final RepoType DEV_OPS = fromString("DevOps"); + /** + * Static value AzureDevOps for RepoType. + */ + 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. */ @@ -29,7 +44,7 @@ public static RepoType fromString(String name) { /** * Gets known RepoType values. - * + * * @return known RepoType values. */ public static Collection values() { 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 index 3e26879725a5..ba9fed88978d 100644 --- 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 @@ -5,22 +5,24 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -/** metadata of a repository. */ +/** + * metadata of a repository. + */ @Fluent public final class Repository { /* * Url of repository. */ - @JsonProperty(value = "url") + @JsonProperty(value = "url", required = true) private String url; /* * Branch name of repository. */ - @JsonProperty(value = "branch") + @JsonProperty(value = "branch", required = true) private String branch; /* @@ -32,18 +34,18 @@ public final class Repository { /* * Url to access repository action logs. */ - @JsonProperty(value = "deploymentLogsUrl") + @JsonProperty(value = "deploymentLogsUrl", access = JsonProperty.Access.WRITE_ONLY) private String deploymentLogsUrl; - /* - * Dictionary of source control content type and path mapping. + /** + * Creates an instance of Repository class. */ - @JsonProperty(value = "pathMapping") - private List pathMapping; + public Repository() { + } /** * Get the url property: Url of repository. - * + * * @return the url value. */ public String url() { @@ -52,7 +54,7 @@ public String url() { /** * Set the url property: Url of repository. - * + * * @param url the url value to set. * @return the Repository object itself. */ @@ -63,7 +65,7 @@ public Repository withUrl(String url) { /** * Get the branch property: Branch name of repository. - * + * * @return the branch value. */ public String branch() { @@ -72,7 +74,7 @@ public String branch() { /** * Set the branch property: Branch name of repository. - * + * * @param branch the branch value to set. * @return the Repository object itself. */ @@ -83,7 +85,7 @@ public Repository withBranch(String branch) { /** * Get the displayUrl property: Display url of repository. - * + * * @return the displayUrl value. */ public String displayUrl() { @@ -92,7 +94,7 @@ public String displayUrl() { /** * Set the displayUrl property: Display url of repository. - * + * * @param displayUrl the displayUrl value to set. * @return the Repository object itself. */ @@ -103,52 +105,28 @@ public Repository withDisplayUrl(String displayUrl) { /** * Get the deploymentLogsUrl property: Url to access repository action logs. - * + * * @return the deploymentLogsUrl value. */ public String deploymentLogsUrl() { return this.deploymentLogsUrl; } - /** - * Set the deploymentLogsUrl property: Url to access repository action logs. - * - * @param deploymentLogsUrl the deploymentLogsUrl value to set. - * @return the Repository object itself. - */ - public Repository withDeploymentLogsUrl(String deploymentLogsUrl) { - this.deploymentLogsUrl = deploymentLogsUrl; - return this; - } - - /** - * Get the pathMapping property: Dictionary of source control content type and path mapping. - * - * @return the pathMapping value. - */ - public List pathMapping() { - return this.pathMapping; - } - - /** - * Set the pathMapping property: Dictionary of source control content type and path mapping. - * - * @param pathMapping the pathMapping value to set. - * @return the Repository object itself. - */ - public Repository withPathMapping(List pathMapping) { - this.pathMapping = pathMapping; - return this; - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (pathMapping() != null) { - pathMapping().forEach(e -> e.validate()); + if (url() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property url in model Repository")); + } + if (branch() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property branch in model Repository")); } } + + private static final ClientLogger LOGGER = new ClientLogger(Repository.class); } 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..dcd0723cf4b5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessKind.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The kind of repository access credentials. + */ +public final class RepositoryAccessKind extends ExpandableStringEnum { + /** + * Static value OAuth for RepositoryAccessKind. + */ + public static final RepositoryAccessKind OAUTH = fromString("OAuth"); + + /** + * Static value PAT for RepositoryAccessKind. + */ + public static final RepositoryAccessKind PAT = fromString("PAT"); + + /** + * Static value App for RepositoryAccessKind. + */ + 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. + */ + @JsonCreator + 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..c7e40deeca7d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.RepositoryAccessObject; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Credentials to access repository. + */ +@Fluent +public final class RepositoryAccessProperties { + /* + * RepositoryAccess properties + */ + @JsonProperty(value = "properties", required = true) + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model RepositoryAccessProperties")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RepositoryAccessProperties.class); +} 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 index 5e10c94993ff..827e2589b0ac 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Resources created in user's repository for the source-control. */ +/** + * Resources created in user's repository for the source-control. + */ @Fluent public final class RepositoryResourceInfo { /* @@ -19,18 +21,24 @@ public final class RepositoryResourceInfo { /* * Resources created in GitHub for this source-control. */ - @JsonProperty(value = "gitHubResourceInfo") + @JsonProperty(value = "gitHubResourceInfo", access = JsonProperty.Access.WRITE_ONLY) private GitHubResourceInfo gitHubResourceInfo; /* * Resources created in Azure DevOps for this source-control. */ - @JsonProperty(value = "azureDevOpsResourceInfo") + @JsonProperty(value = "azureDevOpsResourceInfo", access = JsonProperty.Access.WRITE_ONLY) 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() { @@ -39,7 +47,7 @@ public Webhook 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. */ @@ -50,47 +58,25 @@ public RepositoryResourceInfo withWebhook(Webhook webhook) { /** * Get the gitHubResourceInfo property: Resources created in GitHub for this source-control. - * + * * @return the gitHubResourceInfo value. */ public GitHubResourceInfo gitHubResourceInfo() { return this.gitHubResourceInfo; } - /** - * Set the gitHubResourceInfo property: Resources created in GitHub for this source-control. - * - * @param gitHubResourceInfo the gitHubResourceInfo value to set. - * @return the RepositoryResourceInfo object itself. - */ - public RepositoryResourceInfo withGitHubResourceInfo(GitHubResourceInfo gitHubResourceInfo) { - this.gitHubResourceInfo = gitHubResourceInfo; - return this; - } - /** * Get the azureDevOpsResourceInfo property: Resources created in Azure DevOps for this source-control. - * + * * @return the azureDevOpsResourceInfo value. */ public AzureDevOpsResourceInfo azureDevOpsResourceInfo() { return this.azureDevOpsResourceInfo; } - /** - * Set the azureDevOpsResourceInfo property: Resources created in Azure DevOps for this source-control. - * - * @param azureDevOpsResourceInfo the azureDevOpsResourceInfo value to set. - * @return the RepositoryResourceInfo object itself. - */ - public RepositoryResourceInfo withAzureDevOpsResourceInfo(AzureDevOpsResourceInfo azureDevOpsResourceInfo) { - this.azureDevOpsResourceInfo = azureDevOpsResourceInfo; - return this; - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RequiredPermissions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RequiredPermissions.java index 146d39665d20..4f78295fceb8 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Required permissions for the connector. */ +/** + * Required permissions for the connector. + */ @Fluent public final class RequiredPermissions { /* @@ -34,9 +36,15 @@ public final class RequiredPermissions { @JsonProperty(value = "delete") private Boolean delete; + /** + * Creates an instance of RequiredPermissions class. + */ + public RequiredPermissions() { + } + /** * Get the action property: action permission. - * + * * @return the action value. */ public Boolean action() { @@ -45,7 +53,7 @@ public Boolean action() { /** * Set the action property: action permission. - * + * * @param action the action value to set. * @return the RequiredPermissions object itself. */ @@ -56,7 +64,7 @@ public RequiredPermissions withAction(Boolean action) { /** * Get the write property: write permission. - * + * * @return the write value. */ public Boolean write() { @@ -65,7 +73,7 @@ public Boolean write() { /** * Set the write property: write permission. - * + * * @param write the write value to set. * @return the RequiredPermissions object itself. */ @@ -76,7 +84,7 @@ public RequiredPermissions withWrite(Boolean write) { /** * Get the read property: read permission. - * + * * @return the read value. */ public Boolean read() { @@ -85,7 +93,7 @@ public Boolean read() { /** * Set the read property: read permission. - * + * * @param read the read value to set. * @return the RequiredPermissions object itself. */ @@ -96,7 +104,7 @@ public RequiredPermissions withRead(Boolean read) { /** * Get the delete property: delete permission. - * + * * @return the delete value. */ public Boolean delete() { @@ -105,7 +113,7 @@ public Boolean delete() { /** * Set the delete property: delete permission. - * + * * @param delete the delete value to set. * @return the RequiredPermissions object itself. */ @@ -116,7 +124,7 @@ public RequiredPermissions withDelete(Boolean delete) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProvider.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProvider.java index 7024f46e5562..8eb051a90d5d 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Resource provider permissions required for the connector. */ +/** + * Resource provider permissions required for the connector. + */ @Fluent public class ResourceProvider { /* @@ -40,9 +42,15 @@ public class ResourceProvider { @JsonProperty(value = "requiredPermissions") private RequiredPermissions requiredPermissions; + /** + * Creates an instance of ResourceProvider class. + */ + public ResourceProvider() { + } + /** * Get the provider property: Provider name. - * + * * @return the provider value. */ public ProviderName provider() { @@ -51,7 +59,7 @@ public ProviderName provider() { /** * Set the provider property: Provider name. - * + * * @param provider the provider value to set. * @return the ResourceProvider object itself. */ @@ -62,7 +70,7 @@ public ResourceProvider withProvider(ProviderName provider) { /** * Get the permissionsDisplayText property: Permission description text. - * + * * @return the permissionsDisplayText value. */ public String permissionsDisplayText() { @@ -71,7 +79,7 @@ public String permissionsDisplayText() { /** * Set the permissionsDisplayText property: Permission description text. - * + * * @param permissionsDisplayText the permissionsDisplayText value to set. * @return the ResourceProvider object itself. */ @@ -82,7 +90,7 @@ public ResourceProvider withPermissionsDisplayText(String permissionsDisplayText /** * Get the providerDisplayName property: Permission provider display name. - * + * * @return the providerDisplayName value. */ public String providerDisplayName() { @@ -91,7 +99,7 @@ public String providerDisplayName() { /** * Set the providerDisplayName property: Permission provider display name. - * + * * @param providerDisplayName the providerDisplayName value to set. * @return the ResourceProvider object itself. */ @@ -102,7 +110,7 @@ public ResourceProvider withProviderDisplayName(String providerDisplayName) { /** * Get the scope property: Permission provider scope. - * + * * @return the scope value. */ public PermissionProviderScope scope() { @@ -111,7 +119,7 @@ public PermissionProviderScope scope() { /** * Set the scope property: Permission provider scope. - * + * * @param scope the scope value to set. * @return the ResourceProvider object itself. */ @@ -122,7 +130,7 @@ public ResourceProvider withScope(PermissionProviderScope scope) { /** * Get the requiredPermissions property: Required permissions for the connector. - * + * * @return the requiredPermissions value. */ public RequiredPermissions requiredPermissions() { @@ -131,7 +139,7 @@ public RequiredPermissions requiredPermissions() { /** * Set the requiredPermissions property: Required permissions for the connector. - * + * * @param requiredPermissions the requiredPermissions value to set. * @return the ResourceProvider object itself. */ @@ -142,7 +150,7 @@ public ResourceProvider withRequiredPermissions(RequiredPermissions requiredPerm /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviderRequiredPermissions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviderRequiredPermissions.java new file mode 100644 index 000000000000..52491798df84 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviderRequiredPermissions.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + /* + * Gets or sets a value indicating whether the permission is read action (GET). + */ + @JsonProperty(value = "read") + private Boolean read; + + /* + * Gets or sets a value indicating whether the permission is write action (PUT or PATCH). + */ + @JsonProperty(value = "write") + private Boolean write; + + /* + * Gets or sets a value indicating whether the permission is delete action (DELETE). + */ + @JsonProperty(value = "delete") + private Boolean delete; + + /* + * Gets or sets a value indicating whether the permission is custom actions (POST). + */ + @JsonProperty(value = "action") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviders.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviders.java new file mode 100644 index 000000000000..6f6c0d30ec55 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of 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 6ed4515163c8..7a6eaa482e04 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 @@ -9,7 +9,9 @@ import com.azure.core.management.SystemData; import com.fasterxml.jackson.annotation.JsonProperty; -/** An azure resource object with an Etag property. */ +/** + * An azure resource object with an Etag property. + */ @Fluent public class ResourceWithEtag extends ProxyResource { /* @@ -24,9 +26,15 @@ public class ResourceWithEtag extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** + * Creates an instance of ResourceWithEtag class. + */ + public ResourceWithEtag() { + } + /** * Get the etag property: Etag of the azure resource. - * + * * @return the etag value. */ public String etag() { @@ -35,7 +43,7 @@ public String etag() { /** * Set the etag property: Etag of the azure resource. - * + * * @param etag the etag value to set. * @return the ResourceWithEtag object itself. */ @@ -46,7 +54,7 @@ public ResourceWithEtag withEtag(String etag) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -55,7 +63,7 @@ public SystemData systemData() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerDataConnector.java new file mode 100644 index 000000000000..7ec7534152a0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerDataConnector.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.RestApiPollerDataConnectorProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** + * Represents Rest Api Poller data connector. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = RestApiPollerDataConnector.class, + visible = true) +@JsonTypeName("RestApiPoller") +@Fluent +public final class RestApiPollerDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.REST_API_POLLER; + + /* + * Rest Api Poller data connector properties. + */ + @JsonProperty(value = "properties") + private RestApiPollerDataConnectorProperties innerProperties; + + /** + * Creates an instance of RestApiPollerDataConnector class. + */ + public RestApiPollerDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; + } + + /** + * {@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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestConfig.java new file mode 100644 index 000000000000..667b1f27fc05 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestConfig.java @@ -0,0 +1,470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The request configuration. + */ +@Fluent +public final class RestApiPollerRequestConfig { + /* + * The API endpoint. + */ + @JsonProperty(value = "apiEndpoint", required = true) + private String apiEndpoint; + + /* + * The Rate limit queries per second for the request.. + */ + @JsonProperty(value = "rateLimitQPS") + private Integer rateLimitQps; + + /* + * The query window in minutes for the request. + */ + @JsonProperty(value = "queryWindowInMin") + private Integer queryWindowInMin; + + /* + * The HTTP method, default value GET. + */ + @JsonProperty(value = "httpMethod") + 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. + */ + @JsonProperty(value = "queryTimeFormat") + private String queryTimeFormat; + + /* + * The retry count. + */ + @JsonProperty(value = "retryCount") + private Integer retryCount; + + /* + * The timeout in seconds. + */ + @JsonProperty(value = "timeoutInSeconds") + private Integer timeoutInSeconds; + + /* + * Flag to indicate if HTTP POST payload is in JSON format (vs form-urlencoded). + */ + @JsonProperty(value = "isPostPayloadJson") + private Boolean isPostPayloadJson; + + /* + * The header for the request for the remote server. + */ + @JsonProperty(value = "headers") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map headers; + + /* + * The HTTP query parameters to RESTful API. + */ + @JsonProperty(value = "queryParameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map queryParameters; + + /* + * the query parameters template. Defines the query parameters template to use when passing query parameters in advanced scenarios. + */ + @JsonProperty(value = "queryParametersTemplate") + private String queryParametersTemplate; + + /* + * The query parameter name which the remote server expect to start query. This property goes hand to hand with `endTimeAttributeName`. + */ + @JsonProperty(value = "startTimeAttributeName") + private String startTimeAttributeName; + + /* + * The query parameter name which the remote server expect to end query. This property goes hand to hand with `startTimeAttributeName` + */ + @JsonProperty(value = "endTimeAttributeName") + 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` + */ + @JsonProperty(value = "queryTimeIntervalAttributeName") + private String queryTimeIntervalAttributeName; + + /* + * The string prepend to the value of the query parameter in `queryTimeIntervalAttributeName`. + */ + @JsonProperty(value = "queryTimeIntervalPrepend") + private String queryTimeIntervalPrepend; + + /* + * The delimiter string between 2 QueryTimeFormat in the query parameter `queryTimeIntervalAttributeName`. + */ + @JsonProperty(value = "queryTimeIntervalDelimiter") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (apiEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property apiEndpoint in model RestApiPollerRequestConfig")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RestApiPollerRequestConfig.class); +} 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..2685cf020d4d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingConfig.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request paging configuration. + */ +@Fluent +public class RestApiPollerRequestPagingConfig { + /* + * Type of paging + */ + @JsonProperty(value = "pagingType", required = true) + private RestApiPollerRequestPagingKind pagingType; + + /* + * Page size + */ + @JsonProperty(value = "pageSize") + private Integer pageSize; + + /* + * Page size parameter name + */ + @JsonProperty(value = "pageSizeParameterName") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pagingType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property pagingType in model RestApiPollerRequestPagingConfig")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RestApiPollerRequestPagingConfig.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingCountBaseConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingCountBaseConfig.java new file mode 100644 index 000000000000..8a191ab56e55 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingCountBaseConfig.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request paging configuration for Count base paging type parameters. + */ +@Fluent +public final class RestApiPollerRequestPagingCountBaseConfig extends RestApiPollerRequestPagingConfig { + /* + * Indicates whether the count is zero based + */ + @JsonProperty(value = "zeroBasedIndexing") + private Boolean zeroBasedIndexing; + + /* + * JSON path of page count in HTTP response payload + */ + @JsonProperty(value = "pageCountJsonPath") + private String pageCountJsonPath; + + /* + * Parameter name of page number in HTTP request + */ + @JsonProperty(value = "pageNumberParaName") + private String pageNumberParaName; + + /* + * JSON path of page number in HTTP response payload + */ + @JsonProperty(value = "pageNumberJsonPath") + private String pageNumberJsonPath; + + /* + * JSON path of total number of results in HTTP response payload + */ + @JsonProperty(value = "totalResultsJsonPath") + private String totalResultsJsonPath; + + /** + * Creates an instance of RestApiPollerRequestPagingCountBaseConfig class. + */ + public RestApiPollerRequestPagingCountBaseConfig() { + } + + /** + * Get the zeroBasedIndexing property: Indicates whether the count is zero based. + * + * @return the zeroBasedIndexing value. + */ + public Boolean zeroBasedIndexing() { + return this.zeroBasedIndexing; + } + + /** + * Set the zeroBasedIndexing property: Indicates whether the count is zero based. + * + * @param zeroBasedIndexing the zeroBasedIndexing value to set. + * @return the RestApiPollerRequestPagingCountBaseConfig object itself. + */ + public RestApiPollerRequestPagingCountBaseConfig withZeroBasedIndexing(Boolean zeroBasedIndexing) { + this.zeroBasedIndexing = zeroBasedIndexing; + return this; + } + + /** + * Get the pageCountJsonPath property: JSON path of page count in HTTP response payload. + * + * @return the pageCountJsonPath value. + */ + public String pageCountJsonPath() { + return this.pageCountJsonPath; + } + + /** + * Set the pageCountJsonPath property: JSON path of page count in HTTP response payload. + * + * @param pageCountJsonPath the pageCountJsonPath value to set. + * @return the RestApiPollerRequestPagingCountBaseConfig object itself. + */ + public RestApiPollerRequestPagingCountBaseConfig withPageCountJsonPath(String pageCountJsonPath) { + this.pageCountJsonPath = pageCountJsonPath; + return this; + } + + /** + * Get the pageNumberParaName property: Parameter name of page number in HTTP request. + * + * @return the pageNumberParaName value. + */ + public String pageNumberParaName() { + return this.pageNumberParaName; + } + + /** + * Set the pageNumberParaName property: Parameter name of page number in HTTP request. + * + * @param pageNumberParaName the pageNumberParaName value to set. + * @return the RestApiPollerRequestPagingCountBaseConfig object itself. + */ + public RestApiPollerRequestPagingCountBaseConfig withPageNumberParaName(String pageNumberParaName) { + this.pageNumberParaName = pageNumberParaName; + return this; + } + + /** + * Get the pageNumberJsonPath property: JSON path of page number in HTTP response payload. + * + * @return the pageNumberJsonPath value. + */ + public String pageNumberJsonPath() { + return this.pageNumberJsonPath; + } + + /** + * Set the pageNumberJsonPath property: JSON path of page number in HTTP response payload. + * + * @param pageNumberJsonPath the pageNumberJsonPath value to set. + * @return the RestApiPollerRequestPagingCountBaseConfig object itself. + */ + public RestApiPollerRequestPagingCountBaseConfig withPageNumberJsonPath(String pageNumberJsonPath) { + this.pageNumberJsonPath = pageNumberJsonPath; + return this; + } + + /** + * Get the totalResultsJsonPath property: JSON path of total number of results in HTTP response payload. + * + * @return the totalResultsJsonPath value. + */ + public String totalResultsJsonPath() { + return this.totalResultsJsonPath; + } + + /** + * Set the totalResultsJsonPath property: JSON path of total number of results in HTTP response payload. + * + * @param totalResultsJsonPath the totalResultsJsonPath value to set. + * @return the RestApiPollerRequestPagingCountBaseConfig object itself. + */ + public RestApiPollerRequestPagingCountBaseConfig withTotalResultsJsonPath(String totalResultsJsonPath) { + this.totalResultsJsonPath = totalResultsJsonPath; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingCountBaseConfig withPagingType(RestApiPollerRequestPagingKind pagingType) { + super.withPagingType(pagingType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingCountBaseConfig withPageSize(Integer pageSize) { + super.withPageSize(pageSize); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingCountBaseConfig withPageSizeParameterName(String pageSizeParameterName) { + super.withPageSizeParameterName(pageSizeParameterName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingKind.java new file mode 100644 index 000000000000..05eb820e779b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingKind.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of paging. + */ +public final class RestApiPollerRequestPagingKind extends ExpandableStringEnum { + /** + * Static value LinkHeader for RestApiPollerRequestPagingKind. + */ + public static final RestApiPollerRequestPagingKind LINK_HEADER = fromString("LinkHeader"); + + /** + * Static value NextPageToken for RestApiPollerRequestPagingKind. + */ + public static final RestApiPollerRequestPagingKind NEXT_PAGE_TOKEN = fromString("NextPageToken"); + + /** + * Static value NextPageUrl for RestApiPollerRequestPagingKind. + */ + public static final RestApiPollerRequestPagingKind NEXT_PAGE_URL = fromString("NextPageUrl"); + + /** + * Static value PersistentToken for RestApiPollerRequestPagingKind. + */ + public static final RestApiPollerRequestPagingKind PERSISTENT_TOKEN = fromString("PersistentToken"); + + /** + * Static value PersistentLinkHeader for RestApiPollerRequestPagingKind. + */ + public static final RestApiPollerRequestPagingKind PERSISTENT_LINK_HEADER = fromString("PersistentLinkHeader"); + + /** + * Static value Offset for RestApiPollerRequestPagingKind. + */ + public static final RestApiPollerRequestPagingKind OFFSET = fromString("Offset"); + + /** + * Static value CountBasedPaging for RestApiPollerRequestPagingKind. + */ + 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. + */ + @JsonCreator + 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/RestApiPollerRequestPagingLinkHeaderConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingLinkHeaderConfig.java new file mode 100644 index 000000000000..714b4ef60506 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingLinkHeaderConfig.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request paging configuration for LinkHeader and PersistentLinkHeader paging type parameters. + */ +@Fluent +public final class RestApiPollerRequestPagingLinkHeaderConfig extends RestApiPollerRequestPagingConfig { + /* + * JSON path of link header token in HTTP response payload + */ + @JsonProperty(value = "linkHeaderTokenJsonPath") + private String linkHeaderTokenJsonPath; + + /* + * Rel link name from the link header + */ + @JsonProperty(value = "linkHeaderRelLinkName") + private String linkHeaderRelLinkName; + + /** + * Creates an instance of RestApiPollerRequestPagingLinkHeaderConfig class. + */ + public RestApiPollerRequestPagingLinkHeaderConfig() { + } + + /** + * Get the linkHeaderTokenJsonPath property: JSON path of link header token in HTTP response payload. + * + * @return the linkHeaderTokenJsonPath value. + */ + public String linkHeaderTokenJsonPath() { + return this.linkHeaderTokenJsonPath; + } + + /** + * Set the linkHeaderTokenJsonPath property: JSON path of link header token in HTTP response payload. + * + * @param linkHeaderTokenJsonPath the linkHeaderTokenJsonPath value to set. + * @return the RestApiPollerRequestPagingLinkHeaderConfig object itself. + */ + public RestApiPollerRequestPagingLinkHeaderConfig withLinkHeaderTokenJsonPath(String linkHeaderTokenJsonPath) { + this.linkHeaderTokenJsonPath = linkHeaderTokenJsonPath; + return this; + } + + /** + * Get the linkHeaderRelLinkName property: Rel link name from the link header. + * + * @return the linkHeaderRelLinkName value. + */ + public String linkHeaderRelLinkName() { + return this.linkHeaderRelLinkName; + } + + /** + * Set the linkHeaderRelLinkName property: Rel link name from the link header. + * + * @param linkHeaderRelLinkName the linkHeaderRelLinkName value to set. + * @return the RestApiPollerRequestPagingLinkHeaderConfig object itself. + */ + public RestApiPollerRequestPagingLinkHeaderConfig withLinkHeaderRelLinkName(String linkHeaderRelLinkName) { + this.linkHeaderRelLinkName = linkHeaderRelLinkName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingLinkHeaderConfig withPagingType(RestApiPollerRequestPagingKind pagingType) { + super.withPagingType(pagingType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingLinkHeaderConfig withPageSize(Integer pageSize) { + super.withPageSize(pageSize); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingLinkHeaderConfig withPageSizeParameterName(String pageSizeParameterName) { + super.withPageSizeParameterName(pageSizeParameterName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingNextPageUrlConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingNextPageUrlConfig.java new file mode 100644 index 000000000000..25267297b48d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingNextPageUrlConfig.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The request paging configuration for NextPageUrl paging type parameters. + */ +@Fluent +public final class RestApiPollerRequestPagingNextPageUrlConfig extends RestApiPollerRequestPagingConfig { + /* + * Next page URL + */ + @JsonProperty(value = "nextPageUrl") + private String nextPageUrl; + + /* + * Query parameters of next page URL + */ + @JsonProperty(value = "nextPageUrlQueryParameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map nextPageUrlQueryParameters; + + /* + * Paging query parameters in string template format + */ + @JsonProperty(value = "nextPageUrlQueryParametersTemplate") + private String nextPageUrlQueryParametersTemplate; + + /* + * Next page parameter name in HTTP request + */ + @JsonProperty(value = "nextPageParaName") + private String nextPageParaName; + + /* + * Next page header name in the request + */ + @JsonProperty(value = "nextPageRequestHeader") + private String nextPageRequestHeader; + + /* + * JSON path of flag in HTTP response payload to indicate more pages + */ + @JsonProperty(value = "hasNextFlagJsonPath") + private String hasNextFlagJsonPath; + + /** + * Creates an instance of RestApiPollerRequestPagingNextPageUrlConfig class. + */ + public RestApiPollerRequestPagingNextPageUrlConfig() { + } + + /** + * Get the nextPageUrl property: Next page URL. + * + * @return the nextPageUrl value. + */ + public String nextPageUrl() { + return this.nextPageUrl; + } + + /** + * Set the nextPageUrl property: Next page URL. + * + * @param nextPageUrl the nextPageUrl value to set. + * @return the RestApiPollerRequestPagingNextPageUrlConfig object itself. + */ + public RestApiPollerRequestPagingNextPageUrlConfig withNextPageUrl(String nextPageUrl) { + this.nextPageUrl = nextPageUrl; + return this; + } + + /** + * Get the nextPageUrlQueryParameters property: Query parameters of next page URL. + * + * @return the nextPageUrlQueryParameters value. + */ + public Map nextPageUrlQueryParameters() { + return this.nextPageUrlQueryParameters; + } + + /** + * Set the nextPageUrlQueryParameters property: Query parameters of next page URL. + * + * @param nextPageUrlQueryParameters the nextPageUrlQueryParameters value to set. + * @return the RestApiPollerRequestPagingNextPageUrlConfig object itself. + */ + public RestApiPollerRequestPagingNextPageUrlConfig + withNextPageUrlQueryParameters(Map nextPageUrlQueryParameters) { + this.nextPageUrlQueryParameters = nextPageUrlQueryParameters; + return this; + } + + /** + * Get the nextPageUrlQueryParametersTemplate property: Paging query parameters in string template format. + * + * @return the nextPageUrlQueryParametersTemplate value. + */ + public String nextPageUrlQueryParametersTemplate() { + return this.nextPageUrlQueryParametersTemplate; + } + + /** + * Set the nextPageUrlQueryParametersTemplate property: Paging query parameters in string template format. + * + * @param nextPageUrlQueryParametersTemplate the nextPageUrlQueryParametersTemplate value to set. + * @return the RestApiPollerRequestPagingNextPageUrlConfig object itself. + */ + public RestApiPollerRequestPagingNextPageUrlConfig + withNextPageUrlQueryParametersTemplate(String nextPageUrlQueryParametersTemplate) { + this.nextPageUrlQueryParametersTemplate = nextPageUrlQueryParametersTemplate; + return this; + } + + /** + * Get the nextPageParaName property: Next page parameter name in HTTP request. + * + * @return the nextPageParaName value. + */ + public String nextPageParaName() { + return this.nextPageParaName; + } + + /** + * Set the nextPageParaName property: Next page parameter name in HTTP request. + * + * @param nextPageParaName the nextPageParaName value to set. + * @return the RestApiPollerRequestPagingNextPageUrlConfig object itself. + */ + public RestApiPollerRequestPagingNextPageUrlConfig withNextPageParaName(String nextPageParaName) { + this.nextPageParaName = nextPageParaName; + return this; + } + + /** + * Get the nextPageRequestHeader property: Next page header name in the request. + * + * @return the nextPageRequestHeader value. + */ + public String nextPageRequestHeader() { + return this.nextPageRequestHeader; + } + + /** + * Set the nextPageRequestHeader property: Next page header name in the request. + * + * @param nextPageRequestHeader the nextPageRequestHeader value to set. + * @return the RestApiPollerRequestPagingNextPageUrlConfig object itself. + */ + public RestApiPollerRequestPagingNextPageUrlConfig withNextPageRequestHeader(String nextPageRequestHeader) { + this.nextPageRequestHeader = nextPageRequestHeader; + return this; + } + + /** + * Get the hasNextFlagJsonPath property: JSON path of flag in HTTP response payload to indicate more pages. + * + * @return the hasNextFlagJsonPath value. + */ + public String hasNextFlagJsonPath() { + return this.hasNextFlagJsonPath; + } + + /** + * Set the hasNextFlagJsonPath property: JSON path of flag in HTTP response payload to indicate more pages. + * + * @param hasNextFlagJsonPath the hasNextFlagJsonPath value to set. + * @return the RestApiPollerRequestPagingNextPageUrlConfig object itself. + */ + public RestApiPollerRequestPagingNextPageUrlConfig withHasNextFlagJsonPath(String hasNextFlagJsonPath) { + this.hasNextFlagJsonPath = hasNextFlagJsonPath; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingNextPageUrlConfig withPagingType(RestApiPollerRequestPagingKind pagingType) { + super.withPagingType(pagingType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingNextPageUrlConfig withPageSize(Integer pageSize) { + super.withPageSize(pageSize); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingNextPageUrlConfig withPageSizeParameterName(String pageSizeParameterName) { + super.withPageSizeParameterName(pageSizeParameterName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingOffsetConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingOffsetConfig.java new file mode 100644 index 000000000000..c7582b729e5c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingOffsetConfig.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request paging configuration for Offset paging type parameters. + */ +@Fluent +public final class RestApiPollerRequestPagingOffsetConfig extends RestApiPollerRequestPagingConfig { + /* + * Offset parameter name in HTTP request + */ + @JsonProperty(value = "offsetParaName") + private String offsetParaName; + + /** + * Creates an instance of RestApiPollerRequestPagingOffsetConfig class. + */ + public RestApiPollerRequestPagingOffsetConfig() { + } + + /** + * Get the offsetParaName property: Offset parameter name in HTTP request. + * + * @return the offsetParaName value. + */ + public String offsetParaName() { + return this.offsetParaName; + } + + /** + * Set the offsetParaName property: Offset parameter name in HTTP request. + * + * @param offsetParaName the offsetParaName value to set. + * @return the RestApiPollerRequestPagingOffsetConfig object itself. + */ + public RestApiPollerRequestPagingOffsetConfig withOffsetParaName(String offsetParaName) { + this.offsetParaName = offsetParaName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingOffsetConfig withPagingType(RestApiPollerRequestPagingKind pagingType) { + super.withPagingType(pagingType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingOffsetConfig withPageSize(Integer pageSize) { + super.withPageSize(pageSize); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingOffsetConfig withPageSizeParameterName(String pageSizeParameterName) { + super.withPageSizeParameterName(pageSizeParameterName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingTokenConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingTokenConfig.java new file mode 100644 index 000000000000..574e9b886d08 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingTokenConfig.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request paging configuration for NextPageToken and PersistentToken paging type parameters. + */ +@Fluent +public final class RestApiPollerRequestPagingTokenConfig extends RestApiPollerRequestPagingConfig { + /* + * JSON path of next page token in HTTP response payload + */ + @JsonProperty(value = "nextPageTokenJsonPath") + private String nextPageTokenJsonPath; + + /* + * JSON path of flag in HTTP response payload to indicate more pages + */ + @JsonProperty(value = "hasNextFlagJsonPath") + private String hasNextFlagJsonPath; + + /* + * HTTP response header name of next page token + */ + @JsonProperty(value = "nextPageTokenResponseHeader") + private String nextPageTokenResponseHeader; + + /* + * Next page parameter name in HTTP request + */ + @JsonProperty(value = "nextPageParaName") + private String nextPageParaName; + + /* + * Next page header name in the request + */ + @JsonProperty(value = "nextPageRequestHeader") + private String nextPageRequestHeader; + + /** + * Creates an instance of RestApiPollerRequestPagingTokenConfig class. + */ + public RestApiPollerRequestPagingTokenConfig() { + } + + /** + * Get the nextPageTokenJsonPath property: JSON path of next page token in HTTP response payload. + * + * @return the nextPageTokenJsonPath value. + */ + public String nextPageTokenJsonPath() { + return this.nextPageTokenJsonPath; + } + + /** + * Set the nextPageTokenJsonPath property: JSON path of next page token in HTTP response payload. + * + * @param nextPageTokenJsonPath the nextPageTokenJsonPath value to set. + * @return the RestApiPollerRequestPagingTokenConfig object itself. + */ + public RestApiPollerRequestPagingTokenConfig withNextPageTokenJsonPath(String nextPageTokenJsonPath) { + this.nextPageTokenJsonPath = nextPageTokenJsonPath; + return this; + } + + /** + * Get the hasNextFlagJsonPath property: JSON path of flag in HTTP response payload to indicate more pages. + * + * @return the hasNextFlagJsonPath value. + */ + public String hasNextFlagJsonPath() { + return this.hasNextFlagJsonPath; + } + + /** + * Set the hasNextFlagJsonPath property: JSON path of flag in HTTP response payload to indicate more pages. + * + * @param hasNextFlagJsonPath the hasNextFlagJsonPath value to set. + * @return the RestApiPollerRequestPagingTokenConfig object itself. + */ + public RestApiPollerRequestPagingTokenConfig withHasNextFlagJsonPath(String hasNextFlagJsonPath) { + this.hasNextFlagJsonPath = hasNextFlagJsonPath; + return this; + } + + /** + * Get the nextPageTokenResponseHeader property: HTTP response header name of next page token. + * + * @return the nextPageTokenResponseHeader value. + */ + public String nextPageTokenResponseHeader() { + return this.nextPageTokenResponseHeader; + } + + /** + * Set the nextPageTokenResponseHeader property: HTTP response header name of next page token. + * + * @param nextPageTokenResponseHeader the nextPageTokenResponseHeader value to set. + * @return the RestApiPollerRequestPagingTokenConfig object itself. + */ + public RestApiPollerRequestPagingTokenConfig withNextPageTokenResponseHeader(String nextPageTokenResponseHeader) { + this.nextPageTokenResponseHeader = nextPageTokenResponseHeader; + return this; + } + + /** + * Get the nextPageParaName property: Next page parameter name in HTTP request. + * + * @return the nextPageParaName value. + */ + public String nextPageParaName() { + return this.nextPageParaName; + } + + /** + * Set the nextPageParaName property: Next page parameter name in HTTP request. + * + * @param nextPageParaName the nextPageParaName value to set. + * @return the RestApiPollerRequestPagingTokenConfig object itself. + */ + public RestApiPollerRequestPagingTokenConfig withNextPageParaName(String nextPageParaName) { + this.nextPageParaName = nextPageParaName; + return this; + } + + /** + * Get the nextPageRequestHeader property: Next page header name in the request. + * + * @return the nextPageRequestHeader value. + */ + public String nextPageRequestHeader() { + return this.nextPageRequestHeader; + } + + /** + * Set the nextPageRequestHeader property: Next page header name in the request. + * + * @param nextPageRequestHeader the nextPageRequestHeader value to set. + * @return the RestApiPollerRequestPagingTokenConfig object itself. + */ + public RestApiPollerRequestPagingTokenConfig withNextPageRequestHeader(String nextPageRequestHeader) { + this.nextPageRequestHeader = nextPageRequestHeader; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingTokenConfig withPagingType(RestApiPollerRequestPagingKind pagingType) { + super.withPagingType(pagingType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingTokenConfig withPageSize(Integer pageSize) { + super.withPageSize(pageSize); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerRequestPagingTokenConfig withPageSizeParameterName(String pageSizeParameterName) { + super.withPageSizeParameterName(pageSizeParameterName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RfcConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RfcConnector.java new file mode 100644 index 000000000000..f16f0bdefc95 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RfcConnector.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the Rfc connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = RfcConnector.class, visible = true) +@JsonTypeName("Rfc") +@Fluent +public final class RfcConnector extends SystemsConfigurationConnector { + /* + * Represents the types of SAP systems. + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private SystemConfigurationConnectorType type = SystemConfigurationConnectorType.RFC; + + /* + * FQDN, hostname, or IP address of the ABAP server. + */ + @JsonProperty(value = "abapServerHost") + private String abapServerHost; + + /* + * FQDN, hostname, or IP address of the Message server. + */ + @JsonProperty(value = "messageServerHost") + private String messageServerHost; + + /* + * Logon group of the message server. + */ + @JsonProperty(value = "group") + private String group; + + /* + * Port number, or service name (from /etc/services) of the message server. + */ + @JsonProperty(value = "messageServerService") + private String messageServerService; + + /* + * SNC QOP. + * Options are 1, 2, 3, 8, 9. + */ + @JsonProperty(value = "sncQop") + private String sncQop; + + /* + * The SAP code page used for character encoding. + * Example - 1100 + */ + @JsonProperty(value = "codePage") + private String codePage; + + /* + * System number of the ABAP server. + */ + @JsonProperty(value = "systemNumber", required = true) + private String systemNumber; + + /* + * System ID of the ABAP server. + * Example - A4H + */ + @JsonProperty(value = "systemId", required = true) + private String systemId; + + /* + * Client number of the ABAP server. + * Example - 001 + */ + @JsonProperty(value = "client", required = true) + private String client; + + /* + * The authentication type to SAP. + */ + @JsonProperty(value = "authenticationType") + private SapAuthenticationType authenticationType; + + /** + * Creates an instance of RfcConnector class. + */ + public RfcConnector() { + } + + /** + * Get the type property: Represents the types of SAP systems. + * + * @return the type value. + */ + @Override + public SystemConfigurationConnectorType type() { + return this.type; + } + + /** + * Get the abapServerHost property: FQDN, hostname, or IP address of the ABAP server. + * + * @return the abapServerHost value. + */ + public String abapServerHost() { + return this.abapServerHost; + } + + /** + * Set the abapServerHost property: FQDN, hostname, or IP address of the ABAP server. + * + * @param abapServerHost the abapServerHost value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withAbapServerHost(String abapServerHost) { + this.abapServerHost = abapServerHost; + return this; + } + + /** + * Get the messageServerHost property: FQDN, hostname, or IP address of the Message server. + * + * @return the messageServerHost value. + */ + public String messageServerHost() { + return this.messageServerHost; + } + + /** + * Set the messageServerHost property: FQDN, hostname, or IP address of the Message server. + * + * @param messageServerHost the messageServerHost value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withMessageServerHost(String messageServerHost) { + this.messageServerHost = messageServerHost; + return this; + } + + /** + * Get the group property: Logon group of the message server. + * + * @return the group value. + */ + public String group() { + return this.group; + } + + /** + * Set the group property: Logon group of the message server. + * + * @param group the group value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withGroup(String group) { + this.group = group; + return this; + } + + /** + * Get the messageServerService property: Port number, or service name (from /etc/services) of the message server. + * + * @return the messageServerService value. + */ + public String messageServerService() { + return this.messageServerService; + } + + /** + * Set the messageServerService property: Port number, or service name (from /etc/services) of the message server. + * + * @param messageServerService the messageServerService value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withMessageServerService(String messageServerService) { + this.messageServerService = messageServerService; + return this; + } + + /** + * Get the sncQop property: SNC QOP. + * Options are 1, 2, 3, 8, 9. + * + * @return the sncQop value. + */ + public String sncQop() { + return this.sncQop; + } + + /** + * Set the sncQop property: SNC QOP. + * Options are 1, 2, 3, 8, 9. + * + * @param sncQop the sncQop value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withSncQop(String sncQop) { + this.sncQop = sncQop; + return this; + } + + /** + * Get the codePage property: The SAP code page used for character encoding. + * Example - 1100. + * + * @return the codePage value. + */ + public String codePage() { + return this.codePage; + } + + /** + * Set the codePage property: The SAP code page used for character encoding. + * Example - 1100. + * + * @param codePage the codePage value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withCodePage(String codePage) { + this.codePage = codePage; + return this; + } + + /** + * Get the systemNumber property: System number of the ABAP server. + * + * @return the systemNumber value. + */ + public String systemNumber() { + return this.systemNumber; + } + + /** + * Set the systemNumber property: System number of the ABAP server. + * + * @param systemNumber the systemNumber value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withSystemNumber(String systemNumber) { + this.systemNumber = systemNumber; + return this; + } + + /** + * Get the systemId property: System ID of the ABAP server. + * Example - A4H. + * + * @return the systemId value. + */ + public String systemId() { + return this.systemId; + } + + /** + * Set the systemId property: System ID of the ABAP server. + * Example - A4H. + * + * @param systemId the systemId value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withSystemId(String systemId) { + this.systemId = systemId; + return this; + } + + /** + * Get the client property: Client number of the ABAP server. + * Example - 001. + * + * @return the client value. + */ + public String client() { + return this.client; + } + + /** + * Set the client property: Client number of the ABAP server. + * Example - 001. + * + * @param client the client value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withClient(String client) { + this.client = client; + return this; + } + + /** + * Get the authenticationType property: The authentication type to SAP. + * + * @return the authenticationType value. + */ + public SapAuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set the authenticationType property: The authentication type to SAP. + * + * @param authenticationType the authenticationType value to set. + * @return the RfcConnector object itself. + */ + public RfcConnector withAuthenticationType(SapAuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (systemNumber() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property systemNumber in model RfcConnector")); + } + if (systemId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property systemId in model RfcConnector")); + } + if (client() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property client in model RfcConnector")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RfcConnector.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 index 21b538e67f10..b72b34153570 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The sample queries for the connector. */ +/** + * The sample queries for the connector. + */ @Fluent public class SampleQueries { /* @@ -22,9 +24,15 @@ public class SampleQueries { @JsonProperty(value = "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() { @@ -33,7 +41,7 @@ public String description() { /** * Set the description property: The sample query description. - * + * * @param description the description value to set. * @return the SampleQueries object itself. */ @@ -44,7 +52,7 @@ public SampleQueries withDescription(String description) { /** * Get the query property: the sample query. - * + * * @return the query value. */ public String query() { @@ -53,7 +61,7 @@ public String query() { /** * Set the query property: the sample query. - * + * * @param query the query value to set. * @return the SampleQueries object itself. */ @@ -64,7 +72,7 @@ public SampleQueries withQuery(String query) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapAgentConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapAgentConfiguration.java new file mode 100644 index 000000000000..04e4b64339ee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapAgentConfiguration.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the configuration of a SAP Docker agent. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = SapAgentConfiguration.class, visible = true) +@JsonTypeName("SAP") +@Fluent +public final class SapAgentConfiguration extends AgentConfiguration { + /* + * Type of the agent + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private AgentType type = AgentType.SAP; + + /* + * The name of the docker agent. + * only letters with numbers, underscores and hyphens are allowed + * example: "my-agent" + */ + @JsonProperty(value = "agentContainerName") + private String agentContainerName; + + /* + * The SDK path (a file not a folder) on the agent machine. + * example: "/path/to/nwrfc750P_8-70002755.zip" + */ + @JsonProperty(value = "sdkPath") + private String sdkPath; + + /* + * The SNC path (a folder not a file) on the agent machine. + * example: "/path/to/snc" + */ + @JsonProperty(value = "sncPath") + private String sncPath; + + /* + * The key vault resource id to access the key vault. + * example: "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.KeyVault/vaults/myVault" + */ + @JsonProperty(value = "keyVaultResourceId") + private String keyVaultResourceId; + + /* + * The key mode of the agent. + * ManagedIdentity|ApplicationIdentity are the options + */ + @JsonProperty(value = "keyVaultAuthenticationMode") + private KeyVaultAuthenticationMode keyVaultAuthenticationMode; + + /* + * The secret source of the agent. + * AzureKeyVault|EnvironmentVariable are the options + */ + @JsonProperty(value = "secretSource") + private SecretSource secretSource; + + /** + * Creates an instance of SapAgentConfiguration class. + */ + public SapAgentConfiguration() { + } + + /** + * Get the type property: Type of the agent. + * + * @return the type value. + */ + @Override + public AgentType type() { + return this.type; + } + + /** + * Get the agentContainerName property: The name of the docker agent. + * only letters with numbers, underscores and hyphens are allowed + * example: "my-agent". + * + * @return the agentContainerName value. + */ + public String agentContainerName() { + return this.agentContainerName; + } + + /** + * Set the agentContainerName property: The name of the docker agent. + * only letters with numbers, underscores and hyphens are allowed + * example: "my-agent". + * + * @param agentContainerName the agentContainerName value to set. + * @return the SapAgentConfiguration object itself. + */ + public SapAgentConfiguration withAgentContainerName(String agentContainerName) { + this.agentContainerName = agentContainerName; + return this; + } + + /** + * Get the sdkPath property: The SDK path (a file not a folder) on the agent machine. + * example: "/path/to/nwrfc750P_8-70002755.zip". + * + * @return the sdkPath value. + */ + public String sdkPath() { + return this.sdkPath; + } + + /** + * Set the sdkPath property: The SDK path (a file not a folder) on the agent machine. + * example: "/path/to/nwrfc750P_8-70002755.zip". + * + * @param sdkPath the sdkPath value to set. + * @return the SapAgentConfiguration object itself. + */ + public SapAgentConfiguration withSdkPath(String sdkPath) { + this.sdkPath = sdkPath; + return this; + } + + /** + * Get the sncPath property: The SNC path (a folder not a file) on the agent machine. + * example: "/path/to/snc". + * + * @return the sncPath value. + */ + public String sncPath() { + return this.sncPath; + } + + /** + * Set the sncPath property: The SNC path (a folder not a file) on the agent machine. + * example: "/path/to/snc". + * + * @param sncPath the sncPath value to set. + * @return the SapAgentConfiguration object itself. + */ + public SapAgentConfiguration withSncPath(String sncPath) { + this.sncPath = sncPath; + return this; + } + + /** + * Get the keyVaultResourceId property: The key vault resource id to access the key vault. + * example: + * "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.KeyVault/vaults/myVault". + * + * @return the keyVaultResourceId value. + */ + public String keyVaultResourceId() { + return this.keyVaultResourceId; + } + + /** + * Set the keyVaultResourceId property: The key vault resource id to access the key vault. + * example: + * "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.KeyVault/vaults/myVault". + * + * @param keyVaultResourceId the keyVaultResourceId value to set. + * @return the SapAgentConfiguration object itself. + */ + public SapAgentConfiguration withKeyVaultResourceId(String keyVaultResourceId) { + this.keyVaultResourceId = keyVaultResourceId; + return this; + } + + /** + * Get the keyVaultAuthenticationMode property: The key mode of the agent. + * ManagedIdentity|ApplicationIdentity are the options. + * + * @return the keyVaultAuthenticationMode value. + */ + public KeyVaultAuthenticationMode keyVaultAuthenticationMode() { + return this.keyVaultAuthenticationMode; + } + + /** + * Set the keyVaultAuthenticationMode property: The key mode of the agent. + * ManagedIdentity|ApplicationIdentity are the options. + * + * @param keyVaultAuthenticationMode the keyVaultAuthenticationMode value to set. + * @return the SapAgentConfiguration object itself. + */ + public SapAgentConfiguration withKeyVaultAuthenticationMode(KeyVaultAuthenticationMode keyVaultAuthenticationMode) { + this.keyVaultAuthenticationMode = keyVaultAuthenticationMode; + return this; + } + + /** + * Get the secretSource property: The secret source of the agent. + * AzureKeyVault|EnvironmentVariable are the options. + * + * @return the secretSource value. + */ + public SecretSource secretSource() { + return this.secretSource; + } + + /** + * Set the secretSource property: The secret source of the agent. + * AzureKeyVault|EnvironmentVariable are the options. + * + * @param secretSource the secretSource value to set. + * @return the SapAgentConfiguration object itself. + */ + public SapAgentConfiguration withSecretSource(SecretSource secretSource) { + this.secretSource = secretSource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapAuthenticationType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapAuthenticationType.java new file mode 100644 index 000000000000..2a9ee2453df3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapAuthenticationType.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Types of authentication to SAP. + */ +public final class SapAuthenticationType extends ExpandableStringEnum { + /** + * Static value UsernamePassword for SapAuthenticationType. + */ + public static final SapAuthenticationType USERNAME_PASSWORD = fromString("UsernamePassword"); + + /** + * Static value Snc for SapAuthenticationType. + */ + public static final SapAuthenticationType SNC = fromString("Snc"); + + /** + * Static value SncWithUsernamePassword for SapAuthenticationType. + */ + public static final SapAuthenticationType SNC_WITH_USERNAME_PASSWORD = fromString("SncWithUsernamePassword"); + + /** + * Creates a new instance of SapAuthenticationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapAuthenticationType() { + } + + /** + * Creates or finds a SapAuthenticationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapAuthenticationType. + */ + @JsonCreator + public static SapAuthenticationType fromString(String name) { + return fromString(name, SapAuthenticationType.class); + } + + /** + * Gets known SapAuthenticationType values. + * + * @return known SapAuthenticationType values. + */ + public static Collection values() { + return values(SapAuthenticationType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapControlConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapControlConnector.java new file mode 100644 index 000000000000..b3109284e26c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapControlConnector.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the SapControl connector configuration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = SapControlConnector.class, visible = true) +@JsonTypeName("SapControl") +@Fluent +public final class SapControlConnector extends SystemsConfigurationConnector { + /* + * Represents the types of SAP systems. + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private SystemConfigurationConnectorType type = SystemConfigurationConnectorType.SAP_CONTROL; + + /* + * The server name. + * FQDN or IP address. + */ + @JsonProperty(value = "server", required = true) + private String server; + + /* + * The instance name. Only 2 digits are allowed. + */ + @JsonProperty(value = "instance", required = true) + private String instance; + + /* + * The timezone. + * example: "GMT+0" or "GMT-8" + * default: "GMT+0" + */ + @JsonProperty(value = "timezone") + private String timezone; + + /* + * The suffix of the port. 2 digits only. + */ + @JsonProperty(value = "suffix") + private String suffix; + + /* + * Represents the types of HTTPS configuration to connect to the SapControl service. + */ + @JsonProperty(value = "httpsConfiguration") + private HttpsConfigurationType httpsConfiguration; + + /** + * Creates an instance of SapControlConnector class. + */ + public SapControlConnector() { + } + + /** + * Get the type property: Represents the types of SAP systems. + * + * @return the type value. + */ + @Override + public SystemConfigurationConnectorType type() { + return this.type; + } + + /** + * Get the server property: The server name. + * FQDN or IP address. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: The server name. + * FQDN or IP address. + * + * @param server the server value to set. + * @return the SapControlConnector object itself. + */ + public SapControlConnector withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the instance property: The instance name. Only 2 digits are allowed. + * + * @return the instance value. + */ + public String instance() { + return this.instance; + } + + /** + * Set the instance property: The instance name. Only 2 digits are allowed. + * + * @param instance the instance value to set. + * @return the SapControlConnector object itself. + */ + public SapControlConnector withInstance(String instance) { + this.instance = instance; + return this; + } + + /** + * Get the timezone property: The timezone. + * example: "GMT+0" or "GMT-8" + * default: "GMT+0". + * + * @return the timezone value. + */ + public String timezone() { + return this.timezone; + } + + /** + * Set the timezone property: The timezone. + * example: "GMT+0" or "GMT-8" + * default: "GMT+0". + * + * @param timezone the timezone value to set. + * @return the SapControlConnector object itself. + */ + public SapControlConnector withTimezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * Get the suffix property: The suffix of the port. 2 digits only. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the suffix property: The suffix of the port. 2 digits only. + * + * @param suffix the suffix value to set. + * @return the SapControlConnector object itself. + */ + public SapControlConnector withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Get the httpsConfiguration property: Represents the types of HTTPS configuration to connect to the SapControl + * service. + * + * @return the httpsConfiguration value. + */ + public HttpsConfigurationType httpsConfiguration() { + return this.httpsConfiguration; + } + + /** + * Set the httpsConfiguration property: Represents the types of HTTPS configuration to connect to the SapControl + * service. + * + * @param httpsConfiguration the httpsConfiguration value to set. + * @return the SapControlConnector object itself. + */ + public SapControlConnector withHttpsConfiguration(HttpsConfigurationType httpsConfiguration) { + this.httpsConfiguration = httpsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (server() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property server in model SapControlConnector")); + } + if (instance() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property instance in model SapControlConnector")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapControlConnector.class); +} 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..daf07d1f7060 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapSolutionUsageStatistic.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SapSolutionUsageStatisticProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Billing statistic about the Microsoft Sentinel solution for SAP Usage. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = SapSolutionUsageStatistic.class, + visible = true) +@JsonTypeName("SapSolutionUsage") +@Immutable +public final class SapSolutionUsageStatistic extends BillingStatisticInner { + /* + * The kind of the billing statistic + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private BillingStatisticKind kind = BillingStatisticKind.SAP_SOLUTION_USAGE; + + /* + * The SAP solution usage object + */ + @JsonProperty(value = "properties") + private SapSolutionUsageStatisticProperties innerProperties; + + /** + * Creates an instance of SapSolutionUsageStatistic class. + */ + public SapSolutionUsageStatistic() { + } + + /** + * Get the kind property: The kind of the billing statistic. + * + * @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 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(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapSystemsConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapSystemsConfiguration.java new file mode 100644 index 000000000000..145dc673c29e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapSystemsConfiguration.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Describes the SAP configuration. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "type", + defaultImpl = SapSystemsConfiguration.class, + visible = true) +@JsonTypeName("SAP") +@Fluent +public final class SapSystemsConfiguration extends SystemsConfiguration { + /* + * Represents the types of configuration for a system. + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private ConfigurationType type = ConfigurationType.SAP; + + /* + * azure resource id + * example: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" + */ + @JsonProperty(value = "azureResourceId") + private String azureResourceId; + + /* + * Base Model for SAP System Connector. + */ + @JsonProperty(value = "connector", required = true) + private SystemsConfigurationConnector connector; + + /* + * The logs configuration. + */ + @JsonProperty(value = "logs") + private List logs; + + /** + * Creates an instance of SapSystemsConfiguration class. + */ + public SapSystemsConfiguration() { + } + + /** + * Get the type property: Represents the types of configuration for a system. + * + * @return the type value. + */ + @Override + public ConfigurationType type() { + return this.type; + } + + /** + * Get the azureResourceId property: azure resource id + * example: + * "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM". + * + * @return the azureResourceId value. + */ + public String azureResourceId() { + return this.azureResourceId; + } + + /** + * Set the azureResourceId property: azure resource id + * example: + * "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM". + * + * @param azureResourceId the azureResourceId value to set. + * @return the SapSystemsConfiguration object itself. + */ + public SapSystemsConfiguration withAzureResourceId(String azureResourceId) { + this.azureResourceId = azureResourceId; + return this; + } + + /** + * Get the connector property: Base Model for SAP System Connector. + * + * @return the connector value. + */ + public SystemsConfigurationConnector connector() { + return this.connector; + } + + /** + * Set the connector property: Base Model for SAP System Connector. + * + * @param connector the connector value to set. + * @return the SapSystemsConfiguration object itself. + */ + public SapSystemsConfiguration withConnector(SystemsConfigurationConnector connector) { + this.connector = connector; + return this; + } + + /** + * Get the logs property: The logs configuration. + * + * @return the logs value. + */ + public List logs() { + return this.logs; + } + + /** + * Set the logs property: The logs configuration. + * + * @param logs the logs value to set. + * @return the SapSystemsConfiguration object itself. + */ + public SapSystemsConfiguration withLogs(List logs) { + this.logs = logs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (connector() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connector in model SapSystemsConfiguration")); + } else { + connector().validate(); + } + if (logs() != null) { + logs().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapSystemsConfiguration.class); +} 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 5d5575688e63..34b6064c3f69 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 @@ -8,6 +8,7 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; import com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; @@ -15,27 +16,54 @@ import java.util.List; import java.util.Map; -/** Represents scheduled alert rule. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents scheduled alert rule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ScheduledAlertRule.class, visible = true) @JsonTypeName("Scheduled") @Fluent public final class ScheduledAlertRule extends AlertRuleInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.SCHEDULED; + /* * Scheduled alert rule properties */ @JsonProperty(value = "properties") private ScheduledAlertRuleProperties innerProperties; + /** + * Creates an instance of ScheduledAlertRule class. + */ + public ScheduledAlertRule() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Scheduled alert rule properties. - * + * * @return the innerProperties value. */ private ScheduledAlertRuleProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScheduledAlertRule withEtag(String etag) { super.withEtag(etag); @@ -44,7 +72,7 @@ public ScheduledAlertRule withEtag(String etag) { /** * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @return the alertRuleTemplateName value. */ public String alertRuleTemplateName() { @@ -53,7 +81,7 @@ public String alertRuleTemplateName() { /** * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @param alertRuleTemplateName the alertRuleTemplateName value to set. * @return the ScheduledAlertRule object itself. */ @@ -68,7 +96,7 @@ public ScheduledAlertRule withAlertRuleTemplateName(String alertRuleTemplateName /** * 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() { @@ -78,7 +106,7 @@ public String templateVersion() { /** * Set the templateVersion property: The version of the alert rule template used to create this rule - in format * <a.b.c>, where all are numbers, for example 0 <1.0.2>. - * + * * @param templateVersion the templateVersion value to set. * @return the ScheduledAlertRule object itself. */ @@ -92,7 +120,7 @@ public ScheduledAlertRule withTemplateVersion(String templateVersion) { /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -101,7 +129,7 @@ public String description() { /** * Set the description property: The description of the alert rule. - * + * * @param description the description value to set. * @return the ScheduledAlertRule object itself. */ @@ -115,7 +143,7 @@ public ScheduledAlertRule withDescription(String description) { /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -124,7 +152,7 @@ public String displayName() { /** * Set the displayName property: The display name for alerts created by this alert rule. - * + * * @param displayName the displayName value to set. * @return the ScheduledAlertRule object itself. */ @@ -138,7 +166,7 @@ public ScheduledAlertRule withDisplayName(String displayName) { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -147,7 +175,7 @@ public Boolean enabled() { /** * Set the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the ScheduledAlertRule object itself. */ @@ -161,7 +189,7 @@ public ScheduledAlertRule withEnabled(Boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this alert rule has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -171,7 +199,7 @@ public OffsetDateTime 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() { @@ -181,7 +209,7 @@ public Duration suppressionDuration() { /** * Set the suppressionDuration property: The suppression (in ISO 8601 duration format) to wait since last time this * alert rule been triggered. - * + * * @param suppressionDuration the suppressionDuration value to set. * @return the ScheduledAlertRule object itself. */ @@ -196,7 +224,7 @@ public ScheduledAlertRule withSuppressionDuration(Duration suppressionDuration) /** * Get the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or * disabled. - * + * * @return the suppressionEnabled value. */ public Boolean suppressionEnabled() { @@ -206,7 +234,7 @@ public Boolean suppressionEnabled() { /** * Set the suppressionEnabled property: Determines whether the suppression for this alert rule is enabled or * disabled. - * + * * @param suppressionEnabled the suppressionEnabled value to set. * @return the ScheduledAlertRule object itself. */ @@ -220,7 +248,7 @@ public ScheduledAlertRule withSuppressionEnabled(Boolean suppressionEnabled) { /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -229,7 +257,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the alert rule. - * + * * @param tactics the tactics value to set. * @return the ScheduledAlertRule object itself. */ @@ -243,7 +271,7 @@ public ScheduledAlertRule withTactics(List tactics) { /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -252,7 +280,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the ScheduledAlertRule object itself. */ @@ -264,10 +292,33 @@ 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. - * + * * @return the incidentConfiguration value. */ public IncidentConfiguration incidentConfiguration() { @@ -277,7 +328,7 @@ public IncidentConfiguration incidentConfiguration() { /** * Set the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this * analytics rule. - * + * * @param incidentConfiguration the incidentConfiguration value to set. * @return the ScheduledAlertRule object itself. */ @@ -291,7 +342,7 @@ public ScheduledAlertRule withIncidentConfiguration(IncidentConfiguration incide /** * Get the query property: The query that creates alerts for this rule. - * + * * @return the query value. */ public String query() { @@ -300,7 +351,7 @@ public String query() { /** * Set the query property: The query that creates alerts for this rule. - * + * * @param query the query value to set. * @return the ScheduledAlertRule object itself. */ @@ -314,7 +365,7 @@ public ScheduledAlertRule withQuery(String query) { /** * Get the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. - * + * * @return the queryFrequency value. */ public Duration queryFrequency() { @@ -323,7 +374,7 @@ public Duration queryFrequency() { /** * Set the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. - * + * * @param queryFrequency the queryFrequency value to set. * @return the ScheduledAlertRule object itself. */ @@ -337,7 +388,7 @@ public ScheduledAlertRule withQueryFrequency(Duration queryFrequency) { /** * Get the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. - * + * * @return the queryPeriod value. */ public Duration queryPeriod() { @@ -346,7 +397,7 @@ public Duration queryPeriod() { /** * Set the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. - * + * * @param queryPeriod the queryPeriod value to set. * @return the ScheduledAlertRule object itself. */ @@ -360,7 +411,7 @@ public ScheduledAlertRule withQueryPeriod(Duration queryPeriod) { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -369,7 +420,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity for alerts created by this alert rule. - * + * * @param severity the severity value to set. * @return the ScheduledAlertRule object itself. */ @@ -383,7 +434,7 @@ public ScheduledAlertRule withSeverity(AlertSeverity severity) { /** * Get the triggerOperator property: The operation against the threshold that triggers alert rule. - * + * * @return the triggerOperator value. */ public TriggerOperator triggerOperator() { @@ -392,7 +443,7 @@ public TriggerOperator triggerOperator() { /** * Set the triggerOperator property: The operation against the threshold that triggers alert rule. - * + * * @param triggerOperator the triggerOperator value to set. * @return the ScheduledAlertRule object itself. */ @@ -406,7 +457,7 @@ public ScheduledAlertRule withTriggerOperator(TriggerOperator triggerOperator) { /** * Get the triggerThreshold property: The threshold triggers this alert rule. - * + * * @return the triggerThreshold value. */ public Integer triggerThreshold() { @@ -415,7 +466,7 @@ public Integer triggerThreshold() { /** * Set the triggerThreshold property: The threshold triggers this alert rule. - * + * * @param triggerThreshold the triggerThreshold value to set. * @return the ScheduledAlertRule object itself. */ @@ -429,7 +480,7 @@ public ScheduledAlertRule withTriggerThreshold(Integer triggerThreshold) { /** * Get the eventGroupingSettings property: The event grouping settings. - * + * * @return the eventGroupingSettings value. */ public EventGroupingSettings eventGroupingSettings() { @@ -438,7 +489,7 @@ public EventGroupingSettings eventGroupingSettings() { /** * Set the eventGroupingSettings property: The event grouping settings. - * + * * @param eventGroupingSettings the eventGroupingSettings value to set. * @return the ScheduledAlertRule object itself. */ @@ -452,7 +503,7 @@ public ScheduledAlertRule withEventGroupingSettings(EventGroupingSettings eventG /** * 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() { @@ -461,7 +512,7 @@ public Map customDetails() { /** * Set the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. - * + * * @param customDetails the customDetails value to set. * @return the ScheduledAlertRule object itself. */ @@ -475,7 +526,7 @@ public ScheduledAlertRule withCustomDetails(Map customDetails) { /** * Get the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @return the entityMappings value. */ public List entityMappings() { @@ -484,7 +535,7 @@ public List entityMappings() { /** * Set the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @param entityMappings the entityMappings value to set. * @return the ScheduledAlertRule object itself. */ @@ -498,7 +549,7 @@ public ScheduledAlertRule withEntityMappings(List entityMappings) /** * Get the alertDetailsOverride property: The alert details override settings. - * + * * @return the alertDetailsOverride value. */ public AlertDetailsOverride alertDetailsOverride() { @@ -507,7 +558,7 @@ public AlertDetailsOverride alertDetailsOverride() { /** * Set the alertDetailsOverride property: The alert details override settings. - * + * * @param alertDetailsOverride the alertDetailsOverride value to set. * @return the ScheduledAlertRule object itself. */ @@ -519,9 +570,32 @@ public ScheduledAlertRule withAlertDetailsOverride(AlertDetailsOverride alertDet 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 ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withSentinelEntitiesMappings(sentinelEntitiesMappings); + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 181410c28e15..ac2bc0073bba 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 @@ -11,7 +11,9 @@ import java.util.List; import java.util.Map; -/** Scheduled alert rule template property bag. */ +/** + * Scheduled alert rule template property bag. + */ @Fluent public class ScheduledAlertRuleCommonProperties { /* @@ -75,9 +77,21 @@ public class ScheduledAlertRuleCommonProperties { @JsonProperty(value = "alertDetailsOverride") private AlertDetailsOverride alertDetailsOverride; + /* + * Array of the sentinel entity mappings of the alert rule + */ + @JsonProperty(value = "sentinelEntitiesMappings") + private List sentinelEntitiesMappings; + + /** + * Creates an instance of ScheduledAlertRuleCommonProperties class. + */ + public ScheduledAlertRuleCommonProperties() { + } + /** * Get the query property: The query that creates alerts for this rule. - * + * * @return the query value. */ public String query() { @@ -86,7 +100,7 @@ public String query() { /** * Set the query property: The query that creates alerts for this rule. - * + * * @param query the query value to set. * @return the ScheduledAlertRuleCommonProperties object itself. */ @@ -97,7 +111,7 @@ public ScheduledAlertRuleCommonProperties withQuery(String query) { /** * Get the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. - * + * * @return the queryFrequency value. */ public Duration queryFrequency() { @@ -106,7 +120,7 @@ public Duration queryFrequency() { /** * Set the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. - * + * * @param queryFrequency the queryFrequency value to set. * @return the ScheduledAlertRuleCommonProperties object itself. */ @@ -117,7 +131,7 @@ public ScheduledAlertRuleCommonProperties withQueryFrequency(Duration queryFrequ /** * Get the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. - * + * * @return the queryPeriod value. */ public Duration queryPeriod() { @@ -126,7 +140,7 @@ public Duration queryPeriod() { /** * Set the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. - * + * * @param queryPeriod the queryPeriod value to set. * @return the ScheduledAlertRuleCommonProperties object itself. */ @@ -137,7 +151,7 @@ public ScheduledAlertRuleCommonProperties withQueryPeriod(Duration queryPeriod) /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -146,7 +160,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity for alerts created by this alert rule. - * + * * @param severity the severity value to set. * @return the ScheduledAlertRuleCommonProperties object itself. */ @@ -157,7 +171,7 @@ public ScheduledAlertRuleCommonProperties withSeverity(AlertSeverity severity) { /** * Get the triggerOperator property: The operation against the threshold that triggers alert rule. - * + * * @return the triggerOperator value. */ public TriggerOperator triggerOperator() { @@ -166,7 +180,7 @@ public TriggerOperator triggerOperator() { /** * Set the triggerOperator property: The operation against the threshold that triggers alert rule. - * + * * @param triggerOperator the triggerOperator value to set. * @return the ScheduledAlertRuleCommonProperties object itself. */ @@ -177,7 +191,7 @@ public ScheduledAlertRuleCommonProperties withTriggerOperator(TriggerOperator tr /** * Get the triggerThreshold property: The threshold triggers this alert rule. - * + * * @return the triggerThreshold value. */ public Integer triggerThreshold() { @@ -186,7 +200,7 @@ public Integer triggerThreshold() { /** * Set the triggerThreshold property: The threshold triggers this alert rule. - * + * * @param triggerThreshold the triggerThreshold value to set. * @return the ScheduledAlertRuleCommonProperties object itself. */ @@ -197,7 +211,7 @@ public ScheduledAlertRuleCommonProperties withTriggerThreshold(Integer triggerTh /** * Get the eventGroupingSettings property: The event grouping settings. - * + * * @return the eventGroupingSettings value. */ public EventGroupingSettings eventGroupingSettings() { @@ -206,7 +220,7 @@ public EventGroupingSettings eventGroupingSettings() { /** * Set the eventGroupingSettings property: The event grouping settings. - * + * * @param eventGroupingSettings the eventGroupingSettings value to set. * @return the ScheduledAlertRuleCommonProperties object itself. */ @@ -217,7 +231,7 @@ public ScheduledAlertRuleCommonProperties withEventGroupingSettings(EventGroupin /** * 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() { @@ -226,7 +240,7 @@ public Map 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 ScheduledAlertRuleCommonProperties object itself. */ @@ -237,7 +251,7 @@ public ScheduledAlertRuleCommonProperties withCustomDetails(Map /** * Get the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @return the entityMappings value. */ public List entityMappings() { @@ -246,7 +260,7 @@ public List entityMappings() { /** * Set the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @param entityMappings the entityMappings value to set. * @return the ScheduledAlertRuleCommonProperties object itself. */ @@ -257,7 +271,7 @@ public ScheduledAlertRuleCommonProperties withEntityMappings(List /** * Get the alertDetailsOverride property: The alert details override settings. - * + * * @return the alertDetailsOverride value. */ public AlertDetailsOverride alertDetailsOverride() { @@ -266,7 +280,7 @@ public AlertDetailsOverride alertDetailsOverride() { /** * Set the alertDetailsOverride property: The alert details override settings. - * + * * @param alertDetailsOverride the alertDetailsOverride value to set. * @return the ScheduledAlertRuleCommonProperties object itself. */ @@ -275,9 +289,30 @@ public ScheduledAlertRuleCommonProperties withAlertDetailsOverride(AlertDetailsO 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 ScheduledAlertRuleCommonProperties object itself. + */ + public ScheduledAlertRuleCommonProperties + withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + this.sentinelEntitiesMappings = sentinelEntitiesMappings; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -290,5 +325,8 @@ public void validate() { if (alertDetailsOverride() != null) { alertDetailsOverride().validate(); } + if (sentinelEntitiesMappings() != null) { + sentinelEntitiesMappings().forEach(e -> e.validate()); + } } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleTemplate.java index 143d98192d0d..a271186c8f6b 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 @@ -8,6 +8,7 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; import com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleTemplateProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; @@ -15,20 +16,49 @@ import java.util.List; import java.util.Map; -/** Represents scheduled alert rule template. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents scheduled alert rule template. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = ScheduledAlertRuleTemplate.class, + visible = true) @JsonTypeName("Scheduled") @Fluent public final class ScheduledAlertRuleTemplate extends AlertRuleTemplateInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.SCHEDULED; + /* * Scheduled alert rule template properties */ @JsonProperty(value = "properties") private ScheduledAlertRuleTemplateProperties innerProperties; + /** + * Creates an instance of ScheduledAlertRuleTemplate class. + */ + public ScheduledAlertRuleTemplate() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Scheduled alert rule template properties. - * + * * @return the innerProperties value. */ private ScheduledAlertRuleTemplateProperties innerProperties() { @@ -37,7 +67,7 @@ private ScheduledAlertRuleTemplateProperties innerProperties() { /** * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @return the alertRulesCreatedByTemplateCount value. */ public Integer alertRulesCreatedByTemplateCount() { @@ -46,7 +76,7 @@ public Integer 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. */ @@ -60,7 +90,7 @@ public ScheduledAlertRuleTemplate withAlertRulesCreatedByTemplateCount(Integer a /** * Get the createdDateUtc property: The time that this alert rule template has been added. - * + * * @return the createdDateUtc value. */ public OffsetDateTime createdDateUtc() { @@ -69,7 +99,7 @@ public OffsetDateTime createdDateUtc() { /** * Get the lastUpdatedDateUtc property: The time that this alert rule template was last updated. - * + * * @return the lastUpdatedDateUtc value. */ public OffsetDateTime lastUpdatedDateUtc() { @@ -78,7 +108,7 @@ public OffsetDateTime lastUpdatedDateUtc() { /** * Get the description property: The description of the alert rule template. - * + * * @return the description value. */ public String description() { @@ -87,7 +117,7 @@ public String description() { /** * Set the description property: The description of the alert rule template. - * + * * @param description the description value to set. * @return the ScheduledAlertRuleTemplate object itself. */ @@ -101,7 +131,7 @@ public ScheduledAlertRuleTemplate withDescription(String description) { /** * Get the displayName property: The display name for alert rule template. - * + * * @return the displayName value. */ public String displayName() { @@ -110,7 +140,7 @@ public String displayName() { /** * Set the displayName property: The display name for alert rule template. - * + * * @param displayName the displayName value to set. * @return the ScheduledAlertRuleTemplate object itself. */ @@ -124,7 +154,7 @@ public ScheduledAlertRuleTemplate withDisplayName(String displayName) { /** * Get the requiredDataConnectors property: The required data connectors for this template. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -133,12 +163,12 @@ public List 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) { + public ScheduledAlertRuleTemplate + withRequiredDataConnectors(List requiredDataConnectors) { if (this.innerProperties() == null) { this.innerProperties = new ScheduledAlertRuleTemplateProperties(); } @@ -148,7 +178,7 @@ public ScheduledAlertRuleTemplate withRequiredDataConnectors( /** * Get the status property: The alert rule template status. - * + * * @return the status value. */ public TemplateStatus status() { @@ -157,7 +187,7 @@ public TemplateStatus status() { /** * Set the status property: The alert rule template status. - * + * * @param status the status value to set. * @return the ScheduledAlertRuleTemplate object itself. */ @@ -171,7 +201,7 @@ public ScheduledAlertRuleTemplate withStatus(TemplateStatus status) { /** * Get the query property: The query that creates alerts for this rule. - * + * * @return the query value. */ public String query() { @@ -180,7 +210,7 @@ public String 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. */ @@ -194,7 +224,7 @@ public ScheduledAlertRuleTemplate withQuery(String query) { /** * Get the queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. - * + * * @return the queryFrequency value. */ public Duration queryFrequency() { @@ -203,7 +233,7 @@ public Duration 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. */ @@ -217,7 +247,7 @@ public ScheduledAlertRuleTemplate withQueryFrequency(Duration queryFrequency) { /** * Get the queryPeriod property: The period (in ISO 8601 duration format) that this alert rule looks at. - * + * * @return the queryPeriod value. */ public Duration queryPeriod() { @@ -226,7 +256,7 @@ public Duration 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. */ @@ -240,7 +270,7 @@ public ScheduledAlertRuleTemplate withQueryPeriod(Duration queryPeriod) { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -249,7 +279,7 @@ public AlertSeverity 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. */ @@ -263,7 +293,7 @@ public ScheduledAlertRuleTemplate withSeverity(AlertSeverity severity) { /** * Get the triggerOperator property: The operation against the threshold that triggers alert rule. - * + * * @return the triggerOperator value. */ public TriggerOperator triggerOperator() { @@ -272,7 +302,7 @@ public TriggerOperator 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. */ @@ -286,7 +316,7 @@ public ScheduledAlertRuleTemplate withTriggerOperator(TriggerOperator triggerOpe /** * Get the triggerThreshold property: The threshold triggers this alert rule. - * + * * @return the triggerThreshold value. */ public Integer triggerThreshold() { @@ -295,7 +325,7 @@ public Integer triggerThreshold() { /** * Set the triggerThreshold property: The threshold triggers this alert rule. - * + * * @param triggerThreshold the triggerThreshold value to set. * @return the ScheduledAlertRuleTemplate object itself. */ @@ -309,7 +339,7 @@ public ScheduledAlertRuleTemplate withTriggerThreshold(Integer triggerThreshold) /** * Get the tactics property: The tactics of the alert rule template. - * + * * @return the tactics value. */ public List tactics() { @@ -318,7 +348,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. */ @@ -332,7 +362,7 @@ public ScheduledAlertRuleTemplate withTactics(List tactics) { /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -341,7 +371,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the ScheduledAlertRuleTemplate object itself. */ @@ -353,10 +383,33 @@ public ScheduledAlertRuleTemplate 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 ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate withSubTechniques(List subTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withSubTechniques(subTechniques); + return this; + } + /** * Get the version property: The version of this template - in format <a.b.c>, where all are numbers. For * example <1.0.2>. - * + * * @return the version value. */ public String version() { @@ -366,7 +419,7 @@ public String 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. */ @@ -380,7 +433,7 @@ public ScheduledAlertRuleTemplate withVersion(String version) { /** * Get the eventGroupingSettings property: The event grouping settings. - * + * * @return the eventGroupingSettings value. */ public EventGroupingSettings eventGroupingSettings() { @@ -389,7 +442,7 @@ public EventGroupingSettings eventGroupingSettings() { /** * Set the eventGroupingSettings property: The event grouping settings. - * + * * @param eventGroupingSettings the eventGroupingSettings value to set. * @return the ScheduledAlertRuleTemplate object itself. */ @@ -403,7 +456,7 @@ public ScheduledAlertRuleTemplate withEventGroupingSettings(EventGroupingSetting /** * 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() { @@ -412,7 +465,7 @@ public Map 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. */ @@ -426,7 +479,7 @@ public ScheduledAlertRuleTemplate withCustomDetails(Map customDe /** * Get the entityMappings property: Array of the entity mappings of the alert rule. - * + * * @return the entityMappings value. */ public List entityMappings() { @@ -435,7 +488,7 @@ public List 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. */ @@ -449,7 +502,7 @@ public ScheduledAlertRuleTemplate withEntityMappings(List entityM /** * Get the alertDetailsOverride property: The alert details override settings. - * + * * @return the alertDetailsOverride value. */ public AlertDetailsOverride alertDetailsOverride() { @@ -458,7 +511,7 @@ public AlertDetailsOverride alertDetailsOverride() { /** * Set the alertDetailsOverride property: The alert details override settings. - * + * * @param alertDetailsOverride the alertDetailsOverride value to set. * @return the ScheduledAlertRuleTemplate object itself. */ @@ -470,9 +523,33 @@ public ScheduledAlertRuleTemplate withAlertDetailsOverride(AlertDetailsOverride 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 ScheduledAlertRuleTemplate object itself. + */ + public ScheduledAlertRuleTemplate + withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleTemplateProperties(); + } + this.innerProperties().withSentinelEntitiesMappings(sentinelEntitiesMappings); + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecretSource.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecretSource.java new file mode 100644 index 000000000000..b279ac03e3f8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecretSource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type for Secret Source - Azure Key Vault or Environment Variable. + */ +public final class SecretSource extends ExpandableStringEnum { + /** + * Static value AzureKeyVault for SecretSource. + */ + public static final SecretSource AZURE_KEY_VAULT = fromString("AzureKeyVault"); + + /** + * Static value EnvironmentVariable for SecretSource. + */ + public static final SecretSource ENVIRONMENT_VARIABLE = fromString("EnvironmentVariable"); + + /** + * Creates a new instance of SecretSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecretSource() { + } + + /** + * Creates or finds a SecretSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecretSource. + */ + @JsonCreator + public static SecretSource fromString(String name) { + return fromString(name, SecretSource.class); + } + + /** + * Gets known SecretSource values. + * + * @return known SecretSource values. + */ + public static Collection values() { + return values(SecretSource.class); + } +} 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 3052a35d0c5c..53f182924230 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 @@ -8,26 +8,52 @@ import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.SecurityAlertProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** Represents a security alert entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a security alert entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = SecurityAlert.class, visible = true) @JsonTypeName("SecurityAlert") @Fluent public final class SecurityAlert extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.SECURITY_ALERT; + /* * SecurityAlert entity properties */ @JsonProperty(value = "properties") private SecurityAlertProperties innerProperties; + /** + * Creates an instance of SecurityAlert class. + */ + public SecurityAlert() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: SecurityAlert entity properties. - * + * * @return the innerProperties value. */ private SecurityAlertProperties innerProperties() { @@ -36,7 +62,7 @@ private SecurityAlertProperties innerProperties() { /** * Get the alertDisplayName property: The display name of the alert. - * + * * @return the alertDisplayName value. */ public String alertDisplayName() { @@ -45,7 +71,7 @@ public String alertDisplayName() { /** * Get the alertType property: The type name of the alert. - * + * * @return the alertType value. */ public String alertType() { @@ -54,7 +80,7 @@ public String alertType() { /** * Get the compromisedEntity property: Display name of the main entity being reported on. - * + * * @return the compromisedEntity value. */ public String compromisedEntity() { @@ -63,7 +89,7 @@ public String compromisedEntity() { /** * Get the confidenceLevel property: The confidence level of this alert. - * + * * @return the confidenceLevel value. */ public ConfidenceLevel confidenceLevel() { @@ -72,7 +98,7 @@ public ConfidenceLevel confidenceLevel() { /** * Get the confidenceReasons property: The confidence reasons. - * + * * @return the confidenceReasons value. */ public List confidenceReasons() { @@ -81,7 +107,7 @@ public List confidenceReasons() { /** * Get the confidenceScore property: The confidence score of the alert. - * + * * @return the confidenceScore value. */ public Double confidenceScore() { @@ -91,7 +117,7 @@ public Double confidenceScore() { /** * Get the confidenceScoreStatus property: The confidence score calculation status, i.e. indicating if score * calculation is pending for this alert, not applicable or final. - * + * * @return the confidenceScoreStatus value. */ public ConfidenceScoreStatus confidenceScoreStatus() { @@ -100,7 +126,7 @@ public ConfidenceScoreStatus confidenceScoreStatus() { /** * Get the description property: Alert description. - * + * * @return the description value. */ public String description() { @@ -110,7 +136,7 @@ public String description() { /** * Get the endTimeUtc property: The impact end time of the alert (the time of the last event contributing to the * alert). - * + * * @return the endTimeUtc value. */ public OffsetDateTime endTimeUtc() { @@ -119,7 +145,7 @@ public OffsetDateTime endTimeUtc() { /** * Get the intent property: Holds the alert intent stage(s) mapping for this alert. - * + * * @return the intent value. */ public KillChainIntent intent() { @@ -128,7 +154,7 @@ public KillChainIntent intent() { /** * Get the providerAlertId property: The identifier of the alert inside the product which generated the alert. - * + * * @return the providerAlertId value. */ public String providerAlertId() { @@ -137,7 +163,7 @@ public String providerAlertId() { /** * Get the processingEndTime property: The time the alert was made available for consumption. - * + * * @return the processingEndTime value. */ public OffsetDateTime processingEndTime() { @@ -146,7 +172,7 @@ public OffsetDateTime processingEndTime() { /** * Get the productComponentName property: The name of a component inside the product which generated the alert. - * + * * @return the productComponentName value. */ public String productComponentName() { @@ -155,7 +181,7 @@ public String productComponentName() { /** * Get the productName property: The name of the product which published this alert. - * + * * @return the productName value. */ public String productName() { @@ -164,7 +190,7 @@ public String productName() { /** * Get the productVersion property: The version of the product generating the alert. - * + * * @return the productVersion value. */ public String productVersion() { @@ -173,7 +199,7 @@ public String productVersion() { /** * Get the remediationSteps property: Manual action items to take to remediate the alert. - * + * * @return the remediationSteps value. */ public List remediationSteps() { @@ -182,7 +208,7 @@ public List remediationSteps() { /** * Get the severity property: The severity of the alert. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -191,7 +217,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity of the alert. - * + * * @param severity the severity value to set. * @return the SecurityAlert object itself. */ @@ -206,7 +232,7 @@ public SecurityAlert withSeverity(AlertSeverity severity) { /** * Get the startTimeUtc property: The impact start time of the alert (the time of the first event contributing to * the alert). - * + * * @return the startTimeUtc value. */ public OffsetDateTime startTimeUtc() { @@ -215,7 +241,7 @@ public OffsetDateTime startTimeUtc() { /** * Get the status property: The lifecycle status of the alert. - * + * * @return the status value. */ public AlertStatus status() { @@ -224,7 +250,7 @@ public AlertStatus status() { /** * Get the systemAlertId property: Holds the product identifier of the alert for the product. - * + * * @return the systemAlertId value. */ public String systemAlertId() { @@ -233,7 +259,7 @@ public String systemAlertId() { /** * Get the tactics property: The tactics of the alert. - * + * * @return the tactics value. */ public List tactics() { @@ -242,7 +268,7 @@ public List tactics() { /** * Get the timeGenerated property: The time the alert was generated. - * + * * @return the timeGenerated value. */ public OffsetDateTime timeGenerated() { @@ -251,7 +277,7 @@ public OffsetDateTime timeGenerated() { /** * Get the vendorName property: The name of the vendor that raise the alert. - * + * * @return the vendorName value. */ public String vendorName() { @@ -260,7 +286,7 @@ public String vendorName() { /** * Get the alertLink property: The uri link of the alert. - * + * * @return the alertLink value. */ public String alertLink() { @@ -269,7 +295,7 @@ public String alertLink() { /** * Get the resourceIdentifiers property: The list of resource identifiers of the alert. - * + * * @return the resourceIdentifiers value. */ public List resourceIdentifiers() { @@ -279,7 +305,7 @@ public List resourceIdentifiers() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -289,7 +315,7 @@ public Map 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() { @@ -298,7 +324,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 3613253e952a..7f4f251c813e 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** confidence reason item. */ +/** + * confidence reason item. + */ @Immutable public final class SecurityAlertPropertiesConfidenceReasonsItem { /* @@ -22,9 +24,15 @@ public final class SecurityAlertPropertiesConfidenceReasonsItem { @JsonProperty(value = "reasonType", access = JsonProperty.Access.WRITE_ONLY) private String reasonType; + /** + * Creates an instance of SecurityAlertPropertiesConfidenceReasonsItem class. + */ + public SecurityAlertPropertiesConfidenceReasonsItem() { + } + /** * Get the reason property: The reason's description. - * + * * @return the reason value. */ public String reason() { @@ -33,7 +41,7 @@ public String reason() { /** * Get the reasonType property: The type (category) of the reason. - * + * * @return the reasonType value. */ public String reasonType() { @@ -42,7 +50,7 @@ public String reasonType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertTimelineItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertTimelineItem.java index a34da5bbcc1a..1e3d1b34bab0 100644 --- 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 @@ -7,15 +7,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; -/** Represents security alert timeline item. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents security alert timeline item. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = SecurityAlertTimelineItem.class, + visible = true) @JsonTypeName("SecurityAlert") @Fluent public final class SecurityAlertTimelineItem extends EntityTimelineItem { + /* + * The entity query kind type. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityTimelineKind kind = EntityTimelineKind.SECURITY_ALERT; + /* * The alert azure resource id. */ @@ -70,9 +85,37 @@ public final class SecurityAlertTimelineItem extends EntityTimelineItem { @JsonProperty(value = "alertType", required = true) private String alertType; + /* + * The intent of the alert. + */ + @JsonProperty(value = "intent", access = JsonProperty.Access.WRITE_ONLY) + private KillChainIntent intent; + + /* + * The techniques of the alert. + */ + @JsonProperty(value = "techniques") + private List techniques; + + /** + * Creates an instance of SecurityAlertTimelineItem class. + */ + public 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() { @@ -81,7 +124,7 @@ public String azureResourceId() { /** * Set the azureResourceId property: The alert azure resource id. - * + * * @param azureResourceId the azureResourceId value to set. * @return the SecurityAlertTimelineItem object itself. */ @@ -92,7 +135,7 @@ public SecurityAlertTimelineItem withAzureResourceId(String azureResourceId) { /** * Get the productName property: The alert product name. - * + * * @return the productName value. */ public String productName() { @@ -101,7 +144,7 @@ public String productName() { /** * Set the productName property: The alert product name. - * + * * @param productName the productName value to set. * @return the SecurityAlertTimelineItem object itself. */ @@ -112,7 +155,7 @@ public SecurityAlertTimelineItem withProductName(String productName) { /** * Get the description property: The alert description. - * + * * @return the description value. */ public String description() { @@ -121,7 +164,7 @@ public String description() { /** * Set the description property: The alert description. - * + * * @param description the description value to set. * @return the SecurityAlertTimelineItem object itself. */ @@ -132,7 +175,7 @@ public SecurityAlertTimelineItem withDescription(String description) { /** * Get the displayName property: The alert name. - * + * * @return the displayName value. */ public String displayName() { @@ -141,7 +184,7 @@ public String displayName() { /** * Set the displayName property: The alert name. - * + * * @param displayName the displayName value to set. * @return the SecurityAlertTimelineItem object itself. */ @@ -152,7 +195,7 @@ public SecurityAlertTimelineItem withDisplayName(String displayName) { /** * Get the severity property: The alert severity. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -161,7 +204,7 @@ public AlertSeverity severity() { /** * Set the severity property: The alert severity. - * + * * @param severity the severity value to set. * @return the SecurityAlertTimelineItem object itself. */ @@ -172,7 +215,7 @@ public SecurityAlertTimelineItem withSeverity(AlertSeverity severity) { /** * Get the endTimeUtc property: The alert end time. - * + * * @return the endTimeUtc value. */ public OffsetDateTime endTimeUtc() { @@ -181,7 +224,7 @@ public OffsetDateTime endTimeUtc() { /** * Set the endTimeUtc property: The alert end time. - * + * * @param endTimeUtc the endTimeUtc value to set. * @return the SecurityAlertTimelineItem object itself. */ @@ -192,7 +235,7 @@ public SecurityAlertTimelineItem withEndTimeUtc(OffsetDateTime endTimeUtc) { /** * Get the startTimeUtc property: The alert start time. - * + * * @return the startTimeUtc value. */ public OffsetDateTime startTimeUtc() { @@ -201,7 +244,7 @@ public OffsetDateTime startTimeUtc() { /** * Set the startTimeUtc property: The alert start time. - * + * * @param startTimeUtc the startTimeUtc value to set. * @return the SecurityAlertTimelineItem object itself. */ @@ -212,7 +255,7 @@ public SecurityAlertTimelineItem withStartTimeUtc(OffsetDateTime startTimeUtc) { /** * Get the timeGenerated property: The alert generated time. - * + * * @return the timeGenerated value. */ public OffsetDateTime timeGenerated() { @@ -221,7 +264,7 @@ public OffsetDateTime timeGenerated() { /** * Set the timeGenerated property: The alert generated time. - * + * * @param timeGenerated the timeGenerated value to set. * @return the SecurityAlertTimelineItem object itself. */ @@ -232,7 +275,7 @@ public SecurityAlertTimelineItem withTimeGenerated(OffsetDateTime timeGenerated) /** * Get the alertType property: The name of the alert type. - * + * * @return the alertType value. */ public String alertType() { @@ -241,7 +284,7 @@ public String alertType() { /** * Set the alertType property: The name of the alert type. - * + * * @param alertType the alertType value to set. * @return the SecurityAlertTimelineItem object itself. */ @@ -250,55 +293,77 @@ public SecurityAlertTimelineItem withAlertType(String alertType) { return this; } + /** + * 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; + } + + /** + * Set the techniques property: The techniques of the alert. + * + * @param techniques the techniques value to set. + * @return the SecurityAlertTimelineItem object itself. + */ + public SecurityAlertTimelineItem withTechniques(List techniques) { + this.techniques = techniques; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (azureResourceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property azureResourceId in model SecurityAlertTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureResourceId in model SecurityAlertTimelineItem")); } if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model SecurityAlertTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property displayName in model SecurityAlertTimelineItem")); } if (severity() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property severity in model SecurityAlertTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property severity in model SecurityAlertTimelineItem")); } if (endTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endTimeUtc in model SecurityAlertTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property endTimeUtc in model SecurityAlertTimelineItem")); } if (startTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startTimeUtc in model SecurityAlertTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property startTimeUtc in model SecurityAlertTimelineItem")); } if (timeGenerated() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property timeGenerated in model SecurityAlertTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property timeGenerated in model SecurityAlertTimelineItem")); } if (alertType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alertType in model SecurityAlertTimelineItem")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property alertType in model SecurityAlertTimelineItem")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityGroupEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityGroupEntity.java index 119f867b58eb..f13f975d0d1e 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 @@ -4,29 +4,55 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.SecurityGroupEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; import java.util.UUID; -/** Represents a security group entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a security group entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = SecurityGroupEntity.class, visible = true) @JsonTypeName("SecurityGroup") -@Fluent +@Immutable public final class SecurityGroupEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.SECURITY_GROUP; + /* * SecurityGroup entity properties */ @JsonProperty(value = "properties") private SecurityGroupEntityProperties innerProperties; + /** + * Creates an instance of SecurityGroupEntity class. + */ + public SecurityGroupEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: SecurityGroup entity properties. - * + * * @return the innerProperties value. */ private SecurityGroupEntityProperties innerProperties() { @@ -35,7 +61,7 @@ private SecurityGroupEntityProperties innerProperties() { /** * Get the distinguishedName property: The group distinguished name. - * + * * @return the distinguishedName value. */ public String distinguishedName() { @@ -45,7 +71,7 @@ public String distinguishedName() { /** * Get the objectGuid property: A single-value attribute that is the unique identifier for the object, assigned by * active directory. - * + * * @return the objectGuid value. */ public UUID objectGuid() { @@ -55,7 +81,7 @@ public UUID objectGuid() { /** * Get the sid property: The SID attribute is a single-value attribute that specifies the security identifier (SID) * of the group. - * + * * @return the sid value. */ public String sid() { @@ -65,7 +91,7 @@ public String sid() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -75,7 +101,7 @@ public Map 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() { @@ -84,7 +110,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 e1b83148eb66..4215a5fe8c2d 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 @@ -7,46 +7,55 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner; -/** An immutable client-side representation of SecurityMLAnalyticsSetting. */ +/** + * An immutable client-side representation of SecurityMLAnalyticsSetting. + */ public interface SecurityMLAnalyticsSetting { /** * 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 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. - * + * * @return the inner object. */ SecurityMLAnalyticsSettingInner innerModel(); 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 eb9b7a727ef6..f9981890b193 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 @@ -9,11 +9,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner; -/** Resource collection API of SecurityMLAnalyticsSettings. */ +/** + * 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. @@ -25,7 +27,7 @@ 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. * @param context The context to associate with this operation. @@ -38,94 +40,87 @@ public interface SecurityMLAnalyticsSettings { /** * 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 com.azure.core.management.exception.ManagementException 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. + * @return the Security ML Analytics Settings along with {@link Response}. */ - SecurityMLAnalyticsSetting get(String resourceGroupName, String workspaceName, String settingsResourceName); + Response getWithResponse(String resourceGroupName, String workspaceName, + String settingsResourceName, 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 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 com.azure.core.management.exception.ManagementException 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}. + * @return the Security ML Analytics Settings. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String settingsResourceName, Context context); + SecurityMLAnalyticsSetting get(String resourceGroupName, String workspaceName, String settingsResourceName); /** * 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 com.azure.core.management.exception.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. + * @return security ML Analytics Setting along with {@link Response}. */ - SecurityMLAnalyticsSetting createOrUpdate( - String resourceGroupName, - String workspaceName, - String settingsResourceName, - SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, Context 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 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 com.azure.core.management.exception.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}. + * @return security ML Analytics Setting. */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String workspaceName, - String settingsResourceName, - SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, - Context context); + SecurityMLAnalyticsSetting createOrUpdate(String resourceGroupName, String workspaceName, + String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting); /** * 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 com.azure.core.management.exception.ManagementException 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}. */ - void delete(String resourceGroupName, String workspaceName, String settingsResourceName); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String settingsResourceName, + Context 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 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 com.azure.core.management.exception.ManagementException 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 settingsResourceName, Context context); + void delete(String resourceGroupName, String workspaceName, String settingsResourceName); } 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 25eeab69e8b9..9bb1ed553d81 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** security ml analytics settings data sources. */ +/** + * security ml analytics settings data sources. + */ @Fluent public final class SecurityMLAnalyticsSettingsDataSource { /* @@ -23,9 +25,15 @@ public final class SecurityMLAnalyticsSettingsDataSource { @JsonProperty(value = "dataTypes") private List dataTypes; + /** + * Creates an instance of SecurityMLAnalyticsSettingsDataSource class. + */ + public SecurityMLAnalyticsSettingsDataSource() { + } + /** * Get the connectorId property: The connector id that provides the following data types. - * + * * @return the connectorId value. */ public String connectorId() { @@ -34,7 +42,7 @@ public String connectorId() { /** * Set the connectorId property: The connector id that provides the following data types. - * + * * @param connectorId the connectorId value to set. * @return the SecurityMLAnalyticsSettingsDataSource object itself. */ @@ -45,7 +53,7 @@ public SecurityMLAnalyticsSettingsDataSource withConnectorId(String connectorId) /** * Get the dataTypes property: The data types used by the security ml analytics settings. - * + * * @return the dataTypes value. */ public List dataTypes() { @@ -54,7 +62,7 @@ public List dataTypes() { /** * Set the dataTypes property: The data types used by the security ml analytics settings. - * + * * @param dataTypes the dataTypes value to set. * @return the SecurityMLAnalyticsSettingsDataSource object itself. */ @@ -65,7 +73,7 @@ public SecurityMLAnalyticsSettingsDataSource withDataTypes(List dataType /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsKind.java index 81074368d114..bb83e2a3faaa 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 @@ -8,14 +8,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of security ML analytics settings. */ +/** + * The kind of security ML analytics settings. + */ public final class SecurityMLAnalyticsSettingsKind extends ExpandableStringEnum { - /** Static value Anomaly for SecurityMLAnalyticsSettingsKind. */ + /** + * Static value Anomaly for SecurityMLAnalyticsSettingsKind. + */ public static final SecurityMLAnalyticsSettingsKind ANOMALY = fromString("Anomaly"); + /** + * Creates a new instance of SecurityMLAnalyticsSettingsKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityMLAnalyticsSettingsKind() { + } + /** * Creates or finds a SecurityMLAnalyticsSettingsKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding SecurityMLAnalyticsSettingsKind. */ @@ -26,7 +39,7 @@ public static SecurityMLAnalyticsSettingsKind fromString(String name) { /** * Gets known SecurityMLAnalyticsSettingsKind values. - * + * * @return known SecurityMLAnalyticsSettingsKind values. */ public static Collection values() { 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/models/SecurityMLAnalyticsSettingsList.java index 8b72b6ba1ce9..658e6b6e61b0 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/models/SecurityMLAnalyticsSettingsList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the SecurityMLAnalyticsSettings. */ +/** + * List all the SecurityMLAnalyticsSettings. + */ @Fluent public final class SecurityMLAnalyticsSettingsList { /* @@ -25,9 +27,15 @@ public final class SecurityMLAnalyticsSettingsList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of SecurityMLAnalyticsSettingsList class. + */ + public SecurityMLAnalyticsSettingsList() { + } + /** * Get the nextLink property: URL to fetch the next set of SecurityMLAnalyticsSettings. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of SecurityMLAnalyticsSettings. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of SecurityMLAnalyticsSettings. - * + * * @param value the value value to set. * @return the SecurityMLAnalyticsSettingsList object itself. */ @@ -56,15 +64,14 @@ public SecurityMLAnalyticsSettingsList withValue(List e.validate()); } 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..9b419e733900 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelEntityMapping.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single sentinel entity mapping. + */ +@Fluent +public final class SentinelEntityMapping { + /* + * the column name to be mapped to the SentinelEntities + */ + @JsonProperty(value = "columnName") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingState.java index 6d3db4d16b97..1541cd338f0e 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 @@ -8,77 +8,90 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner; -/** An immutable client-side representation of SentinelOnboardingState. */ +/** + * An immutable client-side representation of SentinelOnboardingState. + */ public interface SentinelOnboardingState { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the customerManagedKey property: Flag that indicates the status of the CMK setting. - * + * * @return the customerManagedKey value. */ Boolean customerManagedKey(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner object. - * + * * @return the inner object. */ SentinelOnboardingStateInner innerModel(); - /** The entirety of the SentinelOnboardingState definition. */ + /** + * The entirety of the SentinelOnboardingState definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The SentinelOnboardingState definition stages. */ + + /** + * The SentinelOnboardingState definition stages. + */ interface DefinitionStages { - /** The first stage of the SentinelOnboardingState definition. */ + /** + * The first stage of the SentinelOnboardingState definition. + */ interface Blank extends WithParentResource { } - /** The stage of the SentinelOnboardingState definition allowing to specify parent resource. */ + + /** + * The stage of the SentinelOnboardingState definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** * The stage of the SentinelOnboardingState definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. @@ -86,50 +99,57 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithCustomerManagedKey { /** * Executes the create request. - * + * * @return the created resource. */ SentinelOnboardingState create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ SentinelOnboardingState create(Context context); } - /** The stage of the SentinelOnboardingState definition allowing to specify etag. */ + + /** + * The stage of the SentinelOnboardingState definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the SentinelOnboardingState definition allowing to specify customerManagedKey. */ + + /** + * The stage of the SentinelOnboardingState definition allowing to specify customerManagedKey. + */ interface WithCustomerManagedKey { /** * Specifies the customerManagedKey property: Flag that indicates the status of the CMK setting. - * + * * @param customerManagedKey Flag that indicates the status of the CMK setting. * @return the next definition stage. */ WithCreate withCustomerManagedKey(Boolean customerManagedKey); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ SentinelOnboardingState refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ 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 abcc5d92aa34..42189b8ee81a 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 @@ -7,92 +7,94 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of SentinelOnboardingStates. */ +/** + * Resource collection API of SentinelOnboardingStates. + */ public interface SentinelOnboardingStates { /** * Get Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return sentinel onboarding state along with {@link Response}. */ - SentinelOnboardingState get(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + Response getWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, Context context); /** * Get Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return sentinel onboarding state. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context); + SentinelOnboardingState get(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); /** * Delete Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String sentinelOnboardingStateName, Context context); /** * Delete Sentinel onboarding state. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sentinelOnboardingStateName The Sentinel onboarding state name. Supports - default. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 sentinelOnboardingStateName, Context context); + void delete(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName); /** * Gets all Sentinel onboarding states. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Sentinel onboarding states. + * @return all Sentinel onboarding states along with {@link Response}. */ - SentinelOnboardingStatesList list(String resourceGroupName, String workspaceName); + Response listWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * Gets all Sentinel onboarding states. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. + * @return all Sentinel onboarding states. */ - Response listWithResponse( - String resourceGroupName, String workspaceName, Context context); + SentinelOnboardingStatesList list(String resourceGroupName, String workspaceName); /** * Get Sentinel onboarding state. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -103,7 +105,7 @@ Response listWithResponse( /** * Get Sentinel onboarding state. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -115,7 +117,7 @@ Response listWithResponse( /** * Delete Sentinel onboarding state. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -125,7 +127,7 @@ Response listWithResponse( /** * Delete Sentinel onboarding state. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,7 +139,7 @@ Response listWithResponse( /** * Begins definition for a new SentinelOnboardingState resource. - * + * * @param name resource name. * @return the first stage of the new SentinelOnboardingState definition. */ 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 0699c91c46b2..e6f44913572f 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 @@ -7,18 +7,20 @@ import com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner; import java.util.List; -/** An immutable client-side representation of SentinelOnboardingStatesList. */ +/** + * An immutable client-side representation of SentinelOnboardingStatesList. + */ public interface SentinelOnboardingStatesList { /** * Gets the value property: Array of Sentinel onboarding states. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner object. - * + * * @return the inner object. */ SentinelOnboardingStatesListInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ServicePrincipal.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ServicePrincipal.java new file mode 100644 index 000000000000..a4ee7a7aae78 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ServicePrincipal.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Service principal metadata. + */ +@Fluent +public final class ServicePrincipal { + /* + * Id of service principal. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Tenant id of service principal. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * App id of service principal. + */ + @JsonProperty(value = "appId", access = JsonProperty.Access.WRITE_ONLY) + private String appId; + + /* + * Expiration time of service principal credentials. + */ + @JsonProperty(value = "credentialsExpireOn") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SessionAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SessionAuthModel.java new file mode 100644 index 000000000000..552de77eeeed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SessionAuthModel.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** + * Model for API authentication with session cookie. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = SessionAuthModel.class, visible = true) +@JsonTypeName("Session") +@Fluent +public final class SessionAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private CcpAuthType type = CcpAuthType.SESSION; + + /* + * The user name attribute key value. + */ + @JsonProperty(value = "userName", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map username; + + /* + * The password attribute name. + */ + @JsonProperty(value = "password", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map password; + + /* + * Query parameters to session service endpoint. + */ + @JsonProperty(value = "queryParameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map queryParameters; + + /* + * Indicating whether API key is set in HTTP POST payload. + */ + @JsonProperty(value = "isPostPayloadJson") + private Boolean isPostPayloadJson; + + /* + * HTTP request headers to session service endpoint. + */ + @JsonProperty(value = "headers") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map headers; + + /* + * Session timeout in minutes. + */ + @JsonProperty(value = "sessionTimeoutInMinutes") + private Integer sessionTimeoutInMinutes; + + /* + * Session id attribute name from HTTP response header. + */ + @JsonProperty(value = "sessionIdName") + private String sessionIdName; + + /* + * HTTP request URL to session service endpoint. + */ + @JsonProperty(value = "sessionLoginRequestUri") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (username() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property username in model SessionAuthModel")); + } + if (password() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property password in model SessionAuthModel")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionAuthModel.class); +} 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 index 6ec2ac268c71..a168db68be39 100644 --- 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of the setting. */ +/** + * The kind of the setting. + */ public final class SettingKind extends ExpandableStringEnum { - /** Static value Anomalies for SettingKind. */ + /** + * Static value Anomalies for SettingKind. + */ public static final SettingKind ANOMALIES = fromString("Anomalies"); - /** Static value EyesOn for SettingKind. */ + /** + * Static value EyesOn for SettingKind. + */ public static final SettingKind EYES_ON = fromString("EyesOn"); - /** Static value EntityAnalytics for SettingKind. */ + /** + * Static value EntityAnalytics for SettingKind. + */ public static final SettingKind ENTITY_ANALYTICS = fromString("EntityAnalytics"); - /** Static value Ueba for SettingKind. */ + /** + * Static value Ueba for SettingKind. + */ 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. */ @@ -35,7 +54,7 @@ public static SettingKind fromString(String name) { /** * Gets known SettingKind values. - * + * * @return known SettingKind values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingList.java index 84b5c972e9eb..08dda37d9717 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingList.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner; import java.util.List; -/** An immutable client-side representation of SettingList. */ +/** + * An immutable client-side representation of SettingList. + */ public interface SettingList { /** * Gets the value property: Array of settings. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner object. - * + * * @return the inner object. */ SettingListInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingType.java index 94296a654ffb..f2ef3cb50576 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of the setting. */ +/** + * The kind of the setting. + */ public final class SettingType extends ExpandableStringEnum { - /** Static value CopyableLabel for SettingType. */ + /** + * Static value CopyableLabel for SettingType. + */ public static final SettingType COPYABLE_LABEL = fromString("CopyableLabel"); - /** Static value InstructionStepsGroup for SettingType. */ + /** + * Static value InstructionStepsGroup for SettingType. + */ public static final SettingType INSTRUCTION_STEPS_GROUP = fromString("InstructionStepsGroup"); - /** Static value InfoMessage for SettingType. */ + /** + * Static value InfoMessage for SettingType. + */ 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. */ @@ -32,7 +49,7 @@ public static SettingType fromString(String name) { /** * Gets known SettingType values. - * + * * @return known SettingType values. */ public static Collection values() { 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 index 9533bec7514d..a709698a3024 100644 --- 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 @@ -7,46 +7,55 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; -/** An immutable client-side representation of Settings. */ +/** + * An immutable client-side representation of Settings. + */ public interface Settings { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the kind property: The kind of the setting. + * + * @return the kind value. + */ + SettingKind kind(); + /** * 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 f9cb8e47afa6..af0e79185ac8 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The anomaly SecurityMLAnalyticsSettings status. */ +/** + * The anomaly SecurityMLAnalyticsSettings status. + */ public final class SettingsStatus extends ExpandableStringEnum { - /** Static value Production for SettingsStatus. */ + /** + * Static value Production for SettingsStatus. + */ public static final SettingsStatus PRODUCTION = fromString("Production"); - /** Static value Flighting for SettingsStatus. */ + /** + * Static value Flighting for SettingsStatus. + */ public static final SettingsStatus FLIGHTING = fromString("Flighting"); + /** + * Creates a new instance of SettingsStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SettingsStatus() { + } + /** * Creates or finds a SettingsStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding SettingsStatus. */ @@ -29,7 +44,7 @@ public static SettingsStatus fromString(String name) { /** * Gets known SettingsStatus values. - * + * * @return known SettingsStatus values. */ public static Collection values() { 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..f2926b484aa7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SortingDirection.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The direction to sort the results by. + */ +public final class SortingDirection extends ExpandableStringEnum { + /** + * Static value ASC for SortingDirection. + */ + public static final SortingDirection ASC = fromString("ASC"); + + /** + * Static value DESC for SortingDirection. + */ + 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. + */ + @JsonCreator + 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/SourceControl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControl.java index 6c5a64405d59..e9f7ce516c66 100644 --- 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 @@ -4,283 +4,355 @@ 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. */ +/** + * 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 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.WithCreate { + /** + * 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. */ + + /** + * The SourceControl definition stages. + */ interface DefinitionStages { - /** The first stage of the SourceControl definition. */ + /** + * The first stage of the SourceControl definition. + */ interface Blank extends WithParentResource { } - /** The stage of the SourceControl definition allowing to specify parent resource. */ + + /** + * The stage of the SourceControl definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @return the next definition stage. */ - WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + 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.WithIdPropertiesId, - DefinitionStages.WithVersion, - DefinitionStages.WithDisplayName, - DefinitionStages.WithDescription, - DefinitionStages.WithRepoType, - DefinitionStages.WithContentTypes, - DefinitionStages.WithRepository, - DefinitionStages.WithRepositoryResourceInfo, - DefinitionStages.WithLastDeploymentInfo { + 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. */ + + /** + * The stage of the SourceControl definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the SourceControl definition allowing to specify idPropertiesId. */ - interface WithIdPropertiesId { - /** - * Specifies the idPropertiesId property: The id (a Guid) of the source control. - * - * @param idPropertiesId The id (a Guid) of the source control. - * @return the next definition stage. - */ - WithCreate withIdPropertiesId(String idPropertiesId); - } - /** The stage of the SourceControl definition allowing to specify version. */ - interface WithVersion { - /** - * Specifies the version property: The version number associated with the source control. - * - * @param version The version number associated with the source control. - * @return the next definition stage. - */ - WithCreate withVersion(Version version); - } - /** The stage of the SourceControl definition allowing to specify displayName. */ - interface WithDisplayName { - /** - * Specifies the displayName property: The display name of the source control. - * - * @param displayName The display name of the source control. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - /** The stage of the SourceControl definition allowing to specify description. */ + + /** + * The stage of the SourceControl definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: A description of the source control. - * + * * @param description A description of the source control. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the SourceControl definition allowing to specify repoType. */ - interface WithRepoType { - /** - * Specifies the repoType property: The repository type of the source control. - * - * @param repoType The repository type of the source control. - * @return the next definition stage. - */ - WithCreate withRepoType(RepoType repoType); - } - /** The stage of the SourceControl definition allowing to specify contentTypes. */ - interface WithContentTypes { + + /** + * The stage of the SourceControl definition allowing to specify servicePrincipal. + */ + interface WithServicePrincipal { /** - * Specifies the contentTypes property: Array of source control content types.. - * - * @param contentTypes Array of source control content types. + * Specifies the servicePrincipal property: Service principal metadata.. + * + * @param servicePrincipal Service principal metadata. * @return the next definition stage. */ - WithCreate withContentTypes(List contentTypes); + WithCreate withServicePrincipal(ServicePrincipal servicePrincipal); } - /** The stage of the SourceControl definition allowing to specify repository. */ - interface WithRepository { + + /** + * The stage of the SourceControl definition allowing to specify repositoryAccess. + */ + interface WithRepositoryAccess { /** - * Specifies the repository property: Repository metadata.. - * - * @param repository Repository metadata. + * 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 withRepository(Repository repository); + WithCreate withRepositoryAccess(RepositoryAccess repositoryAccess); } - /** The stage of the SourceControl definition allowing to specify repositoryResourceInfo. */ + + /** + * 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); } - /** The stage of the SourceControl definition allowing to specify lastDeploymentInfo. */ - interface WithLastDeploymentInfo { - /** - * Specifies the lastDeploymentInfo property: Information regarding the latest deployment for the source - * control.. - * - * @param lastDeploymentInfo Information regarding the latest deployment for the source control. - * @return the next definition stage. - */ - WithCreate withLastDeploymentInfo(DeploymentInfo lastDeploymentInfo); - } } + /** * 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/SourceControlList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlList.java index 8fa041261e9a..2d0641ad0b4e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the source controls. */ +/** + * List all the source controls. + */ @Fluent public final class SourceControlList { /* @@ -25,9 +27,15 @@ public final class SourceControlList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of SourceControlList class. + */ + public SourceControlList() { + } + /** * Get the nextLink property: URL to fetch the next set of source controls. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of source controls. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of source controls. - * + * * @param value the value value to set. * @return the SourceControlList object itself. */ @@ -56,14 +64,13 @@ public SourceControlList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SourceControlList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SourceControlList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControls.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControls.java index 291568ce3448..64074be53bde 100644 --- 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 @@ -7,33 +7,36 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of SourceControls. */ +/** + * Resource collection API of SourceControls. + */ public interface SourceControls { /** * Gets a list of repositories metadata. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param repoType The repo type. + * @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 a list of repositories metadata as paginated response with {@link PagedIterable}. */ - PagedIterable listRepositories(String resourceGroupName, String workspaceName, RepoType repoType); + 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 repoType The repo type. + * @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 a list of repositories metadata as paginated response with {@link PagedIterable}. */ - PagedIterable listRepositories( - String resourceGroupName, String workspaceName, RepoType repoType, Context context); + 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/SourceControlsOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlsOperations.java index d7301e3d70cc..808e6ea61c22 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlsOperations.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlsOperations.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of SourceControlsOperations. */ +/** + * Resource collection API of SourceControlsOperations. + */ public interface SourceControlsOperations { /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface SourceControlsOperations { /** * Gets all source controls, without source control items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -37,62 +39,66 @@ public interface SourceControlsOperations { /** * Gets a source control byt its identifier. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a source control byt its identifier. + * @return a source control byt its identifier along with {@link Response}. */ - SourceControl get(String resourceGroupName, String workspaceName, String sourceControlId); + 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 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}. + * @return a source control byt its identifier. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String sourceControlId, Context context); + SourceControl get(String resourceGroupName, String workspaceName, String sourceControlId); /** * Delete a source control. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param sourceControlId Source control Id. + * @param 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}. */ - void delete(String resourceGroupName, String workspaceName, String sourceControlId); + 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 workspace. * @param sourceControlId Source control Id. - * @param context The context to associate with this operation. + * @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 the {@link Response}. + * @return warning response structure. */ - Response deleteWithResponse( - String resourceGroupName, String workspaceName, String sourceControlId, Context context); + 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. @@ -103,7 +109,7 @@ Response deleteWithResponse( /** * 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. @@ -113,31 +119,9 @@ Response deleteWithResponse( */ Response getByIdWithResponse(String id, Context context); - /** - * Delete a source control. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a source control. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - /** * Begins definition for a new SourceControl resource. - * + * * @param name resource name. * @return the first stage of the new SourceControl definition. */ 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 index 81b1a237ddf0..8d5475d3bcd4 100644 --- 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Source type of the content. */ +/** + * Source type of the content. + */ public final class SourceKind extends ExpandableStringEnum { - /** Static value LocalWorkspace for SourceKind. */ + /** + * Static value LocalWorkspace for SourceKind. + */ public static final SourceKind LOCAL_WORKSPACE = fromString("LocalWorkspace"); - /** Static value Community for SourceKind. */ + /** + * Static value Community for SourceKind. + */ public static final SourceKind COMMUNITY = fromString("Community"); - /** Static value Solution for SourceKind. */ + /** + * Static value Solution for SourceKind. + */ public static final SourceKind SOLUTION = fromString("Solution"); - /** Static value SourceRepository for SourceKind. */ + /** + * Static value SourceRepository for SourceKind. + */ 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. */ @@ -35,7 +54,7 @@ public static SourceKind fromString(String name) { /** * Gets known SourceKind values. - * + * * @return known SourceKind values. */ public static Collection values() { 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 index b1e052ce2251..f8d9c55d49c2 100644 --- 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The sourceType of the watchlist. */ +/** + * The sourceType of the watchlist. + */ public final class SourceType extends ExpandableStringEnum { - /** Static value Local file for SourceType. */ + /** + * Static value Local file for SourceType. + */ public static final SourceType LOCAL_FILE = fromString("Local file"); - /** Static value Remote storage for SourceType. */ + /** + * Static value Remote storage for SourceType. + */ public static final SourceType REMOTE_STORAGE = fromString("Remote storage"); + /** + * 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. */ @@ -29,7 +44,7 @@ public static SourceType fromString(String name) { /** * Gets known SourceType values. - * + * * @return known SourceType values. */ public static Collection values() { 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..99de08af0e28 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/State.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * State of recommendation. + */ +public final class State extends ExpandableStringEnum { + /** + * Static value Active for State. + */ + public static final State ACTIVE = fromString("Active"); + + /** + * Static value InProgress for State. + */ + public static final State IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Dismissed for State. + */ + public static final State DISMISSED = fromString("Dismissed"); + + /** + * Static value CompletedByUser for State. + */ + public static final State COMPLETED_BY_USER = fromString("CompletedByUser"); + + /** + * Static value CompletedBySystem for State. + */ + 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. + */ + @JsonCreator + 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..b54d2baf53e9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Status.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The status of the hunt. + */ +public final class Status extends ExpandableStringEnum { + /** + * Static value New for Status. + */ + public static final Status NEW = fromString("New"); + + /** + * Static value Active for Status. + */ + public static final Status ACTIVE = fromString("Active"); + + /** + * Static value Closed for Status. + */ + public static final Status CLOSED = fromString("Closed"); + + /** + * Static value Backlog for Status. + */ + public static final Status BACKLOG = fromString("Backlog"); + + /** + * Static value Approved for Status. + */ + public static final Status APPROVED = fromString("Approved"); + + /** + * Static value Succeeded for Status. + */ + public static final Status SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for Status. + */ + public static final Status FAILED = fromString("Failed"); + + /** + * Static value InProgress for Status. + */ + 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. + */ + @JsonCreator + 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 e1aa218951ef..1845d27114d3 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 @@ -4,30 +4,56 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.SubmissionMailEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.Map; import java.util.UUID; -/** Represents a submission mail entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a submission mail entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = SubmissionMailEntity.class, visible = true) @JsonTypeName("SubmissionMail") -@Fluent +@Immutable public final class SubmissionMailEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.SUBMISSION_MAIL; + /* * Submission mail entity properties */ @JsonProperty(value = "properties") private SubmissionMailEntityProperties innerProperties; + /** + * Creates an instance of SubmissionMailEntity class. + */ + public SubmissionMailEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Submission mail entity properties. - * + * * @return the innerProperties value. */ private SubmissionMailEntityProperties innerProperties() { @@ -36,7 +62,7 @@ private SubmissionMailEntityProperties innerProperties() { /** * Get the networkMessageId property: The network message id of email to which submission belongs. - * + * * @return the networkMessageId value. */ public UUID networkMessageId() { @@ -45,7 +71,7 @@ public UUID networkMessageId() { /** * Get the submissionId property: The submission id. - * + * * @return the submissionId value. */ public UUID submissionId() { @@ -54,7 +80,7 @@ public UUID submissionId() { /** * Get the submitter property: The submitter. - * + * * @return the submitter value. */ public String submitter() { @@ -63,7 +89,7 @@ public String submitter() { /** * Get the submissionDate property: The submission date. - * + * * @return the submissionDate value. */ public OffsetDateTime submissionDate() { @@ -72,7 +98,7 @@ public OffsetDateTime submissionDate() { /** * Get the timestamp property: The Time stamp when the message is received (Mail). - * + * * @return the timestamp value. */ public OffsetDateTime timestamp() { @@ -81,7 +107,7 @@ public OffsetDateTime timestamp() { /** * Get the recipient property: The recipient of the mail. - * + * * @return the recipient value. */ public String recipient() { @@ -90,7 +116,7 @@ public String recipient() { /** * Get the sender property: The sender of the mail. - * + * * @return the sender value. */ public String sender() { @@ -99,7 +125,7 @@ public String sender() { /** * Get the senderIp property: The sender's IP. - * + * * @return the senderIp value. */ public String senderIp() { @@ -108,7 +134,7 @@ public String senderIp() { /** * Get the subject property: The subject of submission mail. - * + * * @return the subject value. */ public String subject() { @@ -118,7 +144,7 @@ public String subject() { /** * Get the reportType property: The submission type for the given instance. This maps to Junk, Phish, Malware or * NotJunk. - * + * * @return the reportType value. */ public String reportType() { @@ -128,7 +154,7 @@ public String reportType() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -138,7 +164,7 @@ public Map 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() { @@ -147,7 +173,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index e911816eb754..43f1b06713cb 100644 --- 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Type of support for content item. */ +/** + * Type of support for content item. + */ public final class SupportTier extends ExpandableStringEnum { - /** Static value Microsoft for SupportTier. */ + /** + * Static value Microsoft for SupportTier. + */ public static final SupportTier MICROSOFT = fromString("Microsoft"); - /** Static value Partner for SupportTier. */ + /** + * Static value Partner for SupportTier. + */ public static final SupportTier PARTNER = fromString("Partner"); - /** Static value Community for SupportTier. */ + /** + * Static value Community for SupportTier. + */ 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. */ @@ -32,7 +49,7 @@ public static SupportTier fromString(String name) { /** * Gets known SupportTier values. - * + * * @return known SupportTier values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemConfigurationConnectorType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemConfigurationConnectorType.java new file mode 100644 index 000000000000..484ba1df056e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemConfigurationConnectorType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Represents the types of SAP systems. + */ +public final class SystemConfigurationConnectorType extends ExpandableStringEnum { + /** + * Static value Rfc for SystemConfigurationConnectorType. + */ + public static final SystemConfigurationConnectorType RFC = fromString("Rfc"); + + /** + * Static value SapControl for SystemConfigurationConnectorType. + */ + public static final SystemConfigurationConnectorType SAP_CONTROL = fromString("SapControl"); + + /** + * Creates a new instance of SystemConfigurationConnectorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SystemConfigurationConnectorType() { + } + + /** + * Creates or finds a SystemConfigurationConnectorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SystemConfigurationConnectorType. + */ + @JsonCreator + public static SystemConfigurationConnectorType fromString(String name) { + return fromString(name, SystemConfigurationConnectorType.class); + } + + /** + * Gets known SystemConfigurationConnectorType values. + * + * @return known SystemConfigurationConnectorType values. + */ + public static Collection values() { + return values(SystemConfigurationConnectorType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemResource.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemResource.java new file mode 100644 index 000000000000..e4345699a23c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemResource.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.SystemResourceInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of SystemResource. + */ +public interface SystemResource { + /** + * 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 status property: The status of the system. + * + * @return the status value. + */ + SystemStatusType status(); + + /** + * Gets the configuration property: The configuration of the system. + * + * @return the configuration value. + */ + SystemsConfiguration configuration(); + + /** + * Gets the displayName property: The displayName property. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the lastModifiedTimeUtc property: The lastModifiedTimeUtc property. + * + * @return the lastModifiedTimeUtc value. + */ + OffsetDateTime lastModifiedTimeUtc(); + + /** + * 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.SystemResourceInner object. + * + * @return the inner object. + */ + SystemResourceInner innerModel(); + + /** + * The entirety of the SystemResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithConfiguration, DefinitionStages.WithDisplayName, DefinitionStages.WithCreate { + } + + /** + * The SystemResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SystemResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SystemResource definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, agentResourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @return the next definition stage. + */ + WithConfiguration withExistingBusinessApplicationAgent(String resourceGroupName, String workspaceName, + String agentResourceName); + } + + /** + * The stage of the SystemResource definition allowing to specify configuration. + */ + interface WithConfiguration { + /** + * Specifies the configuration property: The configuration of the system.. + * + * @param configuration The configuration of the system. + * @return the next definition stage. + */ + WithDisplayName withConfiguration(SystemsConfiguration configuration); + } + + /** + * The stage of the SystemResource definition allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The displayName property.. + * + * @param displayName The displayName property. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the SystemResource 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.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + SystemResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SystemResource create(Context context); + } + + /** + * The stage of the SystemResource 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 SystemResource definition allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: The status of the system.. + * + * @param status The status of the system. + * @return the next definition stage. + */ + WithCreate withStatus(SystemStatusType status); + } + } + + /** + * Begins update for the SystemResource resource. + * + * @return the stage of resource update. + */ + SystemResource.Update update(); + + /** + * The template for SystemResource update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithStatus, UpdateStages.WithConfiguration, + UpdateStages.WithDisplayName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SystemResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SystemResource apply(Context context); + } + + /** + * The SystemResource update stages. + */ + interface UpdateStages { + /** + * The stage of the SystemResource 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 SystemResource update allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: The status of the system.. + * + * @param status The status of the system. + * @return the next definition stage. + */ + Update withStatus(SystemStatusType status); + } + + /** + * The stage of the SystemResource update allowing to specify configuration. + */ + interface WithConfiguration { + /** + * Specifies the configuration property: The configuration of the system.. + * + * @param configuration The configuration of the system. + * @return the next definition stage. + */ + Update withConfiguration(SystemsConfiguration configuration); + } + + /** + * The stage of the SystemResource update allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The displayName property.. + * + * @param displayName The displayName property. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SystemResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SystemResource refresh(Context context); + + /** + * List of actions for a business application system. + * + * @throws com.azure.core.management.exception.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 actions for a system to perform as paginated response with {@link PagedIterable}. + */ + PagedIterable listActions(); + + /** + * List of actions for a business application system. + * + * @param filter Filters the results, based on a Boolean condition. 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 list all actions for a system to perform as paginated response with {@link PagedIterable}. + */ + PagedIterable listActions(String filter, String skipToken, Context context); + + /** + * Undo action, based on the actionId. + * + * @param payload Undo action, based on the actionId. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 undoActionWithResponse(Object payload, Context context); + + /** + * Undo action, based on the actionId. + * + * @throws com.azure.core.management.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 undoAction(); + + /** + * Report the status of the action. + * + * @param payload Report a status of the action that was performed by the agent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 reportActionStatusWithResponse(Object payload, Context context); + + /** + * Report the status of the action. + * + * @throws com.azure.core.management.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 reportActionStatus(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemStatusType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemStatusType.java new file mode 100644 index 000000000000..b68104d0c7b0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemStatusType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The status of the system. + */ +public final class SystemStatusType extends ExpandableStringEnum { + /** + * Static value Running for SystemStatusType. + */ + public static final SystemStatusType RUNNING = fromString("Running"); + + /** + * Static value Stopped for SystemStatusType. + */ + public static final SystemStatusType STOPPED = fromString("Stopped"); + + /** + * Creates a new instance of SystemStatusType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SystemStatusType() { + } + + /** + * Creates or finds a SystemStatusType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SystemStatusType. + */ + @JsonCreator + public static SystemStatusType fromString(String name) { + return fromString(name, SystemStatusType.class); + } + + /** + * Gets known SystemStatusType values. + * + * @return known SystemStatusType values. + */ + public static Collection values() { + return values(SystemStatusType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Systems.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Systems.java new file mode 100644 index 000000000000..44ca20c83965 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Systems.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Systems. + */ +public interface Systems { + /** + * Gets the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName, Context context); + + /** + * Gets the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system. + */ + SystemResource get(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName); + + /** + * Deletes the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 agentResourceName, + String systemResourceName, Context context); + + /** + * Deletes the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 agentResourceName, String systemResourceName); + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent 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 list of Agent's Systems as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String agentResourceName); + + /** + * ListAll the systems. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param filter Filters the results, based on a Boolean condition. 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 list of Agent's Systems as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String agentResourceName, + String filter, String skipToken, Context context); + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 actions for a system to perform as paginated response with {@link PagedIterable}. + */ + PagedIterable listActions(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName); + + /** + * List of actions for a business application system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param filter Filters the results, based on a Boolean condition. 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 list all actions for a system to perform as paginated response with {@link PagedIterable}. + */ + PagedIterable listActions(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName, String filter, String skipToken, Context context); + + /** + * Undo action, based on the actionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Undo action, based on the actionId. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 undoActionWithResponse(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName, Object payload, Context context); + + /** + * Undo action, based on the actionId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 undoAction(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName); + + /** + * Report the status of the action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @param payload Report a status of the action that was performed by the agent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 reportActionStatusWithResponse(String resourceGroupName, String workspaceName, + String agentResourceName, String systemResourceName, Object payload, Context context); + + /** + * Report the status of the action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param agentResourceName Business Application Agent Name. + * @param systemResourceName The name of the system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reportActionStatus(String resourceGroupName, String workspaceName, String agentResourceName, + String systemResourceName); + + /** + * Gets the system. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the system along with {@link Response}. + */ + SystemResource getById(String id); + + /** + * Gets the system. + * + * @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 system along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the system. + * + * @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 the system. + * + * @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 SystemResource resource. + * + * @param name resource name. + * @return the first stage of the new SystemResource definition. + */ + SystemResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemsConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemsConfiguration.java new file mode 100644 index 000000000000..67a2ca9dfe69 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemsConfiguration.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The configuration of the system. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = SystemsConfiguration.class, visible = true) +@JsonTypeName("SystemsConfiguration") +@JsonSubTypes({ @JsonSubTypes.Type(name = "SAP", value = SapSystemsConfiguration.class) }) +@Immutable +public class SystemsConfiguration { + /* + * Represents the types of configuration for a system. + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private ConfigurationType type; + + /** + * Creates an instance of SystemsConfiguration class. + */ + public SystemsConfiguration() { + this.type = ConfigurationType.fromString("SystemsConfiguration"); + } + + /** + * Get the type property: Represents the types of configuration for a system. + * + * @return the type value. + */ + public ConfigurationType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemsConfigurationConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemsConfigurationConnector.java new file mode 100644 index 000000000000..a0d5f7e9c3a7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemsConfigurationConnector.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base Model for SAP System Connector. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "type", + defaultImpl = SystemsConfigurationConnector.class, + visible = true) +@JsonTypeName("SystemsConfigurationConnector") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Rfc", value = RfcConnector.class), + @JsonSubTypes.Type(name = "SapControl", value = SapControlConnector.class) }) +@Immutable +public class SystemsConfigurationConnector { + /* + * Represents the types of SAP systems. + */ + @JsonTypeId + @JsonProperty(value = "type", required = true) + private SystemConfigurationConnectorType type; + + /** + * Creates an instance of SystemsConfigurationConnector class. + */ + public SystemsConfigurationConnector() { + this.type = SystemConfigurationConnectorType.fromString("SystemsConfigurationConnector"); + } + + /** + * Get the type property: Represents the types of SAP systems. + * + * @return the type value. + */ + public SystemConfigurationConnectorType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemsList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemsList.java new file mode 100644 index 000000000000..19d65c127a47 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SystemsList.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.SystemResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of Agent's Systems. + */ +@Fluent +public final class SystemsList { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of SystemsList class. + */ + public SystemsList() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the SystemsList object itself. + */ + public SystemsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the SystemsList object itself. + */ + public SystemsList 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()); + } + } +} 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 index 897fc3f44ce7..d2041cec6eca 100644 --- 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 @@ -7,32 +7,81 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.TICheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Threat Intelligence Platforms data connector check requirements. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Threat Intelligence Platforms data connector check requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = TICheckRequirements.class, visible = true) @JsonTypeName("ThreatIntelligence") @Fluent public final class TICheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.THREAT_INTELLIGENCE; + /* * Threat Intelligence Platforms data connector check required properties */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 4d49f30e45e9..a4fcad0c1b6b 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 @@ -8,31 +8,59 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.TIDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; -/** Represents threat intelligence data connector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents threat intelligence data connector. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = TIDataConnector.class, visible = true) @JsonTypeName("ThreatIntelligence") @Fluent public final class TIDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.THREAT_INTELLIGENCE; + /* * TI (Threat Intelligence) data connector properties. */ @JsonProperty(value = "properties") private TIDataConnectorProperties innerProperties; + /** + * Creates an instance of TIDataConnector class. + */ + public TIDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + /** * Get the innerProperties property: TI (Threat Intelligence) data connector properties. - * + * * @return the innerProperties value. */ private TIDataConnectorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TIDataConnector withEtag(String etag) { super.withEtag(etag); @@ -41,7 +69,7 @@ public TIDataConnector withEtag(String etag) { /** * Get the tipLookbackPeriod property: The lookback period for the feed to be imported. - * + * * @return the tipLookbackPeriod value. */ public OffsetDateTime tipLookbackPeriod() { @@ -50,7 +78,7 @@ public OffsetDateTime tipLookbackPeriod() { /** * Set the tipLookbackPeriod property: The lookback period for the feed to be imported. - * + * * @param tipLookbackPeriod the tipLookbackPeriod value to set. * @return the TIDataConnector object itself. */ @@ -64,7 +92,7 @@ public TIDataConnector withTipLookbackPeriod(OffsetDateTime tipLookbackPeriod) { /** * Get the dataTypes property: The available data types for the connector. - * + * * @return the dataTypes value. */ public TIDataConnectorDataTypes dataTypes() { @@ -73,7 +101,7 @@ public TIDataConnectorDataTypes dataTypes() { /** * Set the dataTypes property: The available data types for the connector. - * + * * @param dataTypes the dataTypes value to set. * @return the TIDataConnector object itself. */ @@ -87,7 +115,7 @@ public TIDataConnector withDataTypes(TIDataConnectorDataTypes dataTypes) { /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -96,7 +124,7 @@ public String 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. */ @@ -110,7 +138,7 @@ public TIDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 6615ba9b2f74..bb3e6939b948 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for TI (Threat Intelligence) data connector. */ +/** + * The available data types for TI (Threat Intelligence) data connector. + */ @Fluent public final class TIDataConnectorDataTypes { /* @@ -17,9 +19,15 @@ public final class TIDataConnectorDataTypes { @JsonProperty(value = "indicators", required = true) private TIDataConnectorDataTypesIndicators indicators; + /** + * Creates an instance of TIDataConnectorDataTypes class. + */ + public TIDataConnectorDataTypes() { + } + /** * Get the indicators property: Data type for indicators connection. - * + * * @return the indicators value. */ public TIDataConnectorDataTypesIndicators indicators() { @@ -28,7 +36,7 @@ public TIDataConnectorDataTypesIndicators indicators() { /** * Set the indicators property: Data type for indicators connection. - * + * * @param indicators the indicators value to set. * @return the TIDataConnectorDataTypes object itself. */ @@ -39,15 +47,14 @@ public TIDataConnectorDataTypes withIndicators(TIDataConnectorDataTypesIndicator /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (indicators() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property indicators in model TIDataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property indicators in model TIDataConnectorDataTypes")); } else { indicators().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypesIndicators.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypesIndicators.java index a51ae50a528a..01abaa95b06b 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Data type for indicators connection. */ +/** + * Data type for indicators connection. + */ @Fluent public final class TIDataConnectorDataTypesIndicators extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of TIDataConnectorDataTypesIndicators class. + */ + public TIDataConnectorDataTypesIndicators() { + } + + /** + * {@inheritDoc} + */ @Override public TIDataConnectorDataTypesIndicators withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public TIDataConnectorDataTypesIndicators withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..3d3a4b92192e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIObject.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * 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. + */ + UserInfoAutoGenerated 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. + */ + UUID 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. + */ + UserInfoAutoGenerated 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..7246f28c47b3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIObjectKind.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The kind of the TI object. + */ +public final class TIObjectKind extends ExpandableStringEnum { + /** + * Static value AttackPattern for TIObjectKind. + */ + public static final TIObjectKind ATTACK_PATTERN = fromString("AttackPattern"); + + /** + * Static value Identity for TIObjectKind. + */ + public static final TIObjectKind IDENTITY = fromString("Identity"); + + /** + * Static value Indicator for TIObjectKind. + */ + public static final TIObjectKind INDICATOR = fromString("Indicator"); + + /** + * Static value Relationship for TIObjectKind. + */ + public static final TIObjectKind RELATIONSHIP = fromString("Relationship"); + + /** + * Static value ThreatActor for TIObjectKind. + */ + 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. + */ + @JsonCreator + 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 index ea1eb3549b75..a4676a567d30 100644 --- 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 @@ -7,46 +7,48 @@ import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of TeamInformation. */ +/** + * An immutable client-side representation of TeamInformation. + */ public interface TeamInformation { /** * Gets the teamId property: Team ID. - * + * * @return the teamId value. */ String teamId(); /** * Gets the primaryChannelUrl property: The primary channel URL of the team. - * + * * @return the primaryChannelUrl value. */ String primaryChannelUrl(); /** * Gets the teamCreationTimeUtc property: The time the team was created. - * + * * @return the teamCreationTimeUtc value. */ OffsetDateTime teamCreationTimeUtc(); /** * Gets the name property: The name of the team. - * + * * @return the name value. */ String name(); /** * Gets the description property: The description of the team. - * + * * @return the description value. */ String description(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner object. - * + * * @return the inner object. */ TeamInformationInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamProperties.java deleted file mode 100644 index 40d641ab8453..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamProperties.java +++ /dev/null @@ -1,134 +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.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.UUID; - -/** Describes team properties. */ -@Fluent -public final class TeamProperties { - /* - * The name of the team - */ - @JsonProperty(value = "teamName", required = true) - private String teamName; - - /* - * The description of the team - */ - @JsonProperty(value = "teamDescription") - private String teamDescription; - - /* - * List of member IDs to add to the team - */ - @JsonProperty(value = "memberIds") - private List memberIds; - - /* - * List of group IDs to add their members to the team - */ - @JsonProperty(value = "groupIds") - private List groupIds; - - /** - * Get the teamName property: The name of the team. - * - * @return the teamName value. - */ - public String teamName() { - return this.teamName; - } - - /** - * Set the teamName property: The name of the team. - * - * @param teamName the teamName value to set. - * @return the TeamProperties object itself. - */ - public TeamProperties withTeamName(String teamName) { - this.teamName = teamName; - return this; - } - - /** - * Get the teamDescription property: The description of the team. - * - * @return the teamDescription value. - */ - public String teamDescription() { - return this.teamDescription; - } - - /** - * Set the teamDescription property: The description of the team. - * - * @param teamDescription the teamDescription value to set. - * @return the TeamProperties object itself. - */ - public TeamProperties withTeamDescription(String teamDescription) { - this.teamDescription = teamDescription; - return this; - } - - /** - * Get the memberIds property: List of member IDs to add to the team. - * - * @return the memberIds value. - */ - public List memberIds() { - return this.memberIds; - } - - /** - * Set the memberIds property: List of member IDs to add to the team. - * - * @param memberIds the memberIds value to set. - * @return the TeamProperties object itself. - */ - public TeamProperties withMemberIds(List memberIds) { - this.memberIds = memberIds; - return this; - } - - /** - * Get the groupIds property: List of group IDs to add their members to the team. - * - * @return the groupIds value. - */ - public List groupIds() { - return this.groupIds; - } - - /** - * Set the groupIds property: List of group IDs to add their members to the team. - * - * @param groupIds the groupIds value to set. - * @return the TeamProperties object itself. - */ - public TeamProperties withGroupIds(List groupIds) { - this.groupIds = groupIds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (teamName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property teamName in model TeamProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TeamProperties.class); -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateAdditionalProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateAdditionalProperties.java new file mode 100644 index 000000000000..cd9cf8ae3065 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateAdditionalProperties.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * additional properties of product template. + */ +@Fluent +public class TemplateAdditionalProperties { + /* + * The JSON of the ARM template to deploy active content. Expandable. + */ + @JsonProperty(value = "mainTemplate") + private Object mainTemplate; + + /* + * Dependant templates. Expandable. + */ + @JsonProperty(value = "dependantTemplates", access = JsonProperty.Access.WRITE_ONLY) + private List dependantTemplates; + + /** + * Creates an instance of TemplateAdditionalProperties class. + */ + public TemplateAdditionalProperties() { + } + + /** + * 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 TemplateAdditionalProperties object itself. + */ + public TemplateAdditionalProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dependantTemplates() != null) { + dependantTemplates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateBaseProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateBaseProperties.java new file mode 100644 index 000000000000..7026fd4486b9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateBaseProperties.java @@ -0,0 +1,708 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** + * Template property bag. + */ +@Fluent +public class TemplateBaseProperties { + /* + * Static ID for the content. Used to identify dependencies and content from solutions or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the resource name + */ + @JsonProperty(value = "contentId") + private String contentId; + + /* + * 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 + */ + @JsonProperty(value = "contentProductId") + 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 + */ + @JsonProperty(value = "packageVersion") + 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 + */ + @JsonProperty(value = "version") + private String version; + + /* + * The display name of the template + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The kind of content the template is for. + */ + @JsonProperty(value = "contentKind") + private Kind contentKind; + + /* + * Source of the content. This is where/how it was created. + */ + @JsonProperty(value = "source") + private MetadataSource source; + + /* + * The creator of the content item. + */ + @JsonProperty(value = "author") + private MetadataAuthor author; + + /* + * Support information for the template - type, name, contact information + */ + @JsonProperty(value = "support") + private MetadataSupport support; + + /* + * Dependencies for the content item, what other content items it requires to work. Can describe more complex dependencies using a recursive/nested structure. For a single dependency an id/kind/version can be supplied or operator/criteria for complex formats. + */ + @JsonProperty(value = "dependencies") + private MetadataDependencies dependencies; + + /* + * Categories for the item + */ + @JsonProperty(value = "categories") + private MetadataCategories categories; + + /* + * Providers for the content item + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * first publish date content item + */ + @JsonProperty(value = "firstPublishDate") + private LocalDate firstPublishDate; + + /* + * last publish date for the content item + */ + @JsonProperty(value = "lastPublishDate") + private LocalDate lastPublishDate; + + /* + * The custom version of the content. A optional free text + */ + @JsonProperty(value = "customVersion") + private String customVersion; + + /* + * Schema version of the content. Can be used to distinguish between different flow based on the schema version + */ + @JsonProperty(value = "contentSchemaVersion") + private String contentSchemaVersion; + + /* + * the icon identifier. this id can later be fetched from the content metadata + */ + @JsonProperty(value = "icon") + private String icon; + + /* + * the tactics the resource covers + */ + @JsonProperty(value = "threatAnalysisTactics") + private List threatAnalysisTactics; + + /* + * the techniques the resource covers, these have to be aligned with the tactics being used + */ + @JsonProperty(value = "threatAnalysisTechniques") + private List threatAnalysisTechniques; + + /* + * preview image file names. These will be taken from the solution artifacts + */ + @JsonProperty(value = "previewImages") + private List previewImages; + + /* + * preview image file names. These will be taken from the solution artifacts. used for dark theme support + */ + @JsonProperty(value = "previewImagesDark") + private List previewImagesDark; + + /* + * the package Id contains this template + */ + @JsonProperty(value = "packageId") + private String packageId; + + /* + * the packageKind of the package contains this template + */ + @JsonProperty(value = "packageKind") + private PackageKind packageKind; + + /* + * the name of the package contains this template + */ + @JsonProperty(value = "packageName") + private String packageName; + + /* + * Flag indicates if this template is deprecated + */ + @JsonProperty(value = "isDeprecated", access = JsonProperty.Access.WRITE_ONLY) + private Flag isDeprecated; + + /** + * Creates an instance of TemplateBaseProperties class. + */ + public TemplateBaseProperties() { + } + + /** + * 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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 TemplateBaseProperties object itself. + */ + public TemplateBaseProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (author() != null) { + author().validate(); + } + if (support() != null) { + support().validate(); + } + if (dependencies() != null) { + dependencies().validate(); + } + if (categories() != null) { + categories().validate(); + } + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateList.java new file mode 100644 index 000000000000..60f0adcf89ab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of all the template. + */ +@Fluent +public final class TemplateList { + /* + * Array of templates. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URL to fetch the next page of template. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of TemplateList class. + */ + public TemplateList() { + } + + /** + * Get the value property: Array of templates. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of templates. + * + * @param value the value value to set. + * @return the TemplateList object itself. + */ + public TemplateList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to fetch the next page of template. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model TemplateList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TemplateList.class); +} 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..947d17ef612b --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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 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 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 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 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.WithMainTemplate, + 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 { + /** + * 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 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); + } + + /** + * 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); + } + } + + /** + * 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.WithMainTemplate, 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 { + /** + * 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 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); + } + + /** + * 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); + } + } + + /** + * 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 f04cc179e840..eef5d8193b1f 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The alert rule template status. */ +/** + * The alert rule template status. + */ public final class TemplateStatus extends ExpandableStringEnum { - /** Static value Installed for TemplateStatus. */ + /** + * Static value Installed for TemplateStatus. + */ public static final TemplateStatus INSTALLED = fromString("Installed"); - /** Static value Available for TemplateStatus. */ + /** + * Static value Available for TemplateStatus. + */ public static final TemplateStatus AVAILABLE = fromString("Available"); - /** Static value NotAvailable for TemplateStatus. */ + /** + * Static value NotAvailable for TemplateStatus. + */ public static final TemplateStatus NOT_AVAILABLE = fromString("NotAvailable"); + /** + * Creates a new instance of TemplateStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TemplateStatus() { + } + /** * Creates or finds a TemplateStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding TemplateStatus. */ @@ -32,7 +49,7 @@ public static TemplateStatus fromString(String name) { /** * Gets known TemplateStatus values. - * + * * @return known TemplateStatus values. */ public static Collection values() { 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..45ef0493d38f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatActor.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a threat actor in Azure Security Insights. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ThreatActor.class, visible = true) +@JsonTypeName("ThreatActor") +@Immutable +public final class ThreatActor extends TIObjectInner { + /* + * The kind of the TI object + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private TIObjectKind kind = TIObjectKind.THREAT_ACTOR; + + /** + * Creates an instance of ThreatActor class. + */ + public ThreatActor() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + @Override + public TIObjectKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligence.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligence.java index 9acbec19c77f..cacc26e801d2 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** ThreatIntelligence property bag. */ +/** + * ThreatIntelligence property bag. + */ @Immutable public final class ThreatIntelligence { /* @@ -46,9 +48,15 @@ public final class ThreatIntelligence { @JsonProperty(value = "threatType", access = JsonProperty.Access.WRITE_ONLY) private String threatType; + /** + * Creates an instance of ThreatIntelligence class. + */ + public ThreatIntelligence() { + } + /** * Get the confidence property: Confidence (must be between 0 and 1). - * + * * @return the confidence value. */ public Double confidence() { @@ -57,7 +65,7 @@ public Double confidence() { /** * Get the providerName property: Name of the provider from whom this Threat Intelligence information was received. - * + * * @return the providerName value. */ public String providerName() { @@ -66,7 +74,7 @@ public String providerName() { /** * Get the reportLink property: Report link. - * + * * @return the reportLink value. */ public String reportLink() { @@ -75,7 +83,7 @@ public String reportLink() { /** * Get the threatDescription property: Threat description (free text). - * + * * @return the threatDescription value. */ public String threatDescription() { @@ -84,7 +92,7 @@ public String threatDescription() { /** * Get the threatName property: Threat name (e.g. "Jedobot malware"). - * + * * @return the threatName value. */ public String threatName() { @@ -93,7 +101,7 @@ public String threatName() { /** * Get the threatType property: Threat type (e.g. "Botnet"). - * + * * @return the threatType value. */ public String threatType() { @@ -102,7 +110,7 @@ public String threatType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRule.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRule.java index 924536281280..cc5e4c735e9a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRule.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRule.java @@ -8,32 +8,64 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents Threat Intelligence alert rule. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Threat Intelligence alert rule. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = ThreatIntelligenceAlertRule.class, + visible = true) @JsonTypeName("ThreatIntelligence") @Fluent public final class ThreatIntelligenceAlertRule extends AlertRuleInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.THREAT_INTELLIGENCE; + /* * Threat Intelligence alert rule properties */ @JsonProperty(value = "properties") private ThreatIntelligenceAlertRuleProperties innerProperties; + /** + * Creates an instance of ThreatIntelligenceAlertRule class. + */ + public ThreatIntelligenceAlertRule() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Threat Intelligence alert rule properties. - * + * * @return the innerProperties value. */ private ThreatIntelligenceAlertRuleProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ThreatIntelligenceAlertRule withEtag(String etag) { super.withEtag(etag); @@ -42,7 +74,7 @@ public ThreatIntelligenceAlertRule withEtag(String etag) { /** * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @return the alertRuleTemplateName value. */ public String alertRuleTemplateName() { @@ -51,7 +83,7 @@ public String alertRuleTemplateName() { /** * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule. - * + * * @param alertRuleTemplateName the alertRuleTemplateName value to set. * @return the ThreatIntelligenceAlertRule object itself. */ @@ -65,7 +97,7 @@ public ThreatIntelligenceAlertRule withAlertRuleTemplateName(String alertRuleTem /** * Get the description property: The description of the alert rule. - * + * * @return the description value. */ public String description() { @@ -74,7 +106,7 @@ public String description() { /** * Get the displayName property: The display name for alerts created by this alert rule. - * + * * @return the displayName value. */ public String displayName() { @@ -83,7 +115,7 @@ public String displayName() { /** * Get the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -92,7 +124,7 @@ public Boolean enabled() { /** * Set the enabled property: Determines whether this alert rule is enabled or disabled. - * + * * @param enabled the enabled value to set. * @return the ThreatIntelligenceAlertRule object itself. */ @@ -106,7 +138,7 @@ public ThreatIntelligenceAlertRule withEnabled(Boolean enabled) { /** * Get the lastModifiedUtc property: The last time that this alert has been modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -115,7 +147,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -124,7 +156,7 @@ public AlertSeverity severity() { /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -133,16 +165,25 @@ public List 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(); + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 734f6a42748a..1773fdd8ee1f 100644 --- 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 @@ -8,25 +8,55 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleTemplateProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Represents Threat Intelligence alert rule template. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents Threat Intelligence alert rule template. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = ThreatIntelligenceAlertRuleTemplate.class, + visible = true) @JsonTypeName("ThreatIntelligence") @Fluent public final class ThreatIntelligenceAlertRuleTemplate extends AlertRuleTemplateInner { + /* + * The kind of the alert rule + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private AlertRuleKind kind = AlertRuleKind.THREAT_INTELLIGENCE; + /* * Threat Intelligence alert rule template properties */ @JsonProperty(value = "properties") private ThreatIntelligenceAlertRuleTemplateProperties innerProperties; + /** + * Creates an instance of ThreatIntelligenceAlertRuleTemplate class. + */ + public ThreatIntelligenceAlertRuleTemplate() { + } + + /** + * Get the kind property: The kind of the alert rule. + * + * @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() { @@ -35,7 +65,7 @@ private ThreatIntelligenceAlertRuleTemplateProperties innerProperties() { /** * Get the severity property: The severity for alerts created by this alert rule. - * + * * @return the severity value. */ public AlertSeverity severity() { @@ -44,7 +74,7 @@ public AlertSeverity severity() { /** * Set the severity property: The severity for alerts created by this alert rule. - * + * * @param severity the severity value to set. * @return the ThreatIntelligenceAlertRuleTemplate object itself. */ @@ -58,7 +88,7 @@ public ThreatIntelligenceAlertRuleTemplate withSeverity(AlertSeverity severity) /** * Get the tactics property: The tactics of the alert rule. - * + * * @return the tactics value. */ public List tactics() { @@ -67,7 +97,7 @@ public List tactics() { /** * Set the tactics property: The tactics of the alert rule. - * + * * @param tactics the tactics value to set. * @return the ThreatIntelligenceAlertRuleTemplate object itself. */ @@ -81,7 +111,7 @@ public ThreatIntelligenceAlertRuleTemplate withTactics(List tactic /** * Get the techniques property: The techniques of the alert rule. - * + * * @return the techniques value. */ public List techniques() { @@ -90,7 +120,7 @@ public List techniques() { /** * Set the techniques property: The techniques of the alert rule. - * + * * @param techniques the techniques value to set. * @return the ThreatIntelligenceAlertRuleTemplate object itself. */ @@ -104,7 +134,7 @@ public ThreatIntelligenceAlertRuleTemplate withTechniques(List technique /** * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @return the alertRulesCreatedByTemplateCount value. */ public Integer alertRulesCreatedByTemplateCount() { @@ -113,12 +143,12 @@ public Integer alertRulesCreatedByTemplateCount() { /** * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. - * + * * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. * @return the ThreatIntelligenceAlertRuleTemplate object itself. */ - public ThreatIntelligenceAlertRuleTemplate withAlertRulesCreatedByTemplateCount( - Integer alertRulesCreatedByTemplateCount) { + public ThreatIntelligenceAlertRuleTemplate + withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { if (this.innerProperties() == null) { this.innerProperties = new ThreatIntelligenceAlertRuleTemplateProperties(); } @@ -128,7 +158,7 @@ public ThreatIntelligenceAlertRuleTemplate withAlertRulesCreatedByTemplateCount( /** * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. - * + * * @return the lastUpdatedDateUtc value. */ public OffsetDateTime lastUpdatedDateUtc() { @@ -137,7 +167,7 @@ public OffsetDateTime lastUpdatedDateUtc() { /** * Get the createdDateUtc property: The time that this alert rule template has been added. - * + * * @return the createdDateUtc value. */ public OffsetDateTime createdDateUtc() { @@ -146,7 +176,7 @@ public OffsetDateTime createdDateUtc() { /** * Get the description property: The description of the alert rule template. - * + * * @return the description value. */ public String description() { @@ -155,7 +185,7 @@ public String description() { /** * Set the description property: The description of the alert rule template. - * + * * @param description the description value to set. * @return the ThreatIntelligenceAlertRuleTemplate object itself. */ @@ -169,7 +199,7 @@ public ThreatIntelligenceAlertRuleTemplate withDescription(String description) { /** * Get the displayName property: The display name for alert rule template. - * + * * @return the displayName value. */ public String displayName() { @@ -178,7 +208,7 @@ public String displayName() { /** * Set the displayName property: The display name for alert rule template. - * + * * @param displayName the displayName value to set. * @return the ThreatIntelligenceAlertRuleTemplate object itself. */ @@ -192,7 +222,7 @@ public ThreatIntelligenceAlertRuleTemplate withDisplayName(String displayName) { /** * Get the requiredDataConnectors property: The required data sources for this template. - * + * * @return the requiredDataConnectors value. */ public List requiredDataConnectors() { @@ -201,12 +231,12 @@ public List requiredDataConnectors() { /** * Set the requiredDataConnectors property: The required data sources for this template. - * + * * @param requiredDataConnectors the requiredDataConnectors value to set. * @return the ThreatIntelligenceAlertRuleTemplate object itself. */ - public ThreatIntelligenceAlertRuleTemplate withRequiredDataConnectors( - List requiredDataConnectors) { + public ThreatIntelligenceAlertRuleTemplate + withRequiredDataConnectors(List requiredDataConnectors) { if (this.innerProperties() == null) { this.innerProperties = new ThreatIntelligenceAlertRuleTemplateProperties(); } @@ -216,7 +246,7 @@ public ThreatIntelligenceAlertRuleTemplate withRequiredDataConnectors( /** * Get the status property: The alert rule template status. - * + * * @return the status value. */ public TemplateStatus status() { @@ -225,7 +255,7 @@ public TemplateStatus status() { /** * Set the status property: The alert rule template status. - * + * * @param status the status value to set. * @return the ThreatIntelligenceAlertRuleTemplate object itself. */ @@ -239,7 +269,7 @@ public ThreatIntelligenceAlertRuleTemplate withStatus(TemplateStatus status) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 847257381b59..88f198da30d3 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Array of tags to be appended to the threat intelligence indicator. */ +/** + * Array of tags to be appended to the threat intelligence indicator. + */ @Fluent public final class ThreatIntelligenceAppendTags { /* @@ -17,9 +19,15 @@ public final class ThreatIntelligenceAppendTags { @JsonProperty(value = "threatIntelligenceTags") private List threatIntelligenceTags; + /** + * Creates an instance of ThreatIntelligenceAppendTags class. + */ + public ThreatIntelligenceAppendTags() { + } + /** * Get the threatIntelligenceTags property: List of tags to be appended. - * + * * @return the threatIntelligenceTags value. */ public List threatIntelligenceTags() { @@ -28,7 +36,7 @@ public List threatIntelligenceTags() { /** * Set the threatIntelligenceTags property: List of tags to be appended. - * + * * @param threatIntelligenceTags the threatIntelligenceTags value to set. * @return the ThreatIntelligenceAppendTags object itself. */ @@ -39,7 +47,7 @@ public ThreatIntelligenceAppendTags withThreatIntelligenceTags(List thre /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceCount.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceCount.java new file mode 100644 index 000000000000..056ff43cf15a --- /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) AutoRest 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 689e8a88e564..f6eddced05b0 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Describes external reference. */ +/** + * Describes external reference. + */ @Fluent public final class ThreatIntelligenceExternalReference { /* @@ -43,9 +45,15 @@ public final class ThreatIntelligenceExternalReference { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map hashes; + /** + * Creates an instance of ThreatIntelligenceExternalReference class. + */ + public ThreatIntelligenceExternalReference() { + } + /** * Get the description property: External reference description. - * + * * @return the description value. */ public String description() { @@ -54,7 +62,7 @@ public String description() { /** * Set the description property: External reference description. - * + * * @param description the description value to set. * @return the ThreatIntelligenceExternalReference object itself. */ @@ -65,7 +73,7 @@ public ThreatIntelligenceExternalReference withDescription(String description) { /** * Get the externalId property: External reference ID. - * + * * @return the externalId value. */ public String externalId() { @@ -74,7 +82,7 @@ public String externalId() { /** * Set the externalId property: External reference ID. - * + * * @param externalId the externalId value to set. * @return the ThreatIntelligenceExternalReference object itself. */ @@ -85,7 +93,7 @@ public ThreatIntelligenceExternalReference withExternalId(String externalId) { /** * Get the sourceName property: External reference source name. - * + * * @return the sourceName value. */ public String sourceName() { @@ -94,7 +102,7 @@ public String sourceName() { /** * Set the sourceName property: External reference source name. - * + * * @param sourceName the sourceName value to set. * @return the ThreatIntelligenceExternalReference object itself. */ @@ -105,7 +113,7 @@ public ThreatIntelligenceExternalReference withSourceName(String sourceName) { /** * Get the url property: External reference URL. - * + * * @return the url value. */ public String url() { @@ -114,7 +122,7 @@ public String url() { /** * Set the url property: External reference URL. - * + * * @param url the url value to set. * @return the ThreatIntelligenceExternalReference object itself. */ @@ -125,7 +133,7 @@ public ThreatIntelligenceExternalReference withUrl(String url) { /** * Get the hashes property: External reference hashes. - * + * * @return the hashes value. */ public Map hashes() { @@ -134,7 +142,7 @@ public Map hashes() { /** * Set the hashes property: External reference hashes. - * + * * @param hashes the hashes value to set. * @return the ThreatIntelligenceExternalReference object itself. */ @@ -145,7 +153,7 @@ public ThreatIntelligenceExternalReference withHashes(Map hashes /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceFilteringCriteria.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceFilteringCriteria.java index 86be0cc60915..b2dfd0fd31f5 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Filtering criteria for querying threat intelligence indicators. */ +/** + * Filtering criteria for querying threat intelligence indicators. + */ @Fluent public final class ThreatIntelligenceFilteringCriteria { /* @@ -89,9 +91,15 @@ public final class ThreatIntelligenceFilteringCriteria { @JsonProperty(value = "skipToken") private String skipToken; + /** + * Creates an instance of ThreatIntelligenceFilteringCriteria class. + */ + public ThreatIntelligenceFilteringCriteria() { + } + /** * Get the pageSize property: Page size. - * + * * @return the pageSize value. */ public Integer pageSize() { @@ -100,7 +108,7 @@ public Integer pageSize() { /** * Set the pageSize property: Page size. - * + * * @param pageSize the pageSize value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -111,7 +119,7 @@ public ThreatIntelligenceFilteringCriteria withPageSize(Integer pageSize) { /** * Get the minConfidence property: Minimum confidence. - * + * * @return the minConfidence value. */ public Integer minConfidence() { @@ -120,7 +128,7 @@ public Integer minConfidence() { /** * Set the minConfidence property: Minimum confidence. - * + * * @param minConfidence the minConfidence value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -131,7 +139,7 @@ public ThreatIntelligenceFilteringCriteria withMinConfidence(Integer minConfiden /** * Get the maxConfidence property: Maximum confidence. - * + * * @return the maxConfidence value. */ public Integer maxConfidence() { @@ -140,7 +148,7 @@ public Integer maxConfidence() { /** * Set the maxConfidence property: Maximum confidence. - * + * * @param maxConfidence the maxConfidence value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -151,7 +159,7 @@ public ThreatIntelligenceFilteringCriteria withMaxConfidence(Integer maxConfiden /** * Get the minValidUntil property: Start time for ValidUntil filter. - * + * * @return the minValidUntil value. */ public String minValidUntil() { @@ -160,7 +168,7 @@ public String minValidUntil() { /** * Set the minValidUntil property: Start time for ValidUntil filter. - * + * * @param minValidUntil the minValidUntil value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -171,7 +179,7 @@ public ThreatIntelligenceFilteringCriteria withMinValidUntil(String minValidUnti /** * Get the maxValidUntil property: End time for ValidUntil filter. - * + * * @return the maxValidUntil value. */ public String maxValidUntil() { @@ -180,7 +188,7 @@ public String maxValidUntil() { /** * Set the maxValidUntil property: End time for ValidUntil filter. - * + * * @param maxValidUntil the maxValidUntil value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -191,7 +199,7 @@ public ThreatIntelligenceFilteringCriteria withMaxValidUntil(String maxValidUnti /** * Get the includeDisabled property: Parameter to include/exclude disabled indicators. - * + * * @return the includeDisabled value. */ public Boolean includeDisabled() { @@ -200,7 +208,7 @@ public Boolean includeDisabled() { /** * Set the includeDisabled property: Parameter to include/exclude disabled indicators. - * + * * @param includeDisabled the includeDisabled value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -211,7 +219,7 @@ public ThreatIntelligenceFilteringCriteria withIncludeDisabled(Boolean includeDi /** * Get the sortBy property: Columns to sort by and sorting order. - * + * * @return the sortBy value. */ public List sortBy() { @@ -220,7 +228,7 @@ public List sortBy() { /** * Set the sortBy property: Columns to sort by and sorting order. - * + * * @param sortBy the sortBy value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -231,7 +239,7 @@ public ThreatIntelligenceFilteringCriteria withSortBy(List sources() { @@ -240,7 +248,7 @@ public List sources() { /** * Set the sources property: Sources of threat intelligence indicators. - * + * * @param sources the sources value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -251,7 +259,7 @@ public ThreatIntelligenceFilteringCriteria withSources(List sources) { /** * Get the patternTypes property: Pattern types. - * + * * @return the patternTypes value. */ public List patternTypes() { @@ -260,7 +268,7 @@ public List patternTypes() { /** * Set the patternTypes property: Pattern types. - * + * * @param patternTypes the patternTypes value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -271,7 +279,7 @@ public ThreatIntelligenceFilteringCriteria withPatternTypes(List pattern /** * Get the threatTypes property: Threat types of threat intelligence indicators. - * + * * @return the threatTypes value. */ public List threatTypes() { @@ -280,7 +288,7 @@ public List threatTypes() { /** * Set the threatTypes property: Threat types of threat intelligence indicators. - * + * * @param threatTypes the threatTypes value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -291,7 +299,7 @@ public ThreatIntelligenceFilteringCriteria withThreatTypes(List threatTy /** * Get the ids property: Ids of threat intelligence indicators. - * + * * @return the ids value. */ public List ids() { @@ -300,7 +308,7 @@ public List ids() { /** * Set the ids property: Ids of threat intelligence indicators. - * + * * @param ids the ids value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -311,7 +319,7 @@ public ThreatIntelligenceFilteringCriteria withIds(List ids) { /** * Get the keywords property: Keywords for searching threat intelligence indicators. - * + * * @return the keywords value. */ public List keywords() { @@ -320,7 +328,7 @@ public List keywords() { /** * Set the keywords property: Keywords for searching threat intelligence indicators. - * + * * @param keywords the keywords value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -331,7 +339,7 @@ public ThreatIntelligenceFilteringCriteria withKeywords(List keywords) { /** * Get the skipToken property: Skip token. - * + * * @return the skipToken value. */ public String skipToken() { @@ -340,7 +348,7 @@ public String skipToken() { /** * Set the skipToken property: Skip token. - * + * * @param skipToken the skipToken value to set. * @return the ThreatIntelligenceFilteringCriteria object itself. */ @@ -351,7 +359,7 @@ public ThreatIntelligenceFilteringCriteria withSkipToken(String skipToken) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceGranularMarkingModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceGranularMarkingModel.java index bb55e6966794..7d2f3d18531b 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes threat granular marking model entity. */ +/** + * Describes threat granular marking model entity. + */ @Fluent public final class ThreatIntelligenceGranularMarkingModel { /* @@ -29,9 +31,15 @@ public final class ThreatIntelligenceGranularMarkingModel { @JsonProperty(value = "selectors") private List selectors; + /** + * Creates an instance of ThreatIntelligenceGranularMarkingModel class. + */ + public ThreatIntelligenceGranularMarkingModel() { + } + /** * Get the language property: Language granular marking model. - * + * * @return the language value. */ public String language() { @@ -40,7 +48,7 @@ public String language() { /** * Set the language property: Language granular marking model. - * + * * @param language the language value to set. * @return the ThreatIntelligenceGranularMarkingModel object itself. */ @@ -51,7 +59,7 @@ public ThreatIntelligenceGranularMarkingModel withLanguage(String language) { /** * Get the markingRef property: marking reference granular marking model. - * + * * @return the markingRef value. */ public Integer markingRef() { @@ -60,7 +68,7 @@ public Integer markingRef() { /** * Set the markingRef property: marking reference granular marking model. - * + * * @param markingRef the markingRef value to set. * @return the ThreatIntelligenceGranularMarkingModel object itself. */ @@ -71,7 +79,7 @@ public ThreatIntelligenceGranularMarkingModel withMarkingRef(Integer markingRef) /** * Get the selectors property: granular marking model selectors. - * + * * @return the selectors value. */ public List selectors() { @@ -80,7 +88,7 @@ public List selectors() { /** * Set the selectors property: granular marking model selectors. - * + * * @param selectors the selectors value to set. * @return the ThreatIntelligenceGranularMarkingModel object itself. */ @@ -91,7 +99,7 @@ public ThreatIntelligenceGranularMarkingModel withSelectors(List selecto /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorMetrics.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorMetrics.java index a9e60f800660..c38e82b5539a 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 @@ -7,32 +7,34 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ThreatIntelligenceIndicatorMetrics. */ +/** + * Resource collection API of ThreatIntelligenceIndicatorMetrics. + */ public interface ThreatIntelligenceIndicatorMetrics { /** * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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). + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source) along with + * {@link Response}. */ - ThreatIntelligenceMetricsList list(String resourceGroupName, String workspaceName); + Response listWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). */ - Response listWithResponse( - String resourceGroupName, String workspaceName, Context context); + ThreatIntelligenceMetricsList list(String resourceGroupName, String workspaceName); } 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 5ce9f114369e..3af27f455297 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 @@ -8,32 +8,64 @@ import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceIndicatorProperties; import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; import java.util.Map; -/** Threat intelligence indicator entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Threat intelligence indicator entity. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = ThreatIntelligenceIndicatorModel.class, + visible = true) @JsonTypeName("indicator") @Fluent public final class ThreatIntelligenceIndicatorModel extends ThreatIntelligenceInformationInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ThreatIntelligenceResourceInnerKind kind = ThreatIntelligenceResourceInnerKind.INDICATOR; + /* * Threat Intelligence Entity properties */ @JsonProperty(value = "properties") private ThreatIntelligenceIndicatorProperties innerProperties; + /** + * Creates an instance of ThreatIntelligenceIndicatorModel class. + */ + public ThreatIntelligenceIndicatorModel() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public ThreatIntelligenceResourceInnerKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Threat Intelligence Entity properties. - * + * * @return the innerProperties value. */ private ThreatIntelligenceIndicatorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ThreatIntelligenceIndicatorModel withEtag(String etag) { super.withEtag(etag); @@ -42,7 +74,7 @@ public ThreatIntelligenceIndicatorModel withEtag(String etag) { /** * Get the threatIntelligenceTags property: List of tags. - * + * * @return the threatIntelligenceTags value. */ public List threatIntelligenceTags() { @@ -51,7 +83,7 @@ public List threatIntelligenceTags() { /** * Set the threatIntelligenceTags property: List of tags. - * + * * @param threatIntelligenceTags the threatIntelligenceTags value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -65,7 +97,7 @@ public ThreatIntelligenceIndicatorModel withThreatIntelligenceTags(List /** * Get the lastUpdatedTimeUtc property: Last updated time in UTC. - * + * * @return the lastUpdatedTimeUtc value. */ public String lastUpdatedTimeUtc() { @@ -74,7 +106,7 @@ public String lastUpdatedTimeUtc() { /** * Set the lastUpdatedTimeUtc property: Last updated time in UTC. - * + * * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -88,7 +120,7 @@ public ThreatIntelligenceIndicatorModel withLastUpdatedTimeUtc(String lastUpdate /** * Get the source property: Source of a threat intelligence entity. - * + * * @return the source value. */ public String source() { @@ -97,7 +129,7 @@ public String source() { /** * Set the source property: Source of a threat intelligence entity. - * + * * @param source the source value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -111,7 +143,7 @@ public ThreatIntelligenceIndicatorModel withSource(String source) { /** * Get the displayName property: Display name of a threat intelligence entity. - * + * * @return the displayName value. */ public String displayName() { @@ -120,7 +152,7 @@ public String displayName() { /** * Set the displayName property: Display name of a threat intelligence entity. - * + * * @param displayName the displayName value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -134,7 +166,7 @@ public ThreatIntelligenceIndicatorModel withDisplayName(String displayName) { /** * Get the description property: Description of a threat intelligence entity. - * + * * @return the description value. */ public String description() { @@ -143,7 +175,7 @@ public String description() { /** * Set the description property: Description of a threat intelligence entity. - * + * * @param description the description value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -157,7 +189,7 @@ public ThreatIntelligenceIndicatorModel withDescription(String description) { /** * Get the indicatorTypes property: Indicator types of threat intelligence entities. - * + * * @return the indicatorTypes value. */ public List indicatorTypes() { @@ -166,7 +198,7 @@ public List indicatorTypes() { /** * Set the indicatorTypes property: Indicator types of threat intelligence entities. - * + * * @param indicatorTypes the indicatorTypes value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -180,7 +212,7 @@ public ThreatIntelligenceIndicatorModel withIndicatorTypes(List indicato /** * Get the pattern property: Pattern of a threat intelligence entity. - * + * * @return the pattern value. */ public String pattern() { @@ -189,7 +221,7 @@ public String pattern() { /** * Set the pattern property: Pattern of a threat intelligence entity. - * + * * @param pattern the pattern value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -203,7 +235,7 @@ public ThreatIntelligenceIndicatorModel withPattern(String pattern) { /** * Get the patternType property: Pattern type of a threat intelligence entity. - * + * * @return the patternType value. */ public String patternType() { @@ -212,7 +244,7 @@ public String patternType() { /** * Set the patternType property: Pattern type of a threat intelligence entity. - * + * * @param patternType the patternType value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -226,7 +258,7 @@ public ThreatIntelligenceIndicatorModel withPatternType(String patternType) { /** * Get the patternVersion property: Pattern version of a threat intelligence entity. - * + * * @return the patternVersion value. */ public String patternVersion() { @@ -235,7 +267,7 @@ public String patternVersion() { /** * Set the patternVersion property: Pattern version of a threat intelligence entity. - * + * * @param patternVersion the patternVersion value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -249,7 +281,7 @@ public ThreatIntelligenceIndicatorModel withPatternVersion(String patternVersion /** * Get the killChainPhases property: Kill chain phases. - * + * * @return the killChainPhases value. */ public List killChainPhases() { @@ -258,12 +290,12 @@ public List killChainPhases() { /** * Set the killChainPhases property: Kill chain phases. - * + * * @param killChainPhases the killChainPhases value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ - public ThreatIntelligenceIndicatorModel withKillChainPhases( - List killChainPhases) { + public ThreatIntelligenceIndicatorModel + withKillChainPhases(List killChainPhases) { if (this.innerProperties() == null) { this.innerProperties = new ThreatIntelligenceIndicatorProperties(); } @@ -273,7 +305,7 @@ public ThreatIntelligenceIndicatorModel withKillChainPhases( /** * Get the parsedPattern property: Parsed patterns. - * + * * @return the parsedPattern value. */ public List parsedPattern() { @@ -282,7 +314,7 @@ public List parsedPattern() { /** * Set the parsedPattern property: Parsed patterns. - * + * * @param parsedPattern the parsedPattern value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -296,7 +328,7 @@ public ThreatIntelligenceIndicatorModel withParsedPattern(List externalReferences() { @@ -397,12 +429,12 @@ public List externalReferences() { /** * Set the externalReferences property: External References. - * + * * @param externalReferences the externalReferences value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ - public ThreatIntelligenceIndicatorModel withExternalReferences( - List externalReferences) { + public ThreatIntelligenceIndicatorModel + withExternalReferences(List externalReferences) { if (this.innerProperties() == null) { this.innerProperties = new ThreatIntelligenceIndicatorProperties(); } @@ -412,7 +444,7 @@ public ThreatIntelligenceIndicatorModel withExternalReferences( /** * Get the granularMarkings property: Granular Markings. - * + * * @return the granularMarkings value. */ public List granularMarkings() { @@ -421,12 +453,12 @@ public List granularMarkings() { /** * Set the granularMarkings property: Granular Markings. - * + * * @param granularMarkings the granularMarkings value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ - public ThreatIntelligenceIndicatorModel withGranularMarkings( - List granularMarkings) { + public ThreatIntelligenceIndicatorModel + withGranularMarkings(List granularMarkings) { if (this.innerProperties() == null) { this.innerProperties = new ThreatIntelligenceIndicatorProperties(); } @@ -436,7 +468,7 @@ public ThreatIntelligenceIndicatorModel withGranularMarkings( /** * Get the labels property: Labels of threat intelligence entity. - * + * * @return the labels value. */ public List labels() { @@ -445,7 +477,7 @@ public List labels() { /** * Set the labels property: Labels of threat intelligence entity. - * + * * @param labels the labels value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -459,7 +491,7 @@ public ThreatIntelligenceIndicatorModel withLabels(List labels) { /** * Get the revoked property: Is threat intelligence entity revoked. - * + * * @return the revoked value. */ public Boolean revoked() { @@ -468,7 +500,7 @@ public Boolean revoked() { /** * Set the revoked property: Is threat intelligence entity revoked. - * + * * @param revoked the revoked value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -482,7 +514,7 @@ public ThreatIntelligenceIndicatorModel withRevoked(Boolean revoked) { /** * Get the confidence property: Confidence of threat intelligence entity. - * + * * @return the confidence value. */ public Integer confidence() { @@ -491,7 +523,7 @@ public Integer confidence() { /** * Set the confidence property: Confidence of threat intelligence entity. - * + * * @param confidence the confidence value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -505,7 +537,7 @@ public ThreatIntelligenceIndicatorModel withConfidence(Integer confidence) { /** * Get the objectMarkingRefs property: Threat intelligence entity object marking references. - * + * * @return the objectMarkingRefs value. */ public List objectMarkingRefs() { @@ -514,7 +546,7 @@ public List objectMarkingRefs() { /** * Set the objectMarkingRefs property: Threat intelligence entity object marking references. - * + * * @param objectMarkingRefs the objectMarkingRefs value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -528,7 +560,7 @@ public ThreatIntelligenceIndicatorModel withObjectMarkingRefs(List objec /** * Get the language property: Language of threat intelligence entity. - * + * * @return the language value. */ public String language() { @@ -537,7 +569,7 @@ public String language() { /** * Set the language property: Language of threat intelligence entity. - * + * * @param language the language value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -551,7 +583,7 @@ public ThreatIntelligenceIndicatorModel withLanguage(String language) { /** * Get the threatTypes property: Threat types. - * + * * @return the threatTypes value. */ public List threatTypes() { @@ -560,7 +592,7 @@ public List threatTypes() { /** * Set the threatTypes property: Threat types. - * + * * @param threatTypes the threatTypes value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -574,7 +606,7 @@ public ThreatIntelligenceIndicatorModel withThreatTypes(List threatTypes /** * Get the validFrom property: Valid from. - * + * * @return the validFrom value. */ public String validFrom() { @@ -583,7 +615,7 @@ public String validFrom() { /** * Set the validFrom property: Valid from. - * + * * @param validFrom the validFrom value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -597,7 +629,7 @@ public ThreatIntelligenceIndicatorModel withValidFrom(String validFrom) { /** * Get the validUntil property: Valid until. - * + * * @return the validUntil value. */ public String validUntil() { @@ -606,7 +638,7 @@ public String validUntil() { /** * Set the validUntil property: Valid until. - * + * * @param validUntil the validUntil value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -620,7 +652,7 @@ public ThreatIntelligenceIndicatorModel withValidUntil(String validUntil) { /** * Get the created property: Created by. - * + * * @return the created value. */ public String created() { @@ -629,7 +661,7 @@ public String created() { /** * Set the created property: Created by. - * + * * @param created the created value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -643,7 +675,7 @@ public ThreatIntelligenceIndicatorModel withCreated(String created) { /** * Get the modified property: Modified by. - * + * * @return the modified value. */ public String modified() { @@ -652,7 +684,7 @@ public String modified() { /** * Set the modified property: Modified by. - * + * * @param modified the modified value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -666,7 +698,7 @@ public ThreatIntelligenceIndicatorModel withModified(String modified) { /** * Get the extensions property: Extensions map. - * + * * @return the extensions value. */ public Map extensions() { @@ -675,7 +707,7 @@ public Map extensions() { /** * Set the extensions property: Extensions map. - * + * * @param extensions the extensions value to set. * @return the ThreatIntelligenceIndicatorModel object itself. */ @@ -690,7 +722,7 @@ public ThreatIntelligenceIndicatorModel withExtensions(Map exten /** * 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() { @@ -700,7 +732,7 @@ public Map 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() { @@ -709,7 +741,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 464cb4b65fbe..357b2b99efda 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 @@ -8,135 +8,127 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ThreatIntelligenceIndicators. */ +/** + * 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. + * @return threat intelligence information object along with {@link Response}. */ - ThreatIntelligenceInformation createIndicator( - String resourceGroupName, String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 threat intelligence information object. */ - Response createIndicatorWithResponse( - String resourceGroupName, - String workspaceName, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - Context context); + 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 name Threat intelligence indicator name field. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object. + * @return threat intelligence information object along with {@link Response}. */ - ThreatIntelligenceInformation get(String resourceGroupName, String workspaceName, String name); + Response getWithResponse(String resourceGroupName, String workspaceName, String name, + Context context); /** * View a threat intelligence indicator by name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 threat intelligence information object. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String name, Context context); + ThreatIntelligenceInformation get(String resourceGroupName, String workspaceName, String name); /** * Update a threat Intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object. + * @return threat intelligence information object along with {@link Response}. */ - ThreatIntelligenceInformation create( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties); + Response createWithResponse(String resourceGroupName, String workspaceName, + String name, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, Context context); /** * Update a threat Intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceProperties Properties of threat intelligence indicators to create and update. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 threat intelligence information object. */ - Response createWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - Context context); + ThreatIntelligenceInformation create(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceIndicatorModel threatIntelligenceProperties); /** * Delete a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String name); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, Context context); /** * Delete a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 name, Context context); + 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. @@ -145,14 +137,12 @@ Response createWithResponse( * @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, + 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. @@ -162,84 +152,67 @@ PagedIterable queryIndicators( * @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); + PagedIterable queryIndicators(String resourceGroupName, String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, Context context); /** * Append tags to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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}. */ - void appendTags( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceAppendTags threatIntelligenceAppendTags); + Response appendTagsWithResponse(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, Context context); /** * Append tags to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceAppendTags The threat intelligence append tags request body. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 appendTagsWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceAppendTags threatIntelligenceAppendTags, - Context context); + void appendTags(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags); /** * Replace tags added to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return threat intelligence information object. + * @return threat intelligence information object along with {@link Response}. */ - ThreatIntelligenceInformation replaceTags( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags); + Response replaceTagsWithResponse(String resourceGroupName, String workspaceName, + String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, Context context); /** * Replace tags added to a threat intelligence indicator. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param name Threat intelligence indicator name field. * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 threat intelligence information object. */ - Response replaceTagsWithResponse( - String resourceGroupName, - String workspaceName, - String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, - Context context); + ThreatIntelligenceInformation replaceTags(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags); } 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 444a66aa1384..e654e1eeb98d 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 @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of ThreatIntelligenceIndicatorsOperations. */ +/** + * Resource collection API of ThreatIntelligenceIndicatorsOperations. + */ public interface ThreatIntelligenceIndicatorsOperations { /** * Get all threat intelligence indicators. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -23,27 +25,21 @@ 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 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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all threat intelligence indicators as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String workspaceName, - String filter, - String orderby, - Integer top, - String skipToken, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, Context context); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformation.java index 542cf50924ff..ab7279512d3c 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 @@ -7,47 +7,56 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; -/** An immutable client-side representation of ThreatIntelligenceInformation. */ +/** + * An immutable client-side representation of ThreatIntelligenceInformation. + */ public interface ThreatIntelligenceInformation { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the kind property: The kind of the entity. + * + * @return the kind value. + */ + ThreatIntelligenceResourceInnerKind kind(); + /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner * object. - * + * * @return the inner object. */ ThreatIntelligenceInformationInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformationList.java index 63195abe89bb..47fe85c65387 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/models/ThreatIntelligenceInformationList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the threat intelligence information objects. */ +/** + * List of all the threat intelligence information objects. + */ @Fluent public final class ThreatIntelligenceInformationList { /* @@ -25,9 +27,15 @@ public final class ThreatIntelligenceInformationList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of ThreatIntelligenceInformationList class. + */ + public ThreatIntelligenceInformationList() { + } + /** * Get the nextLink property: URL to fetch the next set of information objects. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of threat intelligence information objects. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ 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. */ @@ -56,15 +64,14 @@ public ThreatIntelligenceInformationList withValue(List e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceKillChainPhase.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceKillChainPhase.java index 8a1ba6f2bd1d..b6b542c91d0f 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes threat kill chain phase entity. */ +/** + * Describes threat kill chain phase entity. + */ @Fluent public final class ThreatIntelligenceKillChainPhase { /* @@ -22,9 +24,15 @@ public final class ThreatIntelligenceKillChainPhase { @JsonProperty(value = "phaseName") private String phaseName; + /** + * Creates an instance of ThreatIntelligenceKillChainPhase class. + */ + public ThreatIntelligenceKillChainPhase() { + } + /** * Get the killChainName property: Kill chainName name. - * + * * @return the killChainName value. */ public String killChainName() { @@ -33,7 +41,7 @@ public String killChainName() { /** * Set the killChainName property: Kill chainName name. - * + * * @param killChainName the killChainName value to set. * @return the ThreatIntelligenceKillChainPhase object itself. */ @@ -44,7 +52,7 @@ public ThreatIntelligenceKillChainPhase withKillChainName(String killChainName) /** * Get the phaseName property: Phase name. - * + * * @return the phaseName value. */ public String phaseName() { @@ -53,7 +61,7 @@ public String phaseName() { /** * Set the phaseName property: Phase name. - * + * * @param phaseName the phaseName value to set. * @return the ThreatIntelligenceKillChainPhase object itself. */ @@ -64,7 +72,7 @@ public ThreatIntelligenceKillChainPhase withPhaseName(String phaseName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceList.java new file mode 100644 index 000000000000..f62d96844b7a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List all the threat intelligence objects on the workspace that match the provided query. + */ +@Fluent +public final class ThreatIntelligenceList { + /* + * URL to fetch the next set of threat intelligence objects. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of threat intelligence objects on the workspace that match the provided query. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of ThreatIntelligenceList class. + */ + public ThreatIntelligenceList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of threat intelligence objects. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of threat intelligence objects on the workspace that match the provided query. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of threat intelligence objects on the workspace that match the provided query. + * + * @param value the value value to set. + * @return the ThreatIntelligenceList object itself. + */ + public ThreatIntelligenceList 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 ThreatIntelligenceList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ThreatIntelligenceList.class); +} 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 2cb0c00e17c5..586c2a64c05d 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes threat intelligence metric. */ +/** + * Describes threat intelligence metric. + */ @Fluent public final class ThreatIntelligenceMetric { /* @@ -35,9 +37,15 @@ public final class ThreatIntelligenceMetric { @JsonProperty(value = "sourceMetrics") private List sourceMetrics; + /** + * Creates an instance of ThreatIntelligenceMetric class. + */ + public ThreatIntelligenceMetric() { + } + /** * Get the lastUpdatedTimeUtc property: Last updated indicator metric. - * + * * @return the lastUpdatedTimeUtc value. */ public String lastUpdatedTimeUtc() { @@ -46,7 +54,7 @@ public String lastUpdatedTimeUtc() { /** * Set the lastUpdatedTimeUtc property: Last updated indicator metric. - * + * * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. * @return the ThreatIntelligenceMetric object itself. */ @@ -57,7 +65,7 @@ public ThreatIntelligenceMetric withLastUpdatedTimeUtc(String lastUpdatedTimeUtc /** * Get the threatTypeMetrics property: Threat type metrics. - * + * * @return the threatTypeMetrics value. */ public List threatTypeMetrics() { @@ -66,7 +74,7 @@ public List threatTypeMetrics() { /** * Set the threatTypeMetrics property: Threat type metrics. - * + * * @param threatTypeMetrics the threatTypeMetrics value to set. * @return the ThreatIntelligenceMetric object itself. */ @@ -77,7 +85,7 @@ public ThreatIntelligenceMetric withThreatTypeMetrics(List patternTypeMetrics() { @@ -86,7 +94,7 @@ public List patternTypeMetrics() { /** * Set the patternTypeMetrics property: Pattern type metrics. - * + * * @param patternTypeMetrics the patternTypeMetrics value to set. * @return the ThreatIntelligenceMetric object itself. */ @@ -97,7 +105,7 @@ public ThreatIntelligenceMetric withPatternTypeMetrics(List sourceMetrics() { @@ -106,7 +114,7 @@ public List sourceMetrics() { /** * Set the sourceMetrics property: Source metrics. - * + * * @param sourceMetrics the sourceMetrics value to set. * @return the ThreatIntelligenceMetric object itself. */ @@ -117,7 +125,7 @@ public ThreatIntelligenceMetric withSourceMetrics(List value(); @@ -19,7 +21,7 @@ public interface ThreatIntelligenceMetricsList { /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner * object. - * + * * @return the inner object. */ ThreatIntelligenceMetricsListInner innerModel(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPattern.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPattern.java index 1a80738051c9..2b5945aae470 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPattern.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPattern.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes parsed pattern entity. */ +/** + * Describes parsed pattern entity. + */ @Fluent public final class ThreatIntelligenceParsedPattern { /* @@ -23,9 +25,15 @@ public final class ThreatIntelligenceParsedPattern { @JsonProperty(value = "patternTypeValues") private List patternTypeValues; + /** + * Creates an instance of ThreatIntelligenceParsedPattern class. + */ + public ThreatIntelligenceParsedPattern() { + } + /** * Get the patternTypeKey property: Pattern type key. - * + * * @return the patternTypeKey value. */ public String patternTypeKey() { @@ -34,7 +42,7 @@ public String patternTypeKey() { /** * Set the patternTypeKey property: Pattern type key. - * + * * @param patternTypeKey the patternTypeKey value to set. * @return the ThreatIntelligenceParsedPattern object itself. */ @@ -45,7 +53,7 @@ public ThreatIntelligenceParsedPattern withPatternTypeKey(String patternTypeKey) /** * Get the patternTypeValues property: Pattern type keys. - * + * * @return the patternTypeValues value. */ public List patternTypeValues() { @@ -54,19 +62,19 @@ public List patternTypeValues() { /** * Set the patternTypeValues property: Pattern type keys. - * + * * @param patternTypeValues the patternTypeValues value to set. * @return the ThreatIntelligenceParsedPattern object itself. */ - public ThreatIntelligenceParsedPattern withPatternTypeValues( - List patternTypeValues) { + public ThreatIntelligenceParsedPattern + withPatternTypeValues(List patternTypeValues) { this.patternTypeValues = patternTypeValues; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 ead9ca6b8833..1fafbfdcb807 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes threat kill chain phase entity. */ +/** + * Describes threat kill chain phase entity. + */ @Fluent public final class ThreatIntelligenceParsedPatternTypeValue { /* @@ -22,9 +24,15 @@ public final class ThreatIntelligenceParsedPatternTypeValue { @JsonProperty(value = "value") private String value; + /** + * Creates an instance of ThreatIntelligenceParsedPatternTypeValue class. + */ + public ThreatIntelligenceParsedPatternTypeValue() { + } + /** * Get the valueType property: Type of the value. - * + * * @return the valueType value. */ public String valueType() { @@ -33,7 +41,7 @@ public String valueType() { /** * Set the valueType property: Type of the value. - * + * * @param valueType the valueType value to set. * @return the ThreatIntelligenceParsedPatternTypeValue object itself. */ @@ -44,7 +52,7 @@ public ThreatIntelligenceParsedPatternTypeValue withValueType(String valueType) /** * Get the value property: Value of parsed pattern. - * + * * @return the value value. */ public String value() { @@ -53,7 +61,7 @@ public String value() { /** * Set the value property: Value of parsed pattern. - * + * * @param value the value value to set. * @return the ThreatIntelligenceParsedPatternTypeValue object itself. */ @@ -64,7 +72,7 @@ public ThreatIntelligenceParsedPatternTypeValue withValue(String value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceInnerKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceInnerKind.java new file mode 100644 index 000000000000..8aafd5bb9692 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceInnerKind.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The kind of the threat intelligence entity. + */ +public final class ThreatIntelligenceResourceInnerKind + extends ExpandableStringEnum { + /** + * Static value indicator for ThreatIntelligenceResourceInnerKind. + */ + public static final ThreatIntelligenceResourceInnerKind INDICATOR = fromString("indicator"); + + /** + * Creates a new instance of ThreatIntelligenceResourceInnerKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ThreatIntelligenceResourceInnerKind() { + } + + /** + * Creates or finds a ThreatIntelligenceResourceInnerKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ThreatIntelligenceResourceInnerKind. + */ + @JsonCreator + public static ThreatIntelligenceResourceInnerKind fromString(String name) { + return fromString(name, ThreatIntelligenceResourceInnerKind.class); + } + + /** + * Gets known ThreatIntelligenceResourceInnerKind values. + * + * @return known ThreatIntelligenceResourceInnerKind values. + */ + public static Collection values() { + return values(ThreatIntelligenceResourceInnerKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKindEnum.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKindEnum.java deleted file mode 100644 index 6595128b74d9..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceKindEnum.java +++ /dev/null @@ -1,35 +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 com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The kind of the threat intelligence entity. */ -public final class ThreatIntelligenceResourceKindEnum extends ExpandableStringEnum { - /** Static value indicator for ThreatIntelligenceResourceKindEnum. */ - public static final ThreatIntelligenceResourceKindEnum INDICATOR = fromString("indicator"); - - /** - * Creates or finds a ThreatIntelligenceResourceKindEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding ThreatIntelligenceResourceKindEnum. - */ - @JsonCreator - public static ThreatIntelligenceResourceKindEnum fromString(String name) { - return fromString(name, ThreatIntelligenceResourceKindEnum.class); - } - - /** - * Gets known ThreatIntelligenceResourceKindEnum values. - * - * @return known ThreatIntelligenceResourceKindEnum values. - */ - public static Collection values() { - return values(ThreatIntelligenceResourceKindEnum.class); - } -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteria.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteria.java index 7c51d95d08ad..fb9fbe2be339 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** List of available columns for sorting. */ +/** + * List of available columns for sorting. + */ @Fluent public final class ThreatIntelligenceSortingCriteria { /* @@ -20,11 +22,17 @@ public final class ThreatIntelligenceSortingCriteria { * Sorting order (ascending/descending/unsorted). */ @JsonProperty(value = "sortOrder") - private ThreatIntelligenceSortingCriteriaEnum sortOrder; + private ThreatIntelligenceSortingOrder sortOrder; + + /** + * Creates an instance of ThreatIntelligenceSortingCriteria class. + */ + public ThreatIntelligenceSortingCriteria() { + } /** * Get the itemKey property: Column name. - * + * * @return the itemKey value. */ public String itemKey() { @@ -33,7 +41,7 @@ public String itemKey() { /** * Set the itemKey property: Column name. - * + * * @param itemKey the itemKey value to set. * @return the ThreatIntelligenceSortingCriteria object itself. */ @@ -44,27 +52,27 @@ public ThreatIntelligenceSortingCriteria withItemKey(String itemKey) { /** * Get the sortOrder property: Sorting order (ascending/descending/unsorted). - * + * * @return the sortOrder value. */ - public ThreatIntelligenceSortingCriteriaEnum sortOrder() { + public ThreatIntelligenceSortingOrder sortOrder() { return this.sortOrder; } /** * Set the sortOrder property: Sorting order (ascending/descending/unsorted). - * + * * @param sortOrder the sortOrder value to set. * @return the ThreatIntelligenceSortingCriteria object itself. */ - public ThreatIntelligenceSortingCriteria withSortOrder(ThreatIntelligenceSortingCriteriaEnum sortOrder) { + public ThreatIntelligenceSortingCriteria withSortOrder(ThreatIntelligenceSortingOrder sortOrder) { this.sortOrder = sortOrder; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteriaEnum.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteriaEnum.java deleted file mode 100644 index c5933ebe8342..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteriaEnum.java +++ /dev/null @@ -1,42 +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 com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Sorting order (ascending/descending/unsorted). */ -public final class ThreatIntelligenceSortingCriteriaEnum - extends ExpandableStringEnum { - /** Static value unsorted for ThreatIntelligenceSortingCriteriaEnum. */ - public static final ThreatIntelligenceSortingCriteriaEnum UNSORTED = fromString("unsorted"); - - /** Static value ascending for ThreatIntelligenceSortingCriteriaEnum. */ - public static final ThreatIntelligenceSortingCriteriaEnum ASCENDING = fromString("ascending"); - - /** Static value descending for ThreatIntelligenceSortingCriteriaEnum. */ - public static final ThreatIntelligenceSortingCriteriaEnum DESCENDING = fromString("descending"); - - /** - * Creates or finds a ThreatIntelligenceSortingCriteriaEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding ThreatIntelligenceSortingCriteriaEnum. - */ - @JsonCreator - public static ThreatIntelligenceSortingCriteriaEnum fromString(String name) { - return fromString(name, ThreatIntelligenceSortingCriteriaEnum.class); - } - - /** - * Gets known ThreatIntelligenceSortingCriteriaEnum values. - * - * @return known ThreatIntelligenceSortingCriteriaEnum values. - */ - public static Collection values() { - return values(ThreatIntelligenceSortingCriteriaEnum.class); - } -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingOrder.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingOrder.java new file mode 100644 index 000000000000..d275e0bf6495 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingOrder.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Sorting order (ascending/descending/unsorted). + */ +public final class ThreatIntelligenceSortingOrder extends ExpandableStringEnum { + /** + * Static value unsorted for ThreatIntelligenceSortingOrder. + */ + public static final ThreatIntelligenceSortingOrder UNSORTED = fromString("unsorted"); + + /** + * Static value ascending for ThreatIntelligenceSortingOrder. + */ + public static final ThreatIntelligenceSortingOrder ASCENDING = fromString("ascending"); + + /** + * Static value descending for ThreatIntelligenceSortingOrder. + */ + public static final ThreatIntelligenceSortingOrder DESCENDING = fromString("descending"); + + /** + * Creates a new instance of ThreatIntelligenceSortingOrder value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ThreatIntelligenceSortingOrder() { + } + + /** + * Creates or finds a ThreatIntelligenceSortingOrder from its string representation. + * + * @param name a name to look for. + * @return the corresponding ThreatIntelligenceSortingOrder. + */ + @JsonCreator + public static ThreatIntelligenceSortingOrder fromString(String name) { + return fromString(name, ThreatIntelligenceSortingOrder.class); + } + + /** + * Gets known ThreatIntelligenceSortingOrder values. + * + * @return known ThreatIntelligenceSortingOrder values. + */ + public static Collection values() { + return values(ThreatIntelligenceSortingOrder.class); + } +} 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..8dd35861b512 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of 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, + Query 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, + QueryAutoGenerated 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 index a6e561d9e99e..500772e46ad9 100644 --- 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 @@ -7,32 +7,85 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiCheckRequirementsProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Threat Intelligence TAXII data connector check requirements. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Threat Intelligence TAXII data connector check requirements. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = TiTaxiiCheckRequirements.class, + visible = true) @JsonTypeName("ThreatIntelligenceTaxii") @Fluent public final class TiTaxiiCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.THREAT_INTELLIGENCE_TAXII; + /* * Threat Intelligence TAXII check required properties. */ @JsonProperty(value = "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. */ private 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 125e1dd55a28..7f97c1810f9f 100644 --- 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 @@ -8,31 +8,59 @@ import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiDataConnectorProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; -/** Data connector to pull Threat intelligence data from TAXII 2.0/2.1 server. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Data connector to pull Threat intelligence data from TAXII 2.0/2.1 server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = TiTaxiiDataConnector.class, visible = true) @JsonTypeName("ThreatIntelligenceTaxii") @Fluent public final class TiTaxiiDataConnector extends DataConnectorInner { + /* + * The data connector kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private DataConnectorKind kind = DataConnectorKind.THREAT_INTELLIGENCE_TAXII; + /* * Threat intelligence TAXII data connector properties. */ @JsonProperty(value = "properties") private TiTaxiiDataConnectorProperties innerProperties; + /** + * Creates an instance of TiTaxiiDataConnector class. + */ + public TiTaxiiDataConnector() { + } + + /** + * Get the kind property: The data connector kind. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public TiTaxiiDataConnector withEtag(String etag) { super.withEtag(etag); @@ -41,7 +69,7 @@ public TiTaxiiDataConnector withEtag(String etag) { /** * Get the workspaceId property: The workspace id. - * + * * @return the workspaceId value. */ public String workspaceId() { @@ -50,7 +78,7 @@ public String workspaceId() { /** * Set the workspaceId property: The workspace id. - * + * * @param workspaceId the workspaceId value to set. * @return the TiTaxiiDataConnector object itself. */ @@ -64,7 +92,7 @@ public TiTaxiiDataConnector withWorkspaceId(String workspaceId) { /** * Get the friendlyName property: The friendly name for the TAXII server. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -73,7 +101,7 @@ public String friendlyName() { /** * Set the friendlyName property: The friendly name for the TAXII server. - * + * * @param friendlyName the friendlyName value to set. * @return the TiTaxiiDataConnector object itself. */ @@ -87,7 +115,7 @@ public TiTaxiiDataConnector withFriendlyName(String friendlyName) { /** * Get the taxiiServer property: The API root for the TAXII server. - * + * * @return the taxiiServer value. */ public String taxiiServer() { @@ -96,7 +124,7 @@ public String taxiiServer() { /** * Set the taxiiServer property: The API root for the TAXII server. - * + * * @param taxiiServer the taxiiServer value to set. * @return the TiTaxiiDataConnector object itself. */ @@ -110,7 +138,7 @@ public TiTaxiiDataConnector withTaxiiServer(String taxiiServer) { /** * Get the collectionId property: The collection id of the TAXII server. - * + * * @return the collectionId value. */ public String collectionId() { @@ -119,7 +147,7 @@ public String collectionId() { /** * Set the collectionId property: The collection id of the TAXII server. - * + * * @param collectionId the collectionId value to set. * @return the TiTaxiiDataConnector object itself. */ @@ -133,7 +161,7 @@ public TiTaxiiDataConnector withCollectionId(String collectionId) { /** * Get the username property: The userName for the TAXII server. - * + * * @return the username value. */ public String username() { @@ -142,7 +170,7 @@ public String username() { /** * Set the username property: The userName for the TAXII server. - * + * * @param username the username value to set. * @return the TiTaxiiDataConnector object itself. */ @@ -156,7 +184,7 @@ public TiTaxiiDataConnector withUsername(String username) { /** * Get the password property: The password for the TAXII server. - * + * * @return the password value. */ public String password() { @@ -165,7 +193,7 @@ public String password() { /** * Set the password property: The password for the TAXII server. - * + * * @param password the password value to set. * @return the TiTaxiiDataConnector object itself. */ @@ -179,7 +207,7 @@ public TiTaxiiDataConnector withPassword(String password) { /** * Get the taxiiLookbackPeriod property: The lookback period for the TAXII server. - * + * * @return the taxiiLookbackPeriod value. */ public OffsetDateTime taxiiLookbackPeriod() { @@ -188,7 +216,7 @@ public OffsetDateTime taxiiLookbackPeriod() { /** * Set the taxiiLookbackPeriod property: The lookback period for the TAXII server. - * + * * @param taxiiLookbackPeriod the taxiiLookbackPeriod value to set. * @return the TiTaxiiDataConnector object itself. */ @@ -202,7 +230,7 @@ public TiTaxiiDataConnector withTaxiiLookbackPeriod(OffsetDateTime taxiiLookback /** * Get the pollingFrequency property: The polling frequency for the TAXII server. - * + * * @return the pollingFrequency value. */ public PollingFrequency pollingFrequency() { @@ -211,7 +239,7 @@ public PollingFrequency pollingFrequency() { /** * Set the pollingFrequency property: The polling frequency for the TAXII server. - * + * * @param pollingFrequency the pollingFrequency value to set. * @return the TiTaxiiDataConnector object itself. */ @@ -225,7 +253,7 @@ public TiTaxiiDataConnector withPollingFrequency(PollingFrequency pollingFrequen /** * Get the dataTypes property: The available data types for Threat Intelligence TAXII data connector. - * + * * @return the dataTypes value. */ public TiTaxiiDataConnectorDataTypes dataTypes() { @@ -234,7 +262,7 @@ public TiTaxiiDataConnectorDataTypes 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. */ @@ -248,7 +276,7 @@ public TiTaxiiDataConnector withDataTypes(TiTaxiiDataConnectorDataTypes dataType /** * Get the tenantId property: The tenant id to connect to, and get the data from. - * + * * @return the tenantId value. */ public String tenantId() { @@ -257,7 +285,7 @@ public String 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. */ @@ -271,7 +299,7 @@ public TiTaxiiDataConnector withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 22f12b8a6ab9..496ef289a219 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The available data types for Threat Intelligence TAXII data connector. */ +/** + * The available data types for Threat Intelligence TAXII data connector. + */ @Fluent public final class TiTaxiiDataConnectorDataTypes { /* @@ -17,9 +19,15 @@ public final class TiTaxiiDataConnectorDataTypes { @JsonProperty(value = "taxiiClient", required = true) 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() { @@ -28,7 +36,7 @@ public TiTaxiiDataConnectorDataTypesTaxiiClient taxiiClient() { /** * Set the taxiiClient property: Data type for TAXII connector. - * + * * @param taxiiClient the taxiiClient value to set. * @return the TiTaxiiDataConnectorDataTypes object itself. */ @@ -39,15 +47,14 @@ public TiTaxiiDataConnectorDataTypes withTaxiiClient(TiTaxiiDataConnectorDataTyp /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (taxiiClient() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property taxiiClient in model TiTaxiiDataConnectorDataTypes")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property taxiiClient in model TiTaxiiDataConnectorDataTypes")); } else { taxiiClient().validate(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypesTaxiiClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypesTaxiiClient.java index 7b2b40b0a648..c5c63a04bcbe 100644 --- 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 @@ -6,10 +6,20 @@ import com.azure.core.annotation.Fluent; -/** Data type for TAXII connector. */ +/** + * Data type for TAXII connector. + */ @Fluent public final class TiTaxiiDataConnectorDataTypesTaxiiClient extends DataConnectorDataTypeCommon { - /** {@inheritDoc} */ + /** + * Creates an instance of TiTaxiiDataConnectorDataTypesTaxiiClient class. + */ + public TiTaxiiDataConnectorDataTypesTaxiiClient() { + } + + /** + * {@inheritDoc} + */ @Override public TiTaxiiDataConnectorDataTypesTaxiiClient withState(DataTypeState state) { super.withState(state); @@ -18,7 +28,7 @@ public TiTaxiiDataConnectorDataTypesTaxiiClient withState(DataTypeState state) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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..7bbded2eaf49 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Defines values for TiType. + */ +public final class TiType extends ExpandableStringEnum { + /** + * Static value main for TiType. + */ + 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. + */ + @JsonCreator + 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 index d34ece2d531a..7590420078fe 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** timeline aggregation information per kind. */ +/** + * timeline aggregation information per kind. + */ @Fluent public final class TimelineAggregation { /* @@ -23,9 +25,15 @@ public final class TimelineAggregation { @JsonProperty(value = "kind", required = true) private EntityTimelineKind kind; + /** + * Creates an instance of TimelineAggregation class. + */ + public TimelineAggregation() { + } + /** * Get the count property: the total items found for a kind. - * + * * @return the count value. */ public int count() { @@ -34,7 +42,7 @@ public int count() { /** * Set the count property: the total items found for a kind. - * + * * @param count the count value to set. * @return the TimelineAggregation object itself. */ @@ -45,7 +53,7 @@ public TimelineAggregation withCount(int count) { /** * Get the kind property: the query kind. - * + * * @return the kind value. */ public EntityTimelineKind kind() { @@ -54,7 +62,7 @@ public EntityTimelineKind kind() { /** * Set the kind property: the query kind. - * + * * @param kind the kind value to set. * @return the TimelineAggregation object itself. */ @@ -65,14 +73,13 @@ public TimelineAggregation withKind(EntityTimelineKind kind) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (kind() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property kind in model TimelineAggregation")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property kind in model TimelineAggregation")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineError.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineError.java index e6c563cb369f..39c11c91af94 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Timeline Query Errors. */ +/** + * Timeline Query Errors. + */ @Fluent public final class TimelineError { /* @@ -29,9 +31,15 @@ public final class TimelineError { @JsonProperty(value = "errorMessage", required = true) private String errorMessage; + /** + * Creates an instance of TimelineError class. + */ + public TimelineError() { + } + /** * Get the kind property: the query kind. - * + * * @return the kind value. */ public EntityTimelineKind kind() { @@ -40,7 +48,7 @@ public EntityTimelineKind kind() { /** * Set the kind property: the query kind. - * + * * @param kind the kind value to set. * @return the TimelineError object itself. */ @@ -51,7 +59,7 @@ public TimelineError withKind(EntityTimelineKind kind) { /** * Get the queryId property: the query id. - * + * * @return the queryId value. */ public String queryId() { @@ -60,7 +68,7 @@ public String queryId() { /** * Set the queryId property: the query id. - * + * * @param queryId the queryId value to set. * @return the TimelineError object itself. */ @@ -71,7 +79,7 @@ public TimelineError withQueryId(String queryId) { /** * Get the errorMessage property: the error message. - * + * * @return the errorMessage value. */ public String errorMessage() { @@ -80,7 +88,7 @@ public String errorMessage() { /** * Set the errorMessage property: the error message. - * + * * @param errorMessage the errorMessage value to set. * @return the TimelineError object itself. */ @@ -91,19 +99,17 @@ public TimelineError withErrorMessage(String errorMessage) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (kind() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property kind in model TimelineError")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property kind in model TimelineError")); } if (errorMessage() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property errorMessage in model TimelineError")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property errorMessage in model TimelineError")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineResultsMetadata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineResultsMetadata.java index 7d42bccca470..8eb3e29de394 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Expansion result metadata. */ +/** + * Expansion result metadata. + */ @Fluent public final class TimelineResultsMetadata { /* @@ -30,9 +32,15 @@ public final class TimelineResultsMetadata { @JsonProperty(value = "errors") private List errors; + /** + * Creates an instance of TimelineResultsMetadata class. + */ + public TimelineResultsMetadata() { + } + /** * Get the totalCount property: the total items found for the timeline request. - * + * * @return the totalCount value. */ public int totalCount() { @@ -41,7 +49,7 @@ public int totalCount() { /** * Set the totalCount property: the total items found for the timeline request. - * + * * @param totalCount the totalCount value to set. * @return the TimelineResultsMetadata object itself. */ @@ -52,7 +60,7 @@ public TimelineResultsMetadata withTotalCount(int totalCount) { /** * Get the aggregations property: timeline aggregation per kind. - * + * * @return the aggregations value. */ public List aggregations() { @@ -61,7 +69,7 @@ public List aggregations() { /** * Set the aggregations property: timeline aggregation per kind. - * + * * @param aggregations the aggregations value to set. * @return the TimelineResultsMetadata object itself. */ @@ -72,7 +80,7 @@ public TimelineResultsMetadata withAggregations(List aggreg /** * Get the errors property: information about the failure queries. - * + * * @return the errors value. */ public List errors() { @@ -81,7 +89,7 @@ public List errors() { /** * Set the errors property: information about the failure queries. - * + * * @param errors the errors value to set. * @return the TimelineResultsMetadata object itself. */ @@ -92,15 +100,14 @@ public TimelineResultsMetadata withErrors(List errors) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (aggregations() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property aggregations in model TimelineResultsMetadata")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property aggregations in model TimelineResultsMetadata")); } else { aggregations().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggerOperator.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggerOperator.java index 1c824f4332d6..3e0edd4af4ad 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 @@ -7,21 +7,33 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** The operation against the threshold that triggers alert rule. */ +/** + * The operation against the threshold that triggers alert rule. + */ public enum TriggerOperator { - /** Enum value GreaterThan. */ + /** + * Enum value GreaterThan. + */ GREATER_THAN("GreaterThan"), - /** Enum value LessThan. */ + /** + * Enum value LessThan. + */ LESS_THAN("LessThan"), - /** Enum value Equal. */ + /** + * Enum value Equal. + */ EQUAL("Equal"), - /** Enum value NotEqual. */ + /** + * Enum value NotEqual. + */ NOT_EQUAL("NotEqual"); - /** The actual serialized value for a TriggerOperator instance. */ + /** + * The actual serialized value for a TriggerOperator instance. + */ private final String value; TriggerOperator(String value) { @@ -30,7 +42,7 @@ public enum TriggerOperator { /** * Parses a serialized value to a TriggerOperator instance. - * + * * @param value the serialized value to parse. * @return the parsed TriggerOperator object, or null if unable to parse. */ @@ -48,7 +60,9 @@ public static TriggerOperator fromString(String value) { return null; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @JsonValue @Override public String toString() { 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..0b64f76d1ee4 --- /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) AutoRest 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..0c7f2391fa03 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of 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/TriggeredAnalyticsRuleRuns.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRuns.java new file mode 100644 index 000000000000..855cb5fbf741 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRuns.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The triggered analytics rule run array. + */ +@Fluent +public final class TriggeredAnalyticsRuleRuns { + /* + * The value property. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of TriggeredAnalyticsRuleRuns class. + */ + public TriggeredAnalyticsRuleRuns() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the TriggeredAnalyticsRuleRuns object itself. + */ + public TriggeredAnalyticsRuleRuns withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model TriggeredAnalyticsRuleRuns")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TriggeredAnalyticsRuleRuns.class); +} 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 9bb932300877..add04584c61f 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for TriggersOn. */ +/** + * Defines values for TriggersOn. + */ public final class TriggersOn extends ExpandableStringEnum { - /** Static value Incidents for TriggersOn. */ + /** + * Static value Incidents for TriggersOn. + */ public static final TriggersOn INCIDENTS = fromString("Incidents"); - /** Static value Alerts for TriggersOn. */ + /** + * Static value Alerts for TriggersOn. + */ public static final TriggersOn ALERTS = fromString("Alerts"); + /** + * Creates a new instance of TriggersOn value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TriggersOn() { + } + /** * Creates or finds a TriggersOn from its string representation. - * + * * @param name a name to look for. * @return the corresponding TriggersOn. */ @@ -29,7 +44,7 @@ public static TriggersOn fromString(String name) { /** * Gets known TriggersOn values. - * + * * @return known TriggersOn values. */ public static Collection values() { 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 84c11fc4fc6b..6c0fd37e2432 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for TriggersWhen. */ +/** + * Defines values for TriggersWhen. + */ public final class TriggersWhen extends ExpandableStringEnum { - /** Static value Created for TriggersWhen. */ + /** + * Static value Created for TriggersWhen. + */ public static final TriggersWhen CREATED = fromString("Created"); - /** Static value Updated for TriggersWhen. */ + /** + * Static value Updated for TriggersWhen. + */ public static final TriggersWhen UPDATED = fromString("Updated"); + /** + * Creates a new instance of TriggersWhen value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TriggersWhen() { + } + /** * Creates or finds a TriggersWhen from its string representation. - * + * * @param name a name to look for. * @return the corresponding TriggersWhen. */ @@ -29,7 +44,7 @@ public static TriggersWhen fromString(String name) { /** * Gets known TriggersWhen values. - * + * * @return known TriggersWhen values. */ public static Collection values() { 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 index 5a79fd502544..2d94f6aa3afd 100644 --- 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 @@ -8,31 +8,59 @@ import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; import com.azure.resourcemanager.securityinsights.fluent.models.UebaProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** Settings with single toggle. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Settings with single toggle. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = Ueba.class, visible = true) @JsonTypeName("Ueba") @Fluent public final class Ueba extends SettingsInner { + /* + * The kind of the setting + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private SettingKind kind = SettingKind.UEBA; + /* * Ueba properties */ @JsonProperty(value = "properties") private UebaProperties innerProperties; + /** + * Creates an instance of Ueba class. + */ + public Ueba() { + } + + /** + * Get the kind property: The kind of the setting. + * + * @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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Ueba withEtag(String etag) { super.withEtag(etag); @@ -41,7 +69,7 @@ public Ueba withEtag(String etag) { /** * Get the dataSources property: The relevant data sources that enriched by ueba. - * + * * @return the dataSources value. */ public List dataSources() { @@ -50,7 +78,7 @@ public List 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. */ @@ -64,7 +92,7 @@ public Ueba withDataSources(List dataSources) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 8548886d5a2d..8970ead2d56b 100644 --- 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 @@ -8,23 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The data source that enriched by ueba. */ +/** + * The data source that enriched by ueba. + */ public final class UebaDataSources extends ExpandableStringEnum { - /** Static value AuditLogs for UebaDataSources. */ + /** + * Static value AuditLogs for UebaDataSources. + */ public static final UebaDataSources AUDIT_LOGS = fromString("AuditLogs"); - /** Static value AzureActivity for UebaDataSources. */ + /** + * Static value AzureActivity for UebaDataSources. + */ public static final UebaDataSources AZURE_ACTIVITY = fromString("AzureActivity"); - /** Static value SecurityEvent for UebaDataSources. */ + /** + * Static value SecurityEvent for UebaDataSources. + */ public static final UebaDataSources SECURITY_EVENT = fromString("SecurityEvent"); - /** Static value SigninLogs for UebaDataSources. */ + /** + * Static value SigninLogs for UebaDataSources. + */ 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. */ @@ -35,7 +54,7 @@ public static UebaDataSources fromString(String name) { /** * Gets known UebaDataSources values. - * + * * @return known UebaDataSources values. */ public static Collection values() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UnlockUserAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UnlockUserAction.java new file mode 100644 index 000000000000..ab7c5eb04c18 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UnlockUserAction.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.securityinsights.fluent.models.ActionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an unlock user action. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = UnlockUserAction.class, visible = true) +@JsonTypeName("UnlockUser") +@Fluent +public final class UnlockUserAction extends ActionInner { + /* + * The actions kind + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ListActionKind kind = ListActionKind.UNLOCK_USER; + + /* + * The user to unlock + */ + @JsonProperty(value = "user") + private String user; + + /* + * The reason of the failure of the action. Empty if the action is successful. + */ + @JsonProperty(value = "failureReason") + private String failureReason; + + /** + * Creates an instance of UnlockUserAction class. + */ + public UnlockUserAction() { + } + + /** + * Get the kind property: The actions kind. + * + * @return the kind value. + */ + @Override + public ListActionKind kind() { + return this.kind; + } + + /** + * Get the user property: The user to unlock. + * + * @return the user value. + */ + public String user() { + return this.user; + } + + /** + * Set the user property: The user to unlock. + * + * @param user the user value to set. + * @return the UnlockUserAction object itself. + */ + public UnlockUserAction withUser(String user) { + this.user = user; + return this; + } + + /** + * Get the failureReason property: The reason of the failure of the action. Empty if the action is successful. + * + * @return the failureReason value. + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set the failureReason property: The reason of the failure of the action. Empty if the action is successful. + * + * @param failureReason the failureReason value to set. + * @return the UnlockUserAction object itself. + */ + public UnlockUserAction withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Updates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Updates.java new file mode 100644 index 000000000000..c42f4c632e48 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Updates.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.UUID; + +/** + * 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, + UUID 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, UUID 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 0af80094b7e0..1ab0ff75b245 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 @@ -4,28 +4,54 @@ package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner; import com.azure.resourcemanager.securityinsights.fluent.models.UrlEntityProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** Represents a url entity. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Represents a url entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = UrlEntity.class, visible = true) @JsonTypeName("Url") -@Fluent +@Immutable public final class UrlEntity extends EntityInner { + /* + * The kind of the entity. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private EntityKindEnum kind = EntityKindEnum.URL; + /* * Url entity properties */ @JsonProperty(value = "properties") private UrlEntityProperties innerProperties; + /** + * Creates an instance of UrlEntity class. + */ + public UrlEntity() { + } + + /** + * Get the kind property: The kind of the entity. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + /** * Get the innerProperties property: Url entity properties. - * + * * @return the innerProperties value. */ private UrlEntityProperties innerProperties() { @@ -34,7 +60,7 @@ private UrlEntityProperties innerProperties() { /** * Get the url property: A full URL the entity points to. - * + * * @return the url value. */ public String url() { @@ -44,7 +70,7 @@ public String url() { /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -54,7 +80,7 @@ public Map 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() { @@ -63,7 +89,7 @@ public String friendlyName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 8d8dc55f0309..77a59eedb845 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; -/** User information that made some action. */ +/** + * User information that made some action. + */ @Fluent public final class UserInfo { /* @@ -29,9 +31,15 @@ public final class UserInfo { @JsonProperty(value = "objectId") private UUID objectId; + /** + * Creates an instance of UserInfo class. + */ + public UserInfo() { + } + /** * Get the email property: The email of the user. - * + * * @return the email value. */ public String email() { @@ -40,7 +48,7 @@ public String email() { /** * Get the name property: The name of the user. - * + * * @return the name value. */ public String name() { @@ -49,7 +57,7 @@ public String name() { /** * Get the objectId property: The object id of the user. - * + * * @return the objectId value. */ public UUID objectId() { @@ -58,7 +66,7 @@ public UUID objectId() { /** * Set the objectId property: The object id of the user. - * + * * @param objectId the objectId value to set. * @return the UserInfo object itself. */ @@ -69,7 +77,7 @@ public UserInfo withObjectId(UUID objectId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UserInfoAutoGenerated.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UserInfoAutoGenerated.java new file mode 100644 index 000000000000..bc8a4b7790a7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UserInfoAutoGenerated.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** + * Data about a user or client application. + */ +@Fluent +public final class UserInfoAutoGenerated { + /* + * The user's object ID. + */ + @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) + private UUID objectId; + + /* + * The user's email address. + */ + @JsonProperty(value = "email") + private String email; + + /* + * The user's name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Creates an instance of UserInfoAutoGenerated class. + */ + public UserInfoAutoGenerated() { + } + + /** + * Get the objectId property: The user's object ID. + * + * @return the objectId value. + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Get the email property: The user's email address. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The user's email address. + * + * @param email the email value to set. + * @return the UserInfoAutoGenerated object itself. + */ + public UserInfoAutoGenerated withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the name property: The user's name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The user's name. + * + * @param name the name value to set. + * @return the UserInfoAutoGenerated object itself. + */ + public UserInfoAutoGenerated withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ValidationError.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ValidationError.java index 7b74ced2e068..09f55a945764 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes an error encountered in the file during validation. */ +/** + * Describes an error encountered in the file during validation. + */ @Fluent public final class ValidationError { /* @@ -23,9 +25,15 @@ public final class ValidationError { @JsonProperty(value = "errorMessages", access = JsonProperty.Access.WRITE_ONLY) private List errorMessages; + /** + * Creates an instance of ValidationError class. + */ + public ValidationError() { + } + /** * Get the recordIndex property: The number of the record that has the error. - * + * * @return the recordIndex value. */ public Integer recordIndex() { @@ -34,7 +42,7 @@ public Integer recordIndex() { /** * Set the recordIndex property: The number of the record that has the error. - * + * * @param recordIndex the recordIndex value to set. * @return the ValidationError object itself. */ @@ -45,7 +53,7 @@ public ValidationError withRecordIndex(Integer recordIndex) { /** * Get the errorMessages property: A list of descriptions of the error. - * + * * @return the errorMessages value. */ public List errorMessages() { @@ -54,7 +62,7 @@ public List errorMessages() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Version.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Version.java index 285474b81325..dd38e595dc2b 100644 --- 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The version of the source control. */ +/** + * The version of the source control. + */ public final class Version extends ExpandableStringEnum { - /** Static value V1 for Version. */ + /** + * Static value V1 for Version. + */ public static final Version V1 = fromString("V1"); - /** Static value V2 for Version. */ + /** + * Static value V2 for Version. + */ 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. */ @@ -29,7 +44,7 @@ public static Version fromString(String name) { /** * Gets known Version values. - * + * * @return known Version values. */ public static Collection values() { 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..c68d1e5c46bd --- /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) AutoRest 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..2910094162be --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningBody.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Warning details. + */ +@Immutable +public final class WarningBody { + /* + * An identifier for the warning. Codes are invariant and are intended to be consumed programmatically. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private WarningCode code; + + /* + * A message describing the warning, intended to be suitable for display in a user interface. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The details property. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Creates an instance of WarningBody class. + */ + public 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + } +} 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..97509f2bc7e0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningCode.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The type of repository. + */ +public final class WarningCode extends ExpandableStringEnum { + /** + * Static value SourceControlWarning_DeleteServicePrincipal for WarningCode. + */ + public static final WarningCode SOURCE_CONTROL_WARNING_DELETE_SERVICE_PRINCIPAL + = fromString("SourceControlWarning_DeleteServicePrincipal"); + + /** + * Static value SourceControlWarning_DeletePipelineFromAzureDevOps for WarningCode. + */ + public static final WarningCode SOURCE_CONTROL_WARNING_DELETE_PIPELINE_FROM_AZURE_DEV_OPS + = fromString("SourceControlWarning_DeletePipelineFromAzureDevOps"); + + /** + * Static value SourceControlWarning_DeleteWorkflowAndSecretFromGitHub for WarningCode. + */ + public static final WarningCode SOURCE_CONTROL_WARNING_DELETE_WORKFLOW_AND_SECRET_FROM_GIT_HUB + = fromString("SourceControlWarning_DeleteWorkflowAndSecretFromGitHub"); + + /** + * Static value SourceControlWarning_DeleteRoleAssignment for WarningCode. + */ + public static final WarningCode SOURCE_CONTROL_WARNING_DELETE_ROLE_ASSIGNMENT + = fromString("SourceControlWarning_DeleteRoleAssignment"); + + /** + * Static value SourceControl_DeletedWithWarnings for WarningCode. + */ + 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. + */ + @JsonCreator + 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 f00eabf5856b..551efe489cf0 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 @@ -11,158 +11,160 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of Watchlist. */ +/** + * An immutable client-side representation of Watchlist. + */ public interface Watchlist { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the watchlistId property: The id (a Guid) of the watchlist. - * + * * @return the watchlistId value. */ String watchlistId(); /** * Gets the displayName property: The display name of the watchlist. - * + * * @return the displayName value. */ String displayName(); /** * Gets the provider property: The provider of the watchlist. - * + * * @return the provider value. */ String provider(); /** * Gets the source property: The filename of the watchlist, called 'source'. - * + * * @return the source value. */ 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. - * + * * @return the created value. */ OffsetDateTime created(); /** * Gets the updated property: The last time the watchlist was updated. - * + * * @return the updated value. */ OffsetDateTime updated(); /** * Gets the createdBy property: Describes a user that created the watchlist. - * + * * @return the createdBy value. */ UserInfo createdBy(); /** * Gets the updatedBy property: Describes a user that updated the watchlist. - * + * * @return the updatedBy value. */ UserInfo updatedBy(); /** * Gets the description property: A description of the watchlist. - * + * * @return the description value. */ String description(); /** * Gets the watchlistType property: The type of the watchlist. - * + * * @return the watchlistType value. */ String watchlistType(); /** * Gets the watchlistAlias property: The alias of the watchlist. - * + * * @return the watchlistAlias value. */ String watchlistAlias(); /** * Gets the isDeleted property: A flag that indicates if the watchlist is deleted or not. - * + * * @return the isDeleted value. */ Boolean isDeleted(); /** * Gets the labels property: List of labels relevant to this watchlist. - * + * * @return the labels value. */ List labels(); /** * Gets the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration format). - * + * * @return the defaultDuration value. */ Duration defaultDuration(); /** * Gets the tenantId property: The tenantId where the watchlist belongs to. - * + * * @return the tenantId value. */ String tenantId(); /** * Gets the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. - * + * * @return the numberOfLinesToSkip value. */ Integer numberOfLinesToSkip(); @@ -170,7 +172,7 @@ public interface Watchlist { /** * Gets the rawContent property: The raw content that represents to watchlist items to create. In case of csv/tsv * content type, it's the content of the file that will parsed by the endpoint. - * + * * @return the rawContent value. */ String rawContent(); @@ -179,14 +181,14 @@ public interface Watchlist { * Gets the itemsSearchKey property: The search key is used to optimize query performance when using watchlists for * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then * use this field as the key field when joining to other event data by IP address. - * + * * @return the itemsSearchKey value. */ String itemsSearchKey(); /** * Gets the contentType property: The content type of the raw content. Example : text/csv or text/tsv. - * + * * @return the contentType value. */ String contentType(); @@ -194,607 +196,725 @@ public interface Watchlist { /** * Gets the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. Pls note : When * a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. - * + * * @return the uploadStatus value. */ String uploadStatus(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner object. - * + * * @return the inner object. */ WatchlistInner innerModel(); - /** The entirety of the Watchlist definition. */ + /** + * The entirety of the Watchlist definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The Watchlist definition stages. */ + + /** + * The Watchlist definition stages. + */ interface DefinitionStages { - /** The first stage of the Watchlist definition. */ + /** + * The first stage of the Watchlist definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Watchlist definition allowing to specify parent resource. */ + + /** + * The stage of the Watchlist definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** * The stage of the Watchlist definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithEtag, - DefinitionStages.WithWatchlistId, - DefinitionStages.WithDisplayName, - DefinitionStages.WithProvider, - DefinitionStages.WithSource, - DefinitionStages.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 { + 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. - * + * * @return the created resource. */ Watchlist create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Watchlist create(Context context); } - /** The stage of the Watchlist definition allowing to specify etag. */ + + /** + * The stage of the Watchlist definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the Watchlist definition allowing to specify watchlistId. */ + + /** + * The stage of the Watchlist definition allowing to specify watchlistId. + */ interface WithWatchlistId { /** * Specifies the watchlistId property: The id (a Guid) of the watchlist. - * + * * @param watchlistId The id (a Guid) of the watchlist. * @return the next definition stage. */ WithCreate withWatchlistId(String watchlistId); } - /** The stage of the Watchlist definition allowing to specify displayName. */ + + /** + * The stage of the Watchlist definition allowing to specify displayName. + */ interface WithDisplayName { /** * Specifies the displayName property: The display name of the watchlist. - * + * * @param displayName The display name of the watchlist. * @return the next definition stage. */ WithCreate withDisplayName(String displayName); } - /** The stage of the Watchlist definition allowing to specify provider. */ + + /** + * The stage of the Watchlist definition allowing to specify provider. + */ interface WithProvider { /** * Specifies the provider property: The provider of the watchlist. - * + * * @param provider The provider of the watchlist. * @return the next definition stage. */ WithCreate withProvider(String provider); } - /** The stage of the Watchlist definition allowing to specify source. */ + + /** + * The stage of the Watchlist definition allowing to specify source. + */ interface WithSource { /** * 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. */ + + /** + * The stage of the Watchlist definition allowing to specify sourceType. + */ interface WithSourceType { /** * Specifies the sourceType property: The sourceType of the watchlist. - * + * * @param sourceType The sourceType of the watchlist. * @return the next definition stage. */ WithCreate withSourceType(SourceType sourceType); } - /** The stage of the Watchlist definition allowing to specify created. */ + + /** + * The stage of the Watchlist definition allowing to specify created. + */ interface WithCreated { /** * Specifies the created property: The time the watchlist was created. - * + * * @param created The time the watchlist was created. * @return the next definition stage. */ WithCreate withCreated(OffsetDateTime created); } - /** The stage of the Watchlist definition allowing to specify updated. */ + + /** + * The stage of the Watchlist definition allowing to specify updated. + */ interface WithUpdated { /** * Specifies the updated property: The last time the watchlist was updated. - * + * * @param updated The last time the watchlist was updated. * @return the next definition stage. */ WithCreate withUpdated(OffsetDateTime updated); } - /** The stage of the Watchlist definition allowing to specify createdBy. */ + + /** + * The stage of the Watchlist definition allowing to specify createdBy. + */ interface WithCreatedBy { /** * Specifies the createdBy property: Describes a user that created the watchlist. - * + * * @param createdBy Describes a user that created the watchlist. * @return the next definition stage. */ WithCreate withCreatedBy(UserInfo createdBy); } - /** The stage of the Watchlist definition allowing to specify updatedBy. */ + + /** + * The stage of the Watchlist definition allowing to specify updatedBy. + */ interface WithUpdatedBy { /** * Specifies the updatedBy property: Describes a user that updated the watchlist. - * + * * @param updatedBy Describes a user that updated the watchlist. * @return the next definition stage. */ WithCreate withUpdatedBy(UserInfo updatedBy); } - /** The stage of the Watchlist definition allowing to specify description. */ + + /** + * The stage of the Watchlist definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: A description of the watchlist. - * + * * @param description A description of the watchlist. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the Watchlist definition allowing to specify watchlistType. */ + + /** + * The stage of the Watchlist definition allowing to specify watchlistType. + */ interface WithWatchlistType { /** * Specifies the watchlistType property: The type of the watchlist. - * + * * @param watchlistType The type of the watchlist. * @return the next definition stage. */ WithCreate withWatchlistType(String watchlistType); } - /** The stage of the Watchlist definition allowing to specify watchlistAlias. */ + + /** + * The stage of the Watchlist definition allowing to specify watchlistAlias. + */ interface WithWatchlistAlias { /** * Specifies the watchlistAlias property: The alias of the watchlist. - * + * * @param watchlistAlias The alias of the watchlist. * @return the next definition stage. */ WithCreate withWatchlistAlias(String watchlistAlias); } - /** The stage of the Watchlist definition allowing to specify isDeleted. */ + + /** + * The stage of the Watchlist definition allowing to specify isDeleted. + */ interface WithIsDeleted { /** * Specifies the isDeleted property: A flag that indicates if the watchlist is deleted or not. - * + * * @param isDeleted A flag that indicates if the watchlist is deleted or not. * @return the next definition stage. */ WithCreate withIsDeleted(Boolean isDeleted); } - /** The stage of the Watchlist definition allowing to specify labels. */ + + /** + * The stage of the Watchlist definition allowing to specify labels. + */ interface WithLabels { /** * Specifies the labels property: List of labels relevant to this watchlist. - * + * * @param labels List of labels relevant to this watchlist. * @return the next definition stage. */ WithCreate withLabels(List labels); } - /** The stage of the Watchlist definition allowing to specify defaultDuration. */ + + /** + * The stage of the Watchlist definition allowing to specify defaultDuration. + */ interface WithDefaultDuration { /** * Specifies the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration * format). - * + * * @param defaultDuration The default duration of a watchlist (in ISO 8601 duration format). * @return the next definition stage. */ WithCreate withDefaultDuration(Duration defaultDuration); } - /** The stage of the Watchlist definition allowing to specify tenantId. */ + + /** + * The stage of the Watchlist definition allowing to specify tenantId. + */ interface WithTenantId { /** * Specifies the tenantId property: The tenantId where the watchlist belongs to. - * + * * @param tenantId The tenantId where the watchlist belongs to. * @return the next definition stage. */ WithCreate withTenantId(String tenantId); } - /** The stage of the Watchlist definition allowing to specify numberOfLinesToSkip. */ + + /** + * The stage of the Watchlist definition allowing to specify numberOfLinesToSkip. + */ interface WithNumberOfLinesToSkip { /** * Specifies the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the * header. - * + * * @param numberOfLinesToSkip The number of lines in a csv/tsv content to skip before the header. * @return the next definition stage. */ WithCreate withNumberOfLinesToSkip(Integer numberOfLinesToSkip); } - /** The stage of the Watchlist definition allowing to specify rawContent. */ + + /** + * The stage of the Watchlist definition allowing to specify rawContent. + */ interface WithRawContent { /** * Specifies the rawContent property: The raw content that represents to watchlist items to create. In case * of csv/tsv content type, it's the content of the file that will parsed by the endpoint. - * + * * @param rawContent The raw content that represents to watchlist items to create. In case of csv/tsv - * content type, it's the content of the file that will parsed by the endpoint. + * content type, it's the content of the file that will parsed by the endpoint. * @return the next definition stage. */ WithCreate withRawContent(String rawContent); } - /** The stage of the Watchlist definition allowing to specify itemsSearchKey. */ + + /** + * The stage of the Watchlist definition allowing to specify itemsSearchKey. + */ interface WithItemsSearchKey { /** * Specifies the itemsSearchKey property: The search key is used to optimize query performance when using * watchlists for joins with other data. For example, enable a column with IP addresses to be the designated * SearchKey field, then use this field as the key field when joining to other event data by IP address.. - * + * * @param itemsSearchKey The search key is used to optimize query performance when using watchlists for - * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey - * field, then use this field as the key field when joining to other event data by IP address. + * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey + * field, then use this field as the key field when joining to other event data by IP address. * @return the next definition stage. */ WithCreate withItemsSearchKey(String itemsSearchKey); } - /** The stage of the Watchlist definition allowing to specify contentType. */ + + /** + * The stage of the Watchlist definition allowing to specify contentType. + */ interface WithContentType { /** * Specifies the contentType property: The content type of the raw content. Example : text/csv or text/tsv . - * + * * @param contentType The content type of the raw content. Example : text/csv or text/tsv. * @return the next definition stage. */ WithCreate withContentType(String contentType); } - /** The stage of the Watchlist definition allowing to specify uploadStatus. */ + + /** + * The stage of the Watchlist definition allowing to specify uploadStatus. + */ interface WithUploadStatus { /** * Specifies the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. * Pls note : When a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. - * + * * @param uploadStatus The status of the Watchlist upload : New, InProgress or Complete. Pls note : When a - * Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. * @return the next definition stage. */ WithCreate withUploadStatus(String uploadStatus); } } + /** * Begins update for the Watchlist resource. - * + * * @return the stage of resource update. */ Watchlist.Update update(); - /** The template for Watchlist update. */ - interface Update - extends UpdateStages.WithEtag, - UpdateStages.WithWatchlistId, - UpdateStages.WithDisplayName, - UpdateStages.WithProvider, - UpdateStages.WithSource, - UpdateStages.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, - UpdateStages.WithContentType, - UpdateStages.WithUploadStatus { + /** + * The template for Watchlist update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithWatchlistId, UpdateStages.WithDisplayName, + 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, + UpdateStages.WithContentType, UpdateStages.WithUploadStatus { /** * Executes the update request. - * + * * @return the updated resource. */ Watchlist apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Watchlist apply(Context context); } - /** The Watchlist update stages. */ + + /** + * The Watchlist update stages. + */ interface UpdateStages { - /** The stage of the Watchlist update allowing to specify etag. */ + /** + * The stage of the Watchlist update allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ Update withEtag(String etag); } - /** The stage of the Watchlist update allowing to specify watchlistId. */ + + /** + * The stage of the Watchlist update allowing to specify watchlistId. + */ interface WithWatchlistId { /** * Specifies the watchlistId property: The id (a Guid) of the watchlist. - * + * * @param watchlistId The id (a Guid) of the watchlist. * @return the next definition stage. */ Update withWatchlistId(String watchlistId); } - /** The stage of the Watchlist update allowing to specify displayName. */ + + /** + * The stage of the Watchlist update allowing to specify displayName. + */ interface WithDisplayName { /** * Specifies the displayName property: The display name of the watchlist. - * + * * @param displayName The display name of the watchlist. * @return the next definition stage. */ Update withDisplayName(String displayName); } - /** The stage of the Watchlist update allowing to specify provider. */ + + /** + * The stage of the Watchlist update allowing to specify provider. + */ interface WithProvider { /** * Specifies the provider property: The provider of the watchlist. - * + * * @param provider The provider of the watchlist. * @return the next definition stage. */ Update withProvider(String provider); } - /** The stage of the Watchlist update allowing to specify source. */ + + /** + * The stage of the Watchlist update allowing to specify source. + */ interface WithSource { /** * 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. */ + + /** + * The stage of the Watchlist update allowing to specify sourceType. + */ interface WithSourceType { /** * Specifies the sourceType property: The sourceType of the watchlist. - * + * * @param sourceType The sourceType of the watchlist. * @return the next definition stage. */ Update withSourceType(SourceType sourceType); } - /** The stage of the Watchlist update allowing to specify created. */ + + /** + * The stage of the Watchlist update allowing to specify created. + */ interface WithCreated { /** * Specifies the created property: The time the watchlist was created. - * + * * @param created The time the watchlist was created. * @return the next definition stage. */ Update withCreated(OffsetDateTime created); } - /** The stage of the Watchlist update allowing to specify updated. */ + + /** + * The stage of the Watchlist update allowing to specify updated. + */ interface WithUpdated { /** * Specifies the updated property: The last time the watchlist was updated. - * + * * @param updated The last time the watchlist was updated. * @return the next definition stage. */ Update withUpdated(OffsetDateTime updated); } - /** The stage of the Watchlist update allowing to specify createdBy. */ + + /** + * The stage of the Watchlist update allowing to specify createdBy. + */ interface WithCreatedBy { /** * Specifies the createdBy property: Describes a user that created the watchlist. - * + * * @param createdBy Describes a user that created the watchlist. * @return the next definition stage. */ Update withCreatedBy(UserInfo createdBy); } - /** The stage of the Watchlist update allowing to specify updatedBy. */ + + /** + * The stage of the Watchlist update allowing to specify updatedBy. + */ interface WithUpdatedBy { /** * Specifies the updatedBy property: Describes a user that updated the watchlist. - * + * * @param updatedBy Describes a user that updated the watchlist. * @return the next definition stage. */ Update withUpdatedBy(UserInfo updatedBy); } - /** The stage of the Watchlist update allowing to specify description. */ + + /** + * The stage of the Watchlist update allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: A description of the watchlist. - * + * * @param description A description of the watchlist. * @return the next definition stage. */ Update withDescription(String description); } - /** The stage of the Watchlist update allowing to specify watchlistType. */ + + /** + * The stage of the Watchlist update allowing to specify watchlistType. + */ interface WithWatchlistType { /** * Specifies the watchlistType property: The type of the watchlist. - * + * * @param watchlistType The type of the watchlist. * @return the next definition stage. */ Update withWatchlistType(String watchlistType); } - /** The stage of the Watchlist update allowing to specify watchlistAlias. */ + + /** + * The stage of the Watchlist update allowing to specify watchlistAlias. + */ interface WithWatchlistAlias { /** * Specifies the watchlistAlias property: The alias of the watchlist. - * + * * @param watchlistAlias The alias of the watchlist. * @return the next definition stage. */ Update withWatchlistAlias(String watchlistAlias); } - /** The stage of the Watchlist update allowing to specify isDeleted. */ + + /** + * The stage of the Watchlist update allowing to specify isDeleted. + */ interface WithIsDeleted { /** * Specifies the isDeleted property: A flag that indicates if the watchlist is deleted or not. - * + * * @param isDeleted A flag that indicates if the watchlist is deleted or not. * @return the next definition stage. */ Update withIsDeleted(Boolean isDeleted); } - /** The stage of the Watchlist update allowing to specify labels. */ + + /** + * The stage of the Watchlist update allowing to specify labels. + */ interface WithLabels { /** * Specifies the labels property: List of labels relevant to this watchlist. - * + * * @param labels List of labels relevant to this watchlist. * @return the next definition stage. */ Update withLabels(List labels); } - /** The stage of the Watchlist update allowing to specify defaultDuration. */ + + /** + * The stage of the Watchlist update allowing to specify defaultDuration. + */ interface WithDefaultDuration { /** * Specifies the defaultDuration property: The default duration of a watchlist (in ISO 8601 duration * format). - * + * * @param defaultDuration The default duration of a watchlist (in ISO 8601 duration format). * @return the next definition stage. */ Update withDefaultDuration(Duration defaultDuration); } - /** The stage of the Watchlist update allowing to specify tenantId. */ + + /** + * The stage of the Watchlist update allowing to specify tenantId. + */ interface WithTenantId { /** * Specifies the tenantId property: The tenantId where the watchlist belongs to. - * + * * @param tenantId The tenantId where the watchlist belongs to. * @return the next definition stage. */ Update withTenantId(String tenantId); } - /** The stage of the Watchlist update allowing to specify numberOfLinesToSkip. */ + + /** + * The stage of the Watchlist update allowing to specify numberOfLinesToSkip. + */ interface WithNumberOfLinesToSkip { /** * Specifies the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the * header. - * + * * @param numberOfLinesToSkip The number of lines in a csv/tsv content to skip before the header. * @return the next definition stage. */ Update withNumberOfLinesToSkip(Integer numberOfLinesToSkip); } - /** The stage of the Watchlist update allowing to specify rawContent. */ + + /** + * The stage of the Watchlist update allowing to specify rawContent. + */ interface WithRawContent { /** * Specifies the rawContent property: The raw content that represents to watchlist items to create. In case * of csv/tsv content type, it's the content of the file that will parsed by the endpoint. - * + * * @param rawContent The raw content that represents to watchlist items to create. In case of csv/tsv - * content type, it's the content of the file that will parsed by the endpoint. + * content type, it's the content of the file that will parsed by the endpoint. * @return the next definition stage. */ Update withRawContent(String rawContent); } - /** The stage of the Watchlist update allowing to specify itemsSearchKey. */ + + /** + * The stage of the Watchlist update allowing to specify itemsSearchKey. + */ interface WithItemsSearchKey { /** * Specifies the itemsSearchKey property: The search key is used to optimize query performance when using * watchlists for joins with other data. For example, enable a column with IP addresses to be the designated * SearchKey field, then use this field as the key field when joining to other event data by IP address.. - * + * * @param itemsSearchKey The search key is used to optimize query performance when using watchlists for - * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey - * field, then use this field as the key field when joining to other event data by IP address. + * joins with other data. For example, enable a column with IP addresses to be the designated SearchKey + * field, then use this field as the key field when joining to other event data by IP address. * @return the next definition stage. */ Update withItemsSearchKey(String itemsSearchKey); } - /** The stage of the Watchlist update allowing to specify contentType. */ + + /** + * The stage of the Watchlist update allowing to specify contentType. + */ interface WithContentType { /** * Specifies the contentType property: The content type of the raw content. Example : text/csv or text/tsv . - * + * * @param contentType The content type of the raw content. Example : text/csv or text/tsv. * @return the next definition stage. */ Update withContentType(String contentType); } - /** The stage of the Watchlist update allowing to specify uploadStatus. */ + + /** + * The stage of the Watchlist update allowing to specify uploadStatus. + */ interface WithUploadStatus { /** * Specifies the uploadStatus property: The status of the Watchlist upload : New, InProgress or Complete. * Pls note : When a Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. - * + * * @param uploadStatus The status of the Watchlist upload : New, InProgress or Complete. Pls note : When a - * Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. + * Watchlist upload status is equal to InProgress, the Watchlist cannot be deleted. * @return the next definition stage. */ Update withUploadStatus(String uploadStatus); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Watchlist refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ 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 b077295fb50b..82bedf9331e4 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 @@ -10,141 +10,153 @@ import java.time.OffsetDateTime; import java.util.Map; -/** An immutable client-side representation of WatchlistItem. */ +/** + * An immutable client-side representation of WatchlistItem. + */ public interface WatchlistItem { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: Etag of the azure resource. - * + * * @return the etag value. */ String etag(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the watchlistItemType property: The type of the watchlist item. - * + * * @return the watchlistItemType value. */ String watchlistItemType(); /** * Gets the watchlistItemId property: The id (a Guid) of the watchlist item. - * + * * @return the watchlistItemId value. */ String watchlistItemId(); /** * Gets the tenantId property: The tenantId to which the watchlist item belongs to. - * + * * @return the tenantId value. */ String tenantId(); /** * Gets the isDeleted property: A flag that indicates if the watchlist item is deleted or not. - * + * * @return the isDeleted value. */ Boolean isDeleted(); /** * Gets the created property: The time the watchlist item was created. - * + * * @return the created value. */ OffsetDateTime created(); /** * Gets the updated property: The last time the watchlist item was updated. - * + * * @return the updated value. */ OffsetDateTime updated(); /** * Gets the createdBy property: Describes a user that created the watchlist item. - * + * * @return the createdBy value. */ UserInfo createdBy(); /** * Gets the updatedBy property: Describes a user that updated the watchlist item. - * + * * @return the updatedBy value. */ UserInfo updatedBy(); /** * Gets the itemsKeyValue property: key-value pairs for a watchlist item. - * + * * @return the itemsKeyValue value. */ Map itemsKeyValue(); /** * Gets the entityMapping property: key-value pairs for a watchlist item entity mapping. - * + * * @return the entityMapping value. */ Map entityMapping(); /** * 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.WatchlistItemInner object. - * + * * @return the inner object. */ WatchlistItemInner innerModel(); - /** The entirety of the WatchlistItem definition. */ + /** + * The entirety of the WatchlistItem definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The WatchlistItem definition stages. */ + + /** + * The WatchlistItem definition stages. + */ interface DefinitionStages { - /** The first stage of the WatchlistItem definition. */ + /** + * The first stage of the WatchlistItem definition. + */ interface Blank extends WithParentResource { } - /** The stage of the WatchlistItem definition allowing to specify parent resource. */ + + /** + * The stage of the WatchlistItem definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, workspaceName, watchlistAlias. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -152,306 +164,363 @@ interface WithParentResource { */ WithCreate withExistingWatchlist(String resourceGroupName, String workspaceName, String watchlistAlias); } + /** * The stage of the WatchlistItem definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithEtag, - DefinitionStages.WithWatchlistItemType, - DefinitionStages.WithWatchlistItemId, - DefinitionStages.WithTenantId, - DefinitionStages.WithIsDeleted, - DefinitionStages.WithCreated, - DefinitionStages.WithUpdated, - DefinitionStages.WithCreatedBy, - DefinitionStages.WithUpdatedBy, - DefinitionStages.WithItemsKeyValue, - DefinitionStages.WithEntityMapping { + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithWatchlistItemType, + DefinitionStages.WithWatchlistItemId, DefinitionStages.WithTenantId, DefinitionStages.WithIsDeleted, + DefinitionStages.WithCreated, DefinitionStages.WithUpdated, DefinitionStages.WithCreatedBy, + DefinitionStages.WithUpdatedBy, DefinitionStages.WithItemsKeyValue, DefinitionStages.WithEntityMapping { /** * Executes the create request. - * + * * @return the created resource. */ WatchlistItem create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ WatchlistItem create(Context context); } - /** The stage of the WatchlistItem definition allowing to specify etag. */ + + /** + * The stage of the WatchlistItem definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the WatchlistItem definition allowing to specify watchlistItemType. */ + + /** + * The stage of the WatchlistItem definition allowing to specify watchlistItemType. + */ interface WithWatchlistItemType { /** * Specifies the watchlistItemType property: The type of the watchlist item. - * + * * @param watchlistItemType The type of the watchlist item. * @return the next definition stage. */ WithCreate withWatchlistItemType(String watchlistItemType); } - /** The stage of the WatchlistItem definition allowing to specify watchlistItemId. */ + + /** + * The stage of the WatchlistItem definition allowing to specify watchlistItemId. + */ interface WithWatchlistItemId { /** * Specifies the watchlistItemId property: The id (a Guid) of the watchlist item. - * + * * @param watchlistItemId The id (a Guid) of the watchlist item. * @return the next definition stage. */ WithCreate withWatchlistItemId(String watchlistItemId); } - /** The stage of the WatchlistItem definition allowing to specify tenantId. */ + + /** + * The stage of the WatchlistItem definition allowing to specify tenantId. + */ interface WithTenantId { /** * Specifies the tenantId property: The tenantId to which the watchlist item belongs to. - * + * * @param tenantId The tenantId to which the watchlist item belongs to. * @return the next definition stage. */ WithCreate withTenantId(String tenantId); } - /** The stage of the WatchlistItem definition allowing to specify isDeleted. */ + + /** + * The stage of the WatchlistItem definition allowing to specify isDeleted. + */ interface WithIsDeleted { /** * Specifies the isDeleted property: A flag that indicates if the watchlist item is deleted or not. - * + * * @param isDeleted A flag that indicates if the watchlist item is deleted or not. * @return the next definition stage. */ WithCreate withIsDeleted(Boolean isDeleted); } - /** The stage of the WatchlistItem definition allowing to specify created. */ + + /** + * The stage of the WatchlistItem definition allowing to specify created. + */ interface WithCreated { /** * Specifies the created property: The time the watchlist item was created. - * + * * @param created The time the watchlist item was created. * @return the next definition stage. */ WithCreate withCreated(OffsetDateTime created); } - /** The stage of the WatchlistItem definition allowing to specify updated. */ + + /** + * The stage of the WatchlistItem definition allowing to specify updated. + */ interface WithUpdated { /** * Specifies the updated property: The last time the watchlist item was updated. - * + * * @param updated The last time the watchlist item was updated. * @return the next definition stage. */ WithCreate withUpdated(OffsetDateTime updated); } - /** The stage of the WatchlistItem definition allowing to specify createdBy. */ + + /** + * The stage of the WatchlistItem definition allowing to specify createdBy. + */ interface WithCreatedBy { /** * Specifies the createdBy property: Describes a user that created the watchlist item. - * + * * @param createdBy Describes a user that created the watchlist item. * @return the next definition stage. */ WithCreate withCreatedBy(UserInfo createdBy); } - /** The stage of the WatchlistItem definition allowing to specify updatedBy. */ + + /** + * The stage of the WatchlistItem definition allowing to specify updatedBy. + */ interface WithUpdatedBy { /** * Specifies the updatedBy property: Describes a user that updated the watchlist item. - * + * * @param updatedBy Describes a user that updated the watchlist item. * @return the next definition stage. */ WithCreate withUpdatedBy(UserInfo updatedBy); } - /** The stage of the WatchlistItem definition allowing to specify itemsKeyValue. */ + + /** + * The stage of the WatchlistItem definition allowing to specify itemsKeyValue. + */ interface WithItemsKeyValue { /** * Specifies the itemsKeyValue property: key-value pairs for a watchlist item. - * + * * @param itemsKeyValue key-value pairs for a watchlist item. * @return the next definition stage. */ WithCreate withItemsKeyValue(Map itemsKeyValue); } - /** The stage of the WatchlistItem definition allowing to specify entityMapping. */ + + /** + * The stage of the WatchlistItem definition allowing to specify entityMapping. + */ interface WithEntityMapping { /** * Specifies the entityMapping property: key-value pairs for a watchlist item entity mapping. - * + * * @param entityMapping key-value pairs for a watchlist item entity mapping. * @return the next definition stage. */ WithCreate withEntityMapping(Map entityMapping); } } + /** * Begins update for the WatchlistItem resource. - * + * * @return the stage of resource update. */ WatchlistItem.Update update(); - /** The template for WatchlistItem update. */ - interface Update - extends UpdateStages.WithEtag, - UpdateStages.WithWatchlistItemType, - UpdateStages.WithWatchlistItemId, - UpdateStages.WithTenantId, - UpdateStages.WithIsDeleted, - UpdateStages.WithCreated, - UpdateStages.WithUpdated, - UpdateStages.WithCreatedBy, - UpdateStages.WithUpdatedBy, - UpdateStages.WithItemsKeyValue, - UpdateStages.WithEntityMapping { + /** + * The template for WatchlistItem update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithWatchlistItemType, + UpdateStages.WithWatchlistItemId, UpdateStages.WithTenantId, UpdateStages.WithIsDeleted, + UpdateStages.WithCreated, UpdateStages.WithUpdated, UpdateStages.WithCreatedBy, UpdateStages.WithUpdatedBy, + UpdateStages.WithItemsKeyValue, UpdateStages.WithEntityMapping { /** * Executes the update request. - * + * * @return the updated resource. */ WatchlistItem apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ WatchlistItem apply(Context context); } - /** The WatchlistItem update stages. */ + + /** + * The WatchlistItem update stages. + */ interface UpdateStages { - /** The stage of the WatchlistItem update allowing to specify etag. */ + /** + * The stage of the WatchlistItem update allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: Etag of the azure resource. - * + * * @param etag Etag of the azure resource. * @return the next definition stage. */ Update withEtag(String etag); } - /** The stage of the WatchlistItem update allowing to specify watchlistItemType. */ + + /** + * The stage of the WatchlistItem update allowing to specify watchlistItemType. + */ interface WithWatchlistItemType { /** * Specifies the watchlistItemType property: The type of the watchlist item. - * + * * @param watchlistItemType The type of the watchlist item. * @return the next definition stage. */ Update withWatchlistItemType(String watchlistItemType); } - /** The stage of the WatchlistItem update allowing to specify watchlistItemId. */ + + /** + * The stage of the WatchlistItem update allowing to specify watchlistItemId. + */ interface WithWatchlistItemId { /** * Specifies the watchlistItemId property: The id (a Guid) of the watchlist item. - * + * * @param watchlistItemId The id (a Guid) of the watchlist item. * @return the next definition stage. */ Update withWatchlistItemId(String watchlistItemId); } - /** The stage of the WatchlistItem update allowing to specify tenantId. */ + + /** + * The stage of the WatchlistItem update allowing to specify tenantId. + */ interface WithTenantId { /** * Specifies the tenantId property: The tenantId to which the watchlist item belongs to. - * + * * @param tenantId The tenantId to which the watchlist item belongs to. * @return the next definition stage. */ Update withTenantId(String tenantId); } - /** The stage of the WatchlistItem update allowing to specify isDeleted. */ + + /** + * The stage of the WatchlistItem update allowing to specify isDeleted. + */ interface WithIsDeleted { /** * Specifies the isDeleted property: A flag that indicates if the watchlist item is deleted or not. - * + * * @param isDeleted A flag that indicates if the watchlist item is deleted or not. * @return the next definition stage. */ Update withIsDeleted(Boolean isDeleted); } - /** The stage of the WatchlistItem update allowing to specify created. */ + + /** + * The stage of the WatchlistItem update allowing to specify created. + */ interface WithCreated { /** * Specifies the created property: The time the watchlist item was created. - * + * * @param created The time the watchlist item was created. * @return the next definition stage. */ Update withCreated(OffsetDateTime created); } - /** The stage of the WatchlistItem update allowing to specify updated. */ + + /** + * The stage of the WatchlistItem update allowing to specify updated. + */ interface WithUpdated { /** * Specifies the updated property: The last time the watchlist item was updated. - * + * * @param updated The last time the watchlist item was updated. * @return the next definition stage. */ Update withUpdated(OffsetDateTime updated); } - /** The stage of the WatchlistItem update allowing to specify createdBy. */ + + /** + * The stage of the WatchlistItem update allowing to specify createdBy. + */ interface WithCreatedBy { /** * Specifies the createdBy property: Describes a user that created the watchlist item. - * + * * @param createdBy Describes a user that created the watchlist item. * @return the next definition stage. */ Update withCreatedBy(UserInfo createdBy); } - /** The stage of the WatchlistItem update allowing to specify updatedBy. */ + + /** + * The stage of the WatchlistItem update allowing to specify updatedBy. + */ interface WithUpdatedBy { /** * Specifies the updatedBy property: Describes a user that updated the watchlist item. - * + * * @param updatedBy Describes a user that updated the watchlist item. * @return the next definition stage. */ Update withUpdatedBy(UserInfo updatedBy); } - /** The stage of the WatchlistItem update allowing to specify itemsKeyValue. */ + + /** + * The stage of the WatchlistItem update allowing to specify itemsKeyValue. + */ interface WithItemsKeyValue { /** * Specifies the itemsKeyValue property: key-value pairs for a watchlist item. - * + * * @param itemsKeyValue key-value pairs for a watchlist item. * @return the next definition stage. */ Update withItemsKeyValue(Map itemsKeyValue); } - /** The stage of the WatchlistItem update allowing to specify entityMapping. */ + + /** + * The stage of the WatchlistItem update allowing to specify entityMapping. + */ interface WithEntityMapping { /** * Specifies the entityMapping property: key-value pairs for a watchlist item entity mapping. - * + * * @param entityMapping key-value pairs for a watchlist item entity mapping. * @return the next definition stage. */ Update withEntityMapping(Map entityMapping); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ WatchlistItem refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItemList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItemList.java index 97bc46f5f4bd..0ea75ff61559 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/models/WatchlistItemList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the watchlist items. */ +/** + * List all the watchlist items. + */ @Fluent public final class WatchlistItemList { /* @@ -25,9 +27,15 @@ public final class WatchlistItemList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of WatchlistItemList class. + */ + public WatchlistItemList() { + } + /** * Get the nextLink property: URL to fetch the next set of watchlist item. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of watchlist items. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of watchlist items. - * + * * @param value the value value to set. * @return the WatchlistItemList object itself. */ @@ -56,14 +64,13 @@ public WatchlistItemList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model WatchlistItemList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model WatchlistItemList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItems.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItems.java index 9b56cdba2403..814ad742de3a 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of WatchlistItems. */ +/** + * Resource collection API of WatchlistItems. + */ public interface WatchlistItems { /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. @@ -25,84 +27,84 @@ public interface WatchlistItems { /** * Gets all watchlist Items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @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. + * 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}. */ - PagedIterable list( - String resourceGroupName, String workspaceName, String watchlistAlias, String skipToken, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, + String skipToken, Context context); /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a watchlist, without its watchlist items along with {@link Response}. */ - WatchlistItem get(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, Context context); /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a watchlist, without its watchlist items. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId, Context context); + WatchlistItem get(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); /** * Delete a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, Context context); /** * Delete a watchlist item. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. * @param watchlistItemId Watchlist Item Id (GUID). - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 watchlistAlias, String watchlistItemId, Context context); + void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); /** * Gets a watchlist, without its watchlist items. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -113,7 +115,7 @@ Response deleteWithResponse( /** * Gets a watchlist, without its watchlist items. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -125,7 +127,7 @@ Response deleteWithResponse( /** * Delete a watchlist item. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -135,7 +137,7 @@ Response deleteWithResponse( /** * Delete a watchlist item. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -147,7 +149,7 @@ Response deleteWithResponse( /** * Begins definition for a new WatchlistItem resource. - * + * * @param name resource name. * @return the first stage of the new WatchlistItem definition. */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistList.java index 4e03f77f637e..08d3764322d6 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/models/WatchlistList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List all the watchlists. */ +/** + * List all the watchlists. + */ @Fluent public final class WatchlistList { /* @@ -25,9 +27,15 @@ public final class WatchlistList { @JsonProperty(value = "value", required = true) private List value; + /** + * Creates an instance of WatchlistList class. + */ + public WatchlistList() { + } + /** * Get the nextLink property: URL to fetch the next set of watchlists. - * + * * @return the nextLink value. */ public String nextLink() { @@ -36,7 +44,7 @@ public String nextLink() { /** * Get the value property: Array of watchlist. - * + * * @return the value value. */ public List value() { @@ -45,7 +53,7 @@ public List value() { /** * Set the value property: Array of watchlist. - * + * * @param value the value value to set. * @return the WatchlistList object itself. */ @@ -56,14 +64,13 @@ public WatchlistList withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model WatchlistList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model WatchlistList")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlists.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlists.java index 4e53d746f064..4d46dcc57528 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Watchlists. */ +/** + * Resource collection API of Watchlists. + */ public interface Watchlists { /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,12 +26,12 @@ public interface Watchlists { /** * Gets all watchlists, without watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @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. + * 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. @@ -40,62 +42,62 @@ public interface Watchlists { /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a watchlist, without its watchlist items. + * @return a watchlist, without its watchlist items along with {@link Response}. */ - Watchlist get(String resourceGroupName, String workspaceName, String watchlistAlias); + Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + Context context); /** * Gets a watchlist, without its watchlist items. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 a watchlist, without its watchlist items. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + Watchlist get(String resourceGroupName, String workspaceName, String watchlistAlias); /** * Delete a watchlist. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ - void delete(String resourceGroupName, String workspaceName, String watchlistAlias); + WatchlistsDeleteResponse deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + Context context); /** * Delete a watchlist. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param watchlistAlias Watchlist Alias. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. */ - WatchlistsDeleteResponse deleteWithResponse( - String resourceGroupName, String workspaceName, String watchlistAlias, Context context); + void delete(String resourceGroupName, String workspaceName, String watchlistAlias); /** * Gets a watchlist, without its watchlist items. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -106,7 +108,7 @@ WatchlistsDeleteResponse deleteWithResponse( /** * Gets a watchlist, without its watchlist items. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -118,7 +120,7 @@ WatchlistsDeleteResponse deleteWithResponse( /** * Delete a watchlist. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -128,7 +130,7 @@ WatchlistsDeleteResponse deleteWithResponse( /** * Delete a watchlist. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,7 +142,7 @@ WatchlistsDeleteResponse deleteWithResponse( /** * Begins definition for a new Watchlist resource. - * + * * @param name resource name. * @return the first stage of the new Watchlist definition. */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsCreateOrUpdateHeaders.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsCreateOrUpdateHeaders.java index 5356e46d32f6..83ae103afbfb 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsCreateOrUpdateHeaders.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsCreateOrUpdateHeaders.java @@ -5,10 +5,13 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; -/** The WatchlistsCreateOrUpdateHeaders model. */ +/** + * The WatchlistsCreateOrUpdateHeaders model. + */ @Fluent public final class WatchlistsCreateOrUpdateHeaders { /* @@ -17,19 +20,21 @@ public final class WatchlistsCreateOrUpdateHeaders { @JsonProperty(value = "Azure-AsyncOperation") private String azureAsyncOperation; + private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation"); + // HttpHeaders containing the raw property values. /** * Creates an instance of WatchlistsCreateOrUpdateHeaders class. - * + * * @param rawHeaders The raw HttpHeaders that will be used to create the property values. */ public WatchlistsCreateOrUpdateHeaders(HttpHeaders rawHeaders) { - this.azureAsyncOperation = rawHeaders.getValue("Azure-AsyncOperation"); + this.azureAsyncOperation = rawHeaders.getValue(AZURE_ASYNC_OPERATION); } /** * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * + * * @return the azureAsyncOperation value. */ public String azureAsyncOperation() { @@ -38,7 +43,7 @@ public String azureAsyncOperation() { /** * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * + * * @param azureAsyncOperation the azureAsyncOperation value to set. * @return the WatchlistsCreateOrUpdateHeaders object itself. */ @@ -49,7 +54,7 @@ public WatchlistsCreateOrUpdateHeaders withAzureAsyncOperation(String azureAsync /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsCreateOrUpdateResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsCreateOrUpdateResponse.java index afdeedcf85a7..4bc846f41c6b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsCreateOrUpdateResponse.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsCreateOrUpdateResponse.java @@ -9,30 +9,28 @@ import com.azure.core.http.rest.ResponseBase; import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner; -/** Contains all response data for the createOrUpdate operation. */ +/** + * Contains all response data for the createOrUpdate operation. + */ public final class WatchlistsCreateOrUpdateResponse extends ResponseBase { /** * Creates an instance of WatchlistsCreateOrUpdateResponse. - * + * * @param request the request which resulted in this WatchlistsCreateOrUpdateResponse. * @param statusCode the status code of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param value the deserialized value of the HTTP response. * @param headers the deserialized headers of the HTTP response. */ - public WatchlistsCreateOrUpdateResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - WatchlistInner value, - WatchlistsCreateOrUpdateHeaders headers) { + public WatchlistsCreateOrUpdateResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + WatchlistInner value, WatchlistsCreateOrUpdateHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } /** * Gets the deserialized response body. - * + * * @return the deserialized response body. */ @Override diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsDeleteHeaders.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsDeleteHeaders.java index 8105fba3b9de..d878e7f4e715 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsDeleteHeaders.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsDeleteHeaders.java @@ -5,10 +5,13 @@ package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; -/** The WatchlistsDeleteHeaders model. */ +/** + * The WatchlistsDeleteHeaders model. + */ @Fluent public final class WatchlistsDeleteHeaders { /* @@ -17,19 +20,21 @@ public final class WatchlistsDeleteHeaders { @JsonProperty(value = "Azure-AsyncOperation") private String azureAsyncOperation; + private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation"); + // HttpHeaders containing the raw property values. /** * Creates an instance of WatchlistsDeleteHeaders class. - * + * * @param rawHeaders The raw HttpHeaders that will be used to create the property values. */ public WatchlistsDeleteHeaders(HttpHeaders rawHeaders) { - this.azureAsyncOperation = rawHeaders.getValue("Azure-AsyncOperation"); + this.azureAsyncOperation = rawHeaders.getValue(AZURE_ASYNC_OPERATION); } /** * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * + * * @return the azureAsyncOperation value. */ public String azureAsyncOperation() { @@ -38,7 +43,7 @@ public String azureAsyncOperation() { /** * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * + * * @param azureAsyncOperation the azureAsyncOperation value to set. * @return the WatchlistsDeleteHeaders object itself. */ @@ -49,7 +54,7 @@ public WatchlistsDeleteHeaders withAzureAsyncOperation(String azureAsyncOperatio /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsDeleteResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsDeleteResponse.java index 5315f66e3e28..efdd3617a344 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsDeleteResponse.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistsDeleteResponse.java @@ -8,19 +8,21 @@ import com.azure.core.http.HttpRequest; import com.azure.core.http.rest.ResponseBase; -/** Contains all response data for the delete operation. */ +/** + * Contains all response data for the delete operation. + */ public final class WatchlistsDeleteResponse extends ResponseBase { /** * Creates an instance of WatchlistsDeleteResponse. - * + * * @param request the request which resulted in this WatchlistsDeleteResponse. * @param statusCode the status code of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param value the deserialized value of the HTTP response. * @param headers the deserialized headers of the HTTP response. */ - public WatchlistsDeleteResponse( - HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, WatchlistsDeleteHeaders headers) { + public WatchlistsDeleteResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, + WatchlistsDeleteHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } } 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 index 8495bcf9e510..393f53458897 100644 --- 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 @@ -6,27 +6,30 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; -/** Detail about the webhook object. */ +/** + * Detail about the webhook object. + */ @Fluent public final class Webhook { /* * Unique identifier for the webhook. */ - @JsonProperty(value = "webhookId") + @JsonProperty(value = "webhookId", access = JsonProperty.Access.WRITE_ONLY) private String webhookId; /* * URL that gets invoked by the webhook. */ - @JsonProperty(value = "webhookUrl") + @JsonProperty(value = "webhookUrl", access = JsonProperty.Access.WRITE_ONLY) private String webhookUrl; /* * Time when the webhook secret was updated. */ - @JsonProperty(value = "webhookSecretUpdateTime") - private String webhookSecretUpdateTime; + @JsonProperty(value = "webhookSecretUpdateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime webhookSecretUpdateTime; /* * A flag to instruct the backend service to rotate webhook secret. @@ -35,68 +38,41 @@ public final class Webhook { private Boolean rotateWebhookSecret; /** - * Get the webhookId property: Unique identifier for the webhook. - * - * @return the webhookId value. + * Creates an instance of Webhook class. */ - public String webhookId() { - return this.webhookId; + public Webhook() { } /** - * Set the webhookId property: Unique identifier for the webhook. - * - * @param webhookId the webhookId value to set. - * @return the Webhook object itself. + * Get the webhookId property: Unique identifier for the webhook. + * + * @return the webhookId value. */ - public Webhook withWebhookId(String webhookId) { - this.webhookId = webhookId; - return this; + 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; } - /** - * Set the webhookUrl property: URL that gets invoked by the webhook. - * - * @param webhookUrl the webhookUrl value to set. - * @return the Webhook object itself. - */ - public Webhook withWebhookUrl(String webhookUrl) { - this.webhookUrl = webhookUrl; - return this; - } - /** * Get the webhookSecretUpdateTime property: Time when the webhook secret was updated. - * + * * @return the webhookSecretUpdateTime value. */ - public String webhookSecretUpdateTime() { + public OffsetDateTime webhookSecretUpdateTime() { return this.webhookSecretUpdateTime; } - /** - * Set the webhookSecretUpdateTime property: Time when the webhook secret was updated. - * - * @param webhookSecretUpdateTime the webhookSecretUpdateTime value to set. - * @return the Webhook object itself. - */ - public Webhook withWebhookSecretUpdateTime(String webhookSecretUpdateTime) { - this.webhookSecretUpdateTime = webhookSecretUpdateTime; - return this; - } - /** * Get the rotateWebhookSecret property: A flag to instruct the backend service to rotate webhook secret. - * + * * @return the rotateWebhookSecret value. */ public Boolean rotateWebhookSecret() { @@ -105,7 +81,7 @@ public Boolean 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. */ @@ -116,7 +92,7 @@ public Webhook withRotateWebhookSecret(Boolean rotateWebhookSecret) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignment.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignment.java new file mode 100644 index 000000000000..9c8c821f1f0c --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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. + */ + ProvisioningState 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..e26abf0b05ef --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of WorkspaceManagerAssignmentJobs. + */ +public interface WorkspaceManagerAssignmentJobs { + /** + * 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); + + /** + * 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); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignmentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignmentList.java new file mode 100644 index 000000000000..566ace1dfabf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignmentList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of all the workspace manager assignments. + */ +@Fluent +public final class WorkspaceManagerAssignmentList { + /* + * URL to fetch the next set of workspace manager assignments. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of workspace manager assignments. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of WorkspaceManagerAssignmentList class. + */ + public WorkspaceManagerAssignmentList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of workspace manager assignments. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of workspace manager assignments. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of workspace manager assignments. + * + * @param value the value value to set. + * @return the WorkspaceManagerAssignmentList object itself. + */ + public WorkspaceManagerAssignmentList 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 WorkspaceManagerAssignmentList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerAssignmentList.class); +} 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..ebdfe99e716c --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of WorkspaceManagerAssignments. + */ +public interface WorkspaceManagerAssignments { + /** + * 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 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); + + /** + * 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..c516b8c6a4a5 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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/WorkspaceManagerConfigurationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfigurationList.java new file mode 100644 index 000000000000..924084d108f8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfigurationList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List all the workspace manager configurations for the workspace. + */ +@Fluent +public final class WorkspaceManagerConfigurationList { + /* + * URL to fetch the next set of workspace manager configurations. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of workspace manager configurations. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of WorkspaceManagerConfigurationList class. + */ + public WorkspaceManagerConfigurationList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of workspace manager configurations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of workspace manager configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of workspace manager configurations. + * + * @param value the value value to set. + * @return the WorkspaceManagerConfigurationList object itself. + */ + public WorkspaceManagerConfigurationList 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 WorkspaceManagerConfigurationList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerConfigurationList.class); +} 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..5a4f36b33d8f --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of WorkspaceManagerConfigurations. + */ +public interface WorkspaceManagerConfigurations { + /** + * 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 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 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..28d233d46393 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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/WorkspaceManagerGroupList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroupList.java new file mode 100644 index 000000000000..1c2c69989a92 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroupList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of all the workspace manager groups. + */ +@Fluent +public final class WorkspaceManagerGroupList { + /* + * URL to fetch the next set of workspace manager groups. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of workspace manager groups. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of WorkspaceManagerGroupList class. + */ + public WorkspaceManagerGroupList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of workspace manager groups. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of workspace manager groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of workspace manager groups. + * + * @param value the value value to set. + * @return the WorkspaceManagerGroupList object itself. + */ + public WorkspaceManagerGroupList 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 WorkspaceManagerGroupList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerGroupList.class); +} 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..c9e710887111 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of WorkspaceManagerGroups. + */ +public interface WorkspaceManagerGroups { + /** + * 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 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 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..8b247712ba40 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.fluent.models.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..aee183fe34f9 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of WorkspaceManagerMembers. + */ +public interface WorkspaceManagerMembers { + /** + * 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 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 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/WorkspaceManagerMembersList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMembersList.java new file mode 100644 index 000000000000..84277e98ffbb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMembersList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of workspace manager members. + */ +@Fluent +public final class WorkspaceManagerMembersList { + /* + * URL to fetch the next set of workspace manager members + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Array of workspace manager members + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of WorkspaceManagerMembersList class. + */ + public WorkspaceManagerMembersList() { + } + + /** + * Get the nextLink property: URL to fetch the next set of workspace manager members. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: Array of workspace manager members. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of workspace manager members. + * + * @param value the value value to set. + * @return the WorkspaceManagerMembersList object itself. + */ + public WorkspaceManagerMembersList 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 WorkspaceManagerMembersList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerMembersList.class); +} 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 7d0c87c62078..45d88111a38b 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure Security - * Insights) resource provider. + * Package containing the data models for SecurityInsights. + * API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. */ package com.azure.resourcemanager.securityinsights.models; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/package-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/package-info.java index 702e4085ae09..a3c2300976d5 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for SecurityInsights. API spec for Microsoft.SecurityInsights (Azure Security - * Insights) resource provider. + * Package containing the classes for SecurityInsights. + * API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. */ package com.azure.resourcemanager.securityinsights; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/module-info.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/module-info.java index 0d8b5f7fc371..82e186c71a5e 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 @@ -4,16 +4,10 @@ module com.azure.resourcemanager.securityinsights { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.securityinsights; exports com.azure.resourcemanager.securityinsights.fluent; exports com.azure.resourcemanager.securityinsights.fluent.models; exports com.azure.resourcemanager.securityinsights.models; - - opens com.azure.resourcemanager.securityinsights.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.securityinsights.models to - com.azure.core, - com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.securityinsights.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.securityinsights.models to com.azure.core, com.fasterxml.jackson.databind; +} \ 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 new file mode 100644 index 000000000000..e3446e6be5b1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-securityinsights/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.securityinsights.implementation.AlertRulesClientImpl$AlertRulesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ActionsClientImpl$ActionsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.AlertRuleTemplatesClientImpl$AlertRuleTemplatesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.AutomationRulesClientImpl$AutomationRulesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.EntitiesClientImpl$EntitiesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.IncidentsClientImpl$IncidentsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.BillingStatisticsClientImpl$BillingStatisticsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.BookmarksClientImpl$BookmarksService" ], [ "com.azure.resourcemanager.securityinsights.implementation.BookmarkRelationsClientImpl$BookmarkRelationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.BookmarkOperationsClientImpl$BookmarkOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.BusinessApplicationAgentsClientImpl$BusinessApplicationAgentsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.BusinessApplicationAgentOperationsClientImpl$BusinessApplicationAgentOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.SystemsClientImpl$SystemsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ContentPackagesClientImpl$ContentPackagesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ContentPackageOperationsClientImpl$ContentPackageOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ProductPackagesClientImpl$ProductPackagesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ProductPackageOperationsClientImpl$ProductPackageOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ProductTemplatesClientImpl$ProductTemplatesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ProductTemplateOperationsClientImpl$ProductTemplateOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ContentTemplatesClientImpl$ContentTemplatesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ContentTemplateOperationsClientImpl$ContentTemplateOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ResourceProvidersClientImpl$ResourceProvidersService" ], [ "com.azure.resourcemanager.securityinsights.implementation.EntitiesGetTimelinesClientImpl$EntitiesGetTimelinesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.EntitiesRelationsClientImpl$EntitiesRelationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.EntityRelationsClientImpl$EntityRelationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.EntityQueriesClientImpl$EntityQueriesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.EntityQueryTemplatesClientImpl$EntityQueryTemplatesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.FileImportsClientImpl$FileImportsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.HuntsClientImpl$HuntsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.HuntRelationsClientImpl$HuntRelationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.HuntCommentsClientImpl$HuntCommentsService" ], [ "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.MetadatasClientImpl$MetadatasService" ], [ "com.azure.resourcemanager.securityinsights.implementation.OfficeConsentsClientImpl$OfficeConsentsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.SentinelOnboardingStatesClientImpl$SentinelOnboardingStatesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.GetRecommendationsClientImpl$GetRecommendationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.GetsClientImpl$GetsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.UpdatesClientImpl$UpdatesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ReevaluatesClientImpl$ReevaluatesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.SecurityMLAnalyticsSettingsClientImpl$SecurityMLAnalyticsSettingsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ProductSettingsClientImpl$ProductSettingsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.SourceControlsClientImpl$SourceControlsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.SourceControlsOperationsClientImpl$SourceControlsOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorsClientImpl$ThreatIntelligenceIndicatorsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorsOperationsClientImpl$ThreatIntelligenceIndicatorsOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorMetricsClientImpl$ThreatIntelligenceIndicatorMetricsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligencesClientImpl$ThreatIntelligencesService" ], [ "com.azure.resourcemanager.securityinsights.implementation.TriggeredAnalyticsRuleRunOperationsClientImpl$TriggeredAnalyticsRuleRunOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.GetTriggeredAnalyticsRuleRunsClientImpl$GetTriggeredAnalyticsRuleRunsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.AlertRuleOperationsClientImpl$AlertRuleOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.WatchlistsClientImpl$WatchlistsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.WatchlistItemsClientImpl$WatchlistItemsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerAssignmentsClientImpl$WorkspaceManagerAssignmentsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerAssignmentJobsClientImpl$WorkspaceManagerAssignmentJobsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerConfigurationsClientImpl$WorkspaceManagerConfigurationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerGroupsClientImpl$WorkspaceManagerGroupsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerMembersClientImpl$WorkspaceManagerMembersService" ], [ "com.azure.resourcemanager.securityinsights.implementation.DataConnectorDefinitionsClientImpl$DataConnectorDefinitionsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.DataConnectorsClientImpl$DataConnectorsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.DataConnectorsCheckRequirementsOperationsClientImpl$DataConnectorsCheckRequirementsOperationsService" ], [ "com.azure.resourcemanager.securityinsights.implementation.OperationsClientImpl$OperationsService" ] ] \ 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/reflect-config.json b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-securityinsights/reflect-config.json new file mode 100644 index 000000000000..d5a257d20125 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-securityinsights/reflect-config.json @@ -0,0 +1,3541 @@ +[ { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertRulesList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ResourceWithEtag", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActionsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActionPropertiesBase", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActionRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ActionRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatesList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRuleCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRuleAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ClientInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulesList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityManualTriggerRequestBody", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ManualTriggerRequestBody", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BillingStatisticList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AzureEntityResource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BookmarkList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.BookmarkProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.UserInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityFieldMapping", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RelationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RelationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RelationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ExpansionResultAggregation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BookmarkExpandResponseValue", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EntityInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectedEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.BusinessApplicationAgentResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AgentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AgentConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AgentSystem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BusinessApplicationAgentsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SystemResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SystemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SystemsConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SystemsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ListActionsResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ActionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PackageList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.PackageProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PackageBaseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MetadataSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MetadataAuthor", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MetadataSupport", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MetadataDependencies", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MetadataCategories", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ProductPackageList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ProductPackageAdditionalProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ProductTemplateList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TemplateBaseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ProductTemplateAdditionalProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TemplateList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TemplateAdditionalProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EnrichmentIpAddressBody", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisRegistrarDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisContacts", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisContact", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityExpandParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityExpandResponseValue", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityEdges", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TimelineResultsMetadata", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TimelineAggregation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TimelineError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityTimelineItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.GetQueriesResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityQueryItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GetInsightsResultsMetadata", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GetInsightsErrorKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityInsightItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityInsightItemQueryTimeInterval", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightsTableResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightsTableResultColumnsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityQueryList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CustomEntityQuery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FileImportList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.FileImportInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.FileImportProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FileMetadata", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ValidationError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.HuntList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.HuntInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.HuntProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.HuntOwner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.HuntRelationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.HuntCommentList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IncidentPropertiesInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentLabel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentAdditionalData", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SecurityAlert", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SecurityAlertProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SecurityAlertPropertiesConfidenceReasonsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityCommonProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.HuntingBookmark", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.HuntingBookmarkProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentCommentList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentEntitiesResultsMetadata", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentTaskList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MetadataList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MetadataProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MetadataPatch", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MetadataPropertiesPatch", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeConsentList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RecommendationListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RecommendationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RecommendedSuggestion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RecommendationPatch", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RecommendationPatchProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ReevaluateResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SettingListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RepositoryAccessObject", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RepositoryAccess", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RepoList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RepoInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SourceControlList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SourceControlProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Repository", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ServicePrincipal", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RepositoryResourceInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Webhook", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GitHubResourceInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AzureDevOpsResourceInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DeploymentInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Deployment", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PullRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WarningInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WarningBody", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceIndicatorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceKillChainPhase", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceParsedPattern", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceParsedPatternTypeValue", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceExternalReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceGranularMarkingModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteria", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetrics", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetric", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetricEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Query", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.QueryProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConditionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConditionClause", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.QueryAutoGenerated", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.QueryCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.QuerySortBy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TIObjectCommonProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.UserInfoAutoGenerated", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RelationshipHint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TriggeredAnalyticsRuleRuns", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AnalyticsRuleRunTrigger", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AnalyticsRuleRunTriggerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WatchlistList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WatchlistProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WatchlistItemList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignmentList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AssignmentItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.JobList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.JobInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.JobProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.JobItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Error", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WorkspaceManagerConfigurationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WorkspaceManagerGroupList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WorkspaceManagerMembersList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorDefinitionArmCollectionWrapper", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorsCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorRequirementsStateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OperationsList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatePropertiesBase", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateWithMitreProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.QueryBasedAlertRuleTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityMapping", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FieldMapping", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EventGroupingSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SentinelEntityMapping", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MLBehaviorAnalyticsAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MLBehaviorAnalyticsAlertRuleTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionSourceSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionSourceSubTypeSetting", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFilter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFiltersItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionScenarioExclusionPattern", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionAlertRuleTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionTemplateSourceSetting", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionTemplateSourceSubType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FusionTemplateSubTypeSeverityFilter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRuleTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftSecurityIncidentCreationAlertRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRuleCommonProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRuleTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GroupingConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ScheduledAlertRuleCommonProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ScheduledAlertRuleTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.NrtAlertRuleTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ScheduledAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.NrtAlertRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AddIncidentTaskActionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRuleAddIncidentTaskAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRuleBooleanCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRuleModifyPropertiesAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentPropertiesAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayChangedValuesCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayValuesCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyValuesChangedCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyValuesCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRuleRunPlaybookAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PlaybookActionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BooleanConditionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PropertyArrayChangedConditionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PropertyArrayConditionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PropertyChangedConditionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PropertyConditionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SapSolutionUsageStatistic", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SapSolutionUsageStatisticProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SapAgentConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.LockUserAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.UnlockUserAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Log", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RfcConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SystemsConfigurationConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SapControlConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SapSystemsConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActivityTimelineItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BookmarkTimelineItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AnomalyTimelineItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityQueryItemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityQueryItemPropertiesDataTypesItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightQueryItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightQueryItemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQuery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesAdditionalQuery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesDefaultTimeRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesReferenceTimeRange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SecurityAlertTimelineItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ExpansionEntityQuery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ExpansionEntityQueriesProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActivityEntityQuery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActivityEntityQueriesPropertiesQueryDefinitions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActivityCustomEntityQuery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueryTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplatePropertiesQueryDefinitions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataTypeDefinitions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AnomalySecurityMLAnalyticsSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AnomalySecurityMLAnalyticsSettingsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsDataSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Anomalies", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AnomaliesSettingsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EyesOn", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EyesOnSettingsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityAnalytics", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.EntityAnalyticsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Ueba", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.UebaProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatActor", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AttackPattern", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Identity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Relationship", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Indicator", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IndicatorObservablesItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsAvailability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectivityCriterion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectorDataType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CustomizableConnectorDefinition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.CustomizableConnectorDefinitionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GraphQuery", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsPermissions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsResourceProvider", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InstructionStep", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InstructionStepDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CustomizableConnectionsConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AadCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AadCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AatpCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AatpCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AscCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AscCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AwsCloudTrailCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AwsS3CheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Dynamics365CheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365CheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.McasCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.McasCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MdatpCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MdatpCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MstiCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MstiCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MtpCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MtpCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeAtpCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OfficeAtpCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeIrmCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OfficeIrmCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Office365ProjectCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficePowerBICheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBICheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TICheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TICheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TiTaxiiCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IoTCheckRequirements", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IoTCheckRequirementsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AadDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AadDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorWithAlertsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MstiDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MstiDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MtpDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MtpDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MtpDataConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MtpDataConnectorDataTypesIncidents", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MtpDataConnectorDataTypesAlerts", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MtpFilteredProviders", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AatpDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AatpDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AscDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AscDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AwsCloudTrailDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AwsCloudTrailDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AwsCloudTrailDataConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AwsCloudTrailDataConnectorDataTypesLogs", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AwsS3DataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AwsS3DataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypesLogs", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RestApiPollerDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RestApiPollerDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CcpAuthConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DcrConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CcpResponseConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingLinkHeaderConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingTokenConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingNextPageUrlConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingOffsetConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingCountBaseConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GcpDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.GcpDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GcpAuthProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GcpRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ApiKeyAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AwsAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BasicAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GcpAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GenericBlobSbsAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GitHubAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.NoneAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.JwtAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OracleAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SessionAuthModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.McasDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.McasDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.McasDataConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365DataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeAtpDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OfficeAtpDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Office365ProjectDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypesLogs", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficePowerBIDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBIDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypesLogs", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeIrmDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OfficeIrmDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MdatpDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MdatpDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.OfficeDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesExchange", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesSharePoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesTeams", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TIDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TIDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypesIndicators", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypesTaxiiClient", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IoTDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IoTDataConnectorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessUiDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.CodelessParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesGraphQueriesItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GraphQueries", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesSampleQueriesItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SampleQueries", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesDataTypesItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.LastDataReceivedDataType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectivityCriteria", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Availability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Permissions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PermissionsResourceProviderItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ResourceProvider", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RequiredPermissions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PermissionsCustomsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Customs", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CustomsPermission", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesInstructionStepsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InstructionSteps", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectorInstructionModelBase", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessApiPollingDataConnector", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ApiPollingParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingConfigProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingAuthProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingRequestProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingPagingProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingResponseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AccountEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AccountEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AzureResourceEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.AzureResourceEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CloudApplicationEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.CloudApplicationEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DnsEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.DnsEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FileEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.FileEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FileHashEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.FileHashEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.HostEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.HostEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IoTDeviceEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IoTDeviceEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligence", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IpEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.IpEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GeoLocation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MailboxEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MailboxEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MailClusterEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MailClusterEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MailMessageEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MailMessageEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MalwareEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.MalwareEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ProcessEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.ProcessEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RegistryKeyEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RegistryKeyEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RegistryValueEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.RegistryValueEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SecurityGroupEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SecurityGroupEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SubmissionMailEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.SubmissionMailEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.UrlEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.UrlEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.NicEntity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.fluent.models.NicEntityProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WatchlistsDeleteHeaders", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WatchlistsCreateOrUpdateHeaders", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertRuleKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TriggersOn", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TriggersWhen", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConditionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.BillingStatisticKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentSeverity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AttackTactic", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityKindEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AgentType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SystemStatusType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConfigurationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ListActionKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PackageKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Flag", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SourceKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SupportTier", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Kind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Operator", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EnrichmentType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityTimelineKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityQueryKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.GetInsightsError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityQueriesKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CustomEntityQueryKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IngestionMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FileImportContentType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FileFormat", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DeleteStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FileImportState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Status", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.HypothesisStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OwnerType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentClassification", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentLabelType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConfidenceLevel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConfidenceScoreStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.KillChainIntent", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertSeverity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.State", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SettingKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Version", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RepoType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ContentType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DeploymentFetchStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DeploymentState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DeploymentResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.WarningCode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceInnerKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingOrder", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TiType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Connective", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SortingDirection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TIObjectKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SourceType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Mode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorDefinitionKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectAuthKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorAuthorizationState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataConnectorLicenseState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TemplateStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityMappingType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertProperty", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EventGroupingAggregationKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityProductName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MatchingMethod", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AlertDetail", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRuleBooleanConditionSupportedOperator", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayChangedConditionSupportedArrayType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayChangedConditionSupportedChangeType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayConditionSupportedArrayType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayConditionSupportedArrayConditionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyChangedConditionSupportedPropertyType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyChangedConditionSupportedChangedType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyConditionSupportedOperator", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyConditionSupportedProperty", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.KeyVaultAuthenticationMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SecretSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.LogType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.IngestionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.LogStatusType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SapAuthenticationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SystemConfigurationConnectorType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.HttpsConfigurationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OutputType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SettingsStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.EntityProviders", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.UebaDataSources", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ProviderPermissionsScope", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DataTypeState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.MtpProvider", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.CcpAuthType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.HttpMethodVerb", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PollingFrequency", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ConnectivityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ProviderName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.PermissionProviderScope", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.SettingType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.FileHashAlgorithm", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DeviceImportance", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AntispamMailDirection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RegistryHive", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.RegistryValueKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.TriggerOperator", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.OSFamily", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DeliveryAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.DeliveryLocation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.ElevationToken", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.Constant124", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.securityinsights.models.AvailabilityStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file 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 68e39f44ac62..693d21c82f0f 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 @@ -4,20 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -/** Samples for Actions CreateOrUpdate. */ +/** + * Samples for Actions CreateOrUpdate. + */ public final class ActionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/actions/CreateActionOfAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/actions/CreateActionOfAlertRule.json */ /** * Sample code: Creates or updates an action of alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAnActionOfAlertRule( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .actions() + manager.actions() .define("912bec42-cb66-4c03-ac63-1761b6898c3e") .withExistingAlertRule("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5") .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") 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 4eade4f80487..400d0e7b0f1b 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 @@ -4,27 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Actions Delete. */ +/** + * Samples for Actions Delete. + */ public final class ActionsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/actions/DeleteActionOfAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/actions/DeleteActionOfAlertRule.json */ /** * Sample code: Delete an action of alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAnActionOfAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .actions() - .deleteWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - "912bec42-cb66-4c03-ac63-1761b6898c3e", - Context.NONE); + public static void + deleteAnActionOfAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.actions() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "912bec42-cb66-4c03-ac63-1761b6898c3e", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetSamples.java index 3d2f9a3fcd1a..155172d4562d 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 @@ -4,27 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Actions Get. */ +/** + * Samples for Actions Get. + */ public final class ActionsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/actions/GetActionOfAlertRuleById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/actions/GetActionOfAlertRuleById.json */ /** * Sample code: Get an action of alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnActionOfAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .actions() - .getWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - "912bec42-cb66-4c03-ac63-1761b6898c3e", - Context.NONE); + public static void + getAnActionOfAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.actions() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "912bec42-cb66-4c03-ac63-1761b6898c3e", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleSamples.java index 61efbd321ea9..aacb80f3978d 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 @@ -4,20 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Actions ListByAlertRule. */ +/** + * Samples for Actions ListByAlertRule. + */ public final class ActionsListByAlertRuleSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/actions/GetAllActionsByAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/actions/GetAllActionsByAlertRule.json */ /** * Sample code: Get all actions of alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllActionsOfAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.actions().listByAlertRule("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + public static void + getAllActionsOfAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.actions() + .listByAlertRule("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/AlertRuleOperationTriggerRuleRunSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleOperationTriggerRuleRunSamples.java new file mode 100644 index 000000000000..a7703b258a8f --- /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) AutoRest 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 5e2ef04f866c..e19c6cf9749e 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for AlertRuleTemplates Get. */ +/** + * Samples for AlertRuleTemplates Get. + */ public final class AlertRuleTemplatesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplateById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplateById.json */ /** * Sample code: Get alert rule template by Id. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAlertRuleTemplateById( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRuleTemplates() - .getWithResponse("myRg", "myWorkspace", "65360bb0-8986-4ade-a89d-af3cf44d28aa", Context.NONE); + public static void + getAlertRuleTemplateById(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRuleTemplates() + .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/AlertRuleTemplatesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListSamples.java index 30931adbd1bb..df5c4620cfe5 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 @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for AlertRuleTemplates List. */ +/** + * Samples for AlertRuleTemplates List. + */ public final class AlertRuleTemplatesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json */ /** * Sample code: Get all alert rule templates. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllAlertRuleTemplates( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.alertRuleTemplates().list("myRg", "myWorkspace", Context.NONE); + public static void + getAllAlertRuleTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRuleTemplates().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/AlertRulesCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesCreateOrUpdateSamples.java index df3209f52c0c..de2a19f82322 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 @@ -4,9 +4,10 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.AlertDetail; import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.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; @@ -26,279 +27,176 @@ 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; import java.util.HashMap; import java.util.Map; -/** Samples for AlertRules CreateOrUpdate. */ +/** + * Samples for AlertRules CreateOrUpdate. + */ public final class AlertRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/CreateFusionAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/CreateFusionAlertRule.json */ /** * Sample code: Creates or updates a Fusion alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAFusionAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "myFirstFusionRule", - new FusionAlertRule() - .withEtag("3d00c3ca-0000-0100-0000-5d42d5010000") + public static void + createsOrUpdatesAFusionAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRules() + .createOrUpdateWithResponse("myRg", "myWorkspace", "myFirstFusionRule", + new FusionAlertRule().withEtag("3d00c3ca-0000-0100-0000-5d42d5010000") .withAlertRuleTemplateName("f71aba3d-28fb-450b-b192-4e76a83015c8") .withEnabled(true) - .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()))))), - Context.NONE); + .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/preview/2022-09-01-preview/examples/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json */ /** * Sample code: Creates or updates a MicrosoftSecurityIncidentCreation rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAMicrosoftSecurityIncidentCreationRule( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "microsoftSecurityIncidentCreationRuleExample", - new MicrosoftSecurityIncidentCreationAlertRule() - .withEtag("\"260097e0-0000-0d00-0000-5d6fa88f0000\"") + manager.alertRules() + .createOrUpdateWithResponse("myRg", "myWorkspace", "microsoftSecurityIncidentCreationRuleExample", + new MicrosoftSecurityIncidentCreationAlertRule().withEtag("\"260097e0-0000-0d00-0000-5d6fa88f0000\"") .withDisplayName("testing displayname") .withEnabled(true) .withProductFilter(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/CreateScheduledAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/CreateScheduledAlertRule.json */ /** * Sample code: Creates or updates a Scheduled alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAScheduledAlertRule( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new ScheduledAlertRule() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + manager.alertRules() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new ScheduledAlertRule().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") .withDescription("An example for a scheduled rule") .withDisplayName("My scheduled rule") .withEnabled(true) @@ -306,19 +204,14 @@ public static void createsOrUpdatesAScheduledAlertRule( .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) - .withLookbackDuration(Duration.parse("PT5H")) - .withMatchingMethod(MatchingMethod.SELECTED) - .withGroupByEntities(Arrays.asList(EntityMappingType.HOST)) - .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) - .withGroupByCustomDetails( - Arrays.asList("OperatingSystemType", "OperatingSystemName")))) + .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(true) + .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) + .withReopenClosedIncident(false) + .withLookbackDuration(Duration.parse("PT5H")) + .withMatchingMethod(MatchingMethod.SELECTED) + .withGroupByEntities(Arrays.asList(EntityMappingType.HOST)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) + .withGroupByCustomDetails(Arrays.asList("OperatingSystemType", "OperatingSystemName")))) .withQuery("Heartbeat") .withQueryFrequency(Duration.parse("PT1H")) .withQueryPeriod(Duration.parse("P2DT1H30M")) @@ -328,277 +221,170 @@ public static void createsOrUpdatesAScheduledAlertRule( .withEventGroupingSettings( new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.ALERT_PER_RESULT)) .withCustomDetails(mapOf("OperatingSystemName", "OSName", "OperatingSystemType", "OSType")) - .withEntityMappings( - Arrays - .asList( - new EntityMapping() - .withEntityType(EntityMappingType.HOST) - .withFieldMappings( - Arrays - .asList( - new FieldMapping() - .withIdentifier("FullName") - .withColumnName("Computer"))), - new EntityMapping() - .withEntityType(EntityMappingType.IP) - .withFieldMappings( - Arrays - .asList( - new FieldMapping() - .withIdentifier("Address") - .withColumnName("ComputerIP"))))) - .withAlertDetailsOverride( - new AlertDetailsOverride() - .withAlertDisplayNameFormat("Alert from {{Computer}}") - .withAlertDescriptionFormat("Suspicious activity was made by {{ComputerIP}}")), - Context.NONE); + .withEntityMappings(Arrays.asList( + new EntityMapping().withEntityType(EntityMappingType.HOST) + .withFieldMappings(Arrays + .asList(new FieldMapping().withIdentifier("FullName").withColumnName("Computer"))), + new EntityMapping().withEntityType(EntityMappingType.IP) + .withFieldMappings(Arrays + .asList(new FieldMapping().withIdentifier("Address").withColumnName("ComputerIP"))))) + .withAlertDetailsOverride(new AlertDetailsOverride() + .withAlertDisplayNameFormat("Alert from {{Computer}}") + .withAlertDescriptionFormat("Suspicious activity was made by {{ComputerIP}}") + .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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/CreateFusionAlertRuleWithFusionScenarioExclusion.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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") + 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()))))), - Context.NONE); + .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/preview/2022-09-01-preview/examples/alertRules/CreateNrtAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/CreateNrtAlertRule.json */ /** * Sample code: Creates or updates a Nrt alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesANrtAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new NrtAlertRule() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + 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") + "ProtectionStatus | extend HostCustomEntity = Computer | extend IPCustomEntity = ComputerIP_Hidden") .withTactics(Arrays.asList(AttackTactic.PERSISTENCE, AttackTactic.LATERAL_MOVEMENT)) .withTechniques(Arrays.asList("T1037", "T1021")) .withDisplayName("Rule2") @@ -606,22 +392,18 @@ public static void createsOrUpdatesANrtAlertRule( .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)))) + .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)), - Context.NONE); + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 ae8c5d352789..f3cb87aa91d7 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for AlertRules Delete. */ +/** + * Samples for AlertRules Delete. + */ public final class AlertRulesDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/DeleteAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/DeleteAlertRule.json */ /** * Sample code: Delete an alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void deleteAnAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.alertRules() + .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/AlertRulesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesGetSamples.java index 5f59cda357eb..eff0439be2f1 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 @@ -4,63 +4,64 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for AlertRules Get. */ +/** + * Samples for AlertRules Get. + */ public final class AlertRulesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetScheduledAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetScheduledAlertRule.json */ /** * Sample code: Get a Scheduled alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAScheduledAlertRule( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + public static void + getAScheduledAlertRule(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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetNrtAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetNrtAlertRule.json */ /** * Sample code: Get an Nrt alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAnNrtAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.alertRules() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetFusionAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetFusionAlertRule.json */ /** * Sample code: Get a Fusion alert rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAFusionAlertRule(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.alertRules().getWithResponse("myRg", "myWorkspace", "myFirstFusionRule", Context.NONE); + manager.alertRules() + .getWithResponse("myRg", "myWorkspace", "myFirstFusionRule", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json */ /** * Sample code: Get a MicrosoftSecurityIncidentCreation rule. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAMicrosoftSecurityIncidentCreationRule( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .alertRules() - .getWithResponse("myRg", "myWorkspace", "microsoftSecurityIncidentCreationRuleExample", Context.NONE); + manager.alertRules() + .getWithResponse("myRg", "myWorkspace", "microsoftSecurityIncidentCreationRuleExample", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListSamples.java index a76a803ecb34..f167157c524d 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for AlertRules List. */ +/** + * Samples for AlertRules List. + */ public final class AlertRulesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/alertRules/GetAllAlertRules.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetAllAlertRules.json */ /** * Sample code: Get all alert rules. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllAlertRules(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.alertRules().list("myRg", "myWorkspace", Context.NONE); + manager.alertRules().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/AutomationRulesCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesCreateOrUpdateSamples.java index 0ddbba866ce2..a5159a1e3d54 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 @@ -8,20 +8,21 @@ import com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic; import java.util.List; -/** Samples for AutomationRules CreateOrUpdate. */ +/** + * Samples for AutomationRules CreateOrUpdate. + */ public final class AutomationRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/automationRules/AutomationRules_CreateOrUpdate.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/automationRules/AutomationRules_CreateOrUpdate.json */ /** * Sample code: AutomationRules_CreateOrUpdate. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void automationRulesCreateOrUpdate( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .automationRules() + public static void + automationRulesCreateOrUpdate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.automationRules() .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") .withExistingWorkspace("myRg", "myWorkspace") .withDisplayName((String) null) 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 9931b428f993..b23192066dce 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for AutomationRules Delete. */ +/** + * Samples for AutomationRules Delete. + */ public final class AutomationRulesDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/automationRules/AutomationRules_Delete.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/automationRules/AutomationRules_Delete.json */ /** * Sample code: AutomationRules_Delete. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void automationRulesDelete( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .automationRules() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + public static void + automationRulesDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.automationRules() + .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/AutomationRulesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesGetSamples.java index 79bd1f2bf1dd..eae1e5508113 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for AutomationRules Get. */ +/** + * Samples for AutomationRules Get. + */ public final class AutomationRulesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/automationRules/AutomationRules_Get.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/automationRules/AutomationRules_Get.json */ /** * Sample code: AutomationRules_Get. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void automationRulesGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .automationRules() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.automationRules() + .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/AutomationRulesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListSamples.java index cb067a4161d2..52a67369c849 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for AutomationRules List. */ +/** + * Samples for AutomationRules List. + */ public final class AutomationRulesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/automationRules/AutomationRules_List.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/automationRules/AutomationRules_List.json */ /** * Sample code: AutomationRules_List. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void automationRulesList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.automationRules().list("myRg", "myWorkspace", Context.NONE); + manager.automationRules().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/BillingStatisticsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsGetSamples.java new file mode 100644 index 000000000000..31334fd081ed --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BillingStatistics Get. + */ +public final class BillingStatisticsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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/IpGeodataGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListSamples.java similarity index 50% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IpGeodataGetSamples.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListSamples.java index 4c5af0fbd9f2..128d4c4814ce 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IpGeodataGetSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListSamples.java @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for IpGeodata Get. */ -public final class IpGeodataGetSamples { +/** + * Samples for BillingStatistics List. + */ +public final class BillingStatisticsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/enrichment/GetGeodataByIp.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/billingStatistics/GetAllBillingStatistics.json */ /** - * Sample code: Get geodata for a single IP address. - * + * Sample code: Get all Microsoft Sentinel billing statistics. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getGeodataForASingleIPAddress( + public static void getAllMicrosoftSentinelBillingStatistics( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.ipGeodatas().getWithResponse("myRg", "1.2.3.4", Context.NONE); + 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 index 02135e4b1f24..05d64210b70d 100644 --- 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 @@ -4,32 +4,28 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; import java.time.OffsetDateTime; import java.util.UUID; -/** Samples for BookmarkOperation Expand. */ +/** + * Samples for BookmarkOperation Expand. + */ public final class BookmarkOperationExpandSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/expand/PostExpandBookmark.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/expand/PostExpandBookmark.json */ /** * Sample code: Expand an bookmark. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void expandAnBookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkOperations() - .expandWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new BookmarkExpandParameters() - .withEndTime(OffsetDateTime.parse("2020-01-24T17:21:00.000Z")) + manager.bookmarkOperations() + .expandWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new BookmarkExpandParameters().withEndTime(OffsetDateTime.parse("2020-01-24T17:21:00.000Z")) .withExpansionId(UUID.fromString("27f76e63-c41b-480f-bb18-12ad2e011d49")) .withStartTime(OffsetDateTime.parse("2019-12-25T17:21:00.000Z")), - Context.NONE); + 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 index 4ee602ef802a..1d6c3309a9f2 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,20 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -/** Samples for BookmarkRelations CreateOrUpdate. */ +/** + * Samples for BookmarkRelations CreateOrUpdate. + */ public final class BookmarkRelationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/relations/CreateBookmarkRelation.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/CreateBookmarkRelation.json */ /** * Sample code: Creates or updates a bookmark relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesABookmarkRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkRelations() + 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( 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 index 90fe86d803f0..fd8ecc901cd7 100644 --- 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 @@ -4,27 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for BookmarkRelations Delete. */ +/** + * Samples for BookmarkRelations Delete. + */ public final class BookmarkRelationsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/relations/DeleteBookmarkRelation.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/DeleteBookmarkRelation.json */ /** * Sample code: Delete the bookmark relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteTheBookmarkRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkRelations() - .deleteWithResponse( - "myRg", - "myWorkspace", - "2216d0e1-91e3-4902-89fd-d2df8c535096", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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 index 6ae73ac9318f..48ef48edf0f4 100644 --- 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 @@ -4,27 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for BookmarkRelations Get. */ +/** + * Samples for BookmarkRelations Get. + */ public final class BookmarkRelationsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/relations/GetBookmarkRelationByName.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/GetBookmarkRelationByName.json */ /** * Sample code: Get a bookmark relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getABookmarkRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkRelations() - .getWithResponse( - "myRg", - "myWorkspace", - "2216d0e1-91e3-4902-89fd-d2df8c535096", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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 index c04cb45847c2..0858d7a9368c 100644 --- 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for BookmarkRelations List. */ +/** + * Samples for BookmarkRelations List. + */ public final class BookmarkRelationsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.json */ /** * Sample code: Get all bookmark relations. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllBookmarkRelations( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarkRelations() - .list("myRg", "myWorkspace", "2216d0e1-91e3-4902-89fd-d2df8c535096", null, null, null, null, Context.NONE); + 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 f54f13ae59da..223da82c3172 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 @@ -12,20 +12,21 @@ import java.util.Arrays; import java.util.UUID; -/** Samples for Bookmarks CreateOrUpdate. */ +/** + * Samples for Bookmarks CreateOrUpdate. + */ public final class BookmarksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/CreateBookmark.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/CreateBookmark.json */ /** * Sample code: Creates or updates a bookmark. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesABookmark( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarks() + 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\"") @@ -38,17 +39,9 @@ public static void createsOrUpdatesABookmark( .withQueryResult("Security Event query result") .withUpdated(OffsetDateTime.parse("2021-09-01T13:15:30Z")) .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) - .withEntityMappings( - Arrays - .asList( - new BookmarkEntityMappings() - .withEntityType("Account") - .withFieldMappings( - Arrays - .asList( - new EntityFieldMapping() - .withIdentifier("Fullname") - .withValue("johndoe@microsoft.com"))))) + .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 adaf45b1a342..e075e5489d03 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Bookmarks Delete. */ +/** + * Samples for Bookmarks Delete. + */ public final class BookmarksDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/DeleteBookmark.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/DeleteBookmark.json */ /** * Sample code: Delete a bookmark. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void deleteABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarks() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.bookmarks() + .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/BookmarksGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksGetSamples.java index cca078fc516b..da759177c910 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Bookmarks Get. */ +/** + * Samples for Bookmarks Get. + */ public final class BookmarksGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/GetBookmarkById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/GetBookmarkById.json */ /** * Sample code: Get a bookmark. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .bookmarks() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.bookmarks() + .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/BookmarksListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarksListSamples.java index 7ff9e9471b73..0483726482ce 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Bookmarks List. */ +/** + * Samples for Bookmarks List. + */ public final class BookmarksListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/bookmarks/GetBookmarks.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/GetBookmarks.json */ /** * Sample code: Get all bookmarks. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllBookmarks(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.bookmarks().list("myRg", "myWorkspace", Context.NONE); + manager.bookmarks().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/BusinessApplicationAgentOperationGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentOperationGetSamples.java new file mode 100644 index 000000000000..0d4e85f6aef7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BusinessApplicationAgentOperation Get. + */ +public final class BusinessApplicationAgentOperationGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgent_Get.json + */ + /** + * Sample code: BusinessApplicationAgent_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + businessApplicationAgentGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.businessApplicationAgentOperations() + .getWithResponse("myRg", "myWorkspace", "3d69632b-0b60-4af3-8720-77f01a25d34a", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..543e47a3c45d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.AgentConfiguration; + +/** + * Samples for BusinessApplicationAgents CreateOrUpdate. + */ +public final class BusinessApplicationAgentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgents_CreateOrUpdate.json + */ + /** + * Sample code: BusinessApplicationAgents_CreateOrUpdate. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void businessApplicationAgentsCreateOrUpdate( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.businessApplicationAgents() + .define("3d69632b-0b60-4af3-8720-77f01a25d34a") + .withExistingWorkspace("myRg", "myWorkspace") + .withConfiguration((AgentConfiguration) null) + .withDisplayName((String) null) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentsDeleteSamples.java new file mode 100644 index 000000000000..43bff37ab594 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BusinessApplicationAgents Delete. + */ +public final class BusinessApplicationAgentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgents_Delete.json + */ + /** + * Sample code: BusinessApplicationAgents_Delete. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + businessApplicationAgentsDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.businessApplicationAgents() + .deleteWithResponse("myRg", "myWorkspace", "3d69632b-0b60-4af3-8720-77f01a25d34a", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentsListSamples.java new file mode 100644 index 000000000000..1d2ab46db6c3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BusinessApplicationAgentsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BusinessApplicationAgents List. + */ +public final class BusinessApplicationAgentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgents_List.json + */ + /** + * Sample code: BusinessApplicationAgents_List. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + businessApplicationAgentsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.businessApplicationAgents().list("myRg", "myWorkspace", null, null, com.azure.core.util.Context.NONE); + } +} 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..1f279d330395 --- /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) AutoRest 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..c42a012919bb --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentPackageOperation Uninstall. + */ +public final class ContentPackageOperationUninstallSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..7fc10a038ea1 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentPackages Get. + */ +public final class ContentPackagesGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..16b4e01110bf --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentPackages List. + */ +public final class ContentPackagesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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/ContentTemplateOperationDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateOperationDeleteSamples.java new file mode 100644 index 000000000000..67b8b4e0e494 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateOperationDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentTemplateOperation Delete. + */ +public final class ContentTemplateOperationDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentTemplates/DeleteTemplate.json + */ + /** + * Sample code: Delete metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplateOperations() + .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/ContentTemplateOperationGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateOperationGetSamples.java new file mode 100644 index 000000000000..03553a898f7c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateOperationGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentTemplateOperation Get. + */ +public final class ContentTemplateOperationGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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.contentTemplateOperations() + .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/ContentTemplateOperationInstallSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateOperationInstallSamples.java new file mode 100644 index 000000000000..85a3e51f71c4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateOperationInstallSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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 ContentTemplateOperation Install. + */ +public final class ContentTemplateOperationInstallSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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.contentTemplateOperations() + .define("str.azure-sentinel-solution-str") + .withExistingWorkspace("myRg", "myWorkspace") + .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)) + .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") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesListSamples.java new file mode 100644 index 000000000000..fedfd0fb0e68 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentTemplates List. + */ +public final class ContentTemplatesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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.contentTemplates() + .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..ef318fc67f0e --- /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) AutoRest 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.CustomizableConnectorDefinition; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig; +import com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails; +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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..7a8b5e40aa0e --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for DataConnectorDefinitions Delete. + */ +public final class DataConnectorDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..645e9210b5a1 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for DataConnectorDefinitions Get. + */ +public final class DataConnectorDefinitionsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectorDefinitions/GetCustomizableDataConnectoeDefinitionById.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..616f10dd9dac --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for DataConnectorDefinitions List. + */ +public final class DataConnectorDefinitionsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 index 236b908d0955..40123ce97c1f 100644 --- 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 @@ -4,12 +4,12 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.AadCheckRequirements; import com.azure.resourcemanager.securityinsights.models.AscCheckRequirements; import com.azure.resourcemanager.securityinsights.models.Dynamics365CheckRequirements; import com.azure.resourcemanager.securityinsights.models.IoTCheckRequirements; import com.azure.resourcemanager.securityinsights.models.McasCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionCheckRequirements; import com.azure.resourcemanager.securityinsights.models.MstiCheckRequirements; import com.azure.resourcemanager.securityinsights.models.MtpCheckRequirements; import com.azure.resourcemanager.securityinsights.models.Office365ProjectCheckRequirements; @@ -19,253 +19,278 @@ import com.azure.resourcemanager.securityinsights.models.TICheckRequirements; import com.azure.resourcemanager.securityinsights.models.TiTaxiiCheckRequirements; -/** Samples for DataConnectorsCheckRequirementsOperation Post. */ +/** + * Samples for DataConnectorsCheckRequirementsOperation Post. + */ public final class DataConnectorsCheckRequirementsOperationPostSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsOfficeATP.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsOfficeATP.json */ /** * Sample code: Check requirements for OfficeATP. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForOfficeATP( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new OfficeAtpCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsOffice365Project.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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(), Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new Office365ProjectCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectory.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json */ /** - * Sample code: Check requirements for AAD. - * + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection) - no authorization. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForAAD( + public static void checkRequirementsForAADIPAzureActiveDirectoryIdentityProtectionNoAuthorization( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new AadCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftCloudAppSecurity.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftCloudAppSecurity.json */ /** * Sample code: Check requirements for Mcas. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForMcas( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new McasCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsIoT.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", + public static void + checkRequirementsForIoT(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new IoTCheckRequirements().withSubscriptionId("c0688291-89d7-4bed-87a2-a7b1bff43f4c"), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsMdatp.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMdatp.json */ /** * Sample code: Check requirements for Mdatp. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForMdatp( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new McasCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsAzureSecurityCenter.json */ /** - * Sample code: Check requirements for AAD - no authorization. - * + * Sample code: Check requirements for ASC. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForAADNoAuthorization( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsAzureSecurityCenter.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftPurviewInformationProtection.json */ /** - * Sample code: Check requirements for ASC. - * + * Sample code: Check requirements for MicrosoftPurviewInformationProtection. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForASC( + public static void checkRequirementsForMicrosoftPurviewInformationProtection( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse( - "myRg", - "myWorkspace", - new AscCheckRequirements().withSubscriptionId("c0688291-89d7-4bed-87a2-a7b1bff43f4c"), - Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new MicrosoftPurviewInformationProtectionCheckRequirements() + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatProtection.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatProtection.json */ /** * Sample code: Check requirements for MicrosoftThreatProtection. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void checkRequirementsForMicrosoftThreatProtection( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new MtpCheckRequirements(), Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new MtpCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligenceTaxii.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligenceTaxii.json */ /** * Sample code: Check requirements for TI Taxii. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForTITaxii( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new TiTaxiiCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsOfficeIRM.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsOfficeIRM.json */ /** * Sample code: Check requirements for OfficeIRM. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForOfficeIRM( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new OfficeIrmCheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsMicrosoftThreatIntelligence.json */ /** * Sample code: Check requirements for MicrosoftThreatIntelligence. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void checkRequirementsForMicrosoftThreatIntelligence( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new MstiCheckRequirements(), Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new MstiCheckRequirements().withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsOfficePowerBI.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectory.json */ /** - * Sample code: Check requirements for OfficePowerBI. - * + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection). + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForOfficePowerBI( + public static void checkRequirementsForAADIPAzureActiveDirectoryIdentityProtection( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new OfficePowerBICheckRequirements(), Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new AadCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsDynamics365.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsDynamics365.json */ /** * Sample code: Check requirements for Dynamics365. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForDynamics365( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new Dynamics365CheckRequirements(), Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoLicense.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoLicense.json */ /** - * Sample code: Check requirements for AAD - no license. - * + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection) - no license. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForAADNoLicense( + public static void checkRequirementsForAADIPAzureActiveDirectoryIdentityProtectionNoLicense( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new AadCheckRequirements(), Context.NONE); + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new AadCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CheckRequirementsThreatIntelligence.json */ /** * Sample code: Check requirements for TI. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void checkRequirementsForTI( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectorsCheckRequirementsOperations() - .postWithResponse("myRg", "myWorkspace", new TICheckRequirements(), Context.NONE); + 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 index d00218190776..aa8be64ea430 100644 --- 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 @@ -5,79 +5,60 @@ package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.securityinsights.models.ConnectAuthKind; import com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody; import java.io.IOException; import java.util.Arrays; -/** Samples for DataConnectors Connect. */ +/** + * Samples for DataConnectors Connect. + */ public final class DataConnectorsConnectSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/ConnectAPIPollingV2Logs.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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("fakeKeyPlaceholder") + 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))), - Context.NONE); + .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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/ConnectAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/ConnectAPIPolling.json */ /** * Sample code: Connect an APIPolling data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void connectAnAPIPollingDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { - manager - .dataConnectors() - .connectWithResponse( - "myRg", - "myWorkspace", - "316ec55e-7138-4d63-ab18-90c8a60fd1c8", - new DataConnectorConnectBody() - .withKind(ConnectAuthKind.APIKEY) - .withApiKey("fakeKeyPlaceholder") - .withRequestConfigUserInputValues( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"displayText\":\"Organization" - + " Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"somePlaceHolderValue\",\"requestObjectKey\":\"apiEndpoint\"}", - Object.class, - SerializerEncoding.JSON))), - Context.NONE); + 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); } } 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 8a4b352fb274..34c7b3282d8e 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.securityinsights.models.Availability; import com.azure.resourcemanager.securityinsights.models.AvailabilityStatus; @@ -24,10 +23,26 @@ import com.azure.resourcemanager.securityinsights.models.CodelessUiDataConnector; import com.azure.resourcemanager.securityinsights.models.ConnectivityType; import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.DcrConfiguration; 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.MicrosoftPurviewInformationProtectionConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionDataConnector; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnector; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed; +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 com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes; import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypesLogs; import com.azure.resourcemanager.securityinsights.models.Office365ProjectDataConnector; @@ -57,633 +72,412 @@ import java.time.OffsetDateTime; import java.util.Arrays; -/** Samples for DataConnectors CreateOrUpdate. */ +/** + * Samples for DataConnectors CreateOrUpdate. + */ public final class DataConnectorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateOfficeDataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateOfficeDataConnetor.json */ /** * Sample code: Creates or updates an Office365 data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAnOffice365DataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new OfficeDataConnector() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") - .withDataTypes( - new OfficeDataConnectorDataTypes() - .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.ENABLED)) - .withSharePoint( - new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED)) - .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED))) + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new OfficeDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new OfficeDataConnectorDataTypes() + .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.ENABLED)) + .withSharePoint(new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED)) + .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED))) .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), - Context.NONE); + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateOfficePowerBIDataConnector.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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))) + 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"), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateThreatIntelligenceTaxiiDataConnector.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateThreatIntelligenceTaxiiDataConnector.json */ /** * Sample code: Creates or updates a Threat Intelligence Taxii data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAThreatIntelligenceTaxiiDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new TiTaxiiDataConnector() - .withEtag("d12423f6-a60b-4ca5-88c0-feb1a182d0f0") + 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("--") + .withPassword("fakeTokenPlaceholder") .withTaxiiLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) .withPollingFrequency(PollingFrequency.ONCE_ADAY) - .withDataTypes( - new TiTaxiiDataConnectorDataTypes() - .withTaxiiClient( - new TiTaxiiDataConnectorDataTypesTaxiiClient().withState(DataTypeState.ENABLED))) + .withDataTypes(new TiTaxiiDataConnectorDataTypes().withTaxiiClient( + new TiTaxiiDataConnectorDataTypesTaxiiClient().withState(DataTypeState.ENABLED))) .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateThreatIntelligenceDataConnector.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateThreatIntelligenceDataConnector.json */ /** * Sample code: Creates or updates an Threat Intelligence Platform data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAnThreatIntelligencePlatformDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new TIDataConnector() - .withTipLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) - .withDataTypes( - new TIDataConnectorDataTypes() - .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))) + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new TIDataConnector().withTipLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) + .withDataTypes(new TIDataConnectorDataTypes() + .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))) .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateDynamics365DataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateDynamics365DataConnetor.json */ /** * Sample code: Creates or updates a Dynamics365 data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesADynamics365DataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "c2541efb-c9a6-47fe-9501-87d1017d1512", - new Dynamics365DataConnector() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") - .withDataTypes( - new Dynamics365DataConnectorDataTypes() - .withDynamics365CdsActivities( - new Dynamics365DataConnectorDataTypesDynamics365CdsActivities() - .withState(DataTypeState.ENABLED))) + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "c2541efb-c9a6-47fe-9501-87d1017d1512", + new Dynamics365DataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new Dynamics365DataConnectorDataTypes() + .withDynamics365CdsActivities(new Dynamics365DataConnectorDataTypesDynamics365CdsActivities() + .withState(DataTypeState.ENABLED))) .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateGenericUI.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateGenericUI.json */ /** * Sample code: Creates or updates a GenericUI data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAGenericUIDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "316ec55e-7138-4d63-ab18-90c8a60fd1c8", - new CodelessUiDataConnector() - .withConnectorUiConfig( - new CodelessUiConnectorConfigProperties() - .withTitle("Qualys Vulnerability Management (CCP DEMO)") - .withPublisher("Qualys") - .withDescriptionMarkdown( - "The [Qualys Vulnerability Management" - + " (VM)](https://www.qualys.com/apps/vulnerability-management/) data connector" - + " provides the capability to ingest vulnerability host detection data into Azure" - + " Sentinel through the Qualys API. The connector provides visibility into host" - + " detection data from vulerability scans. This connector provides Azure Sentinel" - + " the capability to view dashboards, create custom alerts, and improve" - + " investigation ") - .withGraphQueriesTableName("QualysHostDetection_CL") - .withGraphQueries( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesGraphQueriesItem() - .withMetricName("Total data received") - .withLegend("{{graphQueriesTableName}}") - .withBaseQuery("{{graphQueriesTableName}}"))) - .withSampleQueries( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesSampleQueriesItem() - .withDescription("Top 10 Vulerabilities detected") - .withQuery( - "{{graphQueriesTableName}}\n" - + " | mv-expand todynamic(Detections_s)\n" - + " | extend Vulnerability = tostring(Detections_s.Results)\n" - + " | summarize count() by Vulnerability\n" - + " | top 10 by count_"))) - .withDataTypes( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesDataTypesItem() - .withName("{{graphQueriesTableName}}") - .withLastDataReceivedQuery( - "{{graphQueriesTableName}}\n" - + " | summarize Time = max(TimeGenerated)\n" - + " | where isnotempty(Time)"))) - .withConnectivityCriteria( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() - .withType(ConnectivityType.IS_CONNECTED_QUERY) - .withValue( - Arrays - .asList( - "{{graphQueriesTableName}}\n" - + " | summarize LastLogReceived =" - + " max(TimeGenerated)\n" - + " | project IsConnected = LastLogReceived >" - + " ago(30d)")))) - .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) - .withPermissions( - new Permissions() - .withResourceProvider( - Arrays - .asList( - new PermissionsResourceProviderItem() - .withProvider( - ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) - .withPermissionsDisplayText( - "read and write permissions on the workspace are required.") - .withProviderDisplayName("Workspace") - .withScope(PermissionProviderScope.WORKSPACE) - .withRequiredPermissions( - new RequiredPermissions() - .withWrite(true) - .withRead(true) - .withDelete(true)), - new PermissionsResourceProviderItem() - .withProvider( - ProviderName - .MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS) - .withPermissionsDisplayText( - "read permissions to shared keys for the workspace are" - + " required. [See the documentation to learn more about" - + " workspace" - + " keys](https://docs.microsoft.com/azure/azure-monitor/platform/agent-windows#obtain-workspace-id-and-key).") - .withProviderDisplayName("Keys") - .withScope(PermissionProviderScope.WORKSPACE) - .withRequiredPermissions( - new RequiredPermissions().withAction(true)))) - .withCustoms( - Arrays - .asList( - new PermissionsCustomsItem() - .withName("Microsoft.Web/sites permissions") - .withDescription( - "Read and write permissions to Azure Functions to create a" - + " Function App is required. [See the documentation to" - + " learn more about Azure" - + " Functions](https://docs.microsoft.com/azure/azure-functions/)."), - new PermissionsCustomsItem() - .withName("Qualys API Key") - .withDescription( - "A Qualys VM API username and password is required. [See the" - + " documentation to learn more about Qualys VM" - + " API](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf).")))) - .withInstructionSteps( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - ">**NOTE:** This connector uses Azure Functions to connect to Qualys VM" - + " to pull its logs into Azure Sentinel. This might result in" - + " additional data ingestion costs. Check the [Azure Functions" - + " pricing" - + " page](https://azure.microsoft.com/pricing/details/functions/)" - + " for details."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - ">**(Optional Step)** Securely store workspace and API authorization" - + " key(s) or token(s) in Azure Key Vault. Azure Key Vault provides" - + " a secure mechanism to store and retrieve key values. [Follow" - + " these" - + " instructions](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" - + " to use Azure Key Vault with an Azure Function App."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**STEP 1 - Configuration steps for the Qualys VM API**\n\n" - + "1. Log into the Qualys Vulnerability Management console with an" - + " administrator account, select the **Users** tab and the" - + " **Users** subtab. \n" - + "2. Click on the **New** drop-down menu and select **Users..**\n" - + "3. Create a username and password for the API account. \n" - + "4. In the **User Roles** tab, ensure the account role is set to" - + " **Manager** and access is allowed to **GUI** and **API**\n" - + "4. Log out of the administrator account and log into the console" - + " with the new API credentials for validation, then log out of" - + " the API account. \n" - + "5. Log back into the console using an administrator account and" - + " modify the API accounts User Roles, removing access to **GUI**." - + " \n" - + "6. Save all changes."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**STEP 2 - Choose ONE from the following two deployment options to" - + " deploy the connector and the associated Azure Function**\n\n" - + ">**IMPORTANT:** Before deploying the Qualys VM connector, have" - + " the Workspace ID and Workspace Primary Key (can be copied from" - + " the following), as well as the Qualys VM API Authorization" - + " Key(s), readily available.") - .withInstructions( - Arrays - .asList( - new InstructionStepsInstructionsItem() - .withParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"fillWith\":[\"WorkspaceId\"],\"label\":\"Workspace" - + " ID\"}", - Object.class, - SerializerEncoding.JSON)) - .withType(SettingType.COPYABLE_LABEL), - new InstructionStepsInstructionsItem() - .withParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"fillWith\":[\"PrimaryKey\"],\"label\":\"Primary" - + " Key\"}", - Object.class, - SerializerEncoding.JSON)) - .withType(SettingType.COPYABLE_LABEL))), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("Option 1 - Azure Resource Manager (ARM) Template") - .withDescription( - "Use this method for automated deployment of the Qualys VM connector" - + " using an ARM Tempate.\n\n" - + "1. Click the **Deploy to Azure** button below. \n\n" - + "\t[![Deploy To" - + " Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/sentinelqualysvmazuredeploy)\n" - + "2. Select the preferred **Subscription**, **Resource Group** and" - + " **Location**. \n" - + "3. Enter the **Workspace ID**, **Workspace Key**, **API" - + " Username**, **API Password** , update the **URI**, and any" - + " additional URI **Filter Parameters** (each filter should be" - + " separated by an \"&\" symbol, no spaces.) \n" - + "> - Enter the URI that corresponds to your region. The complete" - + " list of API Server URLs can be [found" - + " here](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf#G4.735348)" - + " -- There is no need to add a time suffix to the URI, the" - + " Function App will dynamically append the Time Value to the URI" - + " in the proper format. \n" - + " - The default **Time Interval** is set to pull the last five" - + " (5) minutes of data. If the time interval needs to be modified," - + " it is recommended to change the Function App Timer Trigger" - + " accordingly (in the function.json file, post deployment) to" - + " prevent overlapping data ingestion. \n" - + "> - Note: If using Azure Key Vault secrets for any of the values" - + " above, use the`@Microsoft.KeyVault(SecretUri={Security" - + " Identifier})`schema in place of the string values. Refer to" - + " [Key Vault references" - + " documentation](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" - + " for further details. \n" - + "4. Mark the checkbox labeled **I agree to the terms and" - + " conditions stated above**. \n" - + "5. Click **Purchase** to deploy."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("Option 2 - Manual Deployment of Azure Functions") - .withDescription( - "Use the following step-by-step instructions to deploy the Quayls VM" - + " connector manually with Azure Functions."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**1. Create a Function App**\n\n" - + "1. From the Azure Portal, navigate to [Function" - + " App](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp)," - + " and select **+ Add**.\n" - + "2. In the **Basics** tab, ensure Runtime stack is set to" - + " **Powershell Core**. \n" - + "3. In the **Hosting** tab, ensure the **Consumption" - + " (Serverless)** plan type is selected.\n" - + "4. Make other preferrable configuration changes, if needed, then" - + " click **Create**."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**2. Import Function App Code**\n\n" - + "1. In the newly created Function App, select **Functions** on" - + " the left pane and click **+ New Function**.\n" - + "2. Select **Timer Trigger**.\n" - + "3. Enter a unique Function **Name** and leave the default cron" - + " schedule of every 5 minutes, then click **Create**.\n" - + "5. Click on **Code + Test** on the left pane. \n" - + "6. Copy the [Function App" - + " Code](https://aka.ms/sentinelqualysvmazurefunctioncode) and" - + " paste into the Function App `run.ps1` editor.\n" - + "7. Click **Save**."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**3. Configure the Function App**\n\n" - + "1. In the Function App, select the Function App Name and select" - + " **Configuration**.\n" - + "2. In the **Application settings** tab, select **+ New" - + " application setting**.\n" - + "3. Add each of the following seven (7) application settings" - + " individually, with their respective string values" - + " (case-sensitive): \n" - + "\t\tapiUsername\n" - + "\t\tapiPassword\n" - + "\t\tworkspaceID\n" - + "\t\tworkspaceKey\n" - + "\t\turi\n" - + "\t\tfilterParameters\n" - + "\t\ttimeInterval\n" - + "> - Enter the URI that corresponds to your region. The complete" - + " list of API Server URLs can be [found" - + " here](https://www.qualys.com/docs/qualys-api-vmpc-user-guide.pdf#G4.735348)." - + " The `uri` value must follow the following schema: `https:///api/2.0/fo/asset/host/vm/detection/?action=list&vm_processed_after=`" - + " -- There is no need to add a time suffix to the URI, the" - + " Function App will dynamically append the Time Value to the URI" - + " in the proper format.\n" - + "> - Add any additional filter parameters, for the" - + " `filterParameters` variable, that need to be appended to the" - + " URI. Each parameter should be seperated by an \"&\" symbol and" - + " should not include any spaces.\n" - + "> - Set the `timeInterval` (in minutes) to the value of `5` to" - + " correspond to the Timer Trigger of every `5` minutes. If the" - + " time interval needs to be modified, it is recommended to change" - + " the Function App Timer Trigger accordingly to prevent" - + " overlapping data ingestion.\n" - + "> - Note: If using Azure Key Vault, use" - + " the`@Microsoft.KeyVault(SecretUri={Security Identifier})`schema" - + " in place of the string values. Refer to [Key Vault references" - + " documentation](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references)" - + " for further details.\n" - + "4. Once all application settings have been entered, click" - + " **Save**."), - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("") - .withDescription( - "**4. Configure the host.json**.\n\n" - + "Due to the potentially large amount of Qualys host detection" - + " data being ingested, it can cause the execution time to surpass" - + " the default Function App timeout of five (5) minutes. Increase" - + " the default timeout duration to the maximum of ten (10)" - + " minutes, under the Consumption Plan, to allow more time for the" - + " Function App to execute.\n\n" - + "1. In the Function App, select the Function App Name and select" - + " the **App Service Editor** blade.\n" - + "2. Click **Go** to open the editor, then select the" - + " **host.json** file under the **wwwroot** directory.\n" - + "3. Add the line `\"functionTimeout\": \"00:10:00\",` above the" - + " `managedDependancy` line \n" - + "4. Ensure **SAVED** appears on the top right corner of the" - + " editor, then exit the editor.\n\n" - + "> NOTE: If a longer timeout duration is required, consider" - + " upgrading to an [App Service" - + " Plan](https://docs.microsoft.com/azure/azure-functions/functions-scale#timeout)")))), - Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateOffice365ProjectDataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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))) + 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"), - Context.NONE); + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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("1970-01-01T00:00:00.000Z"))) + .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/CreateAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateAPIPolling.json */ /** * Sample code: Creates or updates a APIPolling data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAAPIPollingDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { - manager - .dataConnectors() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "316ec55e-7138-4d63-ab18-90c8a60fd1c8", - new CodelessApiPollingDataConnector() - .withConnectorUiConfig( - new CodelessUiConnectorConfigProperties() - .withTitle("GitHub Enterprise Audit Log") - .withPublisher("GitHub") - .withDescriptionMarkdown( - "The GitHub audit log connector provides the capability to ingest GitHub logs into" - + " Azure Sentinel. By connecting GitHub audit logs into Azure Sentinel, you can" - + " view this data in workbooks, use it to create custom alerts, and improve your" - + " investigation process.") - .withGraphQueriesTableName("GitHubAuditLogPolling_CL") - .withGraphQueries( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesGraphQueriesItem() - .withMetricName("Total events received") - .withLegend("GitHub audit log events") - .withBaseQuery("{{graphQueriesTableName}}"))) - .withSampleQueries( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesSampleQueriesItem() - .withDescription("All logs") - .withQuery("{{graphQueriesTableName}}\n | take 10 "))) - .withDataTypes( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesDataTypesItem() - .withName("{{graphQueriesTableName}}") - .withLastDataReceivedQuery( - "{{graphQueriesTableName}}\n" - + " | summarize Time = max(TimeGenerated)\n" - + " | where isnotempty(Time)"))) - .withConnectivityCriteria( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() - .withType(ConnectivityType.fromString("SentinelKindsV2")) - .withValue(Arrays.asList()))) - .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) - .withPermissions( - new Permissions() - .withResourceProvider( - Arrays - .asList( - new PermissionsResourceProviderItem() - .withProvider( - ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) - .withPermissionsDisplayText( - "read and write permissions are required.") - .withProviderDisplayName("Workspace") - .withScope(PermissionProviderScope.WORKSPACE) - .withRequiredPermissions( - new RequiredPermissions() - .withWrite(true) - .withRead(true) - .withDelete(true)))) - .withCustoms( - Arrays - .asList( - new PermissionsCustomsItem() - .withName("GitHub API personal token Key") - .withDescription( - "You need access to GitHub personal token, the key should have" - + " 'admin:org' scope")))) - .withInstructionSteps( - Arrays - .asList( - new CodelessUiConnectorConfigPropertiesInstructionStepsItem() - .withTitle("Connect GitHub Enterprise Audit Log to Azure Sentinel") - .withDescription( - "Enable GitHub audit Logs. \n" - + " Follow" - + " [this](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)" - + " to create or find your personal key") - .withInstructions( - Arrays - .asList( - new InstructionStepsInstructionsItem() - .withParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"enable\":\"true\",\"userRequestPlaceHoldersInput\":[{\"displayText\":\"Organization" - + " Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"\",\"requestObjectKey\":\"apiEndpoint\"}]}", - Object.class, - SerializerEncoding.JSON)) - .withType(SettingType.fromString("APIKey"))))))) - .withPollingConfig( - new CodelessConnectorPollingConfigProperties() - .withAuth( - new CodelessConnectorPollingAuthProperties() - .withAuthType("APIKey") - .withApiKeyName("Authorization") - .withApiKeyIdentifier("token")) - .withRequest( - new CodelessConnectorPollingRequestProperties() - .withApiEndpoint("https://api.github.com/organizations/{{placeHolder1}}/audit-log") - .withRateLimitQps(50) - .withQueryWindowInMin(15) - .withHttpMethod("Get") - .withQueryTimeFormat("yyyy-MM-ddTHH:mm:ssZ") - .withRetryCount(2) - .withTimeoutInSeconds(60) - .withHeaders( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"Accept\":\"application/json\",\"User-Agent\":\"Scuba\"}", - Object.class, - SerializerEncoding.JSON)) - .withQueryParameters( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"phrase\":\"created:{_QueryWindowStartTime}..{_QueryWindowEndTime}\"}", - Object.class, - SerializerEncoding.JSON))) - .withPaging( - new CodelessConnectorPollingPagingProperties() - .withPagingType("LinkHeader") - .withPageSizeParaName("per_page")) - .withResponse( - new CodelessConnectorPollingResponseProperties() - .withEventsJsonPaths(Arrays.asList("$")))), - Context.NONE); + 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 54ce6d4bb0bc..14c276633f63 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 @@ -4,82 +4,127 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for DataConnectors Delete. */ +/** + * Samples for DataConnectors Delete. + */ public final class DataConnectorsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DeleteOffice365ProjectDataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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/preview/2022-09-01-preview/examples/dataConnectors/DeleteGenericUI.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteMicrosoftPurviewInformationProtectionDataConnetor.json */ /** - * Sample code: Delete a GenericUI data connector. - * + * Sample code: Delete an MicrosoftPurviewInformationProtection data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAGenericUIDataConnector( + public static void deleteAnMicrosoftPurviewInformationProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + 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/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteGenericUI.json + */ + /** + * Sample code: Delete a GenericUI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAGenericUIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DeleteOfficeDataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteOfficeDataConnetor.json */ /** * Sample code: Delete an Office365 data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAnOffice365DataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DeleteOfficePowerBIDataConnetor.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DeleteAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteAPIPolling.json */ /** * Sample code: Delete a APIPolling data connector. - * + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAAPIPollingDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteMicrosoftThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Delete an MicrosoftThreatIntelligence data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAAPIPollingDataConnector( + public static void deleteAnMicrosoftThreatIntelligenceDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .deleteWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", + 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 index b9727cf73d26..6de992e7def1 100644 --- 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for DataConnectors Disconnect. */ +/** + * Samples for DataConnectors Disconnect. + */ public final class DataConnectorsDisconnectSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/DisconnectAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DisconnectAPIPolling.json */ /** * Sample code: Disconnect an APIPolling data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void disconnectAnAPIPollingDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .disconnectWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + 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 4e229927f6b9..ca6ad723cc80 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 @@ -4,306 +4,351 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for DataConnectors Get. */ +/** + * Samples for DataConnectors Get. + */ public final class DataConnectorsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetOffice365ProjectDataConnetorById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAzureActiveDirectoryById.json */ /** - * Sample code: Get an Office365 Project data connector. - * + * Sample code: Get an AADIP (Azure Active Directory Identity Protection) data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnOffice365ProjectDataConnector( + public static void getAnAADIPAzureActiveDirectoryIdentityProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetGenericUI.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetGenericUI.json */ /** * Sample code: Get a GenericUI data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAGenericUIDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetOffice365AdvancedThreatProtectionById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetIoTById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftCloudAppSecurityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftCloudAppSecurityById.json */ /** * Sample code: Get a MCAS data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMCASDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "b96d014d-b5c2-4a01-9aba-a8058f629d42", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetThreatIntelligenceTaxiiById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetThreatIntelligenceTaxiiById.json */ /** * Sample code: Get a TI Taxii data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getATITaxiiDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c39bb458-02a7-4b3f-b0c8-71a1d2692652", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftThreatIntelligenceById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftThreatIntelligenceById.json */ /** * Sample code: Get a MicrosoftThreatIntelligence data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAMicrosoftThreatIntelligenceDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + 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/preview/2022-09-01-preview/examples/dataConnectors/GetAzureSecurityCenterById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAzureSecurityCenterById.json */ /** * Sample code: Get a ASC data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAASCDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetThreatIntelligenceById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetThreatIntelligenceById.json */ /** * Sample code: Get a TI data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getATIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + 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/preview/2022-09-01-preview/examples/dataConnectors/GetAmazonWebServicesCloudTrailById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAmazonWebServicesCloudTrailById.json */ /** * Sample code: Get an AwsCloudTrail data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAwsCloudTrailDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json */ /** * Sample code: Get a MDATP data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMDATPDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "06b3ccb8-1384-4bcc-aec7-852f6d57161b", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftThreatProtectionById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftThreatProtectionById.json */ /** * Sample code: Get a MicrosoftThreatProtection data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAMicrosoftThreatProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", Context.NONE); + 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/preview/2022-09-01-preview/examples/dataConnectors/GetAzureActiveDirectoryById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftPurviewInformationProtectionDataConnetorById.json */ /** - * Sample code: Get an AAD data connector. - * + * Sample code: Get a MicrosoftPurviewInformationProtection data connector. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAADDataConnector( + public static void getAMicrosoftPurviewInformationProtectionDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d", Context.NONE); + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetAzureAdvancedThreatProtectionById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAzureAdvancedThreatProtectionById.json */ /** * Sample code: Get an AATP data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAATPDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "07e42cb3-e658-4e90-801c-efa0f29d3d44", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetAPIPolling.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAPIPolling.json */ /** * Sample code: Get a APIPolling data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAAPIPollingDataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetMicrosoftInsiderRiskManagementById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetDynamics365DataConnectorById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetDynamics365DataConnectorById.json */ /** * Sample code: Get a Dynamics365 data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getADynamics365DataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "c2541efb-c9a6-47fe-9501-87d1017d1512", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetOfficeDataConnetorById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetOfficeDataConnetorById.json */ /** * Sample code: Get an Office365 data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnOffice365DataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetAmazonWebServicesS3ById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAmazonWebServicesS3ById.json */ /** * Sample code: Get an Aws S3 data connector. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAwsS3DataConnector( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .dataConnectors() - .getWithResponse("myRg", "myWorkspace", "afef3743-0c88-469c-84ff-ca2e87dc1e48", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetOfficePowerBIDataConnetorById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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 962a0a285d9e..2fc452a0e9c6 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 @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for DataConnectors List. */ +/** + * Samples for DataConnectors List. + */ public final class DataConnectorsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/dataConnectors/GetDataConnectors.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetDataConnectors.json */ /** * Sample code: Get all data connectors. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllDataConnectors( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.dataConnectors().list("myRg", "myWorkspace", Context.NONE); + public static void + getAllDataConnectors(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors().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/DomainWhoisGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DomainWhoisGetSamples.java deleted file mode 100644 index 0bb699a3decd..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DomainWhoisGetSamples.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.Context; - -/** Samples for DomainWhois Get. */ -public final class DomainWhoisGetSamples { - /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/enrichment/GetWhoisByDomainName.json - */ - /** - * Sample code: Get whois information for a single domain name. - * - * @param manager Entry point to SecurityInsightsManager. - */ - public static void getWhoisInformationForASingleDomainName( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.domainWhois().getWithResponse("myRg", "microsoft.com", Context.NONE); - } -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandSamples.java index c18a6971c401..c604a7ffc49a 100644 --- 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 @@ -4,32 +4,28 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; import java.time.OffsetDateTime; import java.util.UUID; -/** Samples for Entities Expand. */ +/** + * Samples for Entities Expand. + */ public final class EntitiesExpandSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/expand/PostExpandEntity.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/expand/PostExpandEntity.json */ /** * Sample code: Expand an entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void expandAnEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entities() - .expandWithResponse( - "myRg", - "myWorkspace", - "e1d3d618-e11f-478b-98e3-bb381539a8e1", - new EntityExpandParameters() - .withEndTime(OffsetDateTime.parse("2019-05-26T00:00:00.000Z")) + manager.entities() + .expandWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityExpandParameters().withEndTime(OffsetDateTime.parse("2019-05-26T00:00:00.000Z")) .withExpansionId(UUID.fromString("a77992f3-25e9-4d01-99a4-5ff606cc410a")) .withStartTime(OffsetDateTime.parse("2019-04-25T00:00:00.000Z")), - Context.NONE); + 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 index 87a4794ab75b..c1f58db13074 100644 --- 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 @@ -4,34 +4,30 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; -/** Samples for Entities GetInsights. */ +/** + * Samples for Entities GetInsights. + */ public final class EntitiesGetInsightsSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/insights/PostGetInsights.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/insights/PostGetInsights.json */ /** * Sample code: Entity Insight. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void entityInsight(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entities() - .getInsightsWithResponse( - "myRg", - "myWorkspace", - "e1d3d618-e11f-478b-98e3-bb381539a8e1", - new EntityGetInsightsParameters() - .withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) + manager.entities() + .getInsightsWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityGetInsightsParameters().withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) .withEndTime(OffsetDateTime.parse("2021-10-01T00:00:00.000Z")) .withAddDefaultExtendedTimeRange(false) .withInsightQueryIds(Arrays.asList(UUID.fromString("cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4"))), - Context.NONE); + 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 index 03835df0aca6..26761f032225 100644 --- 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 @@ -4,257 +4,297 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Entities Get. */ +/** + * Samples for Entities Get. + */ public final class EntitiesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetSubmissionMailEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetSubmissionMailEntityById.json */ /** * Sample code: Get a submissionMail entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getASubmissionMailEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetDnsEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetDnsEntityById.json */ /** * Sample code: Get a dns entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getADnsEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "f4e74920-f2c0-4412-a45f-66d94fdf01f8", Context.NONE); + manager.entities() + .getWithResponse("myRg", "myWorkspace", "f4e74920-f2c0-4412-a45f-66d94fdf01f8", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetFileHashEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetFileHashEntityById.json */ /** * Sample code: Get a file hash entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAFileHashEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "ea359fa6-c1e5-f878-e105-6344f3e399a1", Context.NONE); + manager.entities() + .getWithResponse("myRg", "myWorkspace", "ea359fa6-c1e5-f878-e105-6344f3e399a1", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetIoTDeviceEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetIoTDeviceEntityById.json */ /** * Sample code: Get an IoT device entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnIoTDeviceEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetRegistryKeyEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetRegistryKeyEntityById.json */ /** * Sample code: Get a registry key entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getARegistryKeyEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetMailboxEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetMailboxEntityById.json */ /** * Sample code: Get a mailbox entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAMailboxEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetMalwareEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetMalwareEntityById.json */ /** * Sample code: Get a malware entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAMalwareEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", Context.NONE); + manager.entities() + .getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetSecurityAlertEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetSecurityAlertEntityById.json */ /** * Sample code: Get a security alert entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getASecurityAlertEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "4aa486e0-6f85-41af-99ea-7acdce7be6c8", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetIpEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetIpEntityById.json */ /** * Sample code: Get an ip entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAnIpEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetAccountEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetAccountEntityById.json */ /** * Sample code: Get an account entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAnAccountEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetCloudApplicationEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetCloudApplicationEntityById.json */ /** * Sample code: Get a cloud application entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getACloudApplicationEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetFileEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetFileEntityById.json */ /** * Sample code: Get a file entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAFileEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", Context.NONE); + manager.entities() + .getWithResponse("myRg", "myWorkspace", "af378b21-b4aa-4fe7-bc70-13f8621a322f", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetRegistryValueEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetRegistryValueEntityById.json */ /** * Sample code: Get a registry value entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getARegistryValueEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "dc44bd11-b348-4d76-ad29-37bf7aa41356", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetUrlEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetUrlEntityById.json */ /** * Sample code: Get a url entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAUrlEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetMailClusterEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetMailClusterEntityById.json */ /** * Sample code: Get a mailCluster entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMailClusterEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetSecurityGroupEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetSecurityGroupEntityById.json */ /** * Sample code: Get a security group entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getASecurityGroupEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetMailMessageEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetMailMessageEntityById.json */ /** * Sample code: Get a mailMessage entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAMailMessageEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetAzureResourceEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetAzureResourceEntityById.json */ /** * Sample code: Get an azure resource entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnAzureResourceEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetHostEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetHostEntityById.json */ /** * Sample code: Get a host entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAHostEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", Context.NONE); + manager.entities() + .getWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetProcessEntityById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetProcessEntityById.json */ /** * Sample code: Get a process entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAProcessEntity(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().getWithResponse("myRg", "myWorkspace", "7264685c-038c-42c6-948c-38e14ef1fb98", Context.NONE); + 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 index 660a3055de2e..7413021582af 100644 --- 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 @@ -4,31 +4,27 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; import java.time.OffsetDateTime; -/** Samples for EntitiesGetTimeline List. */ +/** + * Samples for EntitiesGetTimeline List. + */ public final class EntitiesGetTimelineListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/timeline/PostTimelineEntity.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/timeline/PostTimelineEntity.json */ /** * Sample code: Entity timeline. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void entityTimeline(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entitiesGetTimelines() - .listWithResponse( - "myRg", - "myWorkspace", - "e1d3d618-e11f-478b-98e3-bb381539a8e1", - new EntityTimelineParameters() - .withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) + manager.entitiesGetTimelines() + .listWithResponse("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", + new EntityTimelineParameters().withStartTime(OffsetDateTime.parse("2021-09-01T00:00:00.000Z")) .withEndTime(OffsetDateTime.parse("2021-10-01T00:00:00.000Z")) .withNumberOfBucket(4), - Context.NONE); + 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 index 76d03c406094..618a8aaf5f2f 100644 --- 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Entities List. */ +/** + * Samples for Entities List. + */ public final class EntitiesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetEntities.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetEntities.json */ /** * Sample code: Get all entities. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllEntities(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entities().list("myRg", "myWorkspace", Context.NONE); + 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 index a07e0a7b42bd..f9b8d0aefe93 100644 --- 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 @@ -4,27 +4,23 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; -/** Samples for Entities Queries. */ +/** + * Samples for Entities Queries. + */ public final class EntitiesQueriesSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/GetQueries.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetQueries.json */ /** * Sample code: Get Entity Query. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entities() - .queriesWithResponse( - "myRg", - "myWorkspace", - "e1d3d618-e11f-478b-98e3-bb381539a8e1", - EntityItemQueryKind.INSIGHT, - Context.NONE); + manager.entities() + .queriesWithResponse("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 index 49db6e77c5cc..672f0e22f2ed 100644 --- 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for EntitiesRelations List. */ +/** + * Samples for EntitiesRelations List. + */ public final class EntitiesRelationsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/relations/GetAllEntityRelations.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/relations/GetAllEntityRelations.json */ /** * Sample code: Get all relations of an entity. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllRelationsOfAnEntity( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entitiesRelations() - .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, Context.NONE); + 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..4d08993dfd82 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Entities RunPlaybook. + */ +public final class EntitiesRunPlaybookSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 index 719027f63353..6fc4c2448f20 100644 --- 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 @@ -4,7 +4,6 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.ActivityCustomEntityQuery; import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueriesPropertiesQueryDefinitions; import com.azure.resourcemanager.securityinsights.models.EntityType; @@ -12,82 +11,38 @@ import java.util.HashMap; import java.util.Map; -/** Samples for EntityQueries CreateOrUpdate. */ +/** + * Samples for EntityQueries CreateOrUpdate. + */ public final class EntityQueriesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/CreateEntityQueryActivity.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/CreateEntityQueryActivity.json */ /** * Sample code: Creates or updates an Activity entity query. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAnActivityEntityQuery( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueries() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "07da3cc8-c8ad-4710-a44e-334cdcb7882b", - new ActivityCustomEntityQuery() - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + manager.entityQueries() + .createOrUpdateWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + new ActivityCustomEntityQuery().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") .withTitle("An account was deleted on this host") .withContent("On '{{Computer}}' the account '{{TargetAccount}}' was deleted by '{{AddedBy}}'") .withDescription("Account deleted on host") - .withQueryDefinitions( - new ActivityEntityQueriesPropertiesQueryDefinitions() - .withQuery( - "let GetAccountActions = (v_Host_Name:string, v_Host_NTDomain:string," - + " v_Host_DnsDomain:string, v_Host_AzureID:string, v_Host_OMSAgentID:string){\n" - + "SecurityEvent\n" - + "| where EventID in (4725, 4726, 4767, 4720, 4722, 4723, 4724)\n" - + "// parsing for Host to handle variety of conventions coming from data\n" - + "| extend Host_HostName = case(\n" - + "Computer has '@', tostring(split(Computer, '@')[0]),\n" - + "Computer has '\\\\', tostring(split(Computer, '\\\\')[1]),\n" - + "Computer has '.', tostring(split(Computer, '.')[0]),\n" - + "Computer\n" - + ")\n" - + "| extend Host_NTDomain = case(\n" - + "Computer has '\\\\', tostring(split(Computer, '\\\\')[0]), \n" - + "Computer has '.', tostring(split(Computer, '.')[-2]), \n" - + "Computer\n" - + ")\n" - + "| extend Host_DnsDomain = case(\n" - + "Computer has '\\\\', tostring(split(Computer, '\\\\')[0]), \n" - + "Computer has '.', strcat_array(array_slice(split(Computer,'.'),-2,-1),'.'), \n" - + "Computer\n" - + ")\n" - + "| where (Host_HostName =~ v_Host_Name and Host_NTDomain =~ v_Host_NTDomain) \n" - + "or (Host_HostName =~ v_Host_Name and Host_DnsDomain =~ v_Host_DnsDomain) \n" - + "or v_Host_AzureID =~ _ResourceId \n" - + "or v_Host_OMSAgentID == SourceComputerId\n" - + "| project TimeGenerated, EventID, Activity, Computer, TargetAccount," - + " TargetUserName, TargetDomainName, TargetSid, SubjectUserName, SubjectUserSid," - + " _ResourceId, SourceComputerId\n" - + "| extend AddedBy = SubjectUserName\n" - + "// Future support for Activities\n" - + "| extend timestamp = TimeGenerated, HostCustomEntity = Computer," - + " AccountCustomEntity = TargetAccount\n" - + "};\n" - + "GetAccountActions('{{Host_HostName}}', '{{Host_NTDomain}}'," - + " '{{Host_DnsDomain}}', '{{Host_AzureID}}', '{{Host_OMSAgentID}}')\n" - + " \n" - + "| where EventID == 4726 ")) + .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"))) + .withRequiredInputFieldsSets(Arrays.asList(Arrays.asList("Host_HostName", "Host_NTDomain"), + Arrays.asList("Host_HostName", "Host_DnsDomain"), Arrays.asList("Host_AzureID"), + Arrays.asList("Host_OMSAgentID"))) .withEntitiesFilter(mapOf("Host_OsFamily", Arrays.asList("Windows"))) .withEnabled(true), - Context.NONE); + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 index 9ca8ca1c3964..145be1c40c11 100644 --- 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for EntityQueries Delete. */ +/** + * Samples for EntityQueries Delete. + */ public final class EntityQueriesDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/DeleteEntityQuery.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/DeleteEntityQuery.json */ /** * Sample code: Delete an entity query. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void deleteAnEntityQuery(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueries() - .deleteWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + 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 index c5ddd58221cf..cfb251dff965 100644 --- 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 @@ -4,37 +4,37 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for EntityQueries Get. */ +/** + * Samples for EntityQueries Get. + */ public final class EntityQueriesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/GetActivityEntityQueryById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/GetActivityEntityQueryById.json */ /** * Sample code: Get an Activity entity query. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnActivityEntityQuery( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueries() - .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/GetExpansionEntityQueryById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/GetExpansionEntityQueryById.json */ /** * Sample code: Get an Expansion entity query. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnExpansionEntityQuery( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueries() - .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + 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 index 3f319789b367..683f04f83019 100644 --- 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 @@ -4,20 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind; -/** Samples for EntityQueries List. */ +/** + * Samples for EntityQueries List. + */ public final class EntityQueriesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/GetEntityQueries.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/GetEntityQueries.json */ /** * Sample code: Get all entity queries. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllEntityQueries(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entityQueries().list("myRg", "myWorkspace", EntityQueriesKind.EXPANSION, Context.NONE); + manager.entityQueries() + .list("myRg", "myWorkspace", EntityQueriesKind.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 index 8e1290833c7a..21ebe5cb801d 100644 --- 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for EntityQueryTemplates Get. */ +/** + * Samples for EntityQueryTemplates Get. + */ public final class EntityQueryTemplatesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueryTemplates/GetActivityEntityQueryTemplateById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueryTemplates/GetActivityEntityQueryTemplateById.json */ /** * Sample code: Get an Activity entity query template. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnActivityEntityQueryTemplate( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityQueryTemplates() - .getWithResponse("myRg", "myWorkspace", "07da3cc8-c8ad-4710-a44e-334cdcb7882b", Context.NONE); + 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 index 4648fd151d8b..0976111daac4 100644 --- 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 @@ -4,21 +4,23 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.Constant88; +import com.azure.resourcemanager.securityinsights.models.Constant124; -/** Samples for EntityQueryTemplates List. */ +/** + * Samples for EntityQueryTemplates List. + */ public final class EntityQueryTemplatesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.json */ /** * Sample code: Get all entity query templates. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllEntityQueryTemplates( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.entityQueryTemplates().list("myRg", "myWorkspace", Constant88.ACTIVITY, Context.NONE); + public static void + getAllEntityQueryTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entityQueryTemplates() + .list("myRg", "myWorkspace", Constant124.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 index de44787f195e..addcca5dde80 100644 --- 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 @@ -4,26 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for EntityRelations GetRelation. */ +/** + * Samples for EntityRelations GetRelation. + */ public final class EntityRelationsGetRelationSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entities/relations/GetEntityRelationByName.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/relations/GetEntityRelationByName.json */ /** * Sample code: Get an entity relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAnEntityRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .entityRelations() - .getRelationWithResponse( - "myRg", - "myWorkspace", - "afbd324f-6c48-459c-8710-8d1e1cd03812", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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 index a839ca483bbc..a0e6290532b2 100644 --- 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 @@ -9,19 +9,20 @@ import com.azure.resourcemanager.securityinsights.models.FileMetadata; import com.azure.resourcemanager.securityinsights.models.IngestionMode; -/** Samples for FileImports Create. */ +/** + * Samples for FileImports Create. + */ public final class FileImportsCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/fileImports/CreateFileImport.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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() + manager.fileImports() .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") .withExistingWorkspace("myRg", "myWorkspace") .withIngestionMode(IngestionMode.INGEST_ANY_VALID_RECORDS) 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 index 6e961ca4a8bd..215bac040be4 100644 --- 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 @@ -4,19 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for FileImports Delete. */ +/** + * Samples for FileImports Delete. + */ public final class FileImportsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/fileImports/DeleteFileImport.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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 index cf0ff15ffb5b..ee628bbf3174 100644 --- 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for FileImports Get. */ +/** + * Samples for FileImports Get. + */ public final class FileImportsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/fileImports/GetFileImportById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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 index 4f080eb0b16c..102699c0e866 100644 --- 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for FileImports List. */ +/** + * Samples for FileImports List. + */ public final class FileImportsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/fileImports/GetFileImports.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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, Context.NONE); + 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..3c341b59e971 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for GetRecommendations List. + */ +public final class GetRecommendationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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().listWithResponse("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..9da7dd7dd966 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetSingleRecommendationSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import java.util.UUID; + +/** + * Samples for Get SingleRecommendation. + */ +public final class GetSingleRecommendationSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", + UUID.fromString("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..607d6984f625 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for GetTriggeredAnalyticsRuleRuns List. + */ +public final class GetTriggeredAnalyticsRuleRunsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..d1e9fb99c132 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntComments CreateOrUpdate. + */ +public final class HuntCommentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..865790c2238d --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntComments Delete. + */ +public final class HuntCommentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..79eb49d79303 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntComments Get. + */ +public final class HuntCommentsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..887fa562ea70 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntComments List. + */ +public final class HuntCommentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..79c873ed6d03 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import java.util.Arrays; + +/** + * Samples for HuntRelations CreateOrUpdate. + */ +public final class HuntRelationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..9a93dee307aa --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntRelations Delete. + */ +public final class HuntRelationsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..1e320d373dff --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntRelations Get. + */ +public final class HuntRelationsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..d527c3221ef7 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntRelations List. + */ +public final class HuntRelationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..4549ed93fb63 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsCreateOrUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.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; +import java.util.UUID; + +/** + * Samples for Hunts CreateOrUpdate. + */ +public final class HuntsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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(UUID.fromString("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..4c076e39e887 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Hunts Delete. + */ +public final class HuntsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..257f75b04b42 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Hunts Get. + */ +public final class HuntsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..338a4323f78a --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Hunts List. + */ +public final class HuntsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 8a16e508a98f..ec5b4115c2b8 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 @@ -4,20 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -/** Samples for IncidentComments CreateOrUpdate. */ +/** + * Samples for IncidentComments CreateOrUpdate. + */ public final class IncidentCommentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/comments/CreateIncidentComment.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidentComments() + 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") 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 ab58f3db35c5..19622de6645d 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 @@ -4,27 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for IncidentComments Delete. */ +/** + * Samples for IncidentComments Delete. + */ public final class IncidentCommentsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/comments/DeleteIncidentComment.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidentComments() - .deleteWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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); } } 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 b0cc0dbe7c41..8e5a757398fb 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 @@ -4,27 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for IncidentComments Get. */ +/** + * Samples for IncidentComments Get. + */ public final class IncidentCommentsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/comments/GetIncidentCommentById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidentComments() - .getWithResponse( - "myRg", - "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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 3bdb6e55cdb5..12d2627162ab 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for IncidentComments List. */ +/** + * Samples for IncidentComments List. + */ public final class IncidentCommentsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/comments/GetAllIncidentComments.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidentComments() - .list("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", null, null, null, null, Context.NONE); + 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); } } 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 4b99d62695e0..9feecb3b0192 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,31 +4,27 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; -/** Samples for IncidentRelations CreateOrUpdate. */ +/** + * Samples for IncidentRelations CreateOrUpdate. + */ public final class IncidentRelationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/relations/CreateIncidentRelation.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/relations/CreateIncidentRelation.json */ /** * Sample code: Creates or updates an incident relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAnIncidentRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentRelations() - .createOrUpdateWithResponse( - "myRg", - "myWorkspace", - "afbd324f-6c48-459c-8710-8d1e1cd03812", + public static void + createsOrUpdatesAnIncidentRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentRelations() + .createOrUpdateWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - new RelationInner() - .withRelatedResourceId( - "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"), - Context.NONE); + 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 e9f0630456b0..69b6d964e78e 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 @@ -4,27 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for IncidentRelations Delete. */ +/** + * Samples for IncidentRelations Delete. + */ public final class IncidentRelationsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/relations/DeleteIncidentRelation.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/relations/DeleteIncidentRelation.json */ /** * Sample code: Delete the incident relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteTheIncidentRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentRelations() - .deleteWithResponse( - "myRg", - "myWorkspace", - "afbd324f-6c48-459c-8710-8d1e1cd03812", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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); } } 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 9ca14fce1f49..66b01cf1f735 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 @@ -4,27 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for IncidentRelations Get. */ +/** + * Samples for IncidentRelations Get. + */ public final class IncidentRelationsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/relations/GetIncidentRelationByName.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/relations/GetIncidentRelationByName.json */ /** * Sample code: Get an incident relation. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnIncidentRelation( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentRelations() - .getWithResponse( - "myRg", - "myWorkspace", - "afbd324f-6c48-459c-8710-8d1e1cd03812", - "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", - Context.NONE); + 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); } } 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 223b77dfe78f..a2103ab8c0dc 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for IncidentRelations List. */ +/** + * Samples for IncidentRelations List. + */ public final class IncidentRelationsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/relations/GetAllIncidentRelations.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/relations/GetAllIncidentRelations.json */ /** * Sample code: Get all incident relations. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllIncidentRelations( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidentRelations() - .list("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", null, null, null, null, Context.NONE); + 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); } } 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..9b5bcff698e2 --- /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) AutoRest 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..9435487cbc28 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for IncidentTasks Delete. + */ +public final class IncidentTasksDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..3acc35042722 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for IncidentTasks Get. + */ +public final class IncidentTasksGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..4ce8ce192673 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for IncidentTasks List. + */ +public final class IncidentTasksListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 fac645158493..71f9e6cd78d6 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 @@ -12,33 +12,34 @@ import java.time.OffsetDateTime; import java.util.UUID; -/** Samples for Incidents CreateOrUpdate. */ +/** + * Samples for Incidents CreateOrUpdate. + */ public final class IncidentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/CreateIncident.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidents() + 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") - .withClassificationReason(IncidentClassificationReason.INCORRECT_ALERT_LOGIC) - .withDescription("This is a demo incident") + .withOwner(new IncidentOwnerInfo().withObjectId(UUID.fromString("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/IncidentsCreateTeamSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateTeamSamples.java index 1d10ad728869..6b6925fa323a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateTeamSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateTeamSamples.java @@ -4,28 +4,23 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.TeamProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.TeamInformationInner; -/** Samples for Incidents CreateTeam. */ +/** + * Samples for Incidents CreateTeam. + */ public final class IncidentsCreateTeamSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/CreateTeam.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/IncidentTeam/Incidents_CreateTeam.json */ /** - * Sample code: Creates incident teams group. - * + * Sample code: Incidents_CreateTeam. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsIncidentTeamsGroup( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .incidents() - .createTeamWithResponse( - "ambawolvese5resourcegroup", - "AmbaE5WestCentralUS", - "69a30280-6a4c-4aa7-9af0-5d63f335d600", - new TeamProperties().withTeamName("Team name").withTeamDescription("Team description"), - Context.NONE); + public static void incidentsCreateTeam(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .createTeamWithResponse("myRg", "myWorkspace", "69a30280-6a4c-4aa7-9af0-5d63f335d600", + new TeamInformationInner(), com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteSamples.java index 7213c317f62f..de8a3929cdb8 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Incidents Delete. */ +/** + * Samples for Incidents Delete. + */ public final class IncidentsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/DeleteIncident.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidents() - .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + 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 aaebebca140b..103d1360111e 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Incidents Get. */ +/** + * Samples for Incidents Get. + */ public final class IncidentsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/GetIncidentById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidents() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", Context.NONE); + 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 521cc7b9a7ea..e84aa7489a4a 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 @@ -4,22 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Incidents ListAlerts. */ +/** + * Samples for Incidents ListAlerts. + */ public final class IncidentsListAlertsSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/GetAllIncidentAlerts.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidents() - .listAlertsWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + 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); } } 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 396a34e22e02..440b63348868 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Incidents ListBookmarks. */ +/** + * Samples for Incidents ListBookmarks. + */ public final class IncidentsListBookmarksSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/GetAllIncidentBookmarks.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidents() - .listBookmarksWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + 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); } } 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 05dac3dfd232..e28093b04f7f 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Incidents ListEntities. */ +/** + * Samples for Incidents ListEntities. + */ public final class IncidentsListEntitiesSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/entities/GetAllIncidentEntities.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager - .incidents() - .listEntitiesWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", Context.NONE); + 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); } } 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 12ee00a614f6..e2c20db99bcc 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 @@ -4,19 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Incidents List. */ +/** + * Samples for Incidents List. + */ public final class IncidentsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/incidents/GetIncidents.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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) { - manager.incidents().list("myRg", "myWorkspace", null, "properties/createdTimeUtc desc", 1, null, Context.NONE); + 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 index 8aff9771734b..38df0fffe11e 100644 --- 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Incidents RunPlaybook. */ +/** + * Samples for Incidents RunPlaybook. + */ public final class IncidentsRunPlaybookSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/manualTrigger/Incidents_RunPlaybook.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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, Context.NONE); + 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 index 2e1c2cff2c93..24b31d9758ac 100644 --- 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 @@ -16,71 +16,55 @@ import java.time.LocalDate; import java.util.Arrays; -/** Samples for Metadata Create. */ +/** + * Samples for Metadata Create. + */ public final class MetadataCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/PutMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/PutMetadata.json */ /** * Sample code: Create/update full metadata. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createUpdateFullMetadata( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .metadatas() + public static void + createUpdateFullMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas() .define("metadataName") .withExistingWorkspace("myRg", "myWorkspace") .withContentId("c00ee137-7475-47c8-9cce-ec6f0f1bedd0") .withParentId( "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName") .withVersion("1.0.0.0") - .withKind(Kind.ANALYTICS_RULE) - .withSource( - new MetadataSource() - .withKind(SourceKind.SOLUTION) - .withName("Contoso Solution 1.0") - .withSourceId("b688a130-76f4-4a07-bf57-762222a3cadf")) + .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(Operator.AND) - .withCriteria( - Arrays - .asList( - new MetadataDependencies() - .withOperator(Operator.OR) - .withCriteria( - Arrays - .asList( - new MetadataDependencies() - .withContentId("045d06d0-ee72-4794-aba4-cf5646e4c756") - .withKind(Kind.DATA_CONNECTOR) - .withName("Microsoft Defender for Endpoint"), - new MetadataDependencies() - .withContentId("dbfcb2cc-d782-40ef-8d94-fe7af58a6f2d") - .withKind(Kind.DATA_CONNECTOR), - new MetadataDependencies() - .withContentId("de4dca9b-eb37-47d6-a56f-b8b06b261593") - .withKind(Kind.DATA_CONNECTOR) - .withVersion("2.0"))), - new MetadataDependencies() - .withContentId("31ee11cc-9989-4de8-b176-5e0ef5c4dbab") - .withKind(Kind.PLAYBOOK) - .withVersion("1.0"), - new MetadataDependencies() - .withContentId("21ba424a-9438-4444-953a-7059539a7a1b") - .withKind(Kind.PARSER)))) + .withSupport(new MetadataSupport().withTier(SupportTier.PARTNER) + .withName("Microsoft") + .withEmail("support@microsoft.com") + .withLink("https://support.microsoft.com/")) + .withDependencies(new MetadataDependencies().withOperator(Operator.fromString("AND")) + .withCriteria(Arrays.asList( + new MetadataDependencies().withOperator(Operator.fromString("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")) + new MetadataCategories().withDomains(Arrays.asList("Application", "Security – Insider Threat")) .withVerticals(Arrays.asList("Healthcare"))) .withProviders(Arrays.asList("Amazon", "Microsoft")) .withFirstPublishDate(LocalDate.parse("2021-05-18")) @@ -95,23 +79,22 @@ public static void createUpdateFullMetadata( } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/PutMetadataMinimal.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/PutMetadataMinimal.json */ /** * Sample code: Create/update minimal metadata. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createUpdateMinimalMetadata( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .metadatas() + public static void + createUpdateMinimalMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.metadatas() .define("metadataName") .withExistingWorkspace("myRg", "myWorkspace") .withContentId("c00ee137-7475-47c8-9cce-ec6f0f1bedd0") .withParentId( "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName") - .withKind(Kind.ANALYTICS_RULE) + .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 index 83b191e5ca95..51eadb5c2284 100644 --- 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Metadata Delete. */ +/** + * Samples for Metadata Delete. + */ public final class MetadataDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/DeleteMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/DeleteMetadata.json */ /** * Sample code: Delete metadata. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void deleteMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.metadatas().deleteWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE); + 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 index 9d738dafd085..2b0f9bb1f0e4 100644 --- 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 @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Metadata Get. */ +/** + * Samples for Metadata Get. + */ public final class MetadataGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/GetMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/GetMetadata.json */ /** * Sample code: Get single metadata by name. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getSingleMetadataByName( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.metadatas().getWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE); + 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 index 05d6eb76725f..d70441241078 100644 --- 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 @@ -4,32 +4,32 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Metadata List. */ +/** + * Samples for Metadata List. + */ public final class MetadataListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/GetAllMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/GetAllMetadata.json */ /** * Sample code: Get all metadata. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/GetAllMetadataOData.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/GetAllMetadataOData.json */ /** * Sample code: Get all metadata with OData filter/orderby/skip/top. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllMetadataWithODataFilterOrderbySkipTop( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.metadatas().list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + 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 index 91f5be55253b..e7d2bb2c8431 100644 --- 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 @@ -4,25 +4,26 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; import com.azure.resourcemanager.securityinsights.models.MetadataModel; -/** Samples for Metadata Update. */ +/** + * Samples for Metadata Update. + */ public final class MetadataUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/metadata/PatchMetadata.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/metadata/PatchMetadata.json */ /** * Sample code: Update metadata. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void updateMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - MetadataModel resource = - manager.metadatas().getWithResponse("myRg", "myWorkspace", "metadataName", Context.NONE).getValue(); - resource - .update() + 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 index 83381c6ff091..6b894920583a 100644 --- 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for OfficeConsents Delete. */ +/** + * Samples for OfficeConsents Delete. + */ public final class OfficeConsentsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/officeConsents/DeleteOfficeConsents.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/officeConsents/DeleteOfficeConsents.json */ /** * Sample code: Delete an office consent. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAnOfficeConsent( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .officeConsents() - .deleteWithResponse("myRg", "myWorkspace", "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", Context.NONE); + 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 index 82ebecfad742..e39ff2e99c1d 100644 --- 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 @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for OfficeConsents Get. */ +/** + * Samples for OfficeConsents Get. + */ public final class OfficeConsentsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/officeConsents/GetOfficeConsentsById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/officeConsents/GetOfficeConsentsById.json */ /** * Sample code: Get an office consent. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAnOfficeConsent(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .officeConsents() - .getWithResponse("myRg", "myWorkspace", "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", Context.NONE); + 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 index bff20163b14d..e554a0ad4125 100644 --- 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 @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for OfficeConsents List. */ +/** + * Samples for OfficeConsents List. + */ public final class OfficeConsentsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/officeConsents/GetOfficeConsents.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/officeConsents/GetOfficeConsents.json */ /** * Sample code: Get all office consents. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllOfficeConsents( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.officeConsents().list("myRg", "myWorkspace", Context.NONE); + 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 bd9e0689a55d..b9aa20e04e48 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/operations/ListOperations.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageOperationGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageOperationGetSamples.java new file mode 100644 index 000000000000..2959dfadd0ed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageOperationGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductPackageOperation Get. + */ +public final class ProductPackageOperationGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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.productPackageOperations() + .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/ProductPackagesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesListSamples.java new file mode 100644 index 000000000000..308bc15bab98 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductPackages List. + */ +public final class ProductPackagesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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.productPackages().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/ProductSettingsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsDeleteSamples.java index 9b87891b4ad7..c995e1634441 100644 --- 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 @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for ProductSettings Delete. */ +/** + * Samples for ProductSettings Delete. + */ public final class ProductSettingsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/settings/DeleteEyesOnSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/settings/DeleteEyesOnSetting.json */ /** * Sample code: Delete EyesOn settings. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteEyesOnSettings( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.productSettings().deleteWithResponse("myRg", "myWorkspace", "EyesOn", Context.NONE); + 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 index c48e37a90773..299055f065ec 100644 --- 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for ProductSettings Get. */ +/** + * Samples for ProductSettings Get. + */ public final class ProductSettingsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/settings/GetEyesOnSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/settings/GetEyesOnSetting.json */ /** * Sample code: Get EyesOn settings. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getEyesOnSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.productSettings().getWithResponse("myRg", "myWorkspace", "EyesOn", Context.NONE); + 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 index e54fd9e369a6..998873837558 100644 --- 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for ProductSettings List. */ +/** + * Samples for ProductSettings List. + */ public final class ProductSettingsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/settings/GetAllSettings.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/settings/GetAllSettings.json */ /** * Sample code: Get all settings. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.productSettings().listWithResponse("myRg", "myWorkspace", Context.NONE); + manager.productSettings().listWithResponse("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 index d84adcba1067..a972d350c4b4 100644 --- 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 @@ -4,28 +4,24 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.EyesOn; -/** Samples for ProductSettings Update. */ +/** + * Samples for ProductSettings Update. + */ public final class ProductSettingsUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/settings/UpdateEyesOnSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/settings/UpdateEyesOnSetting.json */ /** * Sample code: Update EyesOn settings. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void updateEyesOnSettings( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .productSettings() - .updateWithResponse( - "myRg", - "myWorkspace", - "EyesOn", - new EyesOn().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\""), - Context.NONE); + 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/ProductTemplateOperationGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateOperationGetSamples.java new file mode 100644 index 000000000000..5ff3f761ac8f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateOperationGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductTemplateOperation Get. + */ +public final class ProductTemplateOperationGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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.productTemplateOperations() + .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/ProductTemplatesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesListSamples.java new file mode 100644 index 000000000000..681b4da80cab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductTemplates List. + */ +public final class ProductTemplatesListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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.productTemplates() + .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..f8e6ee7c586c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ReevaluateRecommendationSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import java.util.UUID; + +/** + * Samples for Reevaluate Recommendation. + */ +public final class ReevaluateRecommendationSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", UUID.fromString("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..095ec5b90023 --- /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) AutoRest 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..300488aa7554 --- /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) AutoRest 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 4f4f433d1c48..456661f77b25 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.securityinsights.models.AnomalySecurityMLAnalyticsSettings; import com.azure.resourcemanager.securityinsights.models.AttackTactic; @@ -16,63 +15,42 @@ import java.util.Arrays; import java.util.UUID; -/** Samples for SecurityMLAnalyticsSettings CreateOrUpdate. */ +/** + * Samples for SecurityMLAnalyticsSettings CreateOrUpdate. + */ public final class SecurityMLAnalyticsSettingsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/securityMLAnalyticsSettings/CreateAnomalySecurityMLAnalyticsSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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\"") + 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.") + "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")))) + 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)) + .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")), - Context.NONE); + 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 5a7fbfb4f91a..c89e9a37ea8d 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for SecurityMLAnalyticsSettings Delete. */ +/** + * Samples for SecurityMLAnalyticsSettings Delete. + */ public final class SecurityMLAnalyticsSettingsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + 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); } } 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 fa8f8cd73f74..33941e7851e7 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 @@ -4,22 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for SecurityMLAnalyticsSettings Get. */ +/** + * Samples for SecurityMLAnalyticsSettings Get. + */ public final class SecurityMLAnalyticsSettingsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + manager.securityMLAnalyticsSettings() + .getWithResponse("myRg", "myWorkspace", "myFirstAnomalySettings", com.azure.core.util.Context.NONE); } } 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 a8eb1f6d6008..705d6e55d06e 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 @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for SecurityMLAnalyticsSettings List. */ +/** + * Samples for SecurityMLAnalyticsSettings List. + */ public final class SecurityMLAnalyticsSettingsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", Context.NONE); + public static void + getAllSecurityMLAnalyticsSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.securityMLAnalyticsSettings().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/SentinelOnboardingStatesCreateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesCreateSamples.java index 177a2c21f7ab..13c86789883a 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 @@ -4,20 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -/** Samples for SentinelOnboardingStates Create. */ +/** + * Samples for SentinelOnboardingStates Create. + */ public final class SentinelOnboardingStatesCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/onboardingStates/CreateSentinelOnboardingState.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/onboardingStates/CreateSentinelOnboardingState.json */ /** * Sample code: Create Sentinel onboarding state. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createSentinelOnboardingState( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .sentinelOnboardingStates() + public static void + createSentinelOnboardingState(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates() .define("default") .withExistingWorkspace("myRg", "myWorkspace") .withCustomerManagedKey(false) 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 73d131daaf98..f8a95a0b2b41 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 @@ -4,20 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for SentinelOnboardingStates Delete. */ +/** + * Samples for SentinelOnboardingStates Delete. + */ public final class SentinelOnboardingStatesDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/onboardingStates/DeleteSentinelOnboardingState.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/onboardingStates/DeleteSentinelOnboardingState.json */ /** * Sample code: Delete Sentinel onboarding state. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteSentinelOnboardingState( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sentinelOnboardingStates().deleteWithResponse("myRg", "myWorkspace", "default", Context.NONE); + public static void + deleteSentinelOnboardingState(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates() + .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/SentinelOnboardingStatesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesGetSamples.java index 1e61ad09b71b..b61731e5e95d 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 @@ -4,20 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for SentinelOnboardingStates Get. */ +/** + * Samples for SentinelOnboardingStates Get. + */ public final class SentinelOnboardingStatesGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/onboardingStates/GetSentinelOnboardingState.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/onboardingStates/GetSentinelOnboardingState.json */ /** * Sample code: Get Sentinel onboarding state. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getSentinelOnboardingState( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sentinelOnboardingStates().getWithResponse("myRg", "myWorkspace", "default", Context.NONE); + public static void + getSentinelOnboardingState(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates() + .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/SentinelOnboardingStatesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesListSamples.java index 089fa7920c92..aafabcf2b1da 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 @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for SentinelOnboardingStates List. */ +/** + * Samples for SentinelOnboardingStates List. + */ public final class SentinelOnboardingStatesListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/onboardingStates/GetAllSentinelOnboardingStates.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/onboardingStates/GetAllSentinelOnboardingStates.json */ /** * Sample code: Get all Sentinel onboarding states. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllSentinelOnboardingStates( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sentinelOnboardingStates().listWithResponse("myRg", "myWorkspace", Context.NONE); + public static void + getAllSentinelOnboardingStates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sentinelOnboardingStates().listWithResponse("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlListRepositoriesSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlListRepositoriesSamples.java index eedc402653a9..89117d4172b0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlListRepositoriesSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlListRepositoriesSamples.java @@ -4,20 +4,28 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; -/** Samples for SourceControl ListRepositories. */ +/** + * Samples for SourceControl ListRepositories. + */ public final class SourceControlListRepositoriesSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/repositories/GetRepositories.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/repositories/GetRepositories.json */ /** * Sample code: Get repository list. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getRepositoryList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sourceControls().listRepositories("myRg", "myWorkspace", RepoType.GITHUB, Context.NONE); + manager.sourceControls() + .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/SourceControlsOperationCreateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationCreateSamples.java index 3981370a4a6f..8e0fa6cc11fa 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationCreateSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationCreateSamples.java @@ -4,47 +4,42 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.resourcemanager.securityinsights.models.ContentPathMap; +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 com.azure.resourcemanager.securityinsights.models.RepoType; import java.util.Arrays; -/** Samples for SourceControlsOperation Create. */ +/** + * Samples for SourceControlsOperation Create. + */ public final class SourceControlsOperationCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/sourcecontrols/CreateSourceControl.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/sourcecontrols/CreateSourceControl.json */ /** - * Sample code: Creates a source control. - * + * Sample code: Creates or updates a source control. + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsASourceControl( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .sourceControlsOperations() + public static void + createsOrUpdatesASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControlsOperations() .define("789e0c1f-4a3d-43ad-809c-e713b677b04a") .withExistingWorkspace("myRg", "myWorkspace") - .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") .withDisplayName("My Source Control") - .withDescription("This is a source control") .withRepoType(RepoType.GITHUB) .withContentTypes(Arrays.asList(ContentType.fromString("AnalyticRules"), ContentType.WORKBOOK)) - .withRepository( - new Repository() - .withUrl("https://github.com/user/repo") - .withBranch("master") - .withDisplayUrl("https://github.com/user/repo") - .withPathMapping( - Arrays - .asList( - new ContentPathMap() - .withContentType(ContentType.fromString("AnalyticRules")) - .withPath("path/to/rules"), - new ContentPathMap() - .withContentType(ContentType.WORKBOOK) - .withPath("path/to/workbooks")))) + .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/SourceControlsOperationDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationDeleteSamples.java index 3479bbc73c0d..779b87ddcffa 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationDeleteSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationDeleteSamples.java @@ -4,22 +4,29 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; -/** Samples for SourceControlsOperation Delete. */ +/** + * Samples for SourceControlsOperation Delete. + */ public final class SourceControlsOperationDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/sourcecontrols/DeleteSourceControl.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/sourcecontrols/DeleteSourceControl.json */ /** * Sample code: Delete a source control. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteASourceControl( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .sourceControlsOperations() - .deleteWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", Context.NONE); + public static void + deleteASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControlsOperations() + .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/SourceControlsOperationGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationGetSamples.java index e311a8036dba..efde0e309d87 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationGetSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationGetSamples.java @@ -4,21 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for SourceControlsOperation Get. */ +/** + * Samples for SourceControlsOperation Get. + */ public final class SourceControlsOperationGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/sourcecontrols/GetSourceControlById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/sourcecontrols/GetSourceControlById.json */ /** * Sample code: Get a source control. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .sourceControlsOperations() - .getWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", Context.NONE); + manager.sourceControlsOperations() + .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/SourceControlsOperationListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationListSamples.java index 348b8fabfa69..93806ce0ca90 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationListSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsOperationListSamples.java @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for SourceControlsOperation List. */ +/** + * Samples for SourceControlsOperation List. + */ public final class SourceControlsOperationListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/sourcecontrols/GetSourceControls.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/sourcecontrols/GetSourceControls.json */ /** * Sample code: Get all source controls. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllSourceControls( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sourceControlsOperations().list("myRg", "myWorkspace", Context.NONE); + public static void + getAllSourceControls(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControlsOperations().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/SystemsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..81107d3a30ec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsCreateOrUpdateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.IngestionType; +import com.azure.resourcemanager.securityinsights.models.Log; +import com.azure.resourcemanager.securityinsights.models.LogStatusType; +import com.azure.resourcemanager.securityinsights.models.LogType; +import com.azure.resourcemanager.securityinsights.models.RfcConnector; +import com.azure.resourcemanager.securityinsights.models.SapAuthenticationType; +import com.azure.resourcemanager.securityinsights.models.SapSystemsConfiguration; +import com.azure.resourcemanager.securityinsights.models.SystemStatusType; +import java.util.Arrays; + +/** + * Samples for Systems CreateOrUpdate. + */ +public final class SystemsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_CreateOrUpdate.json + */ + /** + * Sample code: Systems_CreateOrUpdate. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + systemsCreateOrUpdate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .define("3d69632b-0b60-4af3-8720-77f01a25d34a") + .withExistingBusinessApplicationAgent("myRg", "myWorkspace", "3123432b-0b60-4af3-8720-77f01a25d34a") + .withConfiguration(new SapSystemsConfiguration().withAzureResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") + .withConnector(new RfcConnector().withAbapServerHost("1.1.1.1") + .withSystemNumber("001") + .withSystemId("A4H") + .withClient("001") + .withAuthenticationType(SapAuthenticationType.USERNAME_PASSWORD)) + .withLogs(Arrays.asList( + new Log().withType(LogType.ABAP_AUDIT_LOG) + .withIngestionType(IngestionType.INCREMENTAL) + .withStatus(LogStatusType.ENABLED) + .withScheduleInterval(60) + .withBulkSize(100) + .withFilters(Arrays.asList("filter1", "filter2")), + new Log().withType(LogType.USR01) + .withIngestionType(IngestionType.INCREMENTAL) + .withStatus(LogStatusType.ENABLED) + .withScheduleInterval(60) + .withBulkSize(100) + .withFilters(Arrays.asList("filter1", "filter2"))))) + .withDisplayName("A4H_System") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withStatus(SystemStatusType.RUNNING) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsDeleteSamples.java new file mode 100644 index 000000000000..7608468c42ec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Systems Delete. + */ +public final class SystemsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_Delete.json + */ + /** + * Sample code: Systems_Delete. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void systemsDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .deleteWithResponse("myRg", "myWorkspace", "3123432b-0b60-4af3-8720-77f01a25d34a", + "3d69632b-0b60-4af3-8720-77f01a25d34a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsGetSamples.java new file mode 100644 index 000000000000..87e7727ec63f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Systems Get. + */ +public final class SystemsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_Get.json + */ + /** + * Sample code: Systems_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void systemsGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .getWithResponse("myRg", "myWorkspace", "3123432b-0b60-4af3-8720-77f01a25d34a", + "3d69632b-0b60-4af3-8720-77f01a25d34a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsListActionsSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsListActionsSamples.java new file mode 100644 index 000000000000..63017926c999 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsListActionsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Systems ListActions. + */ +public final class SystemsListActionsSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/actions/ListActions.json + */ + /** + * Sample code: ListActions. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void listActions(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .listActions("myRg", "myWorkspace", "247b377a-7137-4b3c-bf15-df1d3260ef1b", + "3d69632b-0b60-4af3-8720-77f01a25d34a", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsListSamples.java new file mode 100644 index 000000000000..42de222d6987 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Systems List. + */ +public final class SystemsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_List.json + */ + /** + * Sample code: Systems_List. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void systemsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .list("myRg", "myWorkspace", "3123432b-0b60-4af3-8720-77f01a25d34a", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsReportActionStatusSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsReportActionStatusSamples.java new file mode 100644 index 000000000000..b073543a4b23 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsReportActionStatusSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Systems ReportActionStatus. + */ +public final class SystemsReportActionStatusSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/actions/ReportActionStatus.json + */ + /** + * Sample code: ReportActionStatus. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void reportActionStatus(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .reportActionStatusWithResponse("myRg", "myWorkspace", "247b377a-7137-4b3c-bf15-df1d3260ef1b", + "3d69632b-0b60-4af3-8720-77f01a25d34a", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsUndoActionSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsUndoActionSamples.java new file mode 100644 index 000000000000..6ddbc26894f5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SystemsUndoActionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Systems UndoAction. + */ +public final class SystemsUndoActionSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/actions/UndoAction.json + */ + /** + * Sample code: UndoAction. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void undoAction(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.systems() + .undoActionWithResponse("myRg", "myWorkspace", "247b377a-7137-4b3c-bf15-df1d3260ef1b", + "3d69632b-0b60-4af3-8720-77f01a25d34a", null, 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..c39ec0d36259 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.TiType; + +/** + * Samples for ThreatIntelligence Count. + */ +public final class ThreatIntelligenceCountSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 Query(), 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 19453e0a796a..012c897dbae3 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 @@ -4,29 +4,26 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; import java.util.Arrays; -/** Samples for ThreatIntelligenceIndicator AppendTags. */ +/** + * Samples for ThreatIntelligenceIndicator AppendTags. + */ public final class ThreatIntelligenceIndicatorAppendTagsSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/AppendTagsThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/AppendTagsThreatIntelligence.json */ /** * Sample code: Append tags to a threat intelligence indicator. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void appendTagsToAThreatIntelligenceIndicator( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .threatIntelligenceIndicators() - .appendTagsWithResponse( - "myRg", - "myWorkspace", - "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", + manager.threatIntelligenceIndicators() + .appendTagsWithResponse("myRg", "myWorkspace", "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", new ThreatIntelligenceAppendTags().withThreatIntelligenceTags(Arrays.asList("tag1", "tag2")), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateIndicatorSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorCreateIndicatorSamples.java index 1934f75a9e79..5bde81858030 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 @@ -4,29 +4,26 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; import java.util.Arrays; -/** Samples for ThreatIntelligenceIndicator CreateIndicator. */ +/** + * Samples for ThreatIntelligenceIndicator CreateIndicator. + */ public final class ThreatIntelligenceIndicatorCreateIndicatorSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/CreateThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/CreateThreatIntelligence.json */ /** * Sample code: Create a new Threat Intelligence. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createANewThreatIntelligence( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .threatIntelligenceIndicators() - .createIndicatorWithResponse( - "myRg", - "myWorkspace", - new ThreatIntelligenceIndicatorModel() - .withThreatIntelligenceTags(Arrays.asList("new schema")) + 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") @@ -43,6 +40,6 @@ public static void createANewThreatIntelligence( .withValidFrom("2021-09-15T17:44:00.114052Z") .withValidUntil("") .withModified(""), - Context.NONE); + 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 6185703dc8aa..89a67631cd85 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 @@ -4,30 +4,26 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; import java.util.Arrays; -/** Samples for ThreatIntelligenceIndicator Create. */ +/** + * Samples for ThreatIntelligenceIndicator Create. + */ public final class ThreatIntelligenceIndicatorCreateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/UpdateThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/UpdateThreatIntelligence.json */ /** * Sample code: Update a threat Intelligence indicator. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void updateAThreatIntelligenceIndicator( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .threatIntelligenceIndicators() - .createWithResponse( - "myRg", - "myWorkspace", - "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", - new ThreatIntelligenceIndicatorModel() - .withThreatIntelligenceTags(Arrays.asList("new schema")) + 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") @@ -44,6 +40,6 @@ public static void updateAThreatIntelligenceIndicator( .withValidFrom("2020-04-15T17:44:00.114052Z") .withValidUntil("") .withModified(""), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorDeleteSamples.java index fe4c1fb359c4..d45d39c4cf97 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for ThreatIntelligenceIndicator Delete. */ +/** + * Samples for ThreatIntelligenceIndicator Delete. + */ public final class ThreatIntelligenceIndicatorDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/DeleteThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/DeleteThreatIntelligence.json */ /** * Sample code: Delete a threat intelligence indicator. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAThreatIntelligenceIndicator( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .threatIntelligenceIndicators() - .deleteWithResponse("myRg", "myWorkspace", "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", Context.NONE); + 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); } } 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 73c9f32e2419..31f6da1e330c 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 @@ -4,22 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for ThreatIntelligenceIndicator Get. */ +/** + * Samples for ThreatIntelligenceIndicator Get. + */ public final class ThreatIntelligenceIndicatorGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json */ /** * Sample code: View a threat intelligence indicator by name. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void viewAThreatIntelligenceIndicatorByName( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .threatIntelligenceIndicators() - .getWithResponse("myRg", "myWorkspace", "e16ef847-962e-d7b6-9c8b-a33e4bd30e47", Context.NONE); + manager.threatIntelligenceIndicators() + .getWithResponse("myRg", "myWorkspace", "e16ef847-962e-d7b6-9c8b-a33e4bd30e47", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListSamples.java index d04ce8551107..2fc793414478 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 @@ -4,20 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for ThreatIntelligenceIndicatorMetrics List. */ +/** + * Samples for ThreatIntelligenceIndicatorMetrics List. + */ public final class ThreatIntelligenceIndicatorMetricsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/CollectThreatIntelligenceMetrics.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/CollectThreatIntelligenceMetrics.json */ /** * Sample code: Get threat intelligence indicators metrics. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getThreatIntelligenceIndicatorsMetrics( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.threatIntelligenceIndicatorMetrics().listWithResponse("myRg", "myWorkspace", Context.NONE); + manager.threatIntelligenceIndicatorMetrics() + .listWithResponse("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorQueryIndicatorsSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorQueryIndicatorsSamples.java index 487339a28251..1d3d28b71dc3 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 @@ -4,42 +4,33 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteria; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteriaEnum; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingOrder; import java.util.Arrays; -/** Samples for ThreatIntelligenceIndicator QueryIndicators. */ +/** + * Samples for ThreatIntelligenceIndicator QueryIndicators. + */ public final class ThreatIntelligenceIndicatorQueryIndicatorsSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/QueryThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/QueryThreatIntelligence.json */ /** * Sample code: Query threat intelligence indicators as per filtering criteria. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void queryThreatIntelligenceIndicatorsAsPerFilteringCriteria( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .threatIntelligenceIndicators() - .queryIndicators( - "myRg", - "myWorkspace", - new ThreatIntelligenceFilteringCriteria() - .withPageSize(100) - .withMinConfidence(25) - .withMaxConfidence(80) - .withMinValidUntil("2021-04-05T17:44:00.114052Z") - .withMaxValidUntil("2021-04-25T17:44:00.114052Z") - .withSortBy( - Arrays - .asList( - new ThreatIntelligenceSortingCriteria() - .withItemKey("lastUpdatedTimeUtc") - .withSortOrder(ThreatIntelligenceSortingCriteriaEnum.DESCENDING))) - .withSources(Arrays.asList("Azure Sentinel")), - Context.NONE); + 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); } } 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 96e9c364d8e4..4ee5369ff88a 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 @@ -4,31 +4,27 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; import java.util.Arrays; -/** Samples for ThreatIntelligenceIndicator ReplaceTags. */ +/** + * Samples for ThreatIntelligenceIndicator ReplaceTags. + */ public final class ThreatIntelligenceIndicatorReplaceTagsSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/ReplaceTagsThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/ReplaceTagsThreatIntelligence.json */ /** * Sample code: Replace tags to a Threat Intelligence. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void replaceTagsToAThreatIntelligence( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .threatIntelligenceIndicators() - .replaceTagsWithResponse( - "myRg", - "myWorkspace", - "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", - new ThreatIntelligenceIndicatorModel() - .withEtag("\"0000262c-0000-0800-0000-5e9767060000\"") + 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")), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationListSamples.java index 3ab41f9ce6d6..e2f28fecc026 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 @@ -4,22 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for ThreatIntelligenceIndicatorsOperation List. */ +/** + * Samples for ThreatIntelligenceIndicatorsOperation List. + */ public final class ThreatIntelligenceIndicatorsOperationListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/threatintelligence/GetThreatIntelligence.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/GetThreatIntelligence.json */ /** * Sample code: Get all threat intelligence indicators. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllThreatIntelligenceIndicators( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .threatIntelligenceIndicatorsOperations() - .list("myRg", "myWorkspace", null, null, null, null, Context.NONE); + 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); } } 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..f075f901ca9e --- /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) AutoRest 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.QueryAutoGenerated; +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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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 QueryAutoGenerated() + .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..8d450e076cd6 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for TriggeredAnalyticsRuleRunOperation Get. + */ +public final class TriggeredAnalyticsRuleRunOperationGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..5f7c9731845e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/UpdateRecommendationSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.RecommendationPatch; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatchProperties; +import com.azure.resourcemanager.securityinsights.models.State; +import java.util.UUID; + +/** + * Samples for Update Recommendation. + */ +public final class UpdateRecommendationSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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", UUID.fromString("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 f6508ac2af4a..864837155235 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 @@ -7,40 +7,31 @@ import java.util.HashMap; import java.util.Map; -/** Samples for WatchlistItems CreateOrUpdate. */ +/** + * Samples for WatchlistItems CreateOrUpdate. + */ public final class WatchlistItemsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/CreateWatchlistItem.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/CreateWatchlistItem.json */ /** * Sample code: Creates or updates a watchlist item. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAWatchlistItem( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .watchlistItems() + public static void + createsOrUpdatesAWatchlistItem(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems() .define("82ba292c-dc97-4dfc-969d-d4dd9e666842") .withExistingWatchlist("myRg", "myWorkspace", "highValueAsset") .withEtag("0300bf09-0000-0000-0000-5c37296e0000") .withItemsKeyValue( - mapOf( - "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")) + mapOf("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")) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 95b63e3a64e9..e479dfdcb8a2 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 @@ -4,23 +4,22 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for WatchlistItems Delete. */ +/** + * Samples for WatchlistItems Delete. + */ public final class WatchlistItemsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/DeleteWatchlistItem.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/DeleteWatchlistItem.json */ /** * Sample code: Delete a watchlist Item. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAWatchlistItem( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .watchlistItems() - .deleteWithResponse( - "myRg", "myWorkspace", "highValueAsset", "4008512e-1d30-48b2-9ee2-d3612ed9d3ea", Context.NONE); + public static void + deleteAWatchlistItem(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems() + .deleteWithResponse("myRg", "myWorkspace", "highValueAsset", "4008512e-1d30-48b2-9ee2-d3612ed9d3ea", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsGetSamples.java index e86b44a1108a..475a6a98172c 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 @@ -4,22 +4,21 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for WatchlistItems Get. */ +/** + * Samples for WatchlistItems Get. + */ public final class WatchlistItemsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/GetWatchlistItemById.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/GetWatchlistItemById.json */ /** * Sample code: Get a watchlist item. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAWatchlistItem(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .watchlistItems() - .getWithResponse( - "myRg", "myWorkspace", "highValueAsset", "3f8901fe-63d9-4875-9ad5-9fb3b8105797", Context.NONE); + manager.watchlistItems() + .getWithResponse("myRg", "myWorkspace", "highValueAsset", "3f8901fe-63d9-4875-9ad5-9fb3b8105797", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsListSamples.java index 7fe192510721..e65119aadb65 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 @@ -4,20 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for WatchlistItems List. */ +/** + * Samples for WatchlistItems List. + */ public final class WatchlistItemsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/GetWatchlistItems.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/GetWatchlistItems.json */ /** * Sample code: Get all watchlist Items. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllWatchlistItems( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlistItems().list("myRg", "myWorkspace", "highValueAsset", null, 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); } } 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 d668e090cc94..22ed50c2f2e1 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 @@ -6,20 +6,21 @@ import com.azure.resourcemanager.securityinsights.models.SourceType; -/** Samples for Watchlists CreateOrUpdate. */ +/** + * Samples for Watchlists CreateOrUpdate. + */ public final class WatchlistsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json */ /** * Sample code: Creates or updates a watchlist and bulk creates watchlist items. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void createsOrUpdatesAWatchlistAndBulkCreatesWatchlistItems( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .watchlists() + manager.watchlists() .define("highValueAsset") .withExistingWorkspace("myRg", "myWorkspace") .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") @@ -36,17 +37,16 @@ public static void createsOrUpdatesAWatchlistAndBulkCreatesWatchlistItems( } /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/CreateWatchlist.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/CreateWatchlist.json */ /** * Sample code: Creates or updates a watchlist. - * + * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAWatchlist( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager - .watchlists() + public static void + createsOrUpdatesAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists() .define("highValueAsset") .withExistingWorkspace("myRg", "myWorkspace") .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") 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 173a9fdce43f..081eeb9d3059 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 @@ -4,19 +4,20 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Watchlists Delete. */ +/** + * Samples for Watchlists Delete. + */ public final class WatchlistsDeleteSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/DeleteWatchlist.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/DeleteWatchlist.json */ /** * Sample code: Delete a watchlist. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void deleteAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlists().deleteWithResponse("myRg", "myWorkspace", "highValueAsset", Context.NONE); + manager.watchlists() + .deleteWithResponse("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 5de292dd4f01..afde250ac456 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Watchlists Get. */ +/** + * Samples for Watchlists Get. + */ public final class WatchlistsGetSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/GetWatchlistByAlias.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/GetWatchlistByAlias.json */ /** * Sample code: Get a watchlist. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlists().getWithResponse("myRg", "myWorkspace", "highValueAsset", Context.NONE); + manager.watchlists().getWithResponse("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/WatchlistsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsListSamples.java index 1ff890f70c81..57e53f207e88 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 @@ -4,19 +4,19 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.core.util.Context; - -/** Samples for Watchlists List. */ +/** + * Samples for Watchlists List. + */ public final class WatchlistsListSamples { /* - * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/watchlists/GetWatchlists.json + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/GetWatchlists.json */ /** * Sample code: Get all watchlists. - * + * * @param manager Entry point to SecurityInsightsManager. */ public static void getAllWatchlists(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlists().list("myRg", "myWorkspace", null, Context.NONE); + manager.watchlists().list("myRg", "myWorkspace", null, com.azure.core.util.Context.NONE); } } 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..4228299adbe5 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignmentJobs Create. + */ +public final class WorkspaceManagerAssignmentJobsCreateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..b50c13b54bba --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignmentJobs Delete. + */ +public final class WorkspaceManagerAssignmentJobsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..4fccfed3ce0d --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignmentJobs Get. + */ +public final class WorkspaceManagerAssignmentJobsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..d612e3f78304 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignmentJobs List. + */ +public final class WorkspaceManagerAssignmentJobsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..7923edac9bd4 --- /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) AutoRest 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: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..901763da8e43 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignments Delete. + */ +public final class WorkspaceManagerAssignmentsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..0a91e0e5198f --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignments Get. + */ +public final class WorkspaceManagerAssignmentsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..7be0f8f42110 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignments List. + */ +public final class WorkspaceManagerAssignmentsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..c912e1ba030c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.Mode; + +/** + * Samples for WorkspaceManagerConfigurations CreateOrUpdate. + */ +public final class WorkspaceManagerConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..7f632e24075e --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerConfigurations Delete. + */ +public final class WorkspaceManagerConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..fbbeb3a6a983 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerConfigurations Get. + */ +public final class WorkspaceManagerConfigurationsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..fc9d2dd8612d --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerConfigurations List. + */ +public final class WorkspaceManagerConfigurationsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..e08bf73e1776 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import java.util.Arrays; + +/** + * Samples for WorkspaceManagerGroups CreateOrUpdate. + */ +public final class WorkspaceManagerGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..6f968c0c1b86 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerGroups Delete. + */ +public final class WorkspaceManagerGroupsDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..bbb559db42a8 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerGroups Get. + */ +public final class WorkspaceManagerGroupsGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..cfb3491926f4 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerGroups List. + */ +public final class WorkspaceManagerGroupsListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..b40b53a770b7 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerMembers CreateOrUpdate. + */ +public final class WorkspaceManagerMembersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..eb8c5253b7ac --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerMembers Delete. + */ +public final class WorkspaceManagerMembersDeleteSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..40df9a6e396d --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerMembers Get. + */ +public final class WorkspaceManagerMembersGetSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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..eaf8a6d86770 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerMembers List. + */ +public final class WorkspaceManagerMembersListSamples { + /* + * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/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); + } +}