From 708e3e64053421a6bfadefb49f154d2801f68a9f Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 16 Jul 2024 12:02:51 +0800 Subject: [PATCH 01/11] regen with latest spec main --- .../defender/easm/EasmAsyncClient.java | 1305 +++++- .../analytics/defender/easm/EasmClient.java | 1054 ++++- .../defender/easm/EasmClientBuilder.java | 85 +- .../defender/easm/EasmServiceVersion.java | 9 +- .../easm/implementation/EasmClientImpl.java | 3936 ++++++++++------- .../CreateOrReplaceDiscoGroupRequest.java | 322 ++ .../implementation/models/package-info.java | 14 + .../defender/easm/models/AlexaDetails.java | 71 +- .../defender/easm/models/AsAsset.java | 182 +- .../defender/easm/models/AsAssetResource.java | 354 +- .../models/AssetChainKindSummaryResult.java | 105 + .../easm/models/AssetChainRequest.java | 107 + .../easm/models/AssetChainSource.java | 57 + .../easm/models/AssetChainSummaryResult.java | 133 + .../defender/easm/models/AssetKind.java | 93 + .../defender/easm/models/AssetPageResult.java | 61 +- .../defender/easm/models/AssetResource.java | 337 +- .../easm/models/AssetResponseType.java | 69 + .../easm/models/AssetSecurityPolicy.java | 80 +- .../defender/easm/models/AssetState.java | 4 +- .../easm/models/AssetSummaryResult.java | 99 +- .../defender/easm/models/AssetUpdateData.java | 58 +- .../easm/models/AssetUpdateState.java | 2 - .../easm/models/AssetUpdateTransfers.java | 2 - .../easm/models/AssetsExportRequest.java | 106 + .../defender/easm/models/Attribute.java | 76 +- .../defender/easm/models/AuditTrailItem.java | 61 +- .../easm/models/AuditTrailItemKind.java | 2 - .../AzureDataExplorerDataConnection.java | 303 +- .../AzureDataExplorerDataConnectionData.java | 98 +- ...eDataExplorerDataConnectionProperties.java | 51 +- .../defender/easm/models/Banner.java | 88 +- .../defender/easm/models/CisaCveResult.java | 317 ++ .../defender/easm/models/ContactAsset.java | 75 +- .../easm/models/ContactAssetResource.java | 354 +- .../defender/easm/models/Cookie.java | 79 +- .../CreateOrReplaceDiscoGroupOptions.java | 271 ++ .../analytics/defender/easm/models/Cve.java | 57 +- .../defender/easm/models/Cvss3Summary.java | 109 +- .../easm/models/DailyDeltaTypeResponse.java | 103 + .../defender/easm/models/DataConnection.java | 277 +- .../easm/models/DataConnectionContent.java | 2 - .../easm/models/DataConnectionData.java | 117 +- .../easm/models/DataConnectionFrequency.java | 2 - .../easm/models/DataConnectionProperties.java | 38 +- .../defender/easm/models/DeltaDateResult.java | 111 + .../defender/easm/models/DeltaDetailType.java | 57 + .../easm/models/DeltaDetailsRequest.java | 174 + .../easm/models/DeltaRangeResult.java | 173 + .../defender/easm/models/DeltaResult.java | 180 + .../easm/models/DeltaSummaryRequest.java | 123 + .../easm/models/DeltaSummaryResult.java | 106 + .../easm/models/DeltaTypeResponse.java | 149 + .../easm/models/DependentResource.java | 155 +- .../defender/easm/models/DiscoGroup.java | 96 +- .../defender/easm/models/DiscoGroupData.java | 76 +- .../easm/models/DiscoGroupSummaryResult.java | 127 + .../defender/easm/models/DiscoRunResult.java | 88 +- .../defender/easm/models/DiscoRunState.java | 2 - .../defender/easm/models/DiscoSource.java | 49 +- .../defender/easm/models/DiscoSourceKind.java | 2 - .../defender/easm/models/DiscoTemplate.java | 83 +- .../defender/easm/models/DomainAsset.java | 219 +- .../easm/models/DomainAssetResource.java | 354 +- .../defender/easm/models/ErrorDetail.java | 82 +- .../defender/easm/models/ErrorResponse.java | 84 + .../defender/easm/models/GlobalAssetType.java | 111 + .../easm/models/GlobalInventoryState.java | 99 + .../defender/easm/models/GuidPair.java | 61 +- .../defender/easm/models/HostAsset.java | 205 +- .../easm/models/HostAssetResource.java | 354 +- .../defender/easm/models/HostCore.java | 223 +- .../defender/easm/models/InnerError.java | 49 +- .../defender/easm/models/InventoryAsset.java | 40 +- .../defender/easm/models/IpAddressAsset.java | 165 +- .../easm/models/IpAddressAssetResource.java | 354 +- .../defender/easm/models/IpBlock.java | 72 +- .../defender/easm/models/IpBlockAsset.java | 209 +- .../easm/models/IpBlockAssetResource.java | 354 +- .../defender/easm/models/Location.java | 85 +- .../models/LogAnalyticsDataConnection.java | 303 +- .../LogAnalyticsDataConnectionData.java | 98 +- .../LogAnalyticsDataConnectionProperties.java | 47 +- .../easm/models/ObservationPageResult.java | 131 + .../easm/models/ObservationPriority.java | 69 + .../easm/models/ObservationResult.java | 174 + .../defender/easm/models/ObservationType.java | 57 + .../defender/easm/models/ObservedBoolean.java | 134 +- .../defender/easm/models/ObservedHeader.java | 133 +- .../defender/easm/models/ObservedInteger.java | 134 +- .../easm/models/ObservedIntegers.java | 135 +- .../easm/models/ObservedLocation.java | 134 +- .../defender/easm/models/ObservedLong.java | 134 +- .../easm/models/ObservedPortState.java | 133 +- .../easm/models/ObservedPortStateValue.java | 4 +- .../defender/easm/models/ObservedString.java | 134 +- .../defender/easm/models/ObservedValue.java | 111 +- .../defender/easm/models/PageAsset.java | 361 +- .../easm/models/PageAssetRedirectType.java | 4 +- .../easm/models/PageAssetResource.java | 354 +- .../defender/easm/models/PageCause.java | 69 +- .../analytics/defender/easm/models/Port.java | 63 +- .../ReportAssetSnapshotExportRequest.java | 157 + .../models/ReportAssetSnapshotRequest.java | 57 +- .../models/ReportAssetSnapshotResult.java | 73 +- .../models/ReportAssetSummaryRequest.java | 81 +- .../easm/models/ReportAssetSummaryResult.java | 48 +- .../models/ReportBillableAssetBreakdown.java | 50 +- .../ReportBillableAssetBreakdownKind.java | 2 - .../ReportBillableAssetSnapshotResult.java | 59 +- .../ReportBillableAssetSummaryResult.java | 49 +- .../defender/easm/models/Reputation.java | 81 +- .../defender/easm/models/ResourceUrl.java | 73 +- .../defender/easm/models/SavedFilter.java | 61 +- .../defender/easm/models/SavedFilterData.java | 60 +- .../defender/easm/models/ScanMetadata.java | 63 +- .../defender/easm/models/Service.java | 97 +- .../defender/easm/models/SoaRecord.java | 75 +- .../defender/easm/models/Source.java | 67 +- .../defender/easm/models/SslCertAsset.java | 212 +- .../easm/models/SslCertAssetResource.java | 354 +- .../models/SslCertAssetValidationType.java | 4 +- .../defender/easm/models/SslServerConfig.java | 74 +- .../models/SubResourceIntegrityCheck.java | 83 +- .../analytics/defender/easm/models/Task.java | 82 +- .../defender/easm/models/TaskPhase.java | 2 - .../defender/easm/models/TaskState.java | 2 - .../defender/easm/models/ValidateResult.java | 47 +- .../defender/easm/models/WebComponent.java | 103 +- .../src/main/java/module-info.java | 3 +- ...tics-defender-easm_apiview_properties.json | 265 ++ .../easm/generated/EasmClientTestBase.java | 45 + .../tsp-location.yaml | 2 +- 133 files changed, 18394 insertions(+), 2949 deletions(-) create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainKindSummaryResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainRequest.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSource.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSummaryResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetKind.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResponseType.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetsExportRequest.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CisaCveResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DailyDeltaTypeResponse.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDateResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailType.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailsRequest.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaRangeResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryRequest.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaTypeResponse.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupSummaryResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorResponse.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalAssetType.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalInventoryState.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPageResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPriority.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationResult.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationType.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotExportRequest.java create mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json create mode 100644 sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/generated/EasmClientTestBase.java diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java index be3d498857ae..ec4ce9f22f07 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java @@ -4,14 +4,24 @@ package com.azure.analytics.defender.easm; import com.azure.analytics.defender.easm.implementation.EasmClientImpl; +import com.azure.analytics.defender.easm.models.AssetChainRequest; +import com.azure.analytics.defender.easm.models.AssetChainSummaryResult; import com.azure.analytics.defender.easm.models.AssetResource; +import com.azure.analytics.defender.easm.models.AssetsExportRequest; import com.azure.analytics.defender.easm.models.AssetUpdateData; +import com.azure.analytics.defender.easm.models.CisaCveResult; import com.azure.analytics.defender.easm.models.DataConnection; import com.azure.analytics.defender.easm.models.DataConnectionData; +import com.azure.analytics.defender.easm.models.DeltaDetailsRequest; +import com.azure.analytics.defender.easm.models.DeltaResult; +import com.azure.analytics.defender.easm.models.DeltaSummaryRequest; +import com.azure.analytics.defender.easm.models.DeltaSummaryResult; import com.azure.analytics.defender.easm.models.DiscoGroup; import com.azure.analytics.defender.easm.models.DiscoGroupData; import com.azure.analytics.defender.easm.models.DiscoRunResult; import com.azure.analytics.defender.easm.models.DiscoTemplate; +import com.azure.analytics.defender.easm.models.ObservationPageResult; +import com.azure.analytics.defender.easm.models.ReportAssetSnapshotExportRequest; import com.azure.analytics.defender.easm.models.ReportAssetSnapshotRequest; import com.azure.analytics.defender.easm.models.ReportAssetSnapshotResult; import com.azure.analytics.defender.easm.models.ReportAssetSummaryRequest; @@ -150,20 +160,23 @@ public final class EasmAsyncClient { public PagedFlux listAssetResource(RequestOptions requestOptions) { PagedFlux pagedFluxResponse = this.serviceClient.listAssetResourceAsync(requestOptions); return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue().stream() - .map(protocolMethodData -> cleanUp(protocolMethodData)).collect(Collectors.toList()), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); } /** * Update labels on assets matching the provided filter. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty) (Optional)
@@ -174,9 +187,9 @@ public PagedFlux listAssetResource(RequestOptions requestOptions) {
      *     transfers: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -193,7 +206,7 @@ public PagedFlux listAssetResource(RequestOptions requestOptions) {
      * }
* * @param filter An expression on the resource type that selects the resources to be returned. - * @param assetUpdateData A request body used to update an asset. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -203,18 +216,18 @@ public PagedFlux listAssetResource(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAssetsWithResponse(String filter, BinaryData assetUpdateData, + public Mono> updateAssetsWithResponse(String filter, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.updateAssetsWithResponseAsync(filter, assetUpdateData, requestOptions); + return this.serviceClient.updateAssetsWithResponseAsync(filter, body, requestOptions); } /** * Retrieve an asset by assetId. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -316,31 +329,35 @@ public Mono> getAssetResourceWithResponse(String assetId, R
     public PagedFlux listDataConnection(RequestOptions requestOptions) {
         PagedFlux pagedFluxResponse = this.serviceClient.listDataConnectionAsync(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue().stream()
-                    .map(protocolMethodData -> cleanUp(protocolMethodData)).collect(Collectors.toList()),
+                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+                pagedResponse.getValue()
+                    .stream()
+                    .map(protocolMethodData -> cleanUp(protocolMethodData))
+                    .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
         });
     }
 
     /**
      * Validate a data connection with a given dataConnectionName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     name: String (Optional)
      *     content: String(assets/attackSurfaceInsights) (Optional)
      *     frequency: String(daily/weekly/monthly) (Optional)
      *     frequencyOffset: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -358,28 +375,29 @@ public PagedFlux listDataConnection(RequestOptions requestOptions) {
      * }
      * }
* - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return validate result for validate action endpoints along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> validateDataConnectionWithResponse(BinaryData dataConnectionData, + public Mono> validateDataConnectionWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.validateDataConnectionWithResponseAsync(dataConnectionData, requestOptions); + return this.serviceClient.validateDataConnectionWithResponseAsync(body, requestOptions); } /** * Retrieve a data connection with a given dataConnectionName. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -411,22 +429,23 @@ public Mono> getDataConnectionWithResponse(String dataConne
 
     /**
      * Create or replace a data connection with a given dataConnectionName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     name: String (Optional)
      *     content: String(assets/attackSurfaceInsights) (Optional)
      *     frequency: String(daily/weekly/monthly) (Optional)
      *     frequencyOffset: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -442,7 +461,7 @@ public Mono> getDataConnectionWithResponse(String dataConne
      * }
* * @param dataConnectionName The caller provided unique name for the resource. - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -453,8 +472,8 @@ public Mono> getDataConnectionWithResponse(String dataConne @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrReplaceDataConnectionWithResponse(String dataConnectionName, - BinaryData dataConnectionData, RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceDataConnectionWithResponseAsync(dataConnectionName, dataConnectionData, + BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDataConnectionWithResponseAsync(dataConnectionName, body, requestOptions); } @@ -568,20 +587,23 @@ public Mono> deleteDataConnectionWithResponse(String dataConnecti public PagedFlux listDiscoGroup(RequestOptions requestOptions) { PagedFlux pagedFluxResponse = this.serviceClient.listDiscoGroupAsync(requestOptions); return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue().stream() - .map(protocolMethodData -> cleanUp(protocolMethodData)).collect(Collectors.toList()), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); } /** * Validate a discovery group with a given groupName. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     name: String (Optional)
@@ -603,9 +625,9 @@ public PagedFlux listDiscoGroup(RequestOptions requestOptions) {
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -623,26 +645,25 @@ public PagedFlux listDiscoGroup(RequestOptions requestOptions) {
      * }
      * }
* - * @param discoGroupData A request body used to create a discovery group. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return validate result for validate action endpoints along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> validateDiscoGroupWithResponse(BinaryData discoGroupData, - RequestOptions requestOptions) { - return this.serviceClient.validateDiscoGroupWithResponseAsync(discoGroupData, requestOptions); + public Mono> validateDiscoGroupWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.validateDiscoGroupWithResponseAsync(body, requestOptions); } /** * Retrieve a discovery group with a given groupName. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -701,9 +722,8 @@ public Mono> getDiscoGroupWithResponse(String groupName, Re
 
     /**
      * Create a discovery group with a given groupName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     name: String (Optional)
@@ -725,9 +745,9 @@ public Mono> getDiscoGroupWithResponse(String groupName, Re
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -771,7 +791,7 @@ public Mono> getDiscoGroupWithResponse(String groupName, Re
      * }
* * @param groupName The caller provided unique name for the resource. - * @param discoGroupData A request body used to create a discovery group. + * @param createOrReplaceDiscoGroupRequest The createOrReplaceDiscoGroupRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -781,9 +801,10 @@ public Mono> getDiscoGroupWithResponse(String groupName, Re */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData discoGroupData, - RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceDiscoGroupWithResponseAsync(groupName, discoGroupData, requestOptions); + public Mono> createOrReplaceDiscoGroupWithResponse(String groupName, + BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDiscoGroupWithResponseAsync(groupName, + createOrReplaceDiscoGroupRequest, requestOptions); } /** @@ -875,20 +896,23 @@ public Mono> runDiscoGroupWithResponse(String groupName, RequestO public PagedFlux listDiscoTemplate(RequestOptions requestOptions) { PagedFlux pagedFluxResponse = this.serviceClient.listDiscoTemplateAsync(requestOptions); return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue().stream() - .map(protocolMethodData -> cleanUp(protocolMethodData)).collect(Collectors.toList()), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); } /** * Retrieve a disco template with a given templateId. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -928,9 +952,8 @@ public Mono> getDiscoTemplateWithResponse(String templateId
 
     /**
      * Get billable assets summary for the workspace.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -964,9 +987,8 @@ public Mono> getBillableWithResponse(RequestOptions request
 
     /**
      * Get the most recent snapshot of asset summary values for the snapshot request.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     metric: String (Optional)
@@ -975,9 +997,9 @@ public Mono> getBillableWithResponse(RequestOptions request
      *     page: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     displayName: String (Optional)
@@ -991,6 +1013,7 @@ public Mono> getBillableWithResponse(RequestOptions request
      *         nextLink: String (Optional)
      *         value (Optional): [
      *              (Optional){
+     *                 kind: String (Required)
      *                 id: String (Required)
      *                 name: String (Optional)
      *                 displayName: String (Optional)
@@ -1020,7 +1043,7 @@ public Mono> getBillableWithResponse(RequestOptions request
      * }
      * }
* - * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1031,16 +1054,14 @@ public Mono> getBillableWithResponse(RequestOptions request */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotWithResponse(BinaryData reportAssetSnapshotRequest, - RequestOptions requestOptions) { - return this.serviceClient.getSnapshotWithResponseAsync(reportAssetSnapshotRequest, requestOptions); + public Mono> getSnapshotWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getSnapshotWithResponseAsync(body, requestOptions); } /** * Get asset summary details for the summary request. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     metricCategories (Optional): [
@@ -1057,9 +1078,9 @@ public Mono> getSnapshotWithResponse(BinaryData reportAsset
      *     labelName: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -1081,8 +1102,7 @@ public Mono> getSnapshotWithResponse(BinaryData reportAsset
      * }
      * }
* - * @param reportAssetSummaryRequest A request body used to retrieve summary asset information. One and only one - * collection of summary identifiers must be provided: filters, metrics, or metricCategories. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1093,9 +1113,8 @@ public Mono> getSnapshotWithResponse(BinaryData reportAsset */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSummaryWithResponse(BinaryData reportAssetSummaryRequest, - RequestOptions requestOptions) { - return this.serviceClient.getSummaryWithResponseAsync(reportAssetSummaryRequest, requestOptions); + public Mono> getSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getSummaryWithResponseAsync(body, requestOptions); } /** @@ -1158,20 +1177,23 @@ public Mono> getSummaryWithResponse(BinaryData reportAssetS public PagedFlux listSavedFilter(RequestOptions requestOptions) { PagedFlux pagedFluxResponse = this.serviceClient.listSavedFilterAsync(requestOptions); return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue().stream() - .map(protocolMethodData -> cleanUp(protocolMethodData)).collect(Collectors.toList()), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); } /** * Retrieve a saved filter by filterName. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -1198,18 +1220,17 @@ public Mono> getSavedFilterWithResponse(String filterName,
 
     /**
      * Create or replace a saved filter with a given filterName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     filter: String (Required)
      *     description: String (Required)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -1221,7 +1242,7 @@ public Mono> getSavedFilterWithResponse(String filterName,
      * }
* * @param filterName The caller provided unique name for the resource. - * @param savedFilterData A request body used to create a saved filter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1231,10 +1252,9 @@ public Mono> getSavedFilterWithResponse(String filterName, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrReplaceSavedFilterWithResponse(String filterName, - BinaryData savedFilterData, RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceSavedFilterWithResponseAsync(filterName, savedFilterData, - requestOptions); + public Mono> createOrReplaceSavedFilterWithResponse(String filterName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceSavedFilterWithResponseAsync(filterName, body, requestOptions); } /** @@ -1325,20 +1345,23 @@ public Mono> deleteSavedFilterWithResponse(String filterName, Req public PagedFlux listTask(RequestOptions requestOptions) { PagedFlux pagedFluxResponse = this.serviceClient.listTaskAsync(requestOptions); return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1) + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationToken).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue().stream() - .map(protocolMethodData -> cleanUp(protocolMethodData)).collect(Collectors.toList()), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); } /** * Retrieve a task by taskId. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -1370,9 +1393,8 @@ public Mono> getTaskWithResponse(String taskId, RequestOpti
 
     /**
      * Cancel a task by taskId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -1402,52 +1424,6 @@ public Mono> cancelTaskWithResponse(String taskId, RequestO
         return this.serviceClient.cancelTaskWithResponseAsync(taskId, requestOptions);
     }
 
-    /**
-     * Retrieve a list of assets for the provided search parameters.
-     *
-     * @param filter Filter the result list using the given expression.
-     * @param orderBy A list of expressions that specify the order of the returned resources.
-     * @param skip The number of result items to skip.
-     * @param mark Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and
-     * subsequent values are returned in the response.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return paged collection of AssetResource items as paginated response with {@link PagedFlux}.
-     */
-    @Generated
-    @ServiceMethod(returns = ReturnType.COLLECTION)
-    public PagedFlux listAssetResource(String filter, String orderBy, Integer skip, String mark) {
-        // Generated convenience method for listAssetResource
-        RequestOptions requestOptions = new RequestOptions();
-        if (filter != null) {
-            requestOptions.addQueryParam("filter", filter, false);
-        }
-        if (orderBy != null) {
-            requestOptions.addQueryParam("orderby", orderBy, false);
-        }
-        if (skip != null) {
-            requestOptions.addQueryParam("skip", String.valueOf(skip), false);
-        }
-        if (mark != null) {
-            requestOptions.addQueryParam("mark", mark, false);
-        }
-        PagedFlux pagedFluxResponse = listAssetResource(requestOptions);
-        return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
-                : pagedFluxResponse.byPage(continuationToken).take(1);
-            return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
-                    .map(protocolMethodData -> protocolMethodData.toObject(AssetResource.class))
-                    .collect(Collectors.toList()),
-                pagedResponse.getContinuationToken(), null));
-        });
-    }
-
     /**
      * Retrieve a list of assets for the provided search parameters.
      *
@@ -1465,11 +1441,13 @@ public PagedFlux listAssetResource() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listAssetResource(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(AssetResource.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -1494,7 +1472,8 @@ public Mono updateAssets(String filter, AssetUpdateData assetUpdateData) {
         // Generated convenience method for updateAssetsWithResponse
         RequestOptions requestOptions = new RequestOptions();
         return updateAssetsWithResponse(filter, BinaryData.fromObject(assetUpdateData), requestOptions)
-            .flatMap(FluxUtil::toMono).map(protocolMethodData -> cleanUp(protocolMethodData).toObject(Task.class));
+            .flatMap(FluxUtil::toMono)
+            .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(Task.class));
     }
 
     /**
@@ -1538,11 +1517,13 @@ public PagedFlux listDataConnection(Integer skip) {
         }
         PagedFlux pagedFluxResponse = listDataConnection(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(DataConnection.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -1565,11 +1546,13 @@ public PagedFlux listDataConnection() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listDataConnection(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(DataConnection.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -1686,11 +1669,13 @@ public PagedFlux listDiscoGroup(String filter, Integer skip) {
         }
         PagedFlux pagedFluxResponse = listDiscoGroup(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -1713,11 +1698,13 @@ public PagedFlux listDiscoGroup() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listDiscoGroup(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -1826,11 +1813,13 @@ public PagedFlux listRuns(String groupName) {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listRuns(groupName, requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(DiscoRunResult.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -1862,11 +1851,13 @@ public PagedFlux listDiscoTemplate(String filter, Integer skip) {
         }
         PagedFlux pagedFluxResponse = listDiscoTemplate(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(DiscoTemplate.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -1889,11 +1880,13 @@ public PagedFlux listDiscoTemplate() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listDiscoTemplate(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(DiscoTemplate.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -2008,11 +2001,13 @@ public PagedFlux listSavedFilter(String filter, Integer skip) {
         }
         PagedFlux pagedFluxResponse = listSavedFilter(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(SavedFilter.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -2036,11 +2031,13 @@ public PagedFlux listSavedFilter() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listSavedFilter(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(SavedFilter.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
@@ -2139,11 +2136,15 @@ public PagedFlux listTask(String filter, String orderBy, Integer skip) {
         }
         PagedFlux pagedFluxResponse = listTask(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue().stream()
-                    .map(protocolMethodData -> protocolMethodData.toObject(Task.class)).collect(Collectors.toList()),
+                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+                pagedResponse.getValue()
+                    .stream()
+                    .map(protocolMethodData -> protocolMethodData.toObject(Task.class))
+                    .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
         });
     }
@@ -2165,11 +2166,15 @@ public PagedFlux listTask() {
         RequestOptions requestOptions = new RequestOptions();
         PagedFlux pagedFluxResponse = listTask(requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue().stream()
-                    .map(protocolMethodData -> protocolMethodData.toObject(Task.class)).collect(Collectors.toList()),
+                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+                pagedResponse.getValue()
+                    .stream()
+                    .map(protocolMethodData -> protocolMethodData.toObject(Task.class))
+                    .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
         });
     }
@@ -2292,11 +2297,15 @@ private BinaryData cleanUp(BinaryData input) {
     public PagedFlux listRuns(String groupName, RequestOptions requestOptions) {
         PagedFlux pagedFluxResponse = this.serviceClient.listRunsAsync(groupName, requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue().stream()
-                    .map(protocolMethodData -> cleanUp(protocolMethodData)).collect(Collectors.toList()),
+                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+                pagedResponse.getValue()
+                    .stream()
+                    .map(protocolMethodData -> cleanUp(protocolMethodData))
+                    .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
         });
     }
@@ -2328,14 +2337,908 @@ public PagedFlux listRuns(String groupName, String filter, Integ
         }
         PagedFlux pagedFluxResponse = listRuns(groupName, requestOptions);
         return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+            Flux> flux = (continuationToken == null)
+                ? pagedFluxResponse.byPage().take(1)
                 : pagedFluxResponse.byPage(continuationToken).take(1);
             return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
                 pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue().stream()
+                pagedResponse.getValue()
+                    .stream()
                     .map(protocolMethodData -> protocolMethodData.toObject(DiscoRunResult.class))
                     .collect(Collectors.toList()),
                 pagedResponse.getContinuationToken(), null));
         });
     }
+
+    /**
+     * Export a list of assets for the provided search parameters.
+     * 

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     fileName: String (Required)
+     *     columns (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAssetsExportWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getAssetsExportWithResponseAsync(body, requestOptions); + } + + /** + * Retrieve observations on an asset. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     totalElements: long (Required)
+     *     prioritySummary (Required): {
+     *         String: int (Required)
+     *     }
+     *     value (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             types (Required): [
+     *                 String(cve/insight) (Required)
+     *             ]
+     *             priority: String(high/medium/low/none) (Required)
+     *             cvssScoreV2: double (Required)
+     *             cvssScoreV3: double (Required)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param assetId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the page result response for the observation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getObservationsWithResponse(String assetId, RequestOptions requestOptions) { + return this.serviceClient.getObservationsWithResponseAsync(assetId, requestOptions); + } + + /** + * Retrieve a list of deltas for the provided time range. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     deltaDetailType: String(added/removed) (Required)
+     *     priorDays: Integer (Optional)
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     name: String (Required)
+     *     createdAt: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getDeltaDetails(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getDeltaDetailsAsync(body, requestOptions); + } + + /** + * Retrieve a list of deltas with overall summary changes for the provided time range. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     priorDays: Integer (Optional)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     summary (Required): {
+     *         range: long (Required)
+     *         removed: long (Required)
+     *         added: long (Required)
+     *         difference: long (Required)
+     *         kindSummaries (Required): [
+     *              (Required){
+     *                 kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *                 removed: long (Required)
+     *                 added: long (Required)
+     *                 difference: long (Required)
+     *             }
+     *         ]
+     *     }
+     *     daily (Required): [
+     *          (Required){
+     *             date: OffsetDateTime (Required)
+     *             deltas (Required): [
+     *                  (Required){
+     *                     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *                     removed: long (Required)
+     *                     added: long (Required)
+     *                     difference: long (Required)
+     *                     count: long (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return define response body for getting delta summary along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeltaSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getDeltaSummaryWithResponseAsync(body, requestOptions); + } + + /** + * Delete a discovery group with a given discovery group name. + * + * @param groupName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { + return this.serviceClient.deleteDiscoGroupWithResponseAsync(groupName, requestOptions); + } + + /** + * Retrieve an asset chain summary. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
+     *     sourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     affectedAssetsSummary (Required): [
+     *          (Required){
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Required)
+     *             affectedCount: long (Required)
+     *         }
+     *     ]
+     *     affectedGroupsSummary (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             name: String (Required)
+     *             displayName: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             error (Required): {
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *                 target: String (Optional)
+     *                 details (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror (Optional): {
+     *                     code: String (Optional)
+     *                     innererror (Optional): (recursive schema, see innererror above)
+     *                 }
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response for the asset chain summary along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAssetChainSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getAssetChainSummaryWithResponseAsync(body, requestOptions); + } + + /** + * Dismiss discovery chain for a given asset chain source. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
+     *     sourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> dismissAssetChainWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.dismissAssetChainWithResponseAsync(body, requestOptions); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     metric: String (Optional)
+     *     fileName: String (Optional)
+     *     columns (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the most recent snapshot of asset summary values for the snapshot request exported to a file along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSnapshotExportWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getSnapshotExportWithResponseAsync(body, requestOptions); + } + + /** + * Run a task by taskId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> runTaskWithResponse(String taskId, RequestOptions requestOptions) { + return this.serviceClient.runTaskWithResponseAsync(taskId, requestOptions); + } + + /** + * Download a task. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> downloadTaskWithResponse(String taskId, RequestOptions requestOptions) { + return this.serviceClient.downloadTaskWithResponseAsync(taskId, requestOptions); + } + + /** + * Retrieve a list of CisaCves for the provided search parameters. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of CisaCveResult items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getCisaCves(RequestOptions requestOptions) { + return this.serviceClient.getCisaCvesAsync(requestOptions); + } + + /** + * Retrieve details of CisaCve by cveId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have + * more than 4 digits. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return cisa cve in a given workspace along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCisaCveWithResponse(String cveId, RequestOptions requestOptions) { + return this.serviceClient.getCisaCveWithResponseAsync(cveId, requestOptions); + } + + /** + * Export a list of assets for the provided search parameters. + * + * @param body Body parameter. + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAssetsExport(AssetsExportRequest body, String filter, String orderBy) { + // Generated convenience method for getAssetsExportWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + return getAssetsExportWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); + } + + /** + * Export a list of assets for the provided search parameters. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAssetsExport(AssetsExportRequest body) { + // Generated convenience method for getAssetsExportWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAssetsExportWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); + } + + /** + * Retrieve observations on an asset. + * + * @param assetId The system generated unique id for the resource. + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @param skip The number of result items to skip. + * @param maxPageSize The maximum number of result items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page result response for the observation on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getObservations(String assetId, String filter, String orderBy, Integer skip, + Integer maxPageSize) { + // Generated convenience method for getObservationsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return getObservationsWithResponse(assetId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ObservationPageResult.class)); + } + + /** + * Retrieve observations on an asset. + * + * @param assetId The system generated unique id for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page result response for the observation on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getObservations(String assetId) { + // Generated convenience method for getObservationsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getObservationsWithResponse(assetId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ObservationPageResult.class)); + } + + /** + * Retrieve a list of deltas for the provided time range. + * + * @param body Body parameter. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getDeltaDetails(DeltaDetailsRequest body, Integer skip) { + // Generated convenience method for getDeltaDetails + RequestOptions requestOptions = new RequestOptions(); + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = getDeltaDetails(BinaryData.fromObject(body), requestOptions); + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeltaResult.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Retrieve a list of deltas for the provided time range. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getDeltaDetails(DeltaDetailsRequest body) { + // Generated convenience method for getDeltaDetails + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = getDeltaDetails(BinaryData.fromObject(body), requestOptions); + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeltaResult.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Retrieve a list of deltas with overall summary changes for the provided time range. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define response body for getting delta summary on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeltaSummary(DeltaSummaryRequest body) { + // Generated convenience method for getDeltaSummaryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeltaSummaryWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeltaSummaryResult.class)); + } + + /** + * Delete a discovery group with a given discovery group name. + * + * @param groupName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteDiscoGroup(String groupName) { + // Generated convenience method for deleteDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteDiscoGroupWithResponse(groupName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve an asset chain summary. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the asset chain summary on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAssetChainSummary(AssetChainRequest body) { + // Generated convenience method for getAssetChainSummaryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAssetChainSummaryWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AssetChainSummaryResult.class)); + } + + /** + * Dismiss discovery chain for a given asset chain source. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono dismissAssetChain(AssetChainRequest body) { + // Generated convenience method for dismissAssetChainWithResponse + RequestOptions requestOptions = new RequestOptions(); + return dismissAssetChainWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the most recent snapshot of asset summary values for the snapshot request exported to a file on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSnapshotExport(ReportAssetSnapshotExportRequest body) { + // Generated convenience method for getSnapshotExportWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSnapshotExportWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); + } + + /** + * Run a task by taskId. + * + * @param taskId The unique identifier of the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono runTask(String taskId) { + // Generated convenience method for runTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return runTaskWithResponse(taskId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); + } + + /** + * Download a task. + * + * @param taskId The unique identifier of the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono downloadTask(String taskId) { + // Generated convenience method for downloadTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return downloadTaskWithResponse(taskId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); + } + + /** + * Retrieve a list of CisaCves for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of CisaCveResult items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getCisaCves() { + // Generated convenience method for getCisaCves + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = getCisaCves(requestOptions); + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(CisaCveResult.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Retrieve details of CisaCve by cveId. + * + * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have + * more than 4 digits. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cisa cve in a given workspace on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCisaCve(String cveId) { + // Generated convenience method for getCisaCveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCisaCveWithResponse(cveId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CisaCveResult.class)); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java index 9c5b97701d92..23a838afc9cd 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java @@ -4,14 +4,24 @@ package com.azure.analytics.defender.easm; import com.azure.analytics.defender.easm.implementation.EasmClientImpl; +import com.azure.analytics.defender.easm.models.AssetChainRequest; +import com.azure.analytics.defender.easm.models.AssetChainSummaryResult; import com.azure.analytics.defender.easm.models.AssetResource; +import com.azure.analytics.defender.easm.models.AssetsExportRequest; import com.azure.analytics.defender.easm.models.AssetUpdateData; +import com.azure.analytics.defender.easm.models.CisaCveResult; import com.azure.analytics.defender.easm.models.DataConnection; import com.azure.analytics.defender.easm.models.DataConnectionData; +import com.azure.analytics.defender.easm.models.DeltaDetailsRequest; +import com.azure.analytics.defender.easm.models.DeltaResult; +import com.azure.analytics.defender.easm.models.DeltaSummaryRequest; +import com.azure.analytics.defender.easm.models.DeltaSummaryResult; import com.azure.analytics.defender.easm.models.DiscoGroup; import com.azure.analytics.defender.easm.models.DiscoGroupData; import com.azure.analytics.defender.easm.models.DiscoRunResult; import com.azure.analytics.defender.easm.models.DiscoTemplate; +import com.azure.analytics.defender.easm.models.ObservationPageResult; +import com.azure.analytics.defender.easm.models.ReportAssetSnapshotExportRequest; import com.azure.analytics.defender.easm.models.ReportAssetSnapshotRequest; import com.azure.analytics.defender.easm.models.ReportAssetSnapshotResult; import com.azure.analytics.defender.easm.models.ReportAssetSummaryRequest; @@ -147,9 +157,8 @@ public PagedIterable listAssetResource(RequestOptions requestOptions /** * Update labels on assets matching the provided filter. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty) (Optional)
@@ -160,9 +169,9 @@ public PagedIterable listAssetResource(RequestOptions requestOptions
      *     transfers: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -179,7 +188,7 @@ public PagedIterable listAssetResource(RequestOptions requestOptions
      * }
* * @param filter An expression on the resource type that selects the resources to be returned. - * @param assetUpdateData A request body used to update an asset. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -189,18 +198,18 @@ public PagedIterable listAssetResource(RequestOptions requestOptions */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAssetsWithResponse(String filter, BinaryData assetUpdateData, + public Response updateAssetsWithResponse(String filter, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.updateAssetsWithResponse(filter, assetUpdateData, requestOptions); + return this.serviceClient.updateAssetsWithResponse(filter, body, requestOptions); } /** * Retrieve an asset by assetId. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -304,20 +313,20 @@ public PagedIterable listDataConnection(RequestOptions requestOption
 
     /**
      * Validate a data connection with a given dataConnectionName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     name: String (Optional)
      *     content: String(assets/attackSurfaceInsights) (Optional)
      *     frequency: String(daily/weekly/monthly) (Optional)
      *     frequencyOffset: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -335,28 +344,27 @@ public PagedIterable listDataConnection(RequestOptions requestOption
      * }
      * }
* - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return validate result for validate action endpoints along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateDataConnectionWithResponse(BinaryData dataConnectionData, - RequestOptions requestOptions) { - return this.serviceClient.validateDataConnectionWithResponse(dataConnectionData, requestOptions); + public Response validateDataConnectionWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.validateDataConnectionWithResponse(body, requestOptions); } /** * Retrieve a data connection with a given dataConnectionName. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -388,22 +396,23 @@ public Response getDataConnectionWithResponse(String dataConnectionN
 
     /**
      * Create or replace a data connection with a given dataConnectionName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     name: String (Optional)
      *     content: String(assets/attackSurfaceInsights) (Optional)
      *     frequency: String(daily/weekly/monthly) (Optional)
      *     frequencyOffset: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -419,7 +428,7 @@ public Response getDataConnectionWithResponse(String dataConnectionN
      * }
* * @param dataConnectionName The caller provided unique name for the resource. - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -429,10 +438,9 @@ public Response getDataConnectionWithResponse(String dataConnectionN */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceDataConnectionWithResponse(String dataConnectionName, - BinaryData dataConnectionData, RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceDataConnectionWithResponse(dataConnectionName, dataConnectionData, - requestOptions); + public Response createOrReplaceDataConnectionWithResponse(String dataConnectionName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDataConnectionWithResponse(dataConnectionName, body, requestOptions); } /** @@ -454,9 +462,8 @@ public Response deleteDataConnectionWithResponse(String dataConnectionName /** * Validate a discovery group with a given groupName. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     name: String (Optional)
@@ -478,9 +485,9 @@ public Response deleteDataConnectionWithResponse(String dataConnectionName
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -498,26 +505,24 @@ public Response deleteDataConnectionWithResponse(String dataConnectionName
      * }
      * }
* - * @param discoGroupData A request body used to create a discovery group. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return validate result for validate action endpoints along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateDiscoGroupWithResponse(BinaryData discoGroupData, - RequestOptions requestOptions) { - return this.serviceClient.validateDiscoGroupWithResponse(discoGroupData, requestOptions); + public Response validateDiscoGroupWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.validateDiscoGroupWithResponse(body, requestOptions); } /** * Retrieve a discovery group with a given groupName. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -576,9 +581,8 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO
 
     /**
      * Create a discovery group with a given groupName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     name: String (Optional)
@@ -600,9 +604,9 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -646,7 +650,7 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO
      * }
* * @param groupName The caller provided unique name for the resource. - * @param discoGroupData A request body used to create a discovery group. + * @param createOrReplaceDiscoGroupRequest The createOrReplaceDiscoGroupRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -656,9 +660,10 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData discoGroupData, - RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceDiscoGroupWithResponse(groupName, discoGroupData, requestOptions); + public Response createOrReplaceDiscoGroupWithResponse(String groupName, + BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDiscoGroupWithResponse(groupName, createOrReplaceDiscoGroupRequest, + requestOptions); } /** @@ -828,9 +833,8 @@ public PagedIterable listDiscoTemplate(RequestOptions requestOptions /** * Retrieve a disco template with a given templateId. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -869,9 +873,8 @@ public Response getDiscoTemplateWithResponse(String templateId, Requ
 
     /**
      * Get billable assets summary for the workspace.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -904,9 +907,8 @@ public Response getBillableWithResponse(RequestOptions requestOption
 
     /**
      * Get the most recent snapshot of asset summary values for the snapshot request.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     metric: String (Optional)
@@ -915,9 +917,9 @@ public Response getBillableWithResponse(RequestOptions requestOption
      *     page: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     displayName: String (Optional)
@@ -931,6 +933,7 @@ public Response getBillableWithResponse(RequestOptions requestOption
      *         nextLink: String (Optional)
      *         value (Optional): [
      *              (Optional){
+     *                 kind: String (Required)
      *                 id: String (Required)
      *                 name: String (Optional)
      *                 displayName: String (Optional)
@@ -960,7 +963,7 @@ public Response getBillableWithResponse(RequestOptions requestOption
      * }
      * }
* - * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -970,16 +973,14 @@ public Response getBillableWithResponse(RequestOptions requestOption */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSnapshotWithResponse(BinaryData reportAssetSnapshotRequest, - RequestOptions requestOptions) { - return this.serviceClient.getSnapshotWithResponse(reportAssetSnapshotRequest, requestOptions); + public Response getSnapshotWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getSnapshotWithResponse(body, requestOptions); } /** * Get asset summary details for the summary request. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     metricCategories (Optional): [
@@ -996,9 +997,9 @@ public Response getSnapshotWithResponse(BinaryData reportAssetSnapsh
      *     labelName: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -1020,8 +1021,7 @@ public Response getSnapshotWithResponse(BinaryData reportAssetSnapsh
      * }
      * }
* - * @param reportAssetSummaryRequest A request body used to retrieve summary asset information. One and only one - * collection of summary identifiers must be provided: filters, metrics, or metricCategories. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1031,9 +1031,8 @@ public Response getSnapshotWithResponse(BinaryData reportAssetSnapsh */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSummaryWithResponse(BinaryData reportAssetSummaryRequest, - RequestOptions requestOptions) { - return this.serviceClient.getSummaryWithResponse(reportAssetSummaryRequest, requestOptions); + public Response getSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getSummaryWithResponse(body, requestOptions); } /** @@ -1099,9 +1098,8 @@ public PagedIterable listSavedFilter(RequestOptions requestOptions) /** * Retrieve a saved filter by filterName. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -1128,18 +1126,17 @@ public Response getSavedFilterWithResponse(String filterName, Reques
 
     /**
      * Create or replace a saved filter with a given filterName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     filter: String (Required)
      *     description: String (Required)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -1151,7 +1148,7 @@ public Response getSavedFilterWithResponse(String filterName, Reques
      * }
* * @param filterName The caller provided unique name for the resource. - * @param savedFilterData A request body used to create a saved filter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1161,9 +1158,9 @@ public Response getSavedFilterWithResponse(String filterName, Reques */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceSavedFilterWithResponse(String filterName, BinaryData savedFilterData, + public Response createOrReplaceSavedFilterWithResponse(String filterName, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceSavedFilterWithResponse(filterName, savedFilterData, requestOptions); + return this.serviceClient.createOrReplaceSavedFilterWithResponse(filterName, body, requestOptions); } /** @@ -1257,9 +1254,8 @@ public PagedIterable listTask(RequestOptions requestOptions) { /** * Retrieve a task by taskId. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -1291,9 +1287,8 @@ public Response getTaskWithResponse(String taskId, RequestOptions re
 
     /**
      * Cancel a task by taskId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -2130,4 +2125,851 @@ public PagedIterable listRuns(String groupName, String filter, I
         return serviceClient.listRuns(groupName, requestOptions)
             .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoRunResult.class));
     }
+
+    /**
+     * Export a list of assets for the provided search parameters.
+     * 

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     fileName: String (Required)
+     *     columns (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssetsExportWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getAssetsExportWithResponse(body, requestOptions); + } + + /** + * Retrieve observations on an asset. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     totalElements: long (Required)
+     *     prioritySummary (Required): {
+     *         String: int (Required)
+     *     }
+     *     value (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             types (Required): [
+     *                 String(cve/insight) (Required)
+     *             ]
+     *             priority: String(high/medium/low/none) (Required)
+     *             cvssScoreV2: double (Required)
+     *             cvssScoreV3: double (Required)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param assetId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the page result response for the observation along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getObservationsWithResponse(String assetId, RequestOptions requestOptions) { + return this.serviceClient.getObservationsWithResponse(assetId, requestOptions); + } + + /** + * Retrieve a list of deltas for the provided time range. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     deltaDetailType: String(added/removed) (Required)
+     *     priorDays: Integer (Optional)
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     name: String (Required)
+     *     createdAt: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getDeltaDetails(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getDeltaDetails(body, requestOptions); + } + + /** + * Retrieve a list of deltas with overall summary changes for the provided time range. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     priorDays: Integer (Optional)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     summary (Required): {
+     *         range: long (Required)
+     *         removed: long (Required)
+     *         added: long (Required)
+     *         difference: long (Required)
+     *         kindSummaries (Required): [
+     *              (Required){
+     *                 kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *                 removed: long (Required)
+     *                 added: long (Required)
+     *                 difference: long (Required)
+     *             }
+     *         ]
+     *     }
+     *     daily (Required): [
+     *          (Required){
+     *             date: OffsetDateTime (Required)
+     *             deltas (Required): [
+     *                  (Required){
+     *                     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *                     removed: long (Required)
+     *                     added: long (Required)
+     *                     difference: long (Required)
+     *                     count: long (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return define response body for getting delta summary along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeltaSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getDeltaSummaryWithResponse(body, requestOptions); + } + + /** + * Delete a discovery group with a given discovery group name. + * + * @param groupName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { + return this.serviceClient.deleteDiscoGroupWithResponse(groupName, requestOptions); + } + + /** + * Retrieve an asset chain summary. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
+     *     sourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     affectedAssetsSummary (Required): [
+     *          (Required){
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Required)
+     *             affectedCount: long (Required)
+     *         }
+     *     ]
+     *     affectedGroupsSummary (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             name: String (Required)
+     *             displayName: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             error (Required): {
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *                 target: String (Optional)
+     *                 details (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror (Optional): {
+     *                     code: String (Optional)
+     *                     innererror (Optional): (recursive schema, see innererror above)
+     *                 }
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response for the asset chain summary along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssetChainSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getAssetChainSummaryWithResponse(body, requestOptions); + } + + /** + * Dismiss discovery chain for a given asset chain source. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
+     *     sourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response dismissAssetChainWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.dismissAssetChainWithResponse(body, requestOptions); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     metric: String (Optional)
+     *     fileName: String (Optional)
+     *     columns (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the most recent snapshot of asset summary values for the snapshot request exported to a file along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSnapshotExportWithResponse(BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getSnapshotExportWithResponse(body, requestOptions); + } + + /** + * Run a task by taskId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response runTaskWithResponse(String taskId, RequestOptions requestOptions) { + return this.serviceClient.runTaskWithResponse(taskId, requestOptions); + } + + /** + * Download a task. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response downloadTaskWithResponse(String taskId, RequestOptions requestOptions) { + return this.serviceClient.downloadTaskWithResponse(taskId, requestOptions); + } + + /** + * Retrieve a list of CisaCves for the provided search parameters. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of CisaCveResult items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getCisaCves(RequestOptions requestOptions) { + return this.serviceClient.getCisaCves(requestOptions); + } + + /** + * Retrieve details of CisaCve by cveId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have + * more than 4 digits. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return cisa cve in a given workspace along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCisaCveWithResponse(String cveId, RequestOptions requestOptions) { + return this.serviceClient.getCisaCveWithResponse(cveId, requestOptions); + } + + /** + * Export a list of assets for the provided search parameters. + * + * @param body Body parameter. + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Task getAssetsExport(AssetsExportRequest body, String filter, String orderBy) { + // Generated convenience method for getAssetsExportWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + return getAssetsExportWithResponse(BinaryData.fromObject(body), requestOptions).getValue().toObject(Task.class); + } + + /** + * Export a list of assets for the provided search parameters. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Task getAssetsExport(AssetsExportRequest body) { + // Generated convenience method for getAssetsExportWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAssetsExportWithResponse(BinaryData.fromObject(body), requestOptions).getValue().toObject(Task.class); + } + + /** + * Retrieve observations on an asset. + * + * @param assetId The system generated unique id for the resource. + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @param skip The number of result items to skip. + * @param maxPageSize The maximum number of result items per page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page result response for the observation. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ObservationPageResult getObservations(String assetId, String filter, String orderBy, Integer skip, + Integer maxPageSize) { + // Generated convenience method for getObservationsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return getObservationsWithResponse(assetId, requestOptions).getValue().toObject(ObservationPageResult.class); + } + + /** + * Retrieve observations on an asset. + * + * @param assetId The system generated unique id for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page result response for the observation. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ObservationPageResult getObservations(String assetId) { + // Generated convenience method for getObservationsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getObservationsWithResponse(assetId, requestOptions).getValue().toObject(ObservationPageResult.class); + } + + /** + * Retrieve a list of deltas for the provided time range. + * + * @param body Body parameter. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getDeltaDetails(DeltaDetailsRequest body, Integer skip) { + // Generated convenience method for getDeltaDetails + RequestOptions requestOptions = new RequestOptions(); + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.getDeltaDetails(BinaryData.fromObject(body), requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeltaResult.class)); + } + + /** + * Retrieve a list of deltas for the provided time range. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getDeltaDetails(DeltaDetailsRequest body) { + // Generated convenience method for getDeltaDetails + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.getDeltaDetails(BinaryData.fromObject(body), requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeltaResult.class)); + } + + /** + * Retrieve a list of deltas with overall summary changes for the provided time range. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define response body for getting delta summary. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DeltaSummaryResult getDeltaSummary(DeltaSummaryRequest body) { + // Generated convenience method for getDeltaSummaryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeltaSummaryWithResponse(BinaryData.fromObject(body), requestOptions).getValue() + .toObject(DeltaSummaryResult.class); + } + + /** + * Delete a discovery group with a given discovery group name. + * + * @param groupName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDiscoGroup(String groupName) { + // Generated convenience method for deleteDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteDiscoGroupWithResponse(groupName, requestOptions).getValue(); + } + + /** + * Retrieve an asset chain summary. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the asset chain summary. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AssetChainSummaryResult getAssetChainSummary(AssetChainRequest body) { + // Generated convenience method for getAssetChainSummaryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAssetChainSummaryWithResponse(BinaryData.fromObject(body), requestOptions).getValue() + .toObject(AssetChainSummaryResult.class); + } + + /** + * Dismiss discovery chain for a given asset chain source. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Task dismissAssetChain(AssetChainRequest body) { + // Generated convenience method for dismissAssetChainWithResponse + RequestOptions requestOptions = new RequestOptions(); + return dismissAssetChainWithResponse(BinaryData.fromObject(body), requestOptions).getValue() + .toObject(Task.class); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. + * + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the most recent snapshot of asset summary values for the snapshot request exported to a file. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Task getSnapshotExport(ReportAssetSnapshotExportRequest body) { + // Generated convenience method for getSnapshotExportWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSnapshotExportWithResponse(BinaryData.fromObject(body), requestOptions).getValue() + .toObject(Task.class); + } + + /** + * Run a task by taskId. + * + * @param taskId The unique identifier of the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Task runTask(String taskId) { + // Generated convenience method for runTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return runTaskWithResponse(taskId, requestOptions).getValue().toObject(Task.class); + } + + /** + * Download a task. + * + * @param taskId The unique identifier of the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Task downloadTask(String taskId) { + // Generated convenience method for downloadTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return downloadTaskWithResponse(taskId, requestOptions).getValue().toObject(Task.class); + } + + /** + * Retrieve a list of CisaCves for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of CisaCveResult items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getCisaCves() { + // Generated convenience method for getCisaCves + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.getCisaCves(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(CisaCveResult.class)); + } + + /** + * Retrieve details of CisaCve by cveId. + * + * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have + * more than 4 digits. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cisa cve in a given workspace. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CisaCveResult getCisaCve(String cveId) { + // Generated convenience method for getCisaCveWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCisaCveWithResponse(cveId, requestOptions).getValue().toObject(CisaCveResult.class); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClientBuilder.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClientBuilder.java index d7f01f71de48..80ac279331fe 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClientBuilder.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClientBuilder.java @@ -12,7 +12,6 @@ import com.azure.core.client.traits.TokenCredentialTrait; import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; @@ -21,8 +20,8 @@ import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.AddHeadersPolicy; import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -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; @@ -84,7 +83,7 @@ public EasmClientBuilder() { @Override public EasmClientBuilder pipeline(HttpPipeline pipeline) { if (this.pipeline != null && pipeline == null) { - LOGGER.info("HttpPipeline is being set to 'null' when it was previously configured."); + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); } this.pipeline = pipeline; return this; @@ -213,60 +212,6 @@ public EasmClientBuilder endpoint(String endpoint) { return this; } - /* - * The ID of the target subscription. - */ - @Generated - private String subscriptionId; - - /** - * Sets The ID of the target subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the EasmClientBuilder. - */ - @Generated - public EasmClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * The name of the Resource Group. - */ - @Generated - private String resourceGroupName; - - /** - * Sets The name of the Resource Group. - * - * @param resourceGroupName the resourceGroupName value. - * @return the EasmClientBuilder. - */ - @Generated - public EasmClientBuilder resourceGroupName(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - /* - * The name of the Workspace. - */ - @Generated - private String workspaceName; - - /** - * Sets The name of the Workspace. - * - * @param workspaceName the workspaceName value. - * @return the EasmClientBuilder. - */ - @Generated - public EasmClientBuilder workspaceName(String workspaceName) { - this.workspaceName = workspaceName; - return this; - } - /* * Service version */ @@ -310,11 +255,12 @@ public EasmClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private EasmClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); EasmServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : EasmServiceVersion.getLatest(); EasmClientImpl client = new EasmClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, this.subscriptionId, this.resourceGroupName, this.workspaceName, localServiceVersion); + this.endpoint, localServiceVersion); return client; } @@ -331,13 +277,12 @@ private HttpPipeline createHttpPipeline() { policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); policies.add(new RequestIdPolicy()); policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders() - .forEach(header -> headers.set(HttpHeaderName.fromString(header.getName()), header.getValue())); - if (headers.getSize() > 0) { + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { policies.add(new AddHeadersPolicy(headers)); } - this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) .forEach(p -> policies.add(p)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); @@ -345,12 +290,15 @@ private HttpPipeline createHttpPipeline() { if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); } - this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(localHttpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient).clientOptions(localClientOptions).build(); + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); return httpPipeline; } @@ -375,4 +323,11 @@ public EasmClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(EasmClientBuilder.class); + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java index d117819faf17..21bb4f99a506 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java @@ -13,7 +13,12 @@ public enum EasmServiceVersion implements ServiceVersion { /** * Enum value 2023-03-01-preview. */ - V2023_03_01_PREVIEW("2023-03-01-preview"); + V2023_03_01_PREVIEW("2023-03-01-preview"), + + /** + * Enum value 2024-03-01-preview. + */ + V2024_03_01_PREVIEW("2024-03-01-preview"); private final String version; @@ -35,6 +40,6 @@ public String getVersion() { * @return The latest {@link EasmServiceVersion}. */ public static EasmServiceVersion getLatest() { - return V2023_03_01_PREVIEW; + return V2024_03_01_PREVIEW; } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java index 083ff7efe91c..2b7874bc15b3 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java @@ -56,12 +56,14 @@ public final class EasmClientImpl { private final EasmClientService service; /** - * The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com. + * The endpoint hosting the requested resource. For example, + * https://{region}.easm.defender.microsoft.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/workspaces/{workspaceName}. */ private final String endpoint; /** - * Gets The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com. + * Gets The endpoint hosting the requested resource. For example, + * https://{region}.easm.defender.microsoft.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/workspaces/{workspaceName}. * * @return the endpoint value. */ @@ -69,48 +71,6 @@ public String getEndpoint() { return this.endpoint; } - /** - * 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; - } - - /** - * The name of the Resource Group. - */ - private final String resourceGroupName; - - /** - * Gets The name of the Resource Group. - * - * @return the resourceGroupName value. - */ - public String getResourceGroupName() { - return this.resourceGroupName; - } - - /** - * The name of the Workspace. - */ - private final String workspaceName; - - /** - * Gets The name of the Workspace. - * - * @return the workspaceName value. - */ - public String getWorkspaceName() { - return this.workspaceName; - } - /** * Service version. */ @@ -157,17 +117,12 @@ public SerializerAdapter getSerializerAdapter() { * Initializes an instance of EasmClient client. * * @param endpoint The endpoint hosting the requested resource. For example, - * https://{region}.easm.defender.microsoft.com. - * @param subscriptionId The ID of the target subscription. - * @param resourceGroupName The name of the Resource Group. - * @param workspaceName The name of the Workspace. + * https://{region}.easm.defender.microsoft.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/workspaces/{workspaceName}. * @param serviceVersion Service version. */ - public EasmClientImpl(String endpoint, String subscriptionId, String resourceGroupName, String workspaceName, - EasmServiceVersion serviceVersion) { + public EasmClientImpl(String endpoint, EasmServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, subscriptionId, resourceGroupName, workspaceName, - serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -175,16 +130,11 @@ public EasmClientImpl(String endpoint, String subscriptionId, String resourceGro * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint The endpoint hosting the requested resource. For example, - * https://{region}.easm.defender.microsoft.com. - * @param subscriptionId The ID of the target subscription. - * @param resourceGroupName The name of the Resource Group. - * @param workspaceName The name of the Workspace. + * https://{region}.easm.defender.microsoft.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/workspaces/{workspaceName}. * @param serviceVersion Service version. */ - public EasmClientImpl(HttpPipeline httpPipeline, String endpoint, String subscriptionId, String resourceGroupName, - String workspaceName, EasmServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, subscriptionId, resourceGroupName, - workspaceName, serviceVersion); + public EasmClientImpl(HttpPipeline httpPipeline, String endpoint, EasmServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -193,20 +143,14 @@ public EasmClientImpl(HttpPipeline httpPipeline, String endpoint, String subscri * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint The endpoint hosting the requested resource. For example, - * https://{region}.easm.defender.microsoft.com. - * @param subscriptionId The ID of the target subscription. - * @param resourceGroupName The name of the Resource Group. - * @param workspaceName The name of the Workspace. + * https://{region}.easm.defender.microsoft.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/workspaces/{workspaceName}. * @param serviceVersion Service version. */ public EasmClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String subscriptionId, String resourceGroupName, String workspaceName, EasmServiceVersion serviceVersion) { + EasmServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.subscriptionId = subscriptionId; - this.resourceGroupName = resourceGroupName; - this.workspaceName = workspaceName; this.serviceVersion = serviceVersion; this.service = RestProxy.create(EasmClientService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -214,7 +158,7 @@ public EasmClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAda /** * The interface defining all the services for EasmClient to be used by the proxy service to perform REST calls. */ - @Host("{endpoint}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/workspaces/{workspaceName}") + @Host("{endpoint}") @ServiceInterface(name = "EasmClient") public interface EasmClientService { @Get("/assets") @@ -224,8 +168,6 @@ public interface EasmClientService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listAssetResource(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -236,8 +178,6 @@ Mono> listAssetResource(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listAssetResourceSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -248,10 +188,8 @@ Response listAssetResourceSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateAssets(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @QueryParam("filter") String filter, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData assetUpdateData, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/assets") @@ -261,10 +199,8 @@ Mono> updateAssets(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateAssetsSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @QueryParam("filter") String filter, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData assetUpdateData, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/assets/{assetId}") @@ -274,8 +210,6 @@ Response updateAssetsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getAssetResource(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("assetId") String assetId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -286,11 +220,89 @@ Mono> getAssetResource(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getAssetResourceSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("assetId") String assetId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @Post("/assets:export") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAssetsExport(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/assets:export") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getAssetsExportSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/assets/{assetId}:getObservations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getObservations(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("assetId") String assetId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/assets/{assetId}:getObservations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getObservationsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("assetId") String assetId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/assets:getDeltaDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeltaDetails(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/assets:getDeltaDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDeltaDetailsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/assets:getDeltaSummary") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeltaSummary(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/assets:getDeltaSummary") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDeltaSummarySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @Get("/dataConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -298,8 +310,6 @@ Response getAssetResourceSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDataConnection(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -310,8 +320,6 @@ Mono> listDataConnection(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDataConnectionSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -322,11 +330,8 @@ Response listDataConnectionSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> validateDataConnection(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData dataConnectionData, RequestOptions requestOptions, - Context context); + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/dataConnections:validate") @ExpectedResponses({ 200 }) @@ -335,11 +340,8 @@ Mono> validateDataConnection(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response validateDataConnectionSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData dataConnectionData, RequestOptions requestOptions, - Context context); + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/dataConnections/{dataConnectionName}") @ExpectedResponses({ 200 }) @@ -348,8 +350,6 @@ Response validateDataConnectionSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDataConnection(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -360,8 +360,6 @@ Mono> getDataConnection(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDataConnectionSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -372,10 +370,8 @@ Response getDataConnectionSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplaceDataConnection(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dataConnectionData, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/dataConnections/{dataConnectionName}") @@ -385,10 +381,8 @@ Mono> createOrReplaceDataConnection(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceDataConnectionSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData dataConnectionData, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/dataConnections/{dataConnectionName}") @@ -398,8 +392,6 @@ Response createOrReplaceDataConnectionSync(@HostParam("endpoint") St @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteDataConnection(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -410,8 +402,6 @@ Mono> deleteDataConnection(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteDataConnectionSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -422,8 +412,6 @@ Response deleteDataConnectionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDiscoGroup(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -434,8 +422,6 @@ Mono> listDiscoGroup(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDiscoGroupSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -446,10 +432,8 @@ Response listDiscoGroupSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> validateDiscoGroup(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData discoGroupData, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/discoGroups:validate") @ExpectedResponses({ 200 }) @@ -458,10 +442,8 @@ Mono> validateDiscoGroup(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response validateDiscoGroupSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData discoGroupData, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/discoGroups/{groupName}") @ExpectedResponses({ 200 }) @@ -470,8 +452,6 @@ Response validateDiscoGroupSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDiscoGroup(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -482,8 +462,26 @@ Mono> getDiscoGroup(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDiscoGroupSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/discoGroups/{groupName}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDiscoGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/discoGroups/{groupName}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDiscoGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -494,11 +492,10 @@ Response getDiscoGroupSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplaceDiscoGroup(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData discoGroupData, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions, + Context context); @Put("/discoGroups/{groupName}") @ExpectedResponses({ 200 }) @@ -507,11 +504,10 @@ Mono> createOrReplaceDiscoGroup(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceDiscoGroupSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData discoGroupData, - RequestOptions requestOptions, Context context); + @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions, + Context context); @Post("/discoGroups/{groupName}:run") @ExpectedResponses({ 204 }) @@ -520,8 +516,6 @@ Response createOrReplaceDiscoGroupSync(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> runDiscoGroup(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -532,8 +526,6 @@ Mono> runDiscoGroup(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response runDiscoGroupSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -544,8 +536,6 @@ Response runDiscoGroupSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listRuns(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -556,11 +546,49 @@ Mono> listRuns(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listRunsSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @Post("/discoGroups:getAssetChainSummary") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAssetChainSummary(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/discoGroups:getAssetChainSummary") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getAssetChainSummarySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/discoGroups:dismissAssetChain") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> dismissAssetChain(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/discoGroups:dismissAssetChain") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response dismissAssetChainSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + @Get("/discoTemplates") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -568,8 +596,6 @@ Response listRunsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDiscoTemplate(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -580,8 +606,6 @@ Mono> listDiscoTemplate(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDiscoTemplateSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -592,8 +616,6 @@ Response listDiscoTemplateSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDiscoTemplate(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("templateId") String templateId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -604,8 +626,6 @@ Mono> getDiscoTemplate(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDiscoTemplateSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("templateId") String templateId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -616,8 +636,6 @@ Response getDiscoTemplateSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getBillable(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -628,8 +646,6 @@ Mono> getBillable(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getBillableSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -640,11 +656,8 @@ Response getBillableSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getSnapshot(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData reportAssetSnapshotRequest, RequestOptions requestOptions, - Context context); + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/reports/assets:getSnapshot") @ExpectedResponses({ 200 }) @@ -653,11 +666,8 @@ Mono> getSnapshot(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSnapshotSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData reportAssetSnapshotRequest, RequestOptions requestOptions, - Context context); + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/reports/assets:getSummary") @ExpectedResponses({ 200 }) @@ -666,11 +676,8 @@ Response getSnapshotSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getSummary(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData reportAssetSummaryRequest, RequestOptions requestOptions, - Context context); + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Post("/reports/assets:getSummary") @ExpectedResponses({ 200 }) @@ -679,11 +686,28 @@ Mono> getSummary(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSummarySync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData reportAssetSummaryRequest, RequestOptions requestOptions, - Context context); + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/reports/assets:getSnapshotExport") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSnapshotExport(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/reports/assets:getSnapshotExport") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSnapshotExportSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Get("/savedFilters") @ExpectedResponses({ 200 }) @@ -692,8 +716,6 @@ Response getSummarySync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSavedFilter(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -704,8 +726,6 @@ Mono> listSavedFilter(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSavedFilterSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -716,8 +736,6 @@ Response listSavedFilterSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getSavedFilter(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -728,8 +746,6 @@ Mono> getSavedFilter(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getSavedFilterSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -740,10 +756,8 @@ Response getSavedFilterSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplaceSavedFilter(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData savedFilterData, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Put("/savedFilters/{filterName}") @@ -753,10 +767,8 @@ Mono> createOrReplaceSavedFilter(@HostParam("endpoint") Str @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceSavedFilterSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData savedFilterData, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/savedFilters/{filterName}") @@ -766,8 +778,6 @@ Response createOrReplaceSavedFilterSync(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteSavedFilter(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -778,8 +788,6 @@ Mono> deleteSavedFilter(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSavedFilterSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -790,8 +798,6 @@ Response deleteSavedFilterSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listTask(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -802,8 +808,6 @@ Mono> listTask(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listTaskSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -814,8 +818,6 @@ Response listTaskSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getTask(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -826,8 +828,6 @@ Mono> getTask(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getTaskSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -838,8 +838,6 @@ Response getTaskSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> cancelTask(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @@ -850,11 +848,89 @@ Mono> cancelTask(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response cancelTaskSync(@HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @Post("/tasks/{taskId}:run") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> runTask(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/tasks/{taskId}:run") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response runTaskSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/tasks/{taskId}:download") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> downloadTask(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/tasks/{taskId}:download") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response downloadTaskSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/cisaCves") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getCisaCves(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/cisaCves") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getCisaCvesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/cisaCves/{cveId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getCisaCve(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("cveId") String cveId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/cisaCves/{cveId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getCisaCveSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("cveId") String cveId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -862,9 +938,8 @@ Response cancelTaskSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listAssetResourceNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -873,9 +948,28 @@ Mono> listAssetResourceNext(@PathParam(value = "nextLink", @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listAssetResourceNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeltaDetailsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDeltaDetailsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -885,8 +979,6 @@ Response listAssetResourceNextSync(@PathParam(value = "nextLink", en @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDataConnectionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -896,9 +988,8 @@ Mono> listDataConnectionNext( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDataConnectionNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -907,9 +998,8 @@ Response listDataConnectionNextSync(@PathParam(value = "nextLink", e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDiscoGroupNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -918,9 +1008,8 @@ Mono> listDiscoGroupNext(@PathParam(value = "nextLink", enc @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDiscoGroupNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -929,9 +1018,8 @@ Response listDiscoGroupNextSync(@PathParam(value = "nextLink", encod @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listRunsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -940,9 +1028,8 @@ Mono> listRunsNext(@PathParam(value = "nextLink", encoded = @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listRunsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -951,9 +1038,8 @@ Response listRunsNextSync(@PathParam(value = "nextLink", encoded = t @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDiscoTemplateNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -962,9 +1048,8 @@ Mono> listDiscoTemplateNext(@PathParam(value = "nextLink", @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDiscoTemplateNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -973,9 +1058,8 @@ Response listDiscoTemplateNextSync(@PathParam(value = "nextLink", en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listSavedFilterNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -984,9 +1068,8 @@ Mono> listSavedFilterNext(@PathParam(value = "nextLink", en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listSavedFilterNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -995,9 +1078,8 @@ Response listSavedFilterNextSync(@PathParam(value = "nextLink", enco @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listTaskNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -1006,62 +1088,55 @@ Mono> listTaskNext(@PathParam(value = "nextLink", encoded = @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listTaskNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HostParam("subscriptionId") String subscriptionId, - @HostParam("resourceGroupName") String resourceGroupName, @HostParam("workspaceName") String workspaceName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - } + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getCisaCvesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getCisaCvesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + } /** * Retrieve a list of assets for the provided search parameters. - *

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent - * values are returned in the response.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based + * searching. Initial value is '*' and subsequent values are returned in the response.
responseTypeStringNoSpecify the response type. The possible values are: ID, + * STANDARD, FULL, REDUCED. Allowed values: "id", "standard", "full", "reduced".
responseIncludesList<String>NoThe properties to include in the response. + * In the form of "," separated string.
recentOnlyBooleanNoIf it's recent only.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -1100,64 +1175,37 @@ Response listTaskNextSync(@PathParam(value = "nextLink", encoded = t
     private Mono> listAssetResourceSinglePageAsync(RequestOptions requestOptions) {
         final String accept = "application/json";
         return FluxUtil
-            .withContext(context -> service.listAssetResource(this.getEndpoint(), this.getSubscriptionId(),
-                this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept,
-                requestOptions, context))
+            .withContext(context -> service.listAssetResource(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                accept, requestOptions, context))
             .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                 getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
     }
 
     /**
      * Retrieve a list of assets for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent - * values are returned in the response.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based + * searching. Initial value is '*' and subsequent values are returned in the response.
responseTypeStringNoSpecify the response type. The possible values are: ID, + * STANDARD, FULL, REDUCED. Allowed values: "id", "standard", "full", "reduced".
responseIncludesList<String>NoThe properties to include in the response. + * In the form of "," separated string.
recentOnlyBooleanNoIf it's recent only.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -1222,55 +1270,29 @@ public PagedFlux listAssetResourceAsync(RequestOptions requestOption
 
     /**
      * Retrieve a list of assets for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent - * values are returned in the response.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based + * searching. Initial value is '*' and subsequent values are returned in the response.
responseTypeStringNoSpecify the response type. The possible values are: ID, + * STANDARD, FULL, REDUCED. Allowed values: "id", "standard", "full", "reduced".
responseIncludesList<String>NoThe properties to include in the response. + * In the form of "," separated string.
recentOnlyBooleanNoIf it's recent only.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -1307,64 +1329,37 @@ public PagedFlux listAssetResourceAsync(RequestOptions requestOption
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listAssetResourceSinglePage(RequestOptions requestOptions) {
         final String accept = "application/json";
-        Response res
-            = service.listAssetResourceSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-                this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+        Response res = service.listAssetResourceSync(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
         return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
             getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
     }
 
     /**
      * Retrieve a list of assets for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent - * values are returned in the response.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based + * searching. Initial value is '*' and subsequent values are returned in the response.
responseTypeStringNoSpecify the response type. The possible values are: ID, + * STANDARD, FULL, REDUCED. Allowed values: "id", "standard", "full", "reduced".
responseIncludesList<String>NoThe properties to include in the response. + * In the form of "," separated string.
recentOnlyBooleanNoIf it's recent only.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -1429,9 +1424,8 @@ public PagedIterable listAssetResource(RequestOptions requestOptions
 
     /**
      * Update labels on assets matching the provided filter.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty) (Optional)
@@ -1442,9 +1436,9 @@ public PagedIterable listAssetResource(RequestOptions requestOptions
      *     transfers: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -1461,7 +1455,7 @@ public PagedIterable listAssetResource(RequestOptions requestOptions
      * }
* * @param filter An expression on the resource type that selects the resources to be returned. - * @param assetUpdateData A request body used to update an asset. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1470,19 +1464,17 @@ public PagedIterable listAssetResource(RequestOptions requestOptions * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAssetsWithResponseAsync(String filter, BinaryData assetUpdateData, + public Mono> updateAssetsWithResponseAsync(String filter, BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateAssets(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), filter, accept, - assetUpdateData, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateAssets(this.getEndpoint(), + this.getServiceVersion().getVersion(), filter, accept, body, requestOptions, context)); } /** * Update labels on assets matching the provided filter. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty) (Optional)
@@ -1493,9 +1485,9 @@ public Mono> updateAssetsWithResponseAsync(String filter, B
      *     transfers: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -1512,7 +1504,7 @@ public Mono> updateAssetsWithResponseAsync(String filter, B
      * }
* * @param filter An expression on the resource type that selects the resources to be returned. - * @param assetUpdateData A request body used to update an asset. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1521,21 +1513,20 @@ public Mono> updateAssetsWithResponseAsync(String filter, B * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAssetsWithResponse(String filter, BinaryData assetUpdateData, + public Response updateAssetsWithResponse(String filter, BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return service.updateAssetsSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(), - this.getWorkspaceName(), this.getServiceVersion().getVersion(), filter, accept, assetUpdateData, + return service.updateAssetsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), filter, accept, body, requestOptions, Context.NONE); } /** * Retrieve an asset by assetId. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -1574,18 +1565,17 @@ public Response updateAssetsWithResponse(String filter, BinaryData a
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getAssetResourceWithResponseAsync(String assetId, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.getAssetResource(this.getEndpoint(), this.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), assetId,
-            accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.getAssetResource(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), assetId, accept, requestOptions, context));
     }
 
     /**
      * Retrieve an asset by assetId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -1608,58 +1598,614 @@ public Mono> getAssetResourceWithResponseAsync(String asset
      *             reason: String (Optional)
      *         }
      *     ]
-     *     reason: String (Optional)
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param assetId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the items in the current page of results along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssetResourceWithResponse(String assetId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getAssetResourceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), assetId, accept, + requestOptions, Context.NONE); + } + + /** + * Export a list of assets for the provided search parameters. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     fileName: String (Required)
+     *     columns (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAssetsExportWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getAssetsExport(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + } + + /** + * Export a list of assets for the provided search parameters. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     fileName: String (Required)
+     *     columns (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssetsExportWithResponse(BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getAssetsExportSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, + requestOptions, Context.NONE); + } + + /** + * Retrieve observations on an asset. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     totalElements: long (Required)
+     *     prioritySummary (Required): {
+     *         String: int (Required)
+     *     }
+     *     value (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             types (Required): [
+     *                 String(cve/insight) (Required)
+     *             ]
+     *             priority: String(high/medium/low/none) (Required)
+     *             cvssScoreV2: double (Required)
+     *             cvssScoreV3: double (Required)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param assetId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the page result response for the observation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getObservationsWithResponseAsync(String assetId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getObservations(this.getEndpoint(), + this.getServiceVersion().getVersion(), assetId, accept, requestOptions, context)); + } + + /** + * Retrieve observations on an asset. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     totalElements: long (Required)
+     *     prioritySummary (Required): {
+     *         String: int (Required)
+     *     }
+     *     value (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             types (Required): [
+     *                 String(cve/insight) (Required)
+     *             ]
+     *             priority: String(high/medium/low/none) (Required)
+     *             cvssScoreV2: double (Required)
+     *             cvssScoreV3: double (Required)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param assetId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the page result response for the observation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getObservationsWithResponse(String assetId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getObservationsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), assetId, accept, + requestOptions, Context.NONE); + } + + /** + * Retrieve a list of deltas for the provided time range. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     deltaDetailType: String(added/removed) (Required)
+     *     priorDays: Integer (Optional)
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     name: String (Required)
+     *     createdAt: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeltaDetailsSinglePageAsync(BinaryData body, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getDeltaDetails(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, body, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Retrieve a list of deltas for the provided time range. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     deltaDetailType: String(added/removed) (Required)
+     *     priorDays: Integer (Optional)
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     name: String (Required)
+     *     createdAt: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getDeltaDetailsAsync(BinaryData body, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getDeltaDetailsSinglePageAsync(body, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getDeltaDetailsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a list of deltas for the provided time range. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     deltaDetailType: String(added/removed) (Required)
+     *     priorDays: Integer (Optional)
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     name: String (Required)
+     *     createdAt: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getDeltaDetailsSinglePage(BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.getDeltaDetailsSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, body, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Retrieve a list of deltas for the provided time range. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     deltaDetailType: String(added/removed) (Required)
+     *     priorDays: Integer (Optional)
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     name: String (Required)
+     *     createdAt: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getDeltaDetails(BinaryData body, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getDeltaDetailsSinglePage(body, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getDeltaDetailsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a list of deltas with overall summary changes for the provided time range. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     priorDays: Integer (Optional)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     summary (Required): {
+     *         range: long (Required)
+     *         removed: long (Required)
+     *         added: long (Required)
+     *         difference: long (Required)
+     *         kindSummaries (Required): [
+     *              (Required){
+     *                 kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *                 removed: long (Required)
+     *                 added: long (Required)
+     *                 difference: long (Required)
+     *             }
+     *         ]
+     *     }
+     *     daily (Required): [
+     *          (Required){
+     *             date: OffsetDateTime (Required)
+     *             deltas (Required): [
+     *                  (Required){
+     *                     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *                     removed: long (Required)
+     *                     added: long (Required)
+     *                     difference: long (Required)
+     *                     count: long (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return define response body for getting delta summary along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeltaSummaryWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getDeltaSummary(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + } + + /** + * Retrieve a list of deltas with overall summary changes for the provided time range. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     priorDays: Integer (Optional)
+     *     date: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     summary (Required): {
+     *         range: long (Required)
+     *         removed: long (Required)
+     *         added: long (Required)
+     *         difference: long (Required)
+     *         kindSummaries (Required): [
+     *              (Required){
+     *                 kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *                 removed: long (Required)
+     *                 added: long (Required)
+     *                 difference: long (Required)
+     *             }
+     *         ]
+     *     }
+     *     daily (Required): [
+     *          (Required){
+     *             date: OffsetDateTime (Required)
+     *             deltas (Required): [
+     *                  (Required){
+     *                     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *                     removed: long (Required)
+     *                     added: long (Required)
+     *                     difference: long (Required)
+     *                     count: long (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
      * }
      * }
* - * @param assetId The system generated unique id for the resource. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the items in the current page of results along with {@link Response}. + * @return define response body for getting delta summary along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAssetResourceWithResponse(String assetId, RequestOptions requestOptions) { + public Response getDeltaSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAssetResourceSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(), - this.getWorkspaceName(), this.getServiceVersion().getVersion(), assetId, accept, requestOptions, - Context.NONE); + return service.getDeltaSummarySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, + requestOptions, Context.NONE); } /** * Retrieve a list of data connections. - *

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -1686,45 +2232,27 @@ public Response getAssetResourceWithResponse(String assetId, Request
     private Mono> listDataConnectionSinglePageAsync(RequestOptions requestOptions) {
         final String accept = "application/json";
         return FluxUtil
-            .withContext(context -> service.listDataConnection(this.getEndpoint(), this.getSubscriptionId(),
-                this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept,
-                requestOptions, context))
+            .withContext(context -> service.listDataConnection(this.getEndpoint(),
+                this.getServiceVersion().getVersion(), accept, requestOptions, context))
             .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                 getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
     }
 
     /**
      * Retrieve a list of data connections.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -1777,36 +2305,19 @@ public PagedFlux listDataConnectionAsync(RequestOptions requestOptio
 
     /**
      * Retrieve a list of data connections.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -1831,45 +2342,27 @@ public PagedFlux listDataConnectionAsync(RequestOptions requestOptio
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listDataConnectionSinglePage(RequestOptions requestOptions) {
         final String accept = "application/json";
-        Response res
-            = service.listDataConnectionSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-                this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+        Response res = service.listDataConnectionSync(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
         return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
             getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
     }
 
     /**
      * Retrieve a list of data connections.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -1922,20 +2415,20 @@ public PagedIterable listDataConnection(RequestOptions requestOption
 
     /**
      * Validate a data connection with a given dataConnectionName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     name: String (Optional)
      *     content: String(assets/attackSurfaceInsights) (Optional)
      *     frequency: String(daily/weekly/monthly) (Optional)
      *     frequencyOffset: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -1953,39 +2446,39 @@ public PagedIterable listDataConnection(RequestOptions requestOption
      * }
      * }
* - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return validate result for validate action endpoints along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> validateDataConnectionWithResponseAsync(BinaryData dataConnectionData, + public Mono> validateDataConnectionWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.validateDataConnection(this.getEndpoint(), - this.getSubscriptionId(), this.getResourceGroupName(), this.getWorkspaceName(), - this.getServiceVersion().getVersion(), accept, dataConnectionData, requestOptions, context)); + this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); } /** * Validate a data connection with a given dataConnectionName. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     name: String (Optional)
      *     content: String(assets/attackSurfaceInsights) (Optional)
      *     frequency: String(daily/weekly/monthly) (Optional)
      *     frequencyOffset: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -2003,30 +2496,28 @@ public Mono> validateDataConnectionWithResponseAsync(Binary
      * }
      * }
* - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return validate result for validate action endpoints along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateDataConnectionWithResponse(BinaryData dataConnectionData, - RequestOptions requestOptions) { + public Response validateDataConnectionWithResponse(BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return service.validateDataConnectionSync(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, - dataConnectionData, requestOptions, Context.NONE); + return service.validateDataConnectionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + body, requestOptions, Context.NONE); } /** * Retrieve a data connection with a given dataConnectionName. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -2053,18 +2544,17 @@ public Response validateDataConnectionWithResponse(BinaryData dataCo
     public Mono> getDataConnectionWithResponseAsync(String dataConnectionName,
         RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.getDataConnection(this.getEndpoint(), this.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(),
-            dataConnectionName, accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.getDataConnection(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), dataConnectionName, accept, requestOptions, context));
     }
 
     /**
      * Retrieve a data connection with a given dataConnectionName.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -2091,29 +2581,29 @@ public Mono> getDataConnectionWithResponseAsync(String data
     public Response getDataConnectionWithResponse(String dataConnectionName,
         RequestOptions requestOptions) {
         final String accept = "application/json";
-        return service.getDataConnectionSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-            this.getWorkspaceName(), this.getServiceVersion().getVersion(), dataConnectionName, accept, requestOptions,
-            Context.NONE);
+        return service.getDataConnectionSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
+            dataConnectionName, accept, requestOptions, Context.NONE);
     }
 
     /**
      * Create or replace a data connection with a given dataConnectionName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     name: String (Optional)
      *     content: String(assets/attackSurfaceInsights) (Optional)
      *     frequency: String(daily/weekly/monthly) (Optional)
      *     frequencyOffset: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -2129,7 +2619,7 @@ public Response getDataConnectionWithResponse(String dataConnectionN
      * }
* * @param dataConnectionName The caller provided unique name for the resource. - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2139,32 +2629,31 @@ public Response getDataConnectionWithResponse(String dataConnectionN */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrReplaceDataConnectionWithResponseAsync(String dataConnectionName, - BinaryData dataConnectionData, RequestOptions requestOptions) { + BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrReplaceDataConnection(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), - dataConnectionName, accept, dataConnectionData, requestOptions, context)); + return FluxUtil.withContext(context -> service.createOrReplaceDataConnection(this.getEndpoint(), + this.getServiceVersion().getVersion(), dataConnectionName, accept, body, requestOptions, context)); } /** * Create or replace a data connection with a given dataConnectionName. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     name: String (Optional)
      *     content: String(assets/attackSurfaceInsights) (Optional)
      *     frequency: String(daily/weekly/monthly) (Optional)
      *     frequencyOffset: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -2180,7 +2669,7 @@ public Mono> createOrReplaceDataConnectionWithResponseAsync
      * }
* * @param dataConnectionName The caller provided unique name for the resource. - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2189,12 +2678,11 @@ public Mono> createOrReplaceDataConnectionWithResponseAsync * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceDataConnectionWithResponse(String dataConnectionName, - BinaryData dataConnectionData, RequestOptions requestOptions) { + public Response createOrReplaceDataConnectionWithResponse(String dataConnectionName, BinaryData body, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.createOrReplaceDataConnectionSync(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), - dataConnectionName, accept, dataConnectionData, requestOptions, Context.NONE); + return service.createOrReplaceDataConnectionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + dataConnectionName, accept, body, requestOptions, Context.NONE); } /** @@ -2213,7 +2701,6 @@ public Mono> deleteDataConnectionWithResponseAsync(String dataCon RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.deleteDataConnection(this.getEndpoint(), - this.getSubscriptionId(), this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), dataConnectionName, accept, requestOptions, context)); } @@ -2231,47 +2718,23 @@ public Mono> deleteDataConnectionWithResponseAsync(String dataCon @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteDataConnectionWithResponse(String dataConnectionName, RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteDataConnectionSync(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), + return service.deleteDataConnectionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), dataConnectionName, accept, requestOptions, Context.NONE); } /** * Retrieve a list of discovery group for the provided search parameters. - *

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -2326,49 +2789,25 @@ public Response deleteDataConnectionWithResponse(String dataConnectionName
     private Mono> listDiscoGroupSinglePageAsync(RequestOptions requestOptions) {
         final String accept = "application/json";
         return FluxUtil
-            .withContext(context -> service.listDiscoGroup(this.getEndpoint(), this.getSubscriptionId(),
-                this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept,
-                requestOptions, context))
+            .withContext(context -> service.listDiscoGroup(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                accept, requestOptions, context))
             .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                 getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
     }
 
     /**
      * Retrieve a list of discovery group for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -2449,40 +2888,17 @@ public PagedFlux listDiscoGroupAsync(RequestOptions requestOptions)
 
     /**
      * Retrieve a list of discovery group for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -2535,49 +2951,25 @@ public PagedFlux listDiscoGroupAsync(RequestOptions requestOptions)
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listDiscoGroupSinglePage(RequestOptions requestOptions) {
         final String accept = "application/json";
-        Response res
-            = service.listDiscoGroupSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-                this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+        Response res = service.listDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
+            accept, requestOptions, Context.NONE);
         return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
             getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
     }
 
     /**
      * Retrieve a list of discovery group for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -2658,9 +3050,8 @@ public PagedIterable listDiscoGroup(RequestOptions requestOptions) {
 
     /**
      * Validate a discovery group with a given groupName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     name: String (Optional)
@@ -2682,9 +3073,9 @@ public PagedIterable listDiscoGroup(RequestOptions requestOptions) {
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -2702,28 +3093,27 @@ public PagedIterable listDiscoGroup(RequestOptions requestOptions) {
      * }
      * }
* - * @param discoGroupData A request body used to create a discovery group. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return validate result for validate action endpoints along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> validateDiscoGroupWithResponseAsync(BinaryData discoGroupData, + public Mono> validateDiscoGroupWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.validateDiscoGroup(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, - discoGroupData, requestOptions, context)); + return FluxUtil.withContext(context -> service.validateDiscoGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); } /** * Validate a discovery group with a given groupName. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     name: String (Optional)
@@ -2745,9 +3135,9 @@ public Mono> validateDiscoGroupWithResponseAsync(BinaryData
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -2765,28 +3155,25 @@ public Mono> validateDiscoGroupWithResponseAsync(BinaryData
      * }
      * }
* - * @param discoGroupData A request body used to create a discovery group. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return validate result for validate action endpoints along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateDiscoGroupWithResponse(BinaryData discoGroupData, - RequestOptions requestOptions) { + public Response validateDiscoGroupWithResponse(BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return service.validateDiscoGroupSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(), - this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, discoGroupData, requestOptions, - Context.NONE); + return service.validateDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, + requestOptions, Context.NONE); } /** * Retrieve a discovery group with a given groupName. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -2840,16 +3227,14 @@ public Response validateDiscoGroupWithResponse(BinaryData discoGroup
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getDiscoGroupWithResponseAsync(String groupName, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.getDiscoGroup(this.getEndpoint(), this.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), groupName,
-            accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.getDiscoGroup(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), groupName, accept, requestOptions, context));
     }
 
     /**
      * Retrieve a discovery group with a given groupName.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -2903,16 +3288,50 @@ public Mono> getDiscoGroupWithResponseAsync(String groupNam
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return service.getDiscoGroupSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-            this.getWorkspaceName(), this.getServiceVersion().getVersion(), groupName, accept, requestOptions,
-            Context.NONE);
+        return service.getDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), groupName, accept,
+            requestOptions, Context.NONE);
+    }
+
+    /**
+     * Delete a discovery group with a given discovery group name.
+     * 
+     * @param groupName The caller provided unique name for the resource.
+     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @return the {@link Response} on successful completion of {@link Mono}.
+     */
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    public Mono> deleteDiscoGroupWithResponseAsync(String groupName, RequestOptions requestOptions) {
+        final String accept = "application/json";
+        return FluxUtil.withContext(context -> service.deleteDiscoGroup(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), groupName, accept, requestOptions, context));
+    }
+
+    /**
+     * Delete a discovery group with a given discovery group name.
+     * 
+     * @param groupName The caller provided unique name for the resource.
+     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+     * @throws HttpResponseException thrown if the request is rejected by server.
+     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+     * @return the {@link Response}.
+     */
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    public Response deleteDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) {
+        final String accept = "application/json";
+        return service.deleteDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), groupName,
+            accept, requestOptions, Context.NONE);
     }
 
     /**
      * Create a discovery group with a given groupName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     name: String (Optional)
@@ -2934,9 +3353,9 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -2980,7 +3399,7 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO
      * }
* * @param groupName The caller provided unique name for the resource. - * @param discoGroupData A request body used to create a discovery group. + * @param createOrReplaceDiscoGroupRequest The createOrReplaceDiscoGroupRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2990,18 +3409,17 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrReplaceDiscoGroupWithResponseAsync(String groupName, - BinaryData discoGroupData, RequestOptions requestOptions) { + BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrReplaceDiscoGroup(this.getEndpoint(), - this.getSubscriptionId(), this.getResourceGroupName(), this.getWorkspaceName(), - this.getServiceVersion().getVersion(), groupName, accept, discoGroupData, requestOptions, context)); + return FluxUtil.withContext( + context -> service.createOrReplaceDiscoGroup(this.getEndpoint(), this.getServiceVersion().getVersion(), + groupName, accept, createOrReplaceDiscoGroupRequest, requestOptions, context)); } /** * Create a discovery group with a given groupName. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     name: String (Optional)
@@ -3023,9 +3441,9 @@ public Mono> createOrReplaceDiscoGroupWithResponseAsync(Str
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -3069,7 +3487,7 @@ public Mono> createOrReplaceDiscoGroupWithResponseAsync(Str
      * }
* * @param groupName The caller provided unique name for the resource. - * @param discoGroupData A request body used to create a discovery group. + * @param createOrReplaceDiscoGroupRequest The createOrReplaceDiscoGroupRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -3078,12 +3496,11 @@ public Mono> createOrReplaceDiscoGroupWithResponseAsync(Str * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData discoGroupData, - RequestOptions requestOptions) { + public Response createOrReplaceDiscoGroupWithResponse(String groupName, + BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions) { final String accept = "application/json"; - return service.createOrReplaceDiscoGroupSync(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), groupName, - accept, discoGroupData, requestOptions, Context.NONE); + return service.createOrReplaceDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + groupName, accept, createOrReplaceDiscoGroupRequest, requestOptions, Context.NONE); } /** @@ -3100,9 +3517,8 @@ public Response createOrReplaceDiscoGroupWithResponse(String groupNa @ServiceMethod(returns = ReturnType.SINGLE) public Mono> runDiscoGroupWithResponseAsync(String groupName, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.runDiscoGroup(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), groupName, - accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.runDiscoGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), groupName, accept, requestOptions, context)); } /** @@ -3119,47 +3535,23 @@ public Mono> runDiscoGroupWithResponseAsync(String groupName, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response runDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { final String accept = "application/json"; - return service.runDiscoGroupSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(), - this.getWorkspaceName(), this.getServiceVersion().getVersion(), groupName, accept, requestOptions, - Context.NONE); + return service.runDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), groupName, accept, + requestOptions, Context.NONE); } /** * Retrieve a collection of discovery run results for a discovery group with a given groupName. - *

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     submittedDate: OffsetDateTime (Optional)
@@ -3195,49 +3587,25 @@ public Response runDiscoGroupWithResponse(String groupName, RequestOptions
     private Mono> listRunsSinglePageAsync(String groupName, RequestOptions requestOptions) {
         final String accept = "application/json";
         return FluxUtil
-            .withContext(context -> service.listRuns(this.getEndpoint(), this.getSubscriptionId(),
-                this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), groupName,
-                accept, requestOptions, context))
+            .withContext(context -> service.listRuns(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                groupName, accept, requestOptions, context))
             .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                 getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
     }
 
     /**
      * Retrieve a collection of discovery run results for a discovery group with a given groupName.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     submittedDate: OffsetDateTime (Optional)
@@ -3300,40 +3668,17 @@ public PagedFlux listRunsAsync(String groupName, RequestOptions requ
 
     /**
      * Retrieve a collection of discovery run results for a discovery group with a given groupName.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     submittedDate: OffsetDateTime (Optional)
@@ -3368,49 +3713,25 @@ public PagedFlux listRunsAsync(String groupName, RequestOptions requ
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listRunsSinglePage(String groupName, RequestOptions requestOptions) {
         final String accept = "application/json";
-        Response res = service.listRunsSync(this.getEndpoint(), this.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), groupName,
-            accept, requestOptions, Context.NONE);
+        Response res = service.listRunsSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
+            groupName, accept, requestOptions, Context.NONE);
         return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
             getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
     }
 
     /**
      * Retrieve a collection of discovery run results for a discovery group with a given groupName.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     submittedDate: OffsetDateTime (Optional)
@@ -3471,42 +3792,240 @@ public PagedIterable listRuns(String groupName, RequestOptions reque
         });
     }
 
+    /**
+     * Retrieve an asset chain summary.
+     * 

Request Body Schema

+ * + *
{@code
+     * {
+     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
+     *     sourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     affectedAssetsSummary (Required): [
+     *          (Required){
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Required)
+     *             affectedCount: long (Required)
+     *         }
+     *     ]
+     *     affectedGroupsSummary (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             name: String (Required)
+     *             displayName: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             error (Required): {
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *                 target: String (Optional)
+     *                 details (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror (Optional): {
+     *                     code: String (Optional)
+     *                     innererror (Optional): (recursive schema, see innererror above)
+     *                 }
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response for the asset chain summary along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAssetChainSummaryWithResponseAsync(BinaryData body, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getAssetChainSummary(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + } + + /** + * Retrieve an asset chain summary. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
+     *     sourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     affectedAssetsSummary (Required): [
+     *          (Required){
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Required)
+     *             affectedCount: long (Required)
+     *         }
+     *     ]
+     *     affectedGroupsSummary (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             name: String (Required)
+     *             displayName: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             error (Required): {
+     *                 code: String (Required)
+     *                 message: String (Required)
+     *                 target: String (Optional)
+     *                 details (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror (Optional): {
+     *                     code: String (Optional)
+     *                     innererror (Optional): (recursive schema, see innererror above)
+     *                 }
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response for the asset chain summary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssetChainSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getAssetChainSummarySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, + requestOptions, Context.NONE); + } + + /** + * Dismiss discovery chain for a given asset chain source. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
+     *     sourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> dismissAssetChainWithResponseAsync(BinaryData body, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.dismissAssetChain(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + } + + /** + * Dismiss discovery chain for a given asset chain source. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
+     *     sourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response dismissAssetChainWithResponse(BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.dismissAssetChainSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, + requestOptions, Context.NONE); + } + /** * Retrieve a list of disco templates for the provided search parameters. - *

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -3541,49 +4060,25 @@ public PagedIterable listRuns(String groupName, RequestOptions reque
     private Mono> listDiscoTemplateSinglePageAsync(RequestOptions requestOptions) {
         final String accept = "application/json";
         return FluxUtil
-            .withContext(context -> service.listDiscoTemplate(this.getEndpoint(), this.getSubscriptionId(),
-                this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept,
-                requestOptions, context))
+            .withContext(context -> service.listDiscoTemplate(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                accept, requestOptions, context))
             .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                 getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
     }
 
     /**
      * Retrieve a list of disco templates for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -3644,40 +4139,17 @@ public PagedFlux listDiscoTemplateAsync(RequestOptions requestOption
 
     /**
      * Retrieve a list of disco templates for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -3710,49 +4182,25 @@ public PagedFlux listDiscoTemplateAsync(RequestOptions requestOption
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listDiscoTemplateSinglePage(RequestOptions requestOptions) {
         final String accept = "application/json";
-        Response res
-            = service.listDiscoTemplateSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-                this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+        Response res = service.listDiscoTemplateSync(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
         return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
             getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
     }
 
     /**
      * Retrieve a list of disco templates for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -3813,9 +4261,8 @@ public PagedIterable listDiscoTemplate(RequestOptions requestOptions
 
     /**
      * Retrieve a disco template with a given templateId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -3851,16 +4298,14 @@ public PagedIterable listDiscoTemplate(RequestOptions requestOptions
     public Mono> getDiscoTemplateWithResponseAsync(String templateId,
         RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.getDiscoTemplate(this.getEndpoint(), this.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), templateId,
-            accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.getDiscoTemplate(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), templateId, accept, requestOptions, context));
     }
 
     /**
      * Retrieve a disco template with a given templateId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -3894,16 +4339,14 @@ public Mono> getDiscoTemplateWithResponseAsync(String templ
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getDiscoTemplateWithResponse(String templateId, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return service.getDiscoTemplateSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-            this.getWorkspaceName(), this.getServiceVersion().getVersion(), templateId, accept, requestOptions,
-            Context.NONE);
+        return service.getDiscoTemplateSync(this.getEndpoint(), this.getServiceVersion().getVersion(), templateId,
+            accept, requestOptions, Context.NONE);
     }
 
     /**
      * Get billable assets summary for the workspace.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -3932,16 +4375,14 @@ public Response getDiscoTemplateWithResponse(String templateId, Requ
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getBillableWithResponseAsync(RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(
-            context -> service.getBillable(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-                this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.getBillable(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), accept, requestOptions, context));
     }
 
     /**
      * Get billable assets summary for the workspace.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -3969,15 +4410,14 @@ public Mono> getBillableWithResponseAsync(RequestOptions re
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getBillableWithResponse(RequestOptions requestOptions) {
         final String accept = "application/json";
-        return service.getBillableSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-            this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+        return service.getBillableSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
+            requestOptions, Context.NONE);
     }
 
     /**
      * Get the most recent snapshot of asset summary values for the snapshot request.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     metric: String (Optional)
@@ -3986,9 +4426,9 @@ public Response getBillableWithResponse(RequestOptions requestOption
      *     page: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     displayName: String (Optional)
@@ -4002,6 +4442,7 @@ public Response getBillableWithResponse(RequestOptions requestOption
      *         nextLink: String (Optional)
      *         value (Optional): [
      *              (Optional){
+     *                 kind: String (Required)
      *                 id: String (Required)
      *                 name: String (Optional)
      *                 displayName: String (Optional)
@@ -4031,7 +4472,7 @@ public Response getBillableWithResponse(RequestOptions requestOption
      * }
      * }
* - * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4041,19 +4482,16 @@ public Response getBillableWithResponse(RequestOptions requestOption * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotWithResponseAsync(BinaryData reportAssetSnapshotRequest, - RequestOptions requestOptions) { + public Mono> getSnapshotWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSnapshot(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, - reportAssetSnapshotRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.getSnapshot(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); } /** * Get the most recent snapshot of asset summary values for the snapshot request. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     metric: String (Optional)
@@ -4062,9 +4500,9 @@ public Mono> getSnapshotWithResponseAsync(BinaryData report
      *     page: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     displayName: String (Optional)
@@ -4078,6 +4516,7 @@ public Mono> getSnapshotWithResponseAsync(BinaryData report
      *         nextLink: String (Optional)
      *         value (Optional): [
      *              (Optional){
+     *                 kind: String (Required)
      *                 id: String (Required)
      *                 name: String (Optional)
      *                 displayName: String (Optional)
@@ -4107,7 +4546,7 @@ public Mono> getSnapshotWithResponseAsync(BinaryData report
      * }
      * }
* - * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4116,19 +4555,16 @@ public Mono> getSnapshotWithResponseAsync(BinaryData report * @return the most recent snapshot of asset summary values for the snapshot request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSnapshotWithResponse(BinaryData reportAssetSnapshotRequest, - RequestOptions requestOptions) { + public Response getSnapshotWithResponse(BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSnapshotSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(), - this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, reportAssetSnapshotRequest, + return service.getSnapshotSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, requestOptions, Context.NONE); } /** * Get asset summary details for the summary request. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     metricCategories (Optional): [
@@ -4145,9 +4581,9 @@ public Response getSnapshotWithResponse(BinaryData reportAssetSnapsh
      *     labelName: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -4169,8 +4605,7 @@ public Response getSnapshotWithResponse(BinaryData reportAssetSnapsh
      * }
      * }
* - * @param reportAssetSummaryRequest A request body used to retrieve summary asset information. One and only one - * collection of summary identifiers must be provided: filters, metrics, or metricCategories. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4180,19 +4615,16 @@ public Response getSnapshotWithResponse(BinaryData reportAssetSnapsh * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSummaryWithResponseAsync(BinaryData reportAssetSummaryRequest, - RequestOptions requestOptions) { + public Mono> getSummaryWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSummary(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, - reportAssetSummaryRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.getSummary(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); } /** * Get asset summary details for the summary request. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     metricCategories (Optional): [
@@ -4209,9 +4641,9 @@ public Mono> getSummaryWithResponseAsync(BinaryData reportA
      *     labelName: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -4233,8 +4665,7 @@ public Mono> getSummaryWithResponseAsync(BinaryData reportA
      * }
      * }
* - * @param reportAssetSummaryRequest A request body used to retrieve summary asset information. One and only one - * collection of summary identifiers must be provided: filters, metrics, or metricCategories. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4243,50 +4674,120 @@ public Mono> getSummaryWithResponseAsync(BinaryData reportA * @return asset summary details for the summary request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSummaryWithResponse(BinaryData reportAssetSummaryRequest, + public Response getSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSummarySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, + requestOptions, Context.NONE); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     metric: String (Optional)
+     *     fileName: String (Optional)
+     *     columns (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the most recent snapshot of asset summary values for the snapshot request exported to a file along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSnapshotExportWithResponseAsync(BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSummarySync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(), - this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, reportAssetSummaryRequest, + return FluxUtil.withContext(context -> service.getSnapshotExport(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     metric: String (Optional)
+     *     fileName: String (Optional)
+     *     columns (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param body Body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the most recent snapshot of asset summary values for the snapshot request exported to a file along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSnapshotExportWithResponse(BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSnapshotExportSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, requestOptions, Context.NONE); } /** * Retrieve a list of saved filters for the provided search parameters. - *

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -4309,49 +4810,25 @@ public Response getSummaryWithResponse(BinaryData reportAssetSummary
     private Mono> listSavedFilterSinglePageAsync(RequestOptions requestOptions) {
         final String accept = "application/json";
         return FluxUtil
-            .withContext(context -> service.listSavedFilter(this.getEndpoint(), this.getSubscriptionId(),
-                this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept,
-                requestOptions, context))
+            .withContext(context -> service.listSavedFilter(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                accept, requestOptions, context))
             .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                 getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
     }
 
     /**
      * Retrieve a list of saved filters for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -4400,40 +4877,17 @@ public PagedFlux listSavedFilterAsync(RequestOptions requestOptions)
 
     /**
      * Retrieve a list of saved filters for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -4454,49 +4908,25 @@ public PagedFlux listSavedFilterAsync(RequestOptions requestOptions)
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listSavedFilterSinglePage(RequestOptions requestOptions) {
         final String accept = "application/json";
-        Response res
-            = service.listSavedFilterSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-                this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+        Response res = service.listSavedFilterSync(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
         return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
             getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
     }
 
     /**
      * Retrieve a list of saved filters for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -4545,9 +4975,8 @@ public PagedIterable listSavedFilter(RequestOptions requestOptions)
 
     /**
      * Retrieve a saved filter by filterName.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -4570,16 +4999,14 @@ public PagedIterable listSavedFilter(RequestOptions requestOptions)
     public Mono> getSavedFilterWithResponseAsync(String filterName,
         RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.getSavedFilter(this.getEndpoint(), this.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), filterName,
-            accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.getSavedFilter(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), filterName, accept, requestOptions, context));
     }
 
     /**
      * Retrieve a saved filter by filterName.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -4601,25 +5028,23 @@ public Mono> getSavedFilterWithResponseAsync(String filterN
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getSavedFilterWithResponse(String filterName, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return service.getSavedFilterSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-            this.getWorkspaceName(), this.getServiceVersion().getVersion(), filterName, accept, requestOptions,
-            Context.NONE);
+        return service.getSavedFilterSync(this.getEndpoint(), this.getServiceVersion().getVersion(), filterName, accept,
+            requestOptions, Context.NONE);
     }
 
     /**
      * Create or replace a saved filter with a given filterName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     filter: String (Required)
      *     description: String (Required)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -4631,7 +5056,7 @@ public Response getSavedFilterWithResponse(String filterName, Reques
      * }
* * @param filterName The caller provided unique name for the resource. - * @param savedFilterData A request body used to create a saved filter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4640,28 +5065,26 @@ public Response getSavedFilterWithResponse(String filterName, Reques * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrReplaceSavedFilterWithResponseAsync(String filterName, - BinaryData savedFilterData, RequestOptions requestOptions) { + public Mono> createOrReplaceSavedFilterWithResponseAsync(String filterName, BinaryData body, + RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrReplaceSavedFilter(this.getEndpoint(), - this.getSubscriptionId(), this.getResourceGroupName(), this.getWorkspaceName(), - this.getServiceVersion().getVersion(), filterName, accept, savedFilterData, requestOptions, context)); + this.getServiceVersion().getVersion(), filterName, accept, body, requestOptions, context)); } /** * Create or replace a saved filter with a given filterName. - *

- * Request Body Schema - *

+ *

Request Body Schema

+ * *
{@code
      * {
      *     filter: String (Required)
      *     description: String (Required)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -4673,7 +5096,7 @@ public Mono> createOrReplaceSavedFilterWithResponseAsync(St
      * }
* * @param filterName The caller provided unique name for the resource. - * @param savedFilterData A request body used to create a saved filter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4682,12 +5105,11 @@ public Mono> createOrReplaceSavedFilterWithResponseAsync(St * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceSavedFilterWithResponse(String filterName, BinaryData savedFilterData, + public Response createOrReplaceSavedFilterWithResponse(String filterName, BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; - return service.createOrReplaceSavedFilterSync(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), filterName, - accept, savedFilterData, requestOptions, Context.NONE); + return service.createOrReplaceSavedFilterSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + filterName, accept, body, requestOptions, Context.NONE); } /** @@ -4704,9 +5126,8 @@ public Response createOrReplaceSavedFilterWithResponse(String filter @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteSavedFilterWithResponseAsync(String filterName, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteSavedFilter(this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), filterName, - accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.deleteSavedFilter(this.getEndpoint(), + this.getServiceVersion().getVersion(), filterName, accept, requestOptions, context)); } /** @@ -4723,53 +5144,25 @@ public Mono> deleteSavedFilterWithResponseAsync(String filterName @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteSavedFilterWithResponse(String filterName, RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteSavedFilterSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(), - this.getWorkspaceName(), this.getServiceVersion().getVersion(), filterName, accept, requestOptions, - Context.NONE); + return service.deleteSavedFilterSync(this.getEndpoint(), this.getServiceVersion().getVersion(), filterName, + accept, requestOptions, Context.NONE); } /** * Retrieve a list of tasks for the provided search parameters. - *

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -4796,55 +5189,27 @@ public Response deleteSavedFilterWithResponse(String filterName, RequestOp
     private Mono> listTaskSinglePageAsync(RequestOptions requestOptions) {
         final String accept = "application/json";
         return FluxUtil
-            .withContext(
-                context -> service.listTask(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-                    this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, requestOptions, context))
+            .withContext(context -> service.listTask(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
+                requestOptions, context))
             .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                 getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
     }
 
     /**
      * Retrieve a list of tasks for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -4898,46 +5263,19 @@ public PagedFlux listTaskAsync(RequestOptions requestOptions) {
 
     /**
      * Retrieve a list of tasks for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -4963,55 +5301,27 @@ public PagedFlux listTaskAsync(RequestOptions requestOptions) {
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listTaskSinglePage(RequestOptions requestOptions) {
         final String accept = "application/json";
-        Response res
-            = service.listTaskSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-                this.getWorkspaceName(), this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+        Response res = service.listTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
+            accept, requestOptions, Context.NONE);
         return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
             getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
     }
 
     /**
      * Retrieve a list of tasks for the provided search parameters.
-     * 

- * Query Parameters - *

+ *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5065,9 +5375,144 @@ public PagedIterable listTask(RequestOptions requestOptions) {
 
     /**
      * Retrieve a task by taskId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTaskWithResponseAsync(String taskId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getTask(this.getEndpoint(), + this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context)); + } + + /** + * Retrieve a task by taskId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTaskWithResponse(String taskId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept, + requestOptions, Context.NONE); + } + + /** + * Cancel a task by taskId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelTaskWithResponseAsync(String taskId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.cancelTask(this.getEndpoint(), + this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context)); + } + + /** + * Cancel a task by taskId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Required)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelTaskWithResponse(String taskId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.cancelTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept, + requestOptions, Context.NONE); + } + + /** + * Run a task by taskId. + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5092,18 +5537,16 @@ public PagedIterable listTask(RequestOptions requestOptions) {
      * @return the response body along with {@link Response} on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> getTaskWithResponseAsync(String taskId, RequestOptions requestOptions) {
+    public Mono> runTaskWithResponseAsync(String taskId, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.getTask(this.getEndpoint(), this.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), taskId, accept,
-            requestOptions, context));
+        return FluxUtil.withContext(context -> service.runTask(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context));
     }
 
     /**
-     * Retrieve a task by taskId.
-     * 

- * Response Body Schema - *

+ * Run a task by taskId. + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5128,18 +5571,16 @@ public Mono> getTaskWithResponseAsync(String taskId, Reques
      * @return the response body along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Response getTaskWithResponse(String taskId, RequestOptions requestOptions) {
+    public Response runTaskWithResponse(String taskId, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return service.getTaskSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(),
-            this.getWorkspaceName(), this.getServiceVersion().getVersion(), taskId, accept, requestOptions,
-            Context.NONE);
+        return service.runTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept,
+            requestOptions, Context.NONE);
     }
 
     /**
-     * Cancel a task by taskId.
-     * 

- * Response Body Schema - *

+ * Download a task. + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5164,18 +5605,16 @@ public Response getTaskWithResponse(String taskId, RequestOptions re
      * @return the response body along with {@link Response} on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> cancelTaskWithResponseAsync(String taskId, RequestOptions requestOptions) {
+    public Mono> downloadTaskWithResponseAsync(String taskId, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.cancelTask(this.getEndpoint(), this.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), taskId, accept,
-            requestOptions, context));
+        return FluxUtil.withContext(context -> service.downloadTask(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context));
     }
 
     /**
-     * Cancel a task by taskId.
-     * 

- * Response Body Schema - *

+ * Download a task. + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5200,20 +5639,237 @@ public Mono> cancelTaskWithResponseAsync(String taskId, Req
      * @return the response body along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Response cancelTaskWithResponse(String taskId, RequestOptions requestOptions) {
+    public Response downloadTaskWithResponse(String taskId, RequestOptions requestOptions) {
+        final String accept = "application/json";
+        return service.downloadTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept,
+            requestOptions, Context.NONE);
+    }
+
+    /**
+     * Retrieve a list of CisaCves for the provided search parameters.
+     * 

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of CisaCveResult items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCisaCvesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getCisaCves(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Retrieve a list of CisaCves for the provided search parameters. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of CisaCveResult items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getCisaCvesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> getCisaCvesSinglePageAsync(requestOptions), + nextLink -> getCisaCvesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Retrieve a list of CisaCves for the provided search parameters. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of CisaCveResult items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getCisaCvesSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.getCisaCvesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Retrieve a list of CisaCves for the provided search parameters. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of CisaCveResult items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getCisaCves(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> getCisaCvesSinglePage(requestOptions), + nextLink -> getCisaCvesNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Retrieve details of CisaCve by cveId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have + * more than 4 digits. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return cisa cve in a given workspace along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCisaCveWithResponseAsync(String cveId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getCisaCve(this.getEndpoint(), + this.getServiceVersion().getVersion(), cveId, accept, requestOptions, context)); + } + + /** + * Retrieve details of CisaCve by cveId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have + * more than 4 digits. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return cisa cve in a given workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCisaCveWithResponse(String cveId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.cancelTaskSync(this.getEndpoint(), this.getSubscriptionId(), this.getResourceGroupName(), - this.getWorkspaceName(), this.getServiceVersion().getVersion(), taskId, accept, requestOptions, - Context.NONE); + return service.getCisaCveSync(this.getEndpoint(), this.getServiceVersion().getVersion(), cveId, accept, + requestOptions, Context.NONE); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -5240,9 +5896,7 @@ public Response cancelTaskWithResponse(String taskId, RequestOptions
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5257,19 +5911,18 @@ private Mono> listAssetResourceNextSinglePageAsync(Str final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listAssetResourceNext(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, context)) + context -> service.listAssetResourceNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -5296,9 +5949,7 @@ private Mono> listAssetResourceNextSinglePageAsync(Str
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5310,19 +5961,82 @@ private Mono> listAssetResourceNextSinglePageAsync(Str private PagedResponse listAssetResourceNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listAssetResourceNextSync(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, Context.NONE); + = service.listAssetResourceNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     name: String (Required)
+     *     createdAt: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeltaDetailsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getDeltaDetailsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
+     *     name: String (Required)
+     *     createdAt: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getDeltaDetailsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res + = service.getDeltaDetailsNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -5337,9 +6051,7 @@ private PagedResponse listAssetResourceNextSinglePage(String nextLin
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5352,21 +6064,19 @@ private PagedResponse listAssetResourceNextSinglePage(String nextLin private Mono> listDataConnectionNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listDataConnectionNext(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, context)) + return FluxUtil.withContext( + context -> service.listDataConnectionNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -5381,9 +6091,7 @@ private Mono> listDataConnectionNextSinglePageAsync(St
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5395,17 +6103,15 @@ private Mono> listDataConnectionNextSinglePageAsync(St private PagedResponse listDataConnectionNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listDataConnectionNextSync(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, Context.NONE); + = service.listDataConnectionNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -5448,9 +6154,7 @@ private PagedResponse listDataConnectionNextSinglePage(String nextLi
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5464,17 +6168,16 @@ private Mono> listDiscoGroupNextSinglePageAsync(String RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDiscoGroupNext(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, context)) + .withContext( + context -> service.listDiscoGroupNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -5517,9 +6220,7 @@ private Mono> listDiscoGroupNextSinglePageAsync(String
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5531,17 +6232,15 @@ private Mono> listDiscoGroupNextSinglePageAsync(String private PagedResponse listDiscoGroupNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listDiscoGroupNextSync(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, Context.NONE); + = service.listDiscoGroupNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     submittedDate: OffsetDateTime (Optional)
@@ -5565,9 +6264,7 @@ private PagedResponse listDiscoGroupNextSinglePage(String nextLink,
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5580,17 +6277,15 @@ private Mono> listRunsNextSinglePageAsync(String nextL RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listRunsNext(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, context)) + .withContext(context -> service.listRunsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     submittedDate: OffsetDateTime (Optional)
@@ -5614,9 +6309,7 @@ private Mono> listRunsNextSinglePageAsync(String nextL
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5627,17 +6320,16 @@ private Mono> listRunsNextSinglePageAsync(String nextL @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listRunsNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listRunsNextSync(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, Context.NONE); + Response res + = service.listRunsNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5660,9 +6352,7 @@ private PagedResponse listRunsNextSinglePage(String nextLink, Reques
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5677,17 +6367,15 @@ private Mono> listDiscoTemplateNextSinglePageAsync(Str final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listDiscoTemplateNext(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, context)) + context -> service.listDiscoTemplateNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5710,9 +6398,7 @@ private Mono> listDiscoTemplateNextSinglePageAsync(Str
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5724,17 +6410,15 @@ private Mono> listDiscoTemplateNextSinglePageAsync(Str private PagedResponse listDiscoTemplateNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listDiscoTemplateNextSync(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, Context.NONE); + = service.listDiscoTemplateNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -5745,9 +6429,7 @@ private PagedResponse listDiscoTemplateNextSinglePage(String nextLin
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5761,17 +6443,16 @@ private Mono> listSavedFilterNextSinglePageAsync(Strin RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listSavedFilterNext(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, context)) + .withContext( + context -> service.listSavedFilterNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -5782,9 +6463,7 @@ private Mono> listSavedFilterNextSinglePageAsync(Strin
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5796,17 +6475,15 @@ private Mono> listSavedFilterNextSinglePageAsync(Strin private PagedResponse listSavedFilterNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listSavedFilterNextSync(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, Context.NONE); + = service.listSavedFilterNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5822,9 +6499,7 @@ private PagedResponse listSavedFilterNextSinglePage(String nextLink,
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5837,17 +6512,15 @@ private Mono> listTaskNextSinglePageAsync(String nextL RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listTaskNext(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, context)) + .withContext(context -> service.listTaskNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get the next page of items. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5863,9 +6536,7 @@ private Mono> listTaskNextSinglePageAsync(String nextL
      * }
      * }
* - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5876,8 +6547,85 @@ private Mono> listTaskNextSinglePageAsync(String nextL @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listTaskNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listTaskNextSync(nextLink, this.getEndpoint(), this.getSubscriptionId(), - this.getResourceGroupName(), this.getWorkspaceName(), accept, requestOptions, Context.NONE); + Response res + = service.listTaskNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of CisaCveResult items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCisaCvesNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getCisaCvesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     cveId: String (Required)
+     *     vendorProject: String (Required)
+     *     product: String (Required)
+     *     vulnerabilityName: String (Required)
+     *     shortDescription: String (Required)
+     *     requiredAction: String (Required)
+     *     notes: String (Required)
+     *     dateAdded: OffsetDateTime (Required)
+     *     dueDate: OffsetDateTime (Required)
+     *     updatedAt: OffsetDateTime (Required)
+     *     count: long (Required)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of CisaCveResult items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getCisaCvesNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res + = service.getCisaCvesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java new file mode 100644 index 000000000000..c920b7cd6a26 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.implementation.models; + +import com.azure.analytics.defender.easm.models.DiscoSource; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The CreateOrReplaceDiscoGroupRequest model. + */ +@Fluent +public final class CreateOrReplaceDiscoGroupRequest implements JsonSerializable { + /* + * The name for a disco group. + */ + @Generated + private String name; + + /* + * The description for a disco group. + */ + @Generated + private String description; + + /* + * The tier for the disco group which will affect the algorithm used for the disco runs in this group. + */ + @Generated + private String tier; + + /* + * The frequency at which the disco group is supposed to be rerun in milliseconds. + */ + @Generated + private Long frequencyMilliseconds; + + /* + * The list of seeds used for the disco group runs. + */ + @Generated + private List seeds; + + /* + * The list of names used for the disco group runs. + */ + @Generated + private List names; + + /* + * The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. + */ + @Generated + private List excludes; + + /* + * The unique identifier for the disco template used for the disco group creation. + */ + @Generated + private String templateId; + + /** + * Creates an instance of CreateOrReplaceDiscoGroupRequest class. + */ + @Generated + public CreateOrReplaceDiscoGroupRequest() { + } + + /** + * Get the name property: The name for a disco group. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The name for a disco group. + * + * @param name the name value to set. + * @return the CreateOrReplaceDiscoGroupRequest object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: The description for a disco group. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The description for a disco group. + * + * @param description the description value to set. + * @return the CreateOrReplaceDiscoGroupRequest object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupRequest setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in + * this group. + * + * @return the tier value. + */ + @Generated + public String getTier() { + return this.tier; + } + + /** + * Set the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in + * this group. + * + * @param tier the tier value to set. + * @return the CreateOrReplaceDiscoGroupRequest object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupRequest setTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in + * milliseconds. + * + * @return the frequencyMilliseconds value. + */ + @Generated + public Long getFrequencyMilliseconds() { + return this.frequencyMilliseconds; + } + + /** + * Set the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in + * milliseconds. + * + * @param frequencyMilliseconds the frequencyMilliseconds value to set. + * @return the CreateOrReplaceDiscoGroupRequest object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupRequest setFrequencyMilliseconds(Long frequencyMilliseconds) { + this.frequencyMilliseconds = frequencyMilliseconds; + return this; + } + + /** + * Get the seeds property: The list of seeds used for the disco group runs. + * + * @return the seeds value. + */ + @Generated + public List getSeeds() { + return this.seeds; + } + + /** + * Set the seeds property: The list of seeds used for the disco group runs. + * + * @param seeds the seeds value to set. + * @return the CreateOrReplaceDiscoGroupRequest object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupRequest setSeeds(List seeds) { + this.seeds = seeds; + return this; + } + + /** + * Get the names property: The list of names used for the disco group runs. + * + * @return the names value. + */ + @Generated + public List getNames() { + return this.names; + } + + /** + * Set the names property: The list of names used for the disco group runs. + * + * @param names the names value to set. + * @return the CreateOrReplaceDiscoGroupRequest object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupRequest setNames(List names) { + this.names = names; + return this; + } + + /** + * Get the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the + * discovery algorithm. + * + * @return the excludes value. + */ + @Generated + public List getExcludes() { + return this.excludes; + } + + /** + * Set the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the + * discovery algorithm. + * + * @param excludes the excludes value to set. + * @return the CreateOrReplaceDiscoGroupRequest object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupRequest setExcludes(List excludes) { + this.excludes = excludes; + return this; + } + + /** + * Get the templateId property: The unique identifier for the disco template used for the disco group creation. + * + * @return the templateId value. + */ + @Generated + public String getTemplateId() { + return this.templateId; + } + + /** + * Set the templateId property: The unique identifier for the disco template used for the disco group creation. + * + * @param templateId the templateId value to set. + * @return the CreateOrReplaceDiscoGroupRequest object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupRequest setTemplateId(String templateId) { + this.templateId = templateId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("tier", this.tier); + jsonWriter.writeNumberField("frequencyMilliseconds", this.frequencyMilliseconds); + jsonWriter.writeArrayField("seeds", this.seeds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("names", this.names, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("excludes", this.excludes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("templateId", this.templateId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateOrReplaceDiscoGroupRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateOrReplaceDiscoGroupRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CreateOrReplaceDiscoGroupRequest. + */ + @Generated + public static CreateOrReplaceDiscoGroupRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateOrReplaceDiscoGroupRequest deserializedCreateOrReplaceDiscoGroupRequest + = new CreateOrReplaceDiscoGroupRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCreateOrReplaceDiscoGroupRequest.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedCreateOrReplaceDiscoGroupRequest.description = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedCreateOrReplaceDiscoGroupRequest.tier = reader.getString(); + } else if ("frequencyMilliseconds".equals(fieldName)) { + deserializedCreateOrReplaceDiscoGroupRequest.frequencyMilliseconds + = reader.getNullable(JsonReader::getLong); + } else if ("seeds".equals(fieldName)) { + List seeds = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); + deserializedCreateOrReplaceDiscoGroupRequest.seeds = seeds; + } else if ("names".equals(fieldName)) { + List names = reader.readArray(reader1 -> reader1.getString()); + deserializedCreateOrReplaceDiscoGroupRequest.names = names; + } else if ("excludes".equals(fieldName)) { + List excludes = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); + deserializedCreateOrReplaceDiscoGroupRequest.excludes = excludes; + } else if ("templateId".equals(fieldName)) { + deserializedCreateOrReplaceDiscoGroupRequest.templateId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateOrReplaceDiscoGroupRequest; + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java new file mode 100644 index 000000000000..017e4c30a6af --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the data models for Easm. + * Defender EASM discovers and maps your digital attack surface to provide an "outside-in" perspective using probes to + * discover assets. The assets are provided with detailed metadata associated, including vulnerabilities, configurations + * and web components, allowing customers to view and prioritize external risk. The EASM REST API enables you to develop + * clients that integrate with your application. + * + */ +package com.azure.analytics.defender.easm.implementation.models; diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AlexaDetails.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AlexaDetails.java index 67a5ded022f7..488f324e7510 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AlexaDetails.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AlexaDetails.java @@ -5,55 +5,55 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The AlexaDetails model. */ @Immutable -public final class AlexaDetails { +public final class AlexaDetails implements JsonSerializable { /* * The alexaRank property. */ @Generated - @JsonProperty(value = "alexaRank") private Long alexaRank; /* * The category property. */ @Generated - @JsonProperty(value = "category") private String category; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /** @@ -122,4 +122,59 @@ public Long getCount() { public Boolean isRecent() { return this.recent; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("alexaRank", this.alexaRank); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeBooleanField("recent", this.recent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AlexaDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AlexaDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AlexaDetails. + */ + @Generated + public static AlexaDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AlexaDetails deserializedAlexaDetails = new AlexaDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("alexaRank".equals(fieldName)) { + deserializedAlexaDetails.alexaRank = reader.getNullable(JsonReader::getLong); + } else if ("category".equals(fieldName)) { + deserializedAlexaDetails.category = reader.getString(); + } else if ("firstSeen".equals(fieldName)) { + deserializedAlexaDetails.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedAlexaDetails.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedAlexaDetails.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedAlexaDetails.recent = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedAlexaDetails; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAsset.java index 427f99e93c14..4a98868cd93e 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAsset.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAsset.java @@ -5,8 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -19,175 +24,150 @@ public final class AsAsset extends InventoryAsset { * The asn property. */ @Generated - @JsonProperty(value = "asn") private Long asn; /* * The asNames property. */ @Generated - @JsonProperty(value = "asNames") private List asNames; /* * The orgNames property. */ @Generated - @JsonProperty(value = "orgNames") private List orgNames; /* * The orgIds property. */ @Generated - @JsonProperty(value = "orgIds") private List orgIds; /* * The countries property. */ @Generated - @JsonProperty(value = "countries") private List countries; /* * The registries property. */ @Generated - @JsonProperty(value = "registries") private List registries; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The registrarCreatedAt property. */ @Generated - @JsonProperty(value = "registrarCreatedAt") private List registrarCreatedAt; /* * The registrarUpdatedAt property. */ @Generated - @JsonProperty(value = "registrarUpdatedAt") private List registrarUpdatedAt; /* * The registrantContacts property. */ @Generated - @JsonProperty(value = "registrantContacts") private List registrantContacts; /* * The adminContacts property. */ @Generated - @JsonProperty(value = "adminContacts") private List adminContacts; /* * The technicalContacts property. */ @Generated - @JsonProperty(value = "technicalContacts") private List technicalContacts; /* * The registrarNames property. */ @Generated - @JsonProperty(value = "registrarNames") private List registrarNames; /* * The registrantNames property. */ @Generated - @JsonProperty(value = "registrantNames") private List registrantNames; /* * The adminNames property. */ @Generated - @JsonProperty(value = "adminNames") private List adminNames; /* * The technicalNames property. */ @Generated - @JsonProperty(value = "technicalNames") private List technicalNames; /* * The adminOrgs property. */ @Generated - @JsonProperty(value = "adminOrgs") private List adminOrgs; /* * The technicalOrgs property. */ @Generated - @JsonProperty(value = "technicalOrgs") private List technicalOrgs; /* * The registrantPhones property. */ @Generated - @JsonProperty(value = "registrantPhones") private List registrantPhones; /* * The adminPhones property. */ @Generated - @JsonProperty(value = "adminPhones") private List adminPhones; /* * The technicalPhones property. */ @Generated - @JsonProperty(value = "technicalPhones") private List technicalPhones; /* * The detailedFromWhoisAt property. */ @Generated - @JsonProperty(value = "detailedFromWhoisAt") private OffsetDateTime detailedFromWhoisAt; /** @@ -446,4 +426,154 @@ public List getTechnicalPhones() { public OffsetDateTime getDetailedFromWhoisAt() { return this.detailedFromWhoisAt; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("asn", this.asn); + jsonWriter.writeArrayField("asNames", this.asNames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("orgNames", this.orgNames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("orgIds", this.orgIds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("countries", this.countries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registries", this.registries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeArrayField("registrarCreatedAt", this.registrarCreatedAt, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrarUpdatedAt", this.registrarUpdatedAt, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantContacts", this.registrantContacts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminContacts", this.adminContacts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalContacts", this.technicalContacts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrarNames", this.registrarNames, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantNames", this.registrantNames, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminNames", this.adminNames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalNames", this.technicalNames, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminOrgs", this.adminOrgs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalOrgs", this.technicalOrgs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantPhones", this.registrantPhones, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminPhones", this.adminPhones, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalPhones", this.technicalPhones, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("detailedFromWhoisAt", + this.detailedFromWhoisAt == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.detailedFromWhoisAt)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AsAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AsAsset if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the AsAsset. + */ + @Generated + public static AsAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AsAsset deserializedAsAsset = new AsAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("asn".equals(fieldName)) { + deserializedAsAsset.asn = reader.getNullable(JsonReader::getLong); + } else if ("asNames".equals(fieldName)) { + List asNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.asNames = asNames; + } else if ("orgNames".equals(fieldName)) { + List orgNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.orgNames = orgNames; + } else if ("orgIds".equals(fieldName)) { + List orgIds = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.orgIds = orgIds; + } else if ("countries".equals(fieldName)) { + List countries = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.countries = countries; + } else if ("registries".equals(fieldName)) { + List registries = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.registries = registries; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedAsAsset.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedAsAsset.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedAsAsset.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedAsAsset.count = reader.getNullable(JsonReader::getLong); + } else if ("registrarCreatedAt".equals(fieldName)) { + List registrarCreatedAt = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedAsAsset.registrarCreatedAt = registrarCreatedAt; + } else if ("registrarUpdatedAt".equals(fieldName)) { + List registrarUpdatedAt = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedAsAsset.registrarUpdatedAt = registrarUpdatedAt; + } else if ("registrantContacts".equals(fieldName)) { + List registrantContacts + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.registrantContacts = registrantContacts; + } else if ("adminContacts".equals(fieldName)) { + List adminContacts = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.adminContacts = adminContacts; + } else if ("technicalContacts".equals(fieldName)) { + List technicalContacts + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.technicalContacts = technicalContacts; + } else if ("registrarNames".equals(fieldName)) { + List registrarNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.registrarNames = registrarNames; + } else if ("registrantNames".equals(fieldName)) { + List registrantNames + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.registrantNames = registrantNames; + } else if ("adminNames".equals(fieldName)) { + List adminNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.adminNames = adminNames; + } else if ("technicalNames".equals(fieldName)) { + List technicalNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.technicalNames = technicalNames; + } else if ("adminOrgs".equals(fieldName)) { + List adminOrgs = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.adminOrgs = adminOrgs; + } else if ("technicalOrgs".equals(fieldName)) { + List technicalOrgs = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.technicalOrgs = technicalOrgs; + } else if ("registrantPhones".equals(fieldName)) { + List registrantPhones + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.registrantPhones = registrantPhones; + } else if ("adminPhones".equals(fieldName)) { + List adminPhones = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.adminPhones = adminPhones; + } else if ("technicalPhones".equals(fieldName)) { + List technicalPhones + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedAsAsset.technicalPhones = technicalPhones; + } else if ("detailedFromWhoisAt".equals(fieldName)) { + deserializedAsAsset.detailedFromWhoisAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + return deserializedAsAsset; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAssetResource.java index 81d9532f1f23..f63765d6b1a2 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAssetResource.java @@ -5,16 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; /** * The AsAssetResource model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("as") @Immutable public final class AsAssetResource extends AssetResource { @@ -22,8 +24,7 @@ public final class AsAssetResource extends AssetResource { * asset */ @Generated - @JsonProperty(value = "asset") - private AsAsset asset; + private final AsAsset asset; /** * Creates an instance of AsAssetResource class. @@ -31,8 +32,7 @@ public final class AsAssetResource extends AssetResource { * @param asset the asset value to set. */ @Generated - @JsonCreator - private AsAssetResource(@JsonProperty(value = "asset") AsAsset asset) { + private AsAssetResource(AsAsset asset) { this.asset = asset; } @@ -45,4 +45,338 @@ private AsAssetResource(@JsonProperty(value = "asset") AsAsset asset) { public AsAsset getAsset() { return this.asset; } + + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "as"; + + /* + * The caller provided unique name for the resource. + */ + @Generated + private String name; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * Global UUID for the asset. + */ + @Generated + private String uuid; + + /* + * The date this asset was first added to this workspace. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The date this asset was last updated for this workspace. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The state property. + */ + @Generated + private AssetState state; + + /* + * An optional customer provided identifier for this asset. + */ + @Generated + private String externalId; + + /* + * Customer labels assigned to this asset. + */ + @Generated + private List labels; + + /* + * An indicator of whether this asset represents a wildcard rollup of assets on this domain. + */ + @Generated + private Boolean wildcard; + + /* + * The name of the DiscoGroup that brought added this asset to the workspace. + */ + @Generated + private String discoGroupName; + + /* + * The history of how this asset was pulled into the workspace through the discovery process. + */ + @Generated + private List auditTrail; + + /* + * The reason property. + */ + @Generated + private String reason; + + /** + * Get the kind property: Discriminator property for AssetResource. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + @Override + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the uuid property: Global UUID for the asset. + * + * @return the uuid value. + */ + @Generated + @Override + public String getUuid() { + return this.uuid; + } + + /** + * Get the createdDate property: The date this asset was first added to this workspace. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the updatedDate property: The date this asset was last updated for this workspace. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + @Generated + @Override + public AssetState getState() { + return this.state; + } + + /** + * Get the externalId property: An optional customer provided identifier for this asset. + * + * @return the externalId value. + */ + @Generated + @Override + public String getExternalId() { + return this.externalId; + } + + /** + * Get the labels property: Customer labels assigned to this asset. + * + * @return the labels value. + */ + @Generated + @Override + public List getLabels() { + return this.labels; + } + + /** + * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. + * + * @return the wildcard value. + */ + @Generated + @Override + public Boolean isWildcard() { + return this.wildcard; + } + + /** + * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * + * @return the discoGroupName value. + */ + @Generated + @Override + public String getDiscoGroupName() { + return this.discoGroupName; + } + + /** + * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. + * + * @return the auditTrail value. + */ + @Generated + @Override + public List getAuditTrail() { + return this.auditTrail; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + @Override + public String getReason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("uuid", getUuid()); + jsonWriter.writeStringField("createdDate", + getCreatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCreatedDate())); + jsonWriter.writeStringField("updatedDate", + getUpdatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getUpdatedDate())); + jsonWriter.writeStringField("state", getState() == null ? null : getState().toString()); + jsonWriter.writeStringField("externalId", getExternalId()); + jsonWriter.writeArrayField("labels", getLabels(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("wildcard", isWildcard()); + jsonWriter.writeStringField("discoGroupName", getDiscoGroupName()); + jsonWriter.writeArrayField("auditTrail", getAuditTrail(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reason", getReason()); + jsonWriter.writeJsonField("asset", this.asset); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AsAssetResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AsAssetResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AsAssetResource. + */ + @Generated + public static AsAssetResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String displayName = null; + String uuid = null; + OffsetDateTime createdDate = null; + OffsetDateTime updatedDate = null; + AssetState state = null; + String externalId = null; + List labels = null; + Boolean wildcard = null; + String discoGroupName = null; + List auditTrail = null; + String reason = null; + AsAsset asset = null; + String kind = "as"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("uuid".equals(fieldName)) { + uuid = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + state = AssetState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + labels = reader.readArray(reader1 -> reader1.getString()); + } else if ("wildcard".equals(fieldName)) { + wildcard = reader.getNullable(JsonReader::getBoolean); + } else if ("discoGroupName".equals(fieldName)) { + discoGroupName = reader.getString(); + } else if ("auditTrail".equals(fieldName)) { + auditTrail = reader.readArray(reader1 -> AuditTrailItem.fromJson(reader1)); + } else if ("reason".equals(fieldName)) { + reason = reader.getString(); + } else if ("asset".equals(fieldName)) { + asset = AsAsset.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + AsAssetResource deserializedAsAssetResource = new AsAssetResource(asset); + deserializedAsAssetResource.setId(id); + deserializedAsAssetResource.name = name; + deserializedAsAssetResource.displayName = displayName; + deserializedAsAssetResource.uuid = uuid; + deserializedAsAssetResource.createdDate = createdDate; + deserializedAsAssetResource.updatedDate = updatedDate; + deserializedAsAssetResource.state = state; + deserializedAsAssetResource.externalId = externalId; + deserializedAsAssetResource.labels = labels; + deserializedAsAssetResource.wildcard = wildcard; + deserializedAsAssetResource.discoGroupName = discoGroupName; + deserializedAsAssetResource.auditTrail = auditTrail; + deserializedAsAssetResource.reason = reason; + deserializedAsAssetResource.kind = kind; + return deserializedAsAssetResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainKindSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainKindSummaryResult.java new file mode 100644 index 000000000000..87def650d21c --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainKindSummaryResult.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A list of asset chain summaries per asset kind. + */ +@Immutable +public final class AssetChainKindSummaryResult implements JsonSerializable { + /* + * The kind of asset + */ + @Generated + private final AssetKind kind; + + /* + * The amount of assets affected for a given asset kind + */ + @Generated + private final long affectedCount; + + /** + * Creates an instance of AssetChainKindSummaryResult class. + * + * @param kind the kind value to set. + * @param affectedCount the affectedCount value to set. + */ + @Generated + private AssetChainKindSummaryResult(AssetKind kind, long affectedCount) { + this.kind = kind; + this.affectedCount = affectedCount; + } + + /** + * Get the kind property: The kind of asset. + * + * @return the kind value. + */ + @Generated + public AssetKind getKind() { + return this.kind; + } + + /** + * Get the affectedCount property: The amount of assets affected for a given asset kind. + * + * @return the affectedCount value. + */ + @Generated + public long getAffectedCount() { + return this.affectedCount; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeLongField("affectedCount", this.affectedCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetChainKindSummaryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetChainKindSummaryResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssetChainKindSummaryResult. + */ + @Generated + public static AssetChainKindSummaryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetKind kind = null; + long affectedCount = 0L; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + kind = AssetKind.fromString(reader.getString()); + } else if ("affectedCount".equals(fieldName)) { + affectedCount = reader.getLong(); + } else { + reader.skipChildren(); + } + } + return new AssetChainKindSummaryResult(kind, affectedCount); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainRequest.java new file mode 100644 index 000000000000..a3b8f293ed71 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainRequest.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * AssetChainRequest containing information needed for the retrieval of the asset chain summary. + */ +@Immutable +public final class AssetChainRequest implements JsonSerializable { + /* + * Asset chain source. + */ + @Generated + private final AssetChainSource assetChainSource; + + /* + * A collection of asset chain source ids. + */ + @Generated + private final List sourceIds; + + /** + * Creates an instance of AssetChainRequest class. + * + * @param assetChainSource the assetChainSource value to set. + * @param sourceIds the sourceIds value to set. + */ + @Generated + public AssetChainRequest(AssetChainSource assetChainSource, List sourceIds) { + this.assetChainSource = assetChainSource; + this.sourceIds = sourceIds; + } + + /** + * Get the assetChainSource property: Asset chain source. + * + * @return the assetChainSource value. + */ + @Generated + public AssetChainSource getAssetChainSource() { + return this.assetChainSource; + } + + /** + * Get the sourceIds property: A collection of asset chain source ids. + * + * @return the sourceIds value. + */ + @Generated + public List getSourceIds() { + return this.sourceIds; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("assetChainSource", + this.assetChainSource == null ? null : this.assetChainSource.toString()); + jsonWriter.writeArrayField("sourceIds", this.sourceIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetChainRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetChainRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssetChainRequest. + */ + @Generated + public static AssetChainRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetChainSource assetChainSource = null; + List sourceIds = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assetChainSource".equals(fieldName)) { + assetChainSource = AssetChainSource.fromString(reader.getString()); + } else if ("sourceIds".equals(fieldName)) { + sourceIds = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new AssetChainRequest(assetChainSource, sourceIds); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSource.java new file mode 100644 index 000000000000..9f7c5b9ec8b6 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSource.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A list of asset chain sources. + */ +public final class AssetChainSource extends ExpandableStringEnum { + /** + * discovery group. + */ + @Generated + public static final AssetChainSource DISCO_GROUP = fromString("DISCO_GROUP"); + + /** + * asset. + */ + @Generated + public static final AssetChainSource ASSET = fromString("ASSET"); + + /** + * Creates a new instance of AssetChainSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AssetChainSource() { + } + + /** + * Creates or finds a AssetChainSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetChainSource. + */ + @Generated + public static AssetChainSource fromString(String name) { + return fromString(name, AssetChainSource.class); + } + + /** + * Gets known AssetChainSource values. + * + * @return known AssetChainSource values. + */ + @Generated + public static Collection values() { + return values(AssetChainSource.class); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSummaryResult.java new file mode 100644 index 000000000000..ae441bc42ca3 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSummaryResult.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Response for the asset chain summary. + */ +@Immutable +public final class AssetChainSummaryResult implements JsonSerializable { + /* + * A list of asset chain summaries per asset kind + */ + @Generated + private final List affectedAssetsSummary; + + /* + * A list of disco group summaries + */ + @Generated + private final List affectedGroupsSummary; + + /* + * The list of exceptions + */ + @Generated + private List errors; + + /** + * Creates an instance of AssetChainSummaryResult class. + * + * @param affectedAssetsSummary the affectedAssetsSummary value to set. + * @param affectedGroupsSummary the affectedGroupsSummary value to set. + */ + @Generated + private AssetChainSummaryResult(List affectedAssetsSummary, + List affectedGroupsSummary) { + this.affectedAssetsSummary = affectedAssetsSummary; + this.affectedGroupsSummary = affectedGroupsSummary; + } + + /** + * Get the affectedAssetsSummary property: A list of asset chain summaries per asset kind. + * + * @return the affectedAssetsSummary value. + */ + @Generated + public List getAffectedAssetsSummary() { + return this.affectedAssetsSummary; + } + + /** + * Get the affectedGroupsSummary property: A list of disco group summaries. + * + * @return the affectedGroupsSummary value. + */ + @Generated + public List getAffectedGroupsSummary() { + return this.affectedGroupsSummary; + } + + /** + * Get the errors property: The list of exceptions. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("affectedAssetsSummary", this.affectedAssetsSummary, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("affectedGroupsSummary", this.affectedGroupsSummary, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetChainSummaryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetChainSummaryResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssetChainSummaryResult. + */ + @Generated + public static AssetChainSummaryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List affectedAssetsSummary = null; + List affectedGroupsSummary = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("affectedAssetsSummary".equals(fieldName)) { + affectedAssetsSummary = reader.readArray(reader1 -> AssetChainKindSummaryResult.fromJson(reader1)); + } else if ("affectedGroupsSummary".equals(fieldName)) { + affectedGroupsSummary = reader.readArray(reader1 -> DiscoGroupSummaryResult.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> ErrorResponse.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AssetChainSummaryResult deserializedAssetChainSummaryResult + = new AssetChainSummaryResult(affectedAssetsSummary, affectedGroupsSummary); + deserializedAssetChainSummaryResult.errors = errors; + + return deserializedAssetChainSummaryResult; + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetKind.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetKind.java new file mode 100644 index 000000000000..2506067282e0 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetKind.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of asset. + */ +public final class AssetKind extends ExpandableStringEnum { + /** + * Static value as for AssetKind. + */ + @Generated + public static final AssetKind AS = fromString("as"); + + /** + * Static value contact for AssetKind. + */ + @Generated + public static final AssetKind CONTACT = fromString("contact"); + + /** + * Static value domain for AssetKind. + */ + @Generated + public static final AssetKind DOMAIN = fromString("domain"); + + /** + * Static value host for AssetKind. + */ + @Generated + public static final AssetKind HOST = fromString("host"); + + /** + * Static value ipAddress for AssetKind. + */ + @Generated + public static final AssetKind IP_ADDRESS = fromString("ipAddress"); + + /** + * Static value ipBlock for AssetKind. + */ + @Generated + public static final AssetKind IP_BLOCK = fromString("ipBlock"); + + /** + * Static value page for AssetKind. + */ + @Generated + public static final AssetKind PAGE = fromString("page"); + + /** + * Static value sslCert for AssetKind. + */ + @Generated + public static final AssetKind SSL_CERT = fromString("sslCert"); + + /** + * Creates a new instance of AssetKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AssetKind() { + } + + /** + * Creates or finds a AssetKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetKind. + */ + @Generated + public static AssetKind fromString(String name) { + return fromString(name, AssetKind.class); + } + + /** + * Gets known AssetKind values. + * + * @return known AssetKind values. + */ + @Generated + public static Collection values() { + return values(AssetKind.class); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetPageResult.java index 019921235e94..0bd33a569564 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetPageResult.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetPageResult.java @@ -5,41 +5,41 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The page of assets that match the provided metric. */ @Immutable -public final class AssetPageResult { +public final class AssetPageResult implements JsonSerializable { /* * The total number of items available in the full result set. */ @Generated - @JsonProperty(value = "totalElements") private Long totalElements; /* * The cursor mark to be used on the next request. Not set if using paging. */ @Generated - @JsonProperty(value = "mark") private String mark; /* * The link to access the next page of results. Not set if at the end of the result set. */ @Generated - @JsonProperty(value = "nextLink") private String nextLink; /* * The items in the current page of results. */ @Generated - @JsonProperty(value = "value") private List value; /** @@ -70,8 +70,7 @@ public String getMark() { } /** - * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result - * set. + * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result set. * * @return the nextLink value. */ @@ -89,4 +88,50 @@ public String getNextLink() { public List getValue() { return this.value; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("totalElements", this.totalElements); + jsonWriter.writeStringField("mark", this.mark); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetPageResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetPageResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssetPageResult. + */ + @Generated + public static AssetPageResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetPageResult deserializedAssetPageResult = new AssetPageResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("totalElements".equals(fieldName)) { + deserializedAssetPageResult.totalElements = reader.getNullable(JsonReader::getLong); + } else if ("mark".equals(fieldName)) { + deserializedAssetPageResult.mark = reader.getString(); + } else if ("nextLink".equals(fieldName)) { + deserializedAssetPageResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AssetResource.fromJson(reader1)); + deserializedAssetPageResult.value = value; + } else { + reader.skipChildren(); + } + } + return deserializedAssetPageResult; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java index 7bf8970da840..9bff56883a00 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java @@ -5,123 +5,98 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The items in the current page of results. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = AssetResource.class) -@JsonTypeName("AssetResource") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "as", value = AsAssetResource.class), - @JsonSubTypes.Type(name = "contact", value = ContactAssetResource.class), - @JsonSubTypes.Type(name = "domain", value = DomainAssetResource.class), - @JsonSubTypes.Type(name = "host", value = HostAssetResource.class), - @JsonSubTypes.Type(name = "ipAddress", value = IpAddressAssetResource.class), - @JsonSubTypes.Type(name = "ipBlock", value = IpBlockAssetResource.class), - @JsonSubTypes.Type(name = "page", value = PageAssetResource.class), - @JsonSubTypes.Type(name = "sslCert", value = SslCertAssetResource.class) }) @Immutable -public class AssetResource { +public class AssetResource implements JsonSerializable { /* * The system generated unique id for the resource. */ @Generated - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The caller provided unique name for the resource. */ @Generated - @JsonProperty(value = "name") private String name; /* * The name that can be used for display purposes. */ @Generated - @JsonProperty(value = "displayName") private String displayName; /* * Global UUID for the asset. */ @Generated - @JsonProperty(value = "uuid") private String uuid; /* * The date this asset was first added to this workspace. */ @Generated - @JsonProperty(value = "createdDate") private OffsetDateTime createdDate; /* * The date this asset was last updated for this workspace. */ @Generated - @JsonProperty(value = "updatedDate") private OffsetDateTime updatedDate; /* * The state property. */ @Generated - @JsonProperty(value = "state") private AssetState state; /* * An optional customer provided identifier for this asset. */ @Generated - @JsonProperty(value = "externalId") private String externalId; /* * Customer labels assigned to this asset. */ @Generated - @JsonProperty(value = "labels") private List labels; /* * An indicator of whether this asset represents a wildcard rollup of assets on this domain. */ @Generated - @JsonProperty(value = "wildcard") private Boolean wildcard; /* * The name of the DiscoGroup that brought added this asset to the workspace. */ @Generated - @JsonProperty(value = "discoGroupName") private String discoGroupName; /* * The history of how this asset was pulled into the workspace through the discovery process. */ @Generated - @JsonProperty(value = "auditTrail") private List auditTrail; /* * The reason property. */ @Generated - @JsonProperty(value = "reason") private String reason; /** @@ -262,4 +237,300 @@ public List getAuditTrail() { public String getReason() { return this.reason; } + + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "AssetResource"; + + /** + * Get the kind property: Discriminator property for AssetResource. + * + * @return the kind value. + */ + @Generated + public String getKind() { + return this.kind; + } + + /** + * Set the id property: The system generated unique id for the resource. + * + * @param id the id value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setId(String id) { + this.id = id; + return this; + } + + /** + * Set the name property: The caller provided unique name for the resource. + * + * @param name the name value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setName(String name) { + this.name = name; + return this; + } + + /** + * Set the displayName property: The name that can be used for display purposes. + * + * @param displayName the displayName value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Set the uuid property: Global UUID for the asset. + * + * @param uuid the uuid value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setUuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Set the createdDate property: The date this asset was first added to this workspace. + * + * @param createdDate the createdDate value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Set the updatedDate property: The date this asset was last updated for this workspace. + * + * @param updatedDate the updatedDate value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setUpdatedDate(OffsetDateTime updatedDate) { + this.updatedDate = updatedDate; + return this; + } + + /** + * Set the state property: The state property. + * + * @param state the state value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setState(AssetState state) { + this.state = state; + return this; + } + + /** + * Set the externalId property: An optional customer provided identifier for this asset. + * + * @param externalId the externalId value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setExternalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Set the labels property: Customer labels assigned to this asset. + * + * @param labels the labels value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Set the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. + * + * @param wildcard the wildcard value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setWildcard(Boolean wildcard) { + this.wildcard = wildcard; + return this; + } + + /** + * Set the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * + * @param discoGroupName the discoGroupName value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setDiscoGroupName(String discoGroupName) { + this.discoGroupName = discoGroupName; + return this; + } + + /** + * Set the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. + * + * @param auditTrail the auditTrail value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setAuditTrail(List auditTrail) { + this.auditTrail = auditTrail; + return this; + } + + /** + * Set the reason property: The reason property. + * + * @param reason the reason value to set. + * @return the AssetResource object itself. + */ + @Generated + AssetResource setReason(String reason) { + this.reason = reason; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("uuid", this.uuid); + jsonWriter.writeStringField("createdDate", + this.createdDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDate)); + jsonWriter.writeStringField("updatedDate", + this.updatedDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedDate)); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("externalId", this.externalId); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("wildcard", this.wildcard); + jsonWriter.writeStringField("discoGroupName", this.discoGroupName); + jsonWriter.writeArrayField("auditTrail", this.auditTrail, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reason", this.reason); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssetResource. + */ + @Generated + public static AssetResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("as".equals(discriminatorValue)) { + return AsAssetResource.fromJson(readerToUse.reset()); + } else if ("contact".equals(discriminatorValue)) { + return ContactAssetResource.fromJson(readerToUse.reset()); + } else if ("domain".equals(discriminatorValue)) { + return DomainAssetResource.fromJson(readerToUse.reset()); + } else if ("host".equals(discriminatorValue)) { + return HostAssetResource.fromJson(readerToUse.reset()); + } else if ("ipAddress".equals(discriminatorValue)) { + return IpAddressAssetResource.fromJson(readerToUse.reset()); + } else if ("ipBlock".equals(discriminatorValue)) { + return IpBlockAssetResource.fromJson(readerToUse.reset()); + } else if ("page".equals(discriminatorValue)) { + return PageAssetResource.fromJson(readerToUse.reset()); + } else if ("sslCert".equals(discriminatorValue)) { + return SslCertAssetResource.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static AssetResource fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetResource deserializedAssetResource = new AssetResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedAssetResource.id = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedAssetResource.kind = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAssetResource.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAssetResource.displayName = reader.getString(); + } else if ("uuid".equals(fieldName)) { + deserializedAssetResource.uuid = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + deserializedAssetResource.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + deserializedAssetResource.updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedAssetResource.state = AssetState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + deserializedAssetResource.externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + List labels = reader.readArray(reader1 -> reader1.getString()); + deserializedAssetResource.labels = labels; + } else if ("wildcard".equals(fieldName)) { + deserializedAssetResource.wildcard = reader.getNullable(JsonReader::getBoolean); + } else if ("discoGroupName".equals(fieldName)) { + deserializedAssetResource.discoGroupName = reader.getString(); + } else if ("auditTrail".equals(fieldName)) { + List auditTrail = reader.readArray(reader1 -> AuditTrailItem.fromJson(reader1)); + deserializedAssetResource.auditTrail = auditTrail; + } else if ("reason".equals(fieldName)) { + deserializedAssetResource.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedAssetResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResponseType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResponseType.java new file mode 100644 index 000000000000..1f951abcaa86 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResponseType.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A list of asset response type. + */ +public final class AssetResponseType extends ExpandableStringEnum { + /** + * Return only the asset id. + */ + @Generated + public static final AssetResponseType ID = fromString("id"); + + /** + * Return the standard set of asset fields. + */ + @Generated + public static final AssetResponseType STANDARD = fromString("standard"); + + /** + * Return the full set of asset fields. + */ + @Generated + public static final AssetResponseType FULL = fromString("full"); + + /** + * Return a reduced set of fields. + */ + @Generated + public static final AssetResponseType REDUCED = fromString("reduced"); + + /** + * Creates a new instance of AssetResponseType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AssetResponseType() { + } + + /** + * Creates or finds a AssetResponseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetResponseType. + */ + @Generated + public static AssetResponseType fromString(String name) { + return fromString(name, AssetResponseType.class); + } + + /** + * Gets known AssetResponseType values. + * + * @return known AssetResponseType values. + */ + @Generated + public static Collection values() { + return values(AssetResponseType.class); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSecurityPolicy.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSecurityPolicy.java index aa705072f186..ddeccd599d67 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSecurityPolicy.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSecurityPolicy.java @@ -5,70 +5,68 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The AssetSecurityPolicy model. */ @Immutable -public final class AssetSecurityPolicy { +public final class AssetSecurityPolicy implements JsonSerializable { /* * The policyName property. */ @Generated - @JsonProperty(value = "policyName") private String policyName; /* * The isAffected property. */ @Generated - @JsonProperty(value = "isAffected") private Boolean isAffected; /* * The description property. */ @Generated - @JsonProperty(value = "description") private String description; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /** @@ -157,4 +155,66 @@ public Boolean isRecent() { public List getSources() { return this.sources; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("policyName", this.policyName); + jsonWriter.writeBooleanField("isAffected", this.isAffected); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeBooleanField("recent", this.recent); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetSecurityPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetSecurityPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssetSecurityPolicy. + */ + @Generated + public static AssetSecurityPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetSecurityPolicy deserializedAssetSecurityPolicy = new AssetSecurityPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("policyName".equals(fieldName)) { + deserializedAssetSecurityPolicy.policyName = reader.getString(); + } else if ("isAffected".equals(fieldName)) { + deserializedAssetSecurityPolicy.isAffected = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + deserializedAssetSecurityPolicy.description = reader.getString(); + } else if ("firstSeen".equals(fieldName)) { + deserializedAssetSecurityPolicy.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedAssetSecurityPolicy.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedAssetSecurityPolicy.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedAssetSecurityPolicy.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedAssetSecurityPolicy.sources = sources; + } else { + reader.skipChildren(); + } + } + return deserializedAssetSecurityPolicy; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetState.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetState.java index bd60827d2ea0..389dd79f1e5f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetState.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetState.java @@ -5,11 +5,10 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * Defines values for AssetState. + * The state of assets. */ public final class AssetState extends ExpandableStringEnum { @@ -72,7 +71,6 @@ public AssetState() { * @return the corresponding AssetState. */ @Generated - @JsonCreator public static AssetState fromString(String name) { return fromString(name, AssetState.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSummaryResult.java index ba753567496a..f0d9f827e2cc 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSummaryResult.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSummaryResult.java @@ -5,29 +5,33 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The collection of asset summaries. */ @Immutable -public final class AssetSummaryResult { +public final class AssetSummaryResult implements JsonSerializable { /* * The name of the summary response. Depending on the request time this will either be the asset filter, risk * category, or risk metric. */ @Generated - @JsonProperty(value = "displayName") private String displayName; /* * The description of the summary response. Filters don't have a description. */ @Generated - @JsonProperty(value = "description") private String description; /* @@ -35,57 +39,49 @@ public final class AssetSummaryResult { * which always pull the live asset data. */ @Generated - @JsonProperty(value = "updatedAt") private OffsetDateTime updatedAt; /* * If the request is for a metric category, this will contain the requested unique category name. */ @Generated - @JsonProperty(value = "metricCategory") private String metricCategory; /* * If the request is for a metric, this will contain the requested unique metric name. */ @Generated - @JsonProperty(value = "metric") private String metric; /* * If the request is for an asset filter, this will contain the corresponding filter. */ @Generated - @JsonProperty(value = "filter") private String filter; /* * An optional label used to filter requests results. */ @Generated - @JsonProperty(value = "labelName") private String labelName; /* * The count of assets matching the request parameters. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The link to the corresponding asset details. */ @Generated - @JsonProperty(value = "link") private String link; /* - * The corresponding child entities. For metric categories this will contain metrics. For filters with groupBy - * and segmentBy this will contain facets. + * The corresponding child entities. For metric categories this will contain metrics. For filters with groupBy and + * segmentBy this will contain facets. */ @Generated - @JsonProperty(value = "children") private List children; /** @@ -96,8 +92,8 @@ private AssetSummaryResult() { } /** - * Get the displayName property: The name of the summary response. Depending on the request time this will either - * be the asset filter, risk category, or risk metric. + * Get the displayName property: The name of the summary response. Depending on the request time this will either be + * the asset filter, risk category, or risk metric. * * @return the displayName value. */ @@ -189,8 +185,8 @@ public String getLink() { } /** - * Get the children property: The corresponding child entities. For metric categories this will contain metrics. - * For filters with groupBy and segmentBy this will contain facets. + * Get the children property: The corresponding child entities. For metric categories this will contain metrics. For + * filters with groupBy and segmentBy this will contain facets. * * @return the children value. */ @@ -198,4 +194,71 @@ public String getLink() { public List getChildren() { return this.children; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("updatedAt", + this.updatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedAt)); + jsonWriter.writeStringField("metricCategory", this.metricCategory); + jsonWriter.writeStringField("metric", this.metric); + jsonWriter.writeStringField("filter", this.filter); + jsonWriter.writeStringField("labelName", this.labelName); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeStringField("link", this.link); + jsonWriter.writeArrayField("children", this.children, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetSummaryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetSummaryResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssetSummaryResult. + */ + @Generated + public static AssetSummaryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetSummaryResult deserializedAssetSummaryResult = new AssetSummaryResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("displayName".equals(fieldName)) { + deserializedAssetSummaryResult.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAssetSummaryResult.description = reader.getString(); + } else if ("updatedAt".equals(fieldName)) { + deserializedAssetSummaryResult.updatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("metricCategory".equals(fieldName)) { + deserializedAssetSummaryResult.metricCategory = reader.getString(); + } else if ("metric".equals(fieldName)) { + deserializedAssetSummaryResult.metric = reader.getString(); + } else if ("filter".equals(fieldName)) { + deserializedAssetSummaryResult.filter = reader.getString(); + } else if ("labelName".equals(fieldName)) { + deserializedAssetSummaryResult.labelName = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedAssetSummaryResult.count = reader.getNullable(JsonReader::getLong); + } else if ("link".equals(fieldName)) { + deserializedAssetSummaryResult.link = reader.getString(); + } else if ("children".equals(fieldName)) { + List children + = reader.readArray(reader1 -> AssetSummaryResult.fromJson(reader1)); + deserializedAssetSummaryResult.children = children; + } else { + reader.skipChildren(); + } + } + return deserializedAssetSummaryResult; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateData.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateData.java index d27f26c9310d..850b3a7de96f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateData.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateData.java @@ -5,41 +5,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * A request body used to update an asset. */ @Fluent -public final class AssetUpdateData { +public final class AssetUpdateData implements JsonSerializable { /* * The state to update the asset to. */ @Generated - @JsonProperty(value = "state") private AssetUpdateState state; /* * A string which can be used to identify the asset in external systems. */ @Generated - @JsonProperty(value = "externalId") private String externalId; /* * Any Labels to update the asset with. */ @Generated - @JsonProperty(value = "labels") private Map labels; /* * A list of asset types to cascade the updates to. */ @Generated - @JsonProperty(value = "transfers") private AssetUpdateTransfers transfers; /** @@ -136,4 +136,50 @@ public AssetUpdateData setTransfers(AssetUpdateTransfers transfers) { this.transfers = transfers; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("externalId", this.externalId); + jsonWriter.writeMapField("labels", this.labels, (writer, element) -> writer.writeBoolean(element)); + jsonWriter.writeStringField("transfers", this.transfers == null ? null : this.transfers.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetUpdateData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetUpdateData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssetUpdateData. + */ + @Generated + public static AssetUpdateData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssetUpdateData deserializedAssetUpdateData = new AssetUpdateData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("state".equals(fieldName)) { + deserializedAssetUpdateData.state = AssetUpdateState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + deserializedAssetUpdateData.externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + Map labels = reader.readMap(reader1 -> reader1.getBoolean()); + deserializedAssetUpdateData.labels = labels; + } else if ("transfers".equals(fieldName)) { + deserializedAssetUpdateData.transfers = AssetUpdateTransfers.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedAssetUpdateData; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateState.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateState.java index f2bdbfb6ba55..eb0205b568e3 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateState.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateState.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -66,7 +65,6 @@ public AssetUpdateState() { * @return the corresponding AssetUpdateState. */ @Generated - @JsonCreator public static AssetUpdateState fromString(String name) { return fromString(name, AssetUpdateState.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateTransfers.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateTransfers.java index ec7a59c65406..4a36b740b8d4 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateTransfers.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateTransfers.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -78,7 +77,6 @@ public AssetUpdateTransfers() { * @return the corresponding AssetUpdateTransfers. */ @Generated - @JsonCreator public static AssetUpdateTransfers fromString(String name) { return fromString(name, AssetUpdateTransfers.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetsExportRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetsExportRequest.java new file mode 100644 index 000000000000..7f8b54b5d94b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetsExportRequest.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A request body used to export an asset. + */ +@Immutable +public final class AssetsExportRequest implements JsonSerializable { + /* + * The name of the file to export. + */ + @Generated + private final String fileName; + + /* + * The columns to export. + */ + @Generated + private final List columns; + + /** + * Creates an instance of AssetsExportRequest class. + * + * @param fileName the fileName value to set. + * @param columns the columns value to set. + */ + @Generated + public AssetsExportRequest(String fileName, List columns) { + this.fileName = fileName; + this.columns = columns; + } + + /** + * Get the fileName property: The name of the file to export. + * + * @return the fileName value. + */ + @Generated + public String getFileName() { + return this.fileName; + } + + /** + * Get the columns property: The columns to export. + * + * @return the columns value. + */ + @Generated + public List getColumns() { + return this.columns; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fileName", this.fileName); + jsonWriter.writeArrayField("columns", this.columns, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetsExportRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetsExportRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssetsExportRequest. + */ + @Generated + public static AssetsExportRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String fileName = null; + List columns = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileName".equals(fieldName)) { + fileName = reader.getString(); + } else if ("columns".equals(fieldName)) { + columns = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new AssetsExportRequest(fileName, columns); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Attribute.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Attribute.java index 921cdcc68fe0..308b352df358 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Attribute.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Attribute.java @@ -5,63 +5,62 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The Attribute model. */ @Immutable -public final class Attribute { +public final class Attribute implements JsonSerializable { /* * The attributeType property. */ @Generated - @JsonProperty(value = "attributeType") private String attributeType; /* * The attributeValue property. */ @Generated - @JsonProperty(value = "attributeValue") private String attributeValue; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /** @@ -140,4 +139,63 @@ public Long getCount() { public Boolean isRecent() { return this.recent; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeType", this.attributeType); + jsonWriter.writeStringField("attributeValue", this.attributeValue); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeBooleanField("recent", this.recent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Attribute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Attribute if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Attribute. + */ + @Generated + public static Attribute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Attribute deserializedAttribute = new Attribute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("attributeType".equals(fieldName)) { + deserializedAttribute.attributeType = reader.getString(); + } else if ("attributeValue".equals(fieldName)) { + deserializedAttribute.attributeValue = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedAttribute.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedAttribute.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedAttribute.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedAttribute.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedAttribute.recent = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedAttribute; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItem.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItem.java index e571af178c4b..384256a412bf 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItem.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItem.java @@ -5,47 +5,46 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The history of how this asset was pulled into the workspace through the discovery process. */ @Immutable -public final class AuditTrailItem { +public final class AuditTrailItem implements JsonSerializable { /* * The system generated unique id for the resource. */ @Generated - @JsonProperty(value = "id") private String id; /* * The caller provided unique name for the resource. */ @Generated - @JsonProperty(value = "name") private String name; /* * The name that can be used for display purposes. */ @Generated - @JsonProperty(value = "displayName") private String displayName; /* * The kind of asset. */ @Generated - @JsonProperty(value = "kind") private AuditTrailItemKind kind; /* * An explanation of why this audit trail node was discovered from the previous node. */ @Generated - @JsonProperty(value = "reason") private String reason; /** @@ -104,4 +103,52 @@ public AuditTrailItemKind getKind() { public String getReason() { return this.reason; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("reason", this.reason); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuditTrailItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuditTrailItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AuditTrailItem. + */ + @Generated + public static AuditTrailItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuditTrailItem deserializedAuditTrailItem = new AuditTrailItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedAuditTrailItem.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAuditTrailItem.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAuditTrailItem.displayName = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedAuditTrailItem.kind = AuditTrailItemKind.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedAuditTrailItem.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedAuditTrailItem; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItemKind.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItemKind.java index b3f3ec86f3a7..4b91f030eae8 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItemKind.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItemKind.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -78,7 +77,6 @@ public AuditTrailItemKind() { * @return the corresponding AuditTrailItemKind. */ @Generated - @JsonCreator public static AuditTrailItemKind fromString(String name) { return fromString(name, AuditTrailItemKind.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnection.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnection.java index 9f8708af8d75..853718455b22 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnection.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnection.java @@ -5,16 +5,16 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; /** * The AzureDataExplorerDataConnection model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("azureDataExplorer") @Immutable public final class AzureDataExplorerDataConnection extends DataConnection { @@ -22,8 +22,7 @@ public final class AzureDataExplorerDataConnection extends DataConnection { * properties */ @Generated - @JsonProperty(value = "properties") - private AzureDataExplorerDataConnectionProperties properties; + private final AzureDataExplorerDataConnectionProperties properties; /** * Creates an instance of AzureDataExplorerDataConnection class. @@ -31,9 +30,7 @@ public final class AzureDataExplorerDataConnection extends DataConnection { * @param properties the properties value to set. */ @Generated - @JsonCreator - private AzureDataExplorerDataConnection( - @JsonProperty(value = "properties") AzureDataExplorerDataConnectionProperties properties) { + private AzureDataExplorerDataConnection(AzureDataExplorerDataConnectionProperties properties) { this.properties = properties; } @@ -46,4 +43,288 @@ private AzureDataExplorerDataConnection( public AzureDataExplorerDataConnectionProperties getProperties() { return this.properties; } + + /* + * Discriminator property for DataConnection. + */ + @Generated + private String kind = "azureDataExplorer"; + + /* + * The system generated unique id for the resource. + */ + @Generated + private String id; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * The type of data the data connection will transfer + */ + @Generated + private DataConnectionContent content; + + /* + * The date the data connection was created. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The rate at which the data connection will receive updates. + */ + @Generated + private DataConnectionFrequency frequency; + + /* + * The day to update the data connection on. + */ + @Generated + private Integer frequencyOffset; + + /* + * The date the data connection was last updated. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The date the data connection was last updated by user. + */ + @Generated + private OffsetDateTime userUpdatedAt; + + /* + * An indicator of whether the data connection is active. + */ + @Generated + private Boolean active; + + /* + * A message that specifies details about data connection if inactive. + */ + @Generated + private String inactiveMessage; + + /** + * Get the kind property: Discriminator property for DataConnection. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the id property: The system generated unique id for the resource. + * + * @return the id value. + */ + @Generated + @Override + public String getId() { + return this.id; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the content property: The type of data the data connection will transfer. + * + * @return the content value. + */ + @Generated + @Override + public DataConnectionContent getContent() { + return this.content; + } + + /** + * Get the createdDate property: The date the data connection was created. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the frequency property: The rate at which the data connection will receive updates. + * + * @return the frequency value. + */ + @Generated + @Override + public DataConnectionFrequency getFrequency() { + return this.frequency; + } + + /** + * Get the frequencyOffset property: The day to update the data connection on. + * + * @return the frequencyOffset value. + */ + @Generated + @Override + public Integer getFrequencyOffset() { + return this.frequencyOffset; + } + + /** + * Get the updatedDate property: The date the data connection was last updated. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the userUpdatedAt property: The date the data connection was last updated by user. + * + * @return the userUpdatedAt value. + */ + @Generated + @Override + public OffsetDateTime getUserUpdatedAt() { + return this.userUpdatedAt; + } + + /** + * Get the active property: An indicator of whether the data connection is active. + * + * @return the active value. + */ + @Generated + @Override + public Boolean isActive() { + return this.active; + } + + /** + * Get the inactiveMessage property: A message that specifies details about data connection if inactive. + * + * @return the inactiveMessage value. + */ + @Generated + @Override + public String getInactiveMessage() { + return this.inactiveMessage; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("content", getContent() == null ? null : getContent().toString()); + jsonWriter.writeStringField("frequency", getFrequency() == null ? null : getFrequency().toString()); + jsonWriter.writeNumberField("frequencyOffset", getFrequencyOffset()); + jsonWriter.writeBooleanField("active", isActive()); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureDataExplorerDataConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureDataExplorerDataConnection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureDataExplorerDataConnection. + */ + @Generated + public static AzureDataExplorerDataConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String id = null; + String displayName = null; + DataConnectionContent content = null; + OffsetDateTime createdDate = null; + DataConnectionFrequency frequency = null; + Integer frequencyOffset = null; + OffsetDateTime updatedDate = null; + OffsetDateTime userUpdatedAt = null; + Boolean active = null; + String inactiveMessage = null; + AzureDataExplorerDataConnectionProperties properties = null; + String kind = "azureDataExplorer"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("content".equals(fieldName)) { + content = DataConnectionContent.fromString(reader.getString()); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("frequency".equals(fieldName)) { + frequency = DataConnectionFrequency.fromString(reader.getString()); + } else if ("frequencyOffset".equals(fieldName)) { + frequencyOffset = reader.getNullable(JsonReader::getInt); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("userUpdatedAt".equals(fieldName)) { + userUpdatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("active".equals(fieldName)) { + active = reader.getNullable(JsonReader::getBoolean); + } else if ("inactiveMessage".equals(fieldName)) { + inactiveMessage = reader.getString(); + } else if ("properties".equals(fieldName)) { + properties = AzureDataExplorerDataConnectionProperties.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + AzureDataExplorerDataConnection deserializedAzureDataExplorerDataConnection + = new AzureDataExplorerDataConnection(properties); + deserializedAzureDataExplorerDataConnection.setName(name); + deserializedAzureDataExplorerDataConnection.id = id; + deserializedAzureDataExplorerDataConnection.displayName = displayName; + deserializedAzureDataExplorerDataConnection.content = content; + deserializedAzureDataExplorerDataConnection.createdDate = createdDate; + deserializedAzureDataExplorerDataConnection.frequency = frequency; + deserializedAzureDataExplorerDataConnection.frequencyOffset = frequencyOffset; + deserializedAzureDataExplorerDataConnection.updatedDate = updatedDate; + deserializedAzureDataExplorerDataConnection.userUpdatedAt = userUpdatedAt; + deserializedAzureDataExplorerDataConnection.active = active; + deserializedAzureDataExplorerDataConnection.inactiveMessage = inactiveMessage; + deserializedAzureDataExplorerDataConnection.kind = kind; + return deserializedAzureDataExplorerDataConnection; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionData.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionData.java index 55d3c7a14877..9220ac452b8d 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionData.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionData.java @@ -5,16 +5,14 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The AzureDataExplorerDataConnectionData model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("azureDataExplorer") @Fluent public final class AzureDataExplorerDataConnectionData extends DataConnectionData { @@ -22,8 +20,7 @@ public final class AzureDataExplorerDataConnectionData extends DataConnectionDat * properties */ @Generated - @JsonProperty(value = "properties") - private AzureDataExplorerDataConnectionProperties properties; + private final AzureDataExplorerDataConnectionProperties properties; /** * Creates an instance of AzureDataExplorerDataConnectionData class. @@ -31,9 +28,7 @@ public final class AzureDataExplorerDataConnectionData extends DataConnectionDat * @param properties the properties value to set. */ @Generated - @JsonCreator - public AzureDataExplorerDataConnectionData( - @JsonProperty(value = "properties") AzureDataExplorerDataConnectionProperties properties) { + public AzureDataExplorerDataConnectionData(AzureDataExplorerDataConnectionProperties properties) { this.properties = properties; } @@ -86,4 +81,85 @@ public AzureDataExplorerDataConnectionData setFrequencyOffset(Integer frequencyO super.setFrequencyOffset(frequencyOffset); return this; } + + /* + * Discriminator property for DataConnectionData. + */ + @Generated + private String kind = "azureDataExplorer"; + + /** + * Get the kind property: Discriminator property for DataConnectionData. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("content", getContent() == null ? null : getContent().toString()); + jsonWriter.writeStringField("frequency", getFrequency() == null ? null : getFrequency().toString()); + jsonWriter.writeNumberField("frequencyOffset", getFrequencyOffset()); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureDataExplorerDataConnectionData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureDataExplorerDataConnectionData if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureDataExplorerDataConnectionData. + */ + @Generated + public static AzureDataExplorerDataConnectionData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + DataConnectionContent content = null; + DataConnectionFrequency frequency = null; + Integer frequencyOffset = null; + AzureDataExplorerDataConnectionProperties properties = null; + String kind = "azureDataExplorer"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("content".equals(fieldName)) { + content = DataConnectionContent.fromString(reader.getString()); + } else if ("frequency".equals(fieldName)) { + frequency = DataConnectionFrequency.fromString(reader.getString()); + } else if ("frequencyOffset".equals(fieldName)) { + frequencyOffset = reader.getNullable(JsonReader::getInt); + } else if ("properties".equals(fieldName)) { + properties = AzureDataExplorerDataConnectionProperties.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + AzureDataExplorerDataConnectionData deserializedAzureDataExplorerDataConnectionData + = new AzureDataExplorerDataConnectionData(properties); + deserializedAzureDataExplorerDataConnectionData.setName(name); + deserializedAzureDataExplorerDataConnectionData.setContent(content); + deserializedAzureDataExplorerDataConnectionData.setFrequency(frequency); + deserializedAzureDataExplorerDataConnectionData.setFrequencyOffset(frequencyOffset); + deserializedAzureDataExplorerDataConnectionData.kind = kind; + return deserializedAzureDataExplorerDataConnectionData; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionProperties.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionProperties.java index 94eea9396737..6331ceb4c664 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionProperties.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionProperties.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The AzureDataExplorerDataConnectionProperties model. @@ -17,21 +20,18 @@ public final class AzureDataExplorerDataConnectionProperties extends DataConnect * The azure data explorer cluster name */ @Generated - @JsonProperty(value = "clusterName") private String clusterName; /* * The azure data explorer region */ @Generated - @JsonProperty(value = "region") private String region; /* * The azure data explorer database name */ @Generated - @JsonProperty(value = "databaseName") private String databaseName; /** @@ -106,4 +106,47 @@ public AzureDataExplorerDataConnectionProperties setDatabaseName(String database this.databaseName = databaseName; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterName", this.clusterName); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("databaseName", this.databaseName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureDataExplorerDataConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureDataExplorerDataConnectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureDataExplorerDataConnectionProperties. + */ + @Generated + public static AzureDataExplorerDataConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureDataExplorerDataConnectionProperties deserializedAzureDataExplorerDataConnectionProperties + = new AzureDataExplorerDataConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("clusterName".equals(fieldName)) { + deserializedAzureDataExplorerDataConnectionProperties.clusterName = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedAzureDataExplorerDataConnectionProperties.region = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedAzureDataExplorerDataConnectionProperties.databaseName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedAzureDataExplorerDataConnectionProperties; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Banner.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Banner.java index c0fee8cc9522..f380c798eae2 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Banner.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Banner.java @@ -5,84 +5,80 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The Banner model. */ @Immutable -public final class Banner { +public final class Banner implements JsonSerializable { /* * The port property. */ @Generated - @JsonProperty(value = "port") private Integer port; /* * The banner property. */ @Generated - @JsonProperty(value = "banner") private String banner; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The scanType property. */ @Generated - @JsonProperty(value = "scanType") private String scanType; /* * The bannerMetadata property. */ @Generated - @JsonProperty(value = "bannerMetadata") private String bannerMetadata; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /* * The sha256 property. */ @Generated - @JsonProperty(value = "sha256") private String sha256; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /** @@ -191,4 +187,72 @@ public String getSha256() { public List getSources() { return this.sources; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("banner", this.banner); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeStringField("scanType", this.scanType); + jsonWriter.writeStringField("bannerMetadata", this.bannerMetadata); + jsonWriter.writeBooleanField("recent", this.recent); + jsonWriter.writeStringField("sha256", this.sha256); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Banner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Banner if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Banner. + */ + @Generated + public static Banner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Banner deserializedBanner = new Banner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("port".equals(fieldName)) { + deserializedBanner.port = reader.getNullable(JsonReader::getInt); + } else if ("banner".equals(fieldName)) { + deserializedBanner.banner = reader.getString(); + } else if ("firstSeen".equals(fieldName)) { + deserializedBanner.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedBanner.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedBanner.count = reader.getNullable(JsonReader::getLong); + } else if ("scanType".equals(fieldName)) { + deserializedBanner.scanType = reader.getString(); + } else if ("bannerMetadata".equals(fieldName)) { + deserializedBanner.bannerMetadata = reader.getString(); + } else if ("recent".equals(fieldName)) { + deserializedBanner.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("sha256".equals(fieldName)) { + deserializedBanner.sha256 = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedBanner.sources = sources; + } else { + reader.skipChildren(); + } + } + return deserializedBanner; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CisaCveResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CisaCveResult.java new file mode 100644 index 000000000000..b25448456d40 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CisaCveResult.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * cisa cve in a given workspace. + */ +@Immutable +public final class CisaCveResult implements JsonSerializable { + /* + * The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 + * digits. + */ + @Generated + private String cveId; + + /* + * The vendor or project name for the vulnerability. + */ + @Generated + private final String vendorProject; + + /* + * The vulnerability product + */ + @Generated + private final String product; + + /* + * The name of the vulnerability + */ + @Generated + private final String vulnerabilityName; + + /* + * A short description of the vulnerability + */ + @Generated + private final String shortDescription; + + /* + * The required action to address the vulnerability + */ + @Generated + private final String requiredAction; + + /* + * Any additional notes about the vulnerability + */ + @Generated + private final String notes; + + /* + * The date the vulnerability was added to the catalog in the format YYYY-MM-DD + */ + @Generated + private final OffsetDateTime dateAdded; + + /* + * The date the required action is due in the format YYYY-MM-DD + */ + @Generated + private final OffsetDateTime dueDate; + + /* + * The date the vulnerability was updated + */ + @Generated + private final OffsetDateTime updatedAt; + + /* + * The number of assets affected by the vulnerability + */ + @Generated + private final long count; + + /** + * Creates an instance of CisaCveResult class. + * + * @param vendorProject the vendorProject value to set. + * @param product the product value to set. + * @param vulnerabilityName the vulnerabilityName value to set. + * @param shortDescription the shortDescription value to set. + * @param requiredAction the requiredAction value to set. + * @param notes the notes value to set. + * @param dateAdded the dateAdded value to set. + * @param dueDate the dueDate value to set. + * @param updatedAt the updatedAt value to set. + * @param count the count value to set. + */ + @Generated + private CisaCveResult(String vendorProject, String product, String vulnerabilityName, String shortDescription, + String requiredAction, String notes, OffsetDateTime dateAdded, OffsetDateTime dueDate, OffsetDateTime updatedAt, + long count) { + this.vendorProject = vendorProject; + this.product = product; + this.vulnerabilityName = vulnerabilityName; + this.shortDescription = shortDescription; + this.requiredAction = requiredAction; + this.notes = notes; + this.dateAdded = dateAdded; + this.dueDate = dueDate; + this.updatedAt = updatedAt; + this.count = count; + } + + /** + * Get the cveId property: The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion + * can have more than 4 digits. + * + * @return the cveId value. + */ + @Generated + public String getCveId() { + return this.cveId; + } + + /** + * Get the vendorProject property: The vendor or project name for the vulnerability. + * + * @return the vendorProject value. + */ + @Generated + public String getVendorProject() { + return this.vendorProject; + } + + /** + * Get the product property: The vulnerability product. + * + * @return the product value. + */ + @Generated + public String getProduct() { + return this.product; + } + + /** + * Get the vulnerabilityName property: The name of the vulnerability. + * + * @return the vulnerabilityName value. + */ + @Generated + public String getVulnerabilityName() { + return this.vulnerabilityName; + } + + /** + * Get the shortDescription property: A short description of the vulnerability. + * + * @return the shortDescription value. + */ + @Generated + public String getShortDescription() { + return this.shortDescription; + } + + /** + * Get the requiredAction property: The required action to address the vulnerability. + * + * @return the requiredAction value. + */ + @Generated + public String getRequiredAction() { + return this.requiredAction; + } + + /** + * Get the notes property: Any additional notes about the vulnerability. + * + * @return the notes value. + */ + @Generated + public String getNotes() { + return this.notes; + } + + /** + * Get the dateAdded property: The date the vulnerability was added to the catalog in the format YYYY-MM-DD. + * + * @return the dateAdded value. + */ + @Generated + public OffsetDateTime getDateAdded() { + return this.dateAdded; + } + + /** + * Get the dueDate property: The date the required action is due in the format YYYY-MM-DD. + * + * @return the dueDate value. + */ + @Generated + public OffsetDateTime getDueDate() { + return this.dueDate; + } + + /** + * Get the updatedAt property: The date the vulnerability was updated. + * + * @return the updatedAt value. + */ + @Generated + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Get the count property: The number of assets affected by the vulnerability. + * + * @return the count value. + */ + @Generated + public long getCount() { + return this.count; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vendorProject", this.vendorProject); + jsonWriter.writeStringField("product", this.product); + jsonWriter.writeStringField("vulnerabilityName", this.vulnerabilityName); + jsonWriter.writeStringField("shortDescription", this.shortDescription); + jsonWriter.writeStringField("requiredAction", this.requiredAction); + jsonWriter.writeStringField("notes", this.notes); + jsonWriter.writeStringField("dateAdded", + this.dateAdded == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateAdded)); + jsonWriter.writeStringField("dueDate", + this.dueDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dueDate)); + jsonWriter.writeStringField("updatedAt", + this.updatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedAt)); + jsonWriter.writeLongField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CisaCveResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CisaCveResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CisaCveResult. + */ + @Generated + public static CisaCveResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String cveId = null; + String vendorProject = null; + String product = null; + String vulnerabilityName = null; + String shortDescription = null; + String requiredAction = null; + String notes = null; + OffsetDateTime dateAdded = null; + OffsetDateTime dueDate = null; + OffsetDateTime updatedAt = null; + long count = 0L; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cveId".equals(fieldName)) { + cveId = reader.getString(); + } else if ("vendorProject".equals(fieldName)) { + vendorProject = reader.getString(); + } else if ("product".equals(fieldName)) { + product = reader.getString(); + } else if ("vulnerabilityName".equals(fieldName)) { + vulnerabilityName = reader.getString(); + } else if ("shortDescription".equals(fieldName)) { + shortDescription = reader.getString(); + } else if ("requiredAction".equals(fieldName)) { + requiredAction = reader.getString(); + } else if ("notes".equals(fieldName)) { + notes = reader.getString(); + } else if ("dateAdded".equals(fieldName)) { + dateAdded = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dueDate".equals(fieldName)) { + dueDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedAt".equals(fieldName)) { + updatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + count = reader.getLong(); + } else { + reader.skipChildren(); + } + } + CisaCveResult deserializedCisaCveResult = new CisaCveResult(vendorProject, product, vulnerabilityName, + shortDescription, requiredAction, notes, dateAdded, dueDate, updatedAt, count); + deserializedCisaCveResult.cveId = cveId; + + return deserializedCisaCveResult; + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAsset.java index 778fbdcf1bd7..3e6a37924f78 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAsset.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAsset.java @@ -5,8 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -19,49 +24,42 @@ public final class ContactAsset extends InventoryAsset { * The email property. */ @Generated - @JsonProperty(value = "email") private String email; /* * The names property. */ @Generated - @JsonProperty(value = "names") private List names; /* * The organizations property. */ @Generated - @JsonProperty(value = "organizations") private List organizations; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /** @@ -140,4 +138,65 @@ public OffsetDateTime getLastSeen() { public Long getCount() { return this.count; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeArrayField("names", this.names, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("organizations", this.organizations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContactAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContactAsset if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ContactAsset. + */ + @Generated + public static ContactAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContactAsset deserializedContactAsset = new ContactAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("email".equals(fieldName)) { + deserializedContactAsset.email = reader.getString(); + } else if ("names".equals(fieldName)) { + List names = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedContactAsset.names = names; + } else if ("organizations".equals(fieldName)) { + List organizations = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedContactAsset.organizations = organizations; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedContactAsset.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedContactAsset.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedContactAsset.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedContactAsset.count = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + return deserializedContactAsset; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAssetResource.java index 6d2565450721..94f049bf870f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAssetResource.java @@ -5,16 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; /** * The ContactAssetResource model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("contact") @Immutable public final class ContactAssetResource extends AssetResource { @@ -22,8 +24,7 @@ public final class ContactAssetResource extends AssetResource { * asset */ @Generated - @JsonProperty(value = "asset") - private ContactAsset asset; + private final ContactAsset asset; /** * Creates an instance of ContactAssetResource class. @@ -31,8 +32,7 @@ public final class ContactAssetResource extends AssetResource { * @param asset the asset value to set. */ @Generated - @JsonCreator - private ContactAssetResource(@JsonProperty(value = "asset") ContactAsset asset) { + private ContactAssetResource(ContactAsset asset) { this.asset = asset; } @@ -45,4 +45,338 @@ private ContactAssetResource(@JsonProperty(value = "asset") ContactAsset asset) public ContactAsset getAsset() { return this.asset; } + + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "contact"; + + /* + * The caller provided unique name for the resource. + */ + @Generated + private String name; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * Global UUID for the asset. + */ + @Generated + private String uuid; + + /* + * The date this asset was first added to this workspace. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The date this asset was last updated for this workspace. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The state property. + */ + @Generated + private AssetState state; + + /* + * An optional customer provided identifier for this asset. + */ + @Generated + private String externalId; + + /* + * Customer labels assigned to this asset. + */ + @Generated + private List labels; + + /* + * An indicator of whether this asset represents a wildcard rollup of assets on this domain. + */ + @Generated + private Boolean wildcard; + + /* + * The name of the DiscoGroup that brought added this asset to the workspace. + */ + @Generated + private String discoGroupName; + + /* + * The history of how this asset was pulled into the workspace through the discovery process. + */ + @Generated + private List auditTrail; + + /* + * The reason property. + */ + @Generated + private String reason; + + /** + * Get the kind property: Discriminator property for AssetResource. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + @Override + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the uuid property: Global UUID for the asset. + * + * @return the uuid value. + */ + @Generated + @Override + public String getUuid() { + return this.uuid; + } + + /** + * Get the createdDate property: The date this asset was first added to this workspace. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the updatedDate property: The date this asset was last updated for this workspace. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + @Generated + @Override + public AssetState getState() { + return this.state; + } + + /** + * Get the externalId property: An optional customer provided identifier for this asset. + * + * @return the externalId value. + */ + @Generated + @Override + public String getExternalId() { + return this.externalId; + } + + /** + * Get the labels property: Customer labels assigned to this asset. + * + * @return the labels value. + */ + @Generated + @Override + public List getLabels() { + return this.labels; + } + + /** + * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. + * + * @return the wildcard value. + */ + @Generated + @Override + public Boolean isWildcard() { + return this.wildcard; + } + + /** + * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * + * @return the discoGroupName value. + */ + @Generated + @Override + public String getDiscoGroupName() { + return this.discoGroupName; + } + + /** + * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. + * + * @return the auditTrail value. + */ + @Generated + @Override + public List getAuditTrail() { + return this.auditTrail; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + @Override + public String getReason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("uuid", getUuid()); + jsonWriter.writeStringField("createdDate", + getCreatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCreatedDate())); + jsonWriter.writeStringField("updatedDate", + getUpdatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getUpdatedDate())); + jsonWriter.writeStringField("state", getState() == null ? null : getState().toString()); + jsonWriter.writeStringField("externalId", getExternalId()); + jsonWriter.writeArrayField("labels", getLabels(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("wildcard", isWildcard()); + jsonWriter.writeStringField("discoGroupName", getDiscoGroupName()); + jsonWriter.writeArrayField("auditTrail", getAuditTrail(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reason", getReason()); + jsonWriter.writeJsonField("asset", this.asset); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContactAssetResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContactAssetResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContactAssetResource. + */ + @Generated + public static ContactAssetResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String displayName = null; + String uuid = null; + OffsetDateTime createdDate = null; + OffsetDateTime updatedDate = null; + AssetState state = null; + String externalId = null; + List labels = null; + Boolean wildcard = null; + String discoGroupName = null; + List auditTrail = null; + String reason = null; + ContactAsset asset = null; + String kind = "contact"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("uuid".equals(fieldName)) { + uuid = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + state = AssetState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + labels = reader.readArray(reader1 -> reader1.getString()); + } else if ("wildcard".equals(fieldName)) { + wildcard = reader.getNullable(JsonReader::getBoolean); + } else if ("discoGroupName".equals(fieldName)) { + discoGroupName = reader.getString(); + } else if ("auditTrail".equals(fieldName)) { + auditTrail = reader.readArray(reader1 -> AuditTrailItem.fromJson(reader1)); + } else if ("reason".equals(fieldName)) { + reason = reader.getString(); + } else if ("asset".equals(fieldName)) { + asset = ContactAsset.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + ContactAssetResource deserializedContactAssetResource = new ContactAssetResource(asset); + deserializedContactAssetResource.setId(id); + deserializedContactAssetResource.name = name; + deserializedContactAssetResource.displayName = displayName; + deserializedContactAssetResource.uuid = uuid; + deserializedContactAssetResource.createdDate = createdDate; + deserializedContactAssetResource.updatedDate = updatedDate; + deserializedContactAssetResource.state = state; + deserializedContactAssetResource.externalId = externalId; + deserializedContactAssetResource.labels = labels; + deserializedContactAssetResource.wildcard = wildcard; + deserializedContactAssetResource.discoGroupName = discoGroupName; + deserializedContactAssetResource.auditTrail = auditTrail; + deserializedContactAssetResource.reason = reason; + deserializedContactAssetResource.kind = kind; + return deserializedContactAssetResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cookie.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cookie.java index f9bf7b175cc5..a05e2b05198f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cookie.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cookie.java @@ -5,62 +5,61 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The Cookie model. */ @Immutable -public final class Cookie { +public final class Cookie implements JsonSerializable { /* * The cookieName property. */ @Generated - @JsonProperty(value = "cookieName") private String cookieName; /* * The cookieDomain property. */ @Generated - @JsonProperty(value = "cookieDomain") private String cookieDomain; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /* * The cookieExpiryDate property. */ @Generated - @JsonProperty(value = "cookieExpiryDate") private OffsetDateTime cookieExpiryDate; /** @@ -139,4 +138,66 @@ public Boolean isRecent() { public OffsetDateTime getCookieExpiryDate() { return this.cookieExpiryDate; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cookieName", this.cookieName); + jsonWriter.writeStringField("cookieDomain", this.cookieDomain); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeBooleanField("recent", this.recent); + jsonWriter.writeStringField("cookieExpiryDate", + this.cookieExpiryDate == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.cookieExpiryDate)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Cookie from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Cookie if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Cookie. + */ + @Generated + public static Cookie fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Cookie deserializedCookie = new Cookie(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("cookieName".equals(fieldName)) { + deserializedCookie.cookieName = reader.getString(); + } else if ("cookieDomain".equals(fieldName)) { + deserializedCookie.cookieDomain = reader.getString(); + } else if ("firstSeen".equals(fieldName)) { + deserializedCookie.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedCookie.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedCookie.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedCookie.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("cookieExpiryDate".equals(fieldName)) { + deserializedCookie.cookieExpiryDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + return deserializedCookie; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java new file mode 100644 index 000000000000..03d23d2e2f93 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.util.List; + +/** + * Options for createOrReplaceDiscoGroup API. + */ +@Fluent +public final class CreateOrReplaceDiscoGroupOptions { + /* + * The caller provided unique name for the resource. + */ + @Generated + private final String groupName; + + /* + * The name for a disco group. + */ + @Generated + private String name; + + /* + * The description for a disco group. + */ + @Generated + private String description; + + /* + * The tier for the disco group which will affect the algorithm used for the disco runs in this group. + */ + @Generated + private String tier; + + /* + * The frequency at which the disco group is supposed to be rerun in milliseconds. + */ + @Generated + private Long frequencyMilliseconds; + + /* + * The list of seeds used for the disco group runs. + */ + @Generated + private List seeds; + + /* + * The list of names used for the disco group runs. + */ + @Generated + private List names; + + /* + * The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. + */ + @Generated + private List excludes; + + /* + * The unique identifier for the disco template used for the disco group creation. + */ + @Generated + private String templateId; + + /** + * Creates an instance of CreateOrReplaceDiscoGroupOptions class. + * + * @param groupName the groupName value to set. + */ + @Generated + public CreateOrReplaceDiscoGroupOptions(String groupName) { + this.groupName = groupName; + } + + /** + * Get the groupName property: The caller provided unique name for the resource. + * + * @return the groupName value. + */ + @Generated + public String getGroupName() { + return this.groupName; + } + + /** + * Get the name property: The name for a disco group. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The name for a disco group. + * + * @param name the name value to set. + * @return the CreateOrReplaceDiscoGroupOptions object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupOptions setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: The description for a disco group. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The description for a disco group. + * + * @param description the description value to set. + * @return the CreateOrReplaceDiscoGroupOptions object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupOptions setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in + * this group. + * + * @return the tier value. + */ + @Generated + public String getTier() { + return this.tier; + } + + /** + * Set the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in + * this group. + * + * @param tier the tier value to set. + * @return the CreateOrReplaceDiscoGroupOptions object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupOptions setTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in + * milliseconds. + * + * @return the frequencyMilliseconds value. + */ + @Generated + public Long getFrequencyMilliseconds() { + return this.frequencyMilliseconds; + } + + /** + * Set the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in + * milliseconds. + * + * @param frequencyMilliseconds the frequencyMilliseconds value to set. + * @return the CreateOrReplaceDiscoGroupOptions object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupOptions setFrequencyMilliseconds(Long frequencyMilliseconds) { + this.frequencyMilliseconds = frequencyMilliseconds; + return this; + } + + /** + * Get the seeds property: The list of seeds used for the disco group runs. + * + * @return the seeds value. + */ + @Generated + public List getSeeds() { + return this.seeds; + } + + /** + * Set the seeds property: The list of seeds used for the disco group runs. + * + * @param seeds the seeds value to set. + * @return the CreateOrReplaceDiscoGroupOptions object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupOptions setSeeds(List seeds) { + this.seeds = seeds; + return this; + } + + /** + * Get the names property: The list of names used for the disco group runs. + * + * @return the names value. + */ + @Generated + public List getNames() { + return this.names; + } + + /** + * Set the names property: The list of names used for the disco group runs. + * + * @param names the names value to set. + * @return the CreateOrReplaceDiscoGroupOptions object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupOptions setNames(List names) { + this.names = names; + return this; + } + + /** + * Get the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the + * discovery algorithm. + * + * @return the excludes value. + */ + @Generated + public List getExcludes() { + return this.excludes; + } + + /** + * Set the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the + * discovery algorithm. + * + * @param excludes the excludes value to set. + * @return the CreateOrReplaceDiscoGroupOptions object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupOptions setExcludes(List excludes) { + this.excludes = excludes; + return this; + } + + /** + * Get the templateId property: The unique identifier for the disco template used for the disco group creation. + * + * @return the templateId value. + */ + @Generated + public String getTemplateId() { + return this.templateId; + } + + /** + * Set the templateId property: The unique identifier for the disco template used for the disco group creation. + * + * @param templateId the templateId value to set. + * @return the CreateOrReplaceDiscoGroupOptions object itself. + */ + @Generated + public CreateOrReplaceDiscoGroupOptions setTemplateId(String templateId) { + this.templateId = templateId; + return this; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cve.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cve.java index ae73107aeda6..1ce8a231598f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cve.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cve.java @@ -5,40 +5,40 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The Cve model. */ @Immutable -public final class Cve { +public final class Cve implements JsonSerializable { /* * The name property. */ @Generated - @JsonProperty(value = "name") private String name; /* * The cweId property. */ @Generated - @JsonProperty(value = "cweId") private String cweId; /* * The cvssScore property. */ @Generated - @JsonProperty(value = "cvssScore") private Double cvssScore; /* * The cvss3Summary property. */ @Generated - @JsonProperty(value = "cvss3Summary") private Cvss3Summary cvss3Summary; /** @@ -87,4 +87,49 @@ public Double getCvssScore() { public Cvss3Summary getCvss3Summary() { return this.cvss3Summary; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("cweId", this.cweId); + jsonWriter.writeNumberField("cvssScore", this.cvssScore); + jsonWriter.writeJsonField("cvss3Summary", this.cvss3Summary); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Cve from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Cve if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Cve. + */ + @Generated + public static Cve fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Cve deserializedCve = new Cve(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedCve.name = reader.getString(); + } else if ("cweId".equals(fieldName)) { + deserializedCve.cweId = reader.getString(); + } else if ("cvssScore".equals(fieldName)) { + deserializedCve.cvssScore = reader.getNullable(JsonReader::getDouble); + } else if ("cvss3Summary".equals(fieldName)) { + deserializedCve.cvss3Summary = Cvss3Summary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedCve; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cvss3Summary.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cvss3Summary.java index 870a77549158..105d68a002c3 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cvss3Summary.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cvss3Summary.java @@ -5,131 +5,118 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The Cvss3Summary model. */ @Immutable -public final class Cvss3Summary { +public final class Cvss3Summary implements JsonSerializable { /* * The version property. */ @Generated - @JsonProperty(value = "version") private String version; /* * The vectorString property. */ @Generated - @JsonProperty(value = "vectorString") private String vectorString; /* * The attackVector property. */ @Generated - @JsonProperty(value = "attackVector") private String attackVector; /* * The attackComplexity property. */ @Generated - @JsonProperty(value = "attackComplexity") private String attackComplexity; /* * The privilegesRequired property. */ @Generated - @JsonProperty(value = "privilegesRequired") private String privilegesRequired; /* * The userInteraction property. */ @Generated - @JsonProperty(value = "userInteraction") private String userInteraction; /* * The scope property. */ @Generated - @JsonProperty(value = "scope") private String scope; /* * The confidentialityImpact property. */ @Generated - @JsonProperty(value = "confidentialityImpact") private String confidentialityImpact; /* * The integrityImpact property. */ @Generated - @JsonProperty(value = "integrityImpact") private String integrityImpact; /* * The availabilityImpact property. */ @Generated - @JsonProperty(value = "availabilityImpact") private String availabilityImpact; /* * The baseScore property. */ @Generated - @JsonProperty(value = "baseScore") private Double baseScore; /* * The baseSeverity property. */ @Generated - @JsonProperty(value = "baseSeverity") private String baseSeverity; /* * The exploitCodeMaturity property. */ @Generated - @JsonProperty(value = "exploitCodeMaturity") private String exploitCodeMaturity; /* * The remediationLevel property. */ @Generated - @JsonProperty(value = "remediationLevel") private String remediationLevel; /* * The reportConfidence property. */ @Generated - @JsonProperty(value = "reportConfidence") private String reportConfidence; /* * The exploitabilityScore property. */ @Generated - @JsonProperty(value = "exploitabilityScore") private Double exploitabilityScore; /* * The impactScore property. */ @Generated - @JsonProperty(value = "impactScore") private Double impactScore; /** @@ -308,4 +295,88 @@ public Double getExploitabilityScore() { public Double getImpactScore() { return this.impactScore; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("vectorString", this.vectorString); + jsonWriter.writeStringField("attackVector", this.attackVector); + jsonWriter.writeStringField("attackComplexity", this.attackComplexity); + jsonWriter.writeStringField("privilegesRequired", this.privilegesRequired); + jsonWriter.writeStringField("userInteraction", this.userInteraction); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("confidentialityImpact", this.confidentialityImpact); + jsonWriter.writeStringField("integrityImpact", this.integrityImpact); + jsonWriter.writeStringField("availabilityImpact", this.availabilityImpact); + jsonWriter.writeNumberField("baseScore", this.baseScore); + jsonWriter.writeStringField("baseSeverity", this.baseSeverity); + jsonWriter.writeStringField("exploitCodeMaturity", this.exploitCodeMaturity); + jsonWriter.writeStringField("remediationLevel", this.remediationLevel); + jsonWriter.writeStringField("reportConfidence", this.reportConfidence); + jsonWriter.writeNumberField("exploitabilityScore", this.exploitabilityScore); + jsonWriter.writeNumberField("impactScore", this.impactScore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Cvss3Summary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Cvss3Summary if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Cvss3Summary. + */ + @Generated + public static Cvss3Summary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Cvss3Summary deserializedCvss3Summary = new Cvss3Summary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("version".equals(fieldName)) { + deserializedCvss3Summary.version = reader.getString(); + } else if ("vectorString".equals(fieldName)) { + deserializedCvss3Summary.vectorString = reader.getString(); + } else if ("attackVector".equals(fieldName)) { + deserializedCvss3Summary.attackVector = reader.getString(); + } else if ("attackComplexity".equals(fieldName)) { + deserializedCvss3Summary.attackComplexity = reader.getString(); + } else if ("privilegesRequired".equals(fieldName)) { + deserializedCvss3Summary.privilegesRequired = reader.getString(); + } else if ("userInteraction".equals(fieldName)) { + deserializedCvss3Summary.userInteraction = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedCvss3Summary.scope = reader.getString(); + } else if ("confidentialityImpact".equals(fieldName)) { + deserializedCvss3Summary.confidentialityImpact = reader.getString(); + } else if ("integrityImpact".equals(fieldName)) { + deserializedCvss3Summary.integrityImpact = reader.getString(); + } else if ("availabilityImpact".equals(fieldName)) { + deserializedCvss3Summary.availabilityImpact = reader.getString(); + } else if ("baseScore".equals(fieldName)) { + deserializedCvss3Summary.baseScore = reader.getNullable(JsonReader::getDouble); + } else if ("baseSeverity".equals(fieldName)) { + deserializedCvss3Summary.baseSeverity = reader.getString(); + } else if ("exploitCodeMaturity".equals(fieldName)) { + deserializedCvss3Summary.exploitCodeMaturity = reader.getString(); + } else if ("remediationLevel".equals(fieldName)) { + deserializedCvss3Summary.remediationLevel = reader.getString(); + } else if ("reportConfidence".equals(fieldName)) { + deserializedCvss3Summary.reportConfidence = reader.getString(); + } else if ("exploitabilityScore".equals(fieldName)) { + deserializedCvss3Summary.exploitabilityScore = reader.getNullable(JsonReader::getDouble); + } else if ("impactScore".equals(fieldName)) { + deserializedCvss3Summary.impactScore = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + return deserializedCvss3Summary; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DailyDeltaTypeResponse.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DailyDeltaTypeResponse.java new file mode 100644 index 000000000000..3386bc65ef6a --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DailyDeltaTypeResponse.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Delta response for each day. + */ +@Immutable +public final class DailyDeltaTypeResponse extends DeltaTypeResponse { + /* + * The current number of assets for one asset kind + */ + @Generated + private final long count; + + /** + * Creates an instance of DailyDeltaTypeResponse class. + * + * @param kind the kind value to set. + * @param removed the removed value to set. + * @param added the added value to set. + * @param difference the difference value to set. + * @param count the count value to set. + */ + @Generated + private DailyDeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference, long count) { + super(kind, removed, added, difference); + this.count = count; + } + + /** + * Get the count property: The current number of assets for one asset kind. + * + * @return the count value. + */ + @Generated + public long getCount() { + return this.count; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", getKind() == null ? null : getKind().toString()); + jsonWriter.writeLongField("removed", getRemoved()); + jsonWriter.writeLongField("added", getAdded()); + jsonWriter.writeLongField("difference", getDifference()); + jsonWriter.writeLongField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DailyDeltaTypeResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DailyDeltaTypeResponse if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DailyDeltaTypeResponse. + */ + @Generated + public static DailyDeltaTypeResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalAssetType kind = null; + long removed = 0L; + long added = 0L; + long difference = 0L; + long count = 0L; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + kind = GlobalAssetType.fromString(reader.getString()); + } else if ("removed".equals(fieldName)) { + removed = reader.getLong(); + } else if ("added".equals(fieldName)) { + added = reader.getLong(); + } else if ("difference".equals(fieldName)) { + difference = reader.getLong(); + } else if ("count".equals(fieldName)) { + count = reader.getLong(); + } else { + reader.skipChildren(); + } + } + return new DailyDeltaTypeResponse(kind, removed, added, difference, count); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnection.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnection.java index f97cf9330e4c..99a8aa061564 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnection.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnection.java @@ -5,102 +5,84 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * The DataConnection model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = DataConnection.class) -@JsonTypeName("DataConnection") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "logAnalytics", value = LogAnalyticsDataConnection.class), - @JsonSubTypes.Type(name = "azureDataExplorer", value = AzureDataExplorerDataConnection.class) }) @Immutable -public class DataConnection { +public class DataConnection implements JsonSerializable { /* * The system generated unique id for the resource. */ @Generated - @JsonProperty(value = "id") private String id; /* * The caller provided unique name for the resource. */ @Generated - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The name that can be used for display purposes. */ @Generated - @JsonProperty(value = "displayName") private String displayName; /* * The type of data the data connection will transfer */ @Generated - @JsonProperty(value = "content") private DataConnectionContent content; /* * The date the data connection was created. */ @Generated - @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime createdDate; /* * The rate at which the data connection will receive updates. */ @Generated - @JsonProperty(value = "frequency") private DataConnectionFrequency frequency; /* * The day to update the data connection on. */ @Generated - @JsonProperty(value = "frequencyOffset") private Integer frequencyOffset; /* * The date the data connection was last updated. */ @Generated - @JsonProperty(value = "updatedDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime updatedDate; /* * The date the data connection was last updated by user. */ @Generated - @JsonProperty(value = "userUpdatedAt", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime userUpdatedAt; /* * An indicator of whether the data connection is active. */ @Generated - @JsonProperty(value = "active") private Boolean active; /* * A message that specifies details about data connection if inactive. */ @Generated - @JsonProperty(value = "inactiveMessage", access = JsonProperty.Access.WRITE_ONLY) private String inactiveMessage; /** @@ -219,4 +201,249 @@ public Boolean isActive() { public String getInactiveMessage() { return this.inactiveMessage; } + + /* + * Discriminator property for DataConnection. + */ + @Generated + private String kind = "DataConnection"; + + /** + * Get the kind property: Discriminator property for DataConnection. + * + * @return the kind value. + */ + @Generated + public String getKind() { + return this.kind; + } + + /** + * Set the id property: The system generated unique id for the resource. + * + * @param id the id value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setId(String id) { + this.id = id; + return this; + } + + /** + * Set the name property: The caller provided unique name for the resource. + * + * @param name the name value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setName(String name) { + this.name = name; + return this; + } + + /** + * Set the displayName property: The name that can be used for display purposes. + * + * @param displayName the displayName value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Set the content property: The type of data the data connection will transfer. + * + * @param content the content value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setContent(DataConnectionContent content) { + this.content = content; + return this; + } + + /** + * Set the createdDate property: The date the data connection was created. + * + * @param createdDate the createdDate value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Set the frequency property: The rate at which the data connection will receive updates. + * + * @param frequency the frequency value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setFrequency(DataConnectionFrequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Set the frequencyOffset property: The day to update the data connection on. + * + * @param frequencyOffset the frequencyOffset value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setFrequencyOffset(Integer frequencyOffset) { + this.frequencyOffset = frequencyOffset; + return this; + } + + /** + * Set the updatedDate property: The date the data connection was last updated. + * + * @param updatedDate the updatedDate value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setUpdatedDate(OffsetDateTime updatedDate) { + this.updatedDate = updatedDate; + return this; + } + + /** + * Set the userUpdatedAt property: The date the data connection was last updated by user. + * + * @param userUpdatedAt the userUpdatedAt value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setUserUpdatedAt(OffsetDateTime userUpdatedAt) { + this.userUpdatedAt = userUpdatedAt; + return this; + } + + /** + * Set the active property: An indicator of whether the data connection is active. + * + * @param active the active value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setActive(Boolean active) { + this.active = active; + return this; + } + + /** + * Set the inactiveMessage property: A message that specifies details about data connection if inactive. + * + * @param inactiveMessage the inactiveMessage value to set. + * @return the DataConnection object itself. + */ + @Generated + DataConnection setInactiveMessage(String inactiveMessage) { + this.inactiveMessage = inactiveMessage; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("content", this.content == null ? null : this.content.toString()); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeNumberField("frequencyOffset", this.frequencyOffset); + jsonWriter.writeBooleanField("active", this.active); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnection if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataConnection. + */ + @Generated + public static DataConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("logAnalytics".equals(discriminatorValue)) { + return LogAnalyticsDataConnection.fromJson(readerToUse.reset()); + } else if ("azureDataExplorer".equals(discriminatorValue)) { + return AzureDataExplorerDataConnection.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static DataConnection fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnection deserializedDataConnection = new DataConnection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedDataConnection.name = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedDataConnection.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedDataConnection.id = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedDataConnection.displayName = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedDataConnection.content = DataConnectionContent.fromString(reader.getString()); + } else if ("createdDate".equals(fieldName)) { + deserializedDataConnection.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("frequency".equals(fieldName)) { + deserializedDataConnection.frequency = DataConnectionFrequency.fromString(reader.getString()); + } else if ("frequencyOffset".equals(fieldName)) { + deserializedDataConnection.frequencyOffset = reader.getNullable(JsonReader::getInt); + } else if ("updatedDate".equals(fieldName)) { + deserializedDataConnection.updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("userUpdatedAt".equals(fieldName)) { + deserializedDataConnection.userUpdatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("active".equals(fieldName)) { + deserializedDataConnection.active = reader.getNullable(JsonReader::getBoolean); + } else if ("inactiveMessage".equals(fieldName)) { + deserializedDataConnection.inactiveMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedDataConnection; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionContent.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionContent.java index 4b5431505df8..59d53143773a 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionContent.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionContent.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public DataConnectionContent() { * @return the corresponding DataConnectionContent. */ @Generated - @JsonCreator public static DataConnectionContent fromString(String name) { return fromString(name, DataConnectionContent.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionData.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionData.java index 7bf9ac3f7830..c239540abc40 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionData.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionData.java @@ -5,52 +5,40 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The DataConnectionData model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = DataConnectionData.class) -@JsonTypeName("DataConnectionData") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "logAnalytics", value = LogAnalyticsDataConnectionData.class), - @JsonSubTypes.Type(name = "azureDataExplorer", value = AzureDataExplorerDataConnectionData.class) }) @Fluent -public class DataConnectionData { +public class DataConnectionData implements JsonSerializable { /* * The name of data connection */ @Generated - @JsonProperty(value = "name") private String name; /* * The type of data the data connection will transfer. */ @Generated - @JsonProperty(value = "content") private DataConnectionContent content; /* * The rate at which the data connection will receive updates. */ @Generated - @JsonProperty(value = "frequency") private DataConnectionFrequency frequency; /* * The day to update the data connection on. (1-7 for weekly, 1-31 for monthly) */ @Generated - @JsonProperty(value = "frequencyOffset") private Integer frequencyOffset; /** @@ -147,4 +135,97 @@ public DataConnectionData setFrequencyOffset(Integer frequencyOffset) { this.frequencyOffset = frequencyOffset; return this; } + + /* + * Discriminator property for DataConnectionData. + */ + @Generated + private String kind = "DataConnectionData"; + + /** + * Get the kind property: Discriminator property for DataConnectionData. + * + * @return the kind value. + */ + @Generated + public String getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("content", this.content == null ? null : this.content.toString()); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeNumberField("frequencyOffset", this.frequencyOffset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectionData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectionData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataConnectionData. + */ + @Generated + public static DataConnectionData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("logAnalytics".equals(discriminatorValue)) { + return LogAnalyticsDataConnectionData.fromJson(readerToUse.reset()); + } else if ("azureDataExplorer".equals(discriminatorValue)) { + return AzureDataExplorerDataConnectionData.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static DataConnectionData fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectionData deserializedDataConnectionData = new DataConnectionData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedDataConnectionData.kind = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataConnectionData.name = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedDataConnectionData.content = DataConnectionContent.fromString(reader.getString()); + } else if ("frequency".equals(fieldName)) { + deserializedDataConnectionData.frequency = DataConnectionFrequency.fromString(reader.getString()); + } else if ("frequencyOffset".equals(fieldName)) { + deserializedDataConnectionData.frequencyOffset = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedDataConnectionData; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionFrequency.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionFrequency.java index cb8df51cf091..15cafd760c6f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionFrequency.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionFrequency.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public DataConnectionFrequency() { * @return the corresponding DataConnectionFrequency. */ @Generated - @JsonCreator public static DataConnectionFrequency fromString(String name) { return fromString(name, DataConnectionFrequency.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionProperties.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionProperties.java index 465774b677ac..a2de2f5d4669 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionProperties.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionProperties.java @@ -5,12 +5,17 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The properties required to establish connection to a particular service. */ @Immutable -public class DataConnectionProperties { +public class DataConnectionProperties implements JsonSerializable { /** * Creates an instance of DataConnectionProperties class. @@ -18,4 +23,35 @@ public class DataConnectionProperties { @Generated public DataConnectionProperties() { } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataConnectionProperties. + */ + @Generated + public static DataConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectionProperties deserializedDataConnectionProperties = new DataConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + reader.skipChildren(); + } + return deserializedDataConnectionProperties; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDateResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDateResult.java new file mode 100644 index 000000000000..6aa57f96d21b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDateResult.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Date information for the delta response. + */ +@Immutable +public final class DeltaDateResult implements JsonSerializable { + /* + * The date that is being requested + */ + @Generated + private final OffsetDateTime date; + + /* + * A list of summary counts per day + */ + @Generated + private final List deltas; + + /** + * Creates an instance of DeltaDateResult class. + * + * @param date the date value to set. + * @param deltas the deltas value to set. + */ + @Generated + private DeltaDateResult(OffsetDateTime date, List deltas) { + this.date = date; + this.deltas = deltas; + } + + /** + * Get the date property: The date that is being requested. + * + * @return the date value. + */ + @Generated + public OffsetDateTime getDate() { + return this.date; + } + + /** + * Get the deltas property: A list of summary counts per day. + * + * @return the deltas value. + */ + @Generated + public List getDeltas() { + return this.deltas; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("date", + this.date == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.date)); + jsonWriter.writeArrayField("deltas", this.deltas, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeltaDateResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeltaDateResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeltaDateResult. + */ + @Generated + public static DeltaDateResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OffsetDateTime date = null; + List deltas = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("date".equals(fieldName)) { + date = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deltas".equals(fieldName)) { + deltas = reader.readArray(reader1 -> DailyDeltaTypeResponse.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new DeltaDateResult(date, deltas); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailType.java new file mode 100644 index 000000000000..1c407ab2ab31 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A list of delta detail type. + */ +public final class DeltaDetailType extends ExpandableStringEnum { + /** + * added. + */ + @Generated + public static final DeltaDetailType ADDED = fromString("added"); + + /** + * removed. + */ + @Generated + public static final DeltaDetailType REMOVED = fromString("removed"); + + /** + * Creates a new instance of DeltaDetailType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DeltaDetailType() { + } + + /** + * Creates or finds a DeltaDetailType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeltaDetailType. + */ + @Generated + public static DeltaDetailType fromString(String name) { + return fromString(name, DeltaDetailType.class); + } + + /** + * Gets known DeltaDetailType values. + * + * @return known DeltaDetailType values. + */ + @Generated + public static Collection values() { + return values(DeltaDetailType.class); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailsRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailsRequest.java new file mode 100644 index 000000000000..f49f86be42ae --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailsRequest.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A request body used to retrieve a list of deltas. + */ +@Fluent +public final class DeltaDetailsRequest implements JsonSerializable { + /* + * The type of delta detail to retrieve. + */ + @Generated + private final DeltaDetailType deltaDetailType; + + /* + * The number of days prior to retrieve deltas for. + */ + @Generated + private Integer priorDays; + + /* + * The type of asset + */ + @Generated + private final GlobalAssetType kind; + + /* + * expected format to be: yyyy-MM-dd + */ + @Generated + private String date; + + /** + * Creates an instance of DeltaDetailsRequest class. + * + * @param deltaDetailType the deltaDetailType value to set. + * @param kind the kind value to set. + */ + @Generated + public DeltaDetailsRequest(DeltaDetailType deltaDetailType, GlobalAssetType kind) { + this.deltaDetailType = deltaDetailType; + this.kind = kind; + } + + /** + * Get the deltaDetailType property: The type of delta detail to retrieve. + * + * @return the deltaDetailType value. + */ + @Generated + public DeltaDetailType getDeltaDetailType() { + return this.deltaDetailType; + } + + /** + * Get the priorDays property: The number of days prior to retrieve deltas for. + * + * @return the priorDays value. + */ + @Generated + public Integer getPriorDays() { + return this.priorDays; + } + + /** + * Set the priorDays property: The number of days prior to retrieve deltas for. + * + * @param priorDays the priorDays value to set. + * @return the DeltaDetailsRequest object itself. + */ + @Generated + public DeltaDetailsRequest setPriorDays(Integer priorDays) { + this.priorDays = priorDays; + return this; + } + + /** + * Get the kind property: The type of asset. + * + * @return the kind value. + */ + @Generated + public GlobalAssetType getKind() { + return this.kind; + } + + /** + * Get the date property: expected format to be: yyyy-MM-dd. + * + * @return the date value. + */ + @Generated + public String getDate() { + return this.date; + } + + /** + * Set the date property: expected format to be: yyyy-MM-dd. + * + * @param date the date value to set. + * @return the DeltaDetailsRequest object itself. + */ + @Generated + public DeltaDetailsRequest setDate(String date) { + this.date = date; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deltaDetailType", + this.deltaDetailType == null ? null : this.deltaDetailType.toString()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeNumberField("priorDays", this.priorDays); + jsonWriter.writeStringField("date", this.date); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeltaDetailsRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeltaDetailsRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeltaDetailsRequest. + */ + @Generated + public static DeltaDetailsRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeltaDetailType deltaDetailType = null; + GlobalAssetType kind = null; + Integer priorDays = null; + String date = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deltaDetailType".equals(fieldName)) { + deltaDetailType = DeltaDetailType.fromString(reader.getString()); + } else if ("kind".equals(fieldName)) { + kind = GlobalAssetType.fromString(reader.getString()); + } else if ("priorDays".equals(fieldName)) { + priorDays = reader.getNullable(JsonReader::getInt); + } else if ("date".equals(fieldName)) { + date = reader.getString(); + } else { + reader.skipChildren(); + } + } + DeltaDetailsRequest deserializedDeltaDetailsRequest = new DeltaDetailsRequest(deltaDetailType, kind); + deserializedDeltaDetailsRequest.priorDays = priorDays; + deserializedDeltaDetailsRequest.date = date; + + return deserializedDeltaDetailsRequest; + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaRangeResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaRangeResult.java new file mode 100644 index 000000000000..966071d925e1 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaRangeResult.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Contains added, removed, and difference values for the whole range either 7 or 30 days. + */ +@Immutable +public final class DeltaRangeResult implements JsonSerializable { + /* + * The range of dates requested + */ + @Generated + private final long range; + + /* + * The total amount of assets removed over a date range + */ + @Generated + private final long removed; + + /* + * The total amount of assets added over a date range + */ + @Generated + private final long added; + + /* + * The total amount of assets changed removed over a date range + */ + @Generated + private final long difference; + + /* + * A list of summary changes per asset kind + */ + @Generated + private final List kindSummaries; + + /** + * Creates an instance of DeltaRangeResult class. + * + * @param range the range value to set. + * @param removed the removed value to set. + * @param added the added value to set. + * @param difference the difference value to set. + * @param kindSummaries the kindSummaries value to set. + */ + @Generated + private DeltaRangeResult(long range, long removed, long added, long difference, + List kindSummaries) { + this.range = range; + this.removed = removed; + this.added = added; + this.difference = difference; + this.kindSummaries = kindSummaries; + } + + /** + * Get the range property: The range of dates requested. + * + * @return the range value. + */ + @Generated + public long getRange() { + return this.range; + } + + /** + * Get the removed property: The total amount of assets removed over a date range. + * + * @return the removed value. + */ + @Generated + public long getRemoved() { + return this.removed; + } + + /** + * Get the added property: The total amount of assets added over a date range. + * + * @return the added value. + */ + @Generated + public long getAdded() { + return this.added; + } + + /** + * Get the difference property: The total amount of assets changed removed over a date range. + * + * @return the difference value. + */ + @Generated + public long getDifference() { + return this.difference; + } + + /** + * Get the kindSummaries property: A list of summary changes per asset kind. + * + * @return the kindSummaries value. + */ + @Generated + public List getKindSummaries() { + return this.kindSummaries; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("range", this.range); + jsonWriter.writeLongField("removed", this.removed); + jsonWriter.writeLongField("added", this.added); + jsonWriter.writeLongField("difference", this.difference); + jsonWriter.writeArrayField("kindSummaries", this.kindSummaries, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeltaRangeResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeltaRangeResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeltaRangeResult. + */ + @Generated + public static DeltaRangeResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + long range = 0L; + long removed = 0L; + long added = 0L; + long difference = 0L; + List kindSummaries = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("range".equals(fieldName)) { + range = reader.getLong(); + } else if ("removed".equals(fieldName)) { + removed = reader.getLong(); + } else if ("added".equals(fieldName)) { + added = reader.getLong(); + } else if ("difference".equals(fieldName)) { + difference = reader.getLong(); + } else if ("kindSummaries".equals(fieldName)) { + kindSummaries = reader.readArray(reader1 -> DeltaTypeResponse.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new DeltaRangeResult(range, removed, added, difference, kindSummaries); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaResult.java new file mode 100644 index 000000000000..82ff4bf98945 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaResult.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Result for each of the delta detail response. + */ +@Immutable +public final class DeltaResult implements JsonSerializable { + /* + * Shows the asset kind + */ + @Generated + private final GlobalAssetType kind; + + /* + * Shows the asset name + */ + @Generated + private final String name; + + /* + * Shows the date when the asset was originally created + */ + @Generated + private final OffsetDateTime createdAt; + + /* + * Shows the date when the asset was last updated, usually the date the we trying to pull up the results for + */ + @Generated + private final OffsetDateTime updatedAt; + + /* + * Shows the inventory state + */ + @Generated + private final GlobalInventoryState state; + + /** + * Creates an instance of DeltaResult class. + * + * @param kind the kind value to set. + * @param name the name value to set. + * @param createdAt the createdAt value to set. + * @param updatedAt the updatedAt value to set. + * @param state the state value to set. + */ + @Generated + private DeltaResult(GlobalAssetType kind, String name, OffsetDateTime createdAt, OffsetDateTime updatedAt, + GlobalInventoryState state) { + this.kind = kind; + this.name = name; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.state = state; + } + + /** + * Get the kind property: Shows the asset kind. + * + * @return the kind value. + */ + @Generated + public GlobalAssetType getKind() { + return this.kind; + } + + /** + * Get the name property: Shows the asset name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the createdAt property: Shows the date when the asset was originally created. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: Shows the date when the asset was last updated, usually the date the we trying to + * pull up the results for. + * + * @return the updatedAt value. + */ + @Generated + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Get the state property: Shows the inventory state. + * + * @return the state value. + */ + @Generated + public GlobalInventoryState getState() { + return this.state; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("createdAt", + this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); + jsonWriter.writeStringField("updatedAt", + this.updatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedAt)); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeltaResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeltaResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeltaResult. + */ + @Generated + public static DeltaResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalAssetType kind = null; + String name = null; + OffsetDateTime createdAt = null; + OffsetDateTime updatedAt = null; + GlobalInventoryState state = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + kind = GlobalAssetType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("createdAt".equals(fieldName)) { + createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedAt".equals(fieldName)) { + updatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + state = GlobalInventoryState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new DeltaResult(kind, name, createdAt, updatedAt, state); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryRequest.java new file mode 100644 index 000000000000..3ad46c061d51 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryRequest.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A request body used to retrieve a delta summary. + */ +@Fluent +public final class DeltaSummaryRequest implements JsonSerializable { + /* + * The number of days prior to retrieve deltas for. + */ + @Generated + private Integer priorDays; + + /* + * expected format to be: yyyy-MM-dd + */ + @Generated + private String date; + + /** + * Creates an instance of DeltaSummaryRequest class. + */ + @Generated + public DeltaSummaryRequest() { + } + + /** + * Get the priorDays property: The number of days prior to retrieve deltas for. + * + * @return the priorDays value. + */ + @Generated + public Integer getPriorDays() { + return this.priorDays; + } + + /** + * Set the priorDays property: The number of days prior to retrieve deltas for. + * + * @param priorDays the priorDays value to set. + * @return the DeltaSummaryRequest object itself. + */ + @Generated + public DeltaSummaryRequest setPriorDays(Integer priorDays) { + this.priorDays = priorDays; + return this; + } + + /** + * Get the date property: expected format to be: yyyy-MM-dd. + * + * @return the date value. + */ + @Generated + public String getDate() { + return this.date; + } + + /** + * Set the date property: expected format to be: yyyy-MM-dd. + * + * @param date the date value to set. + * @return the DeltaSummaryRequest object itself. + */ + @Generated + public DeltaSummaryRequest setDate(String date) { + this.date = date; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("priorDays", this.priorDays); + jsonWriter.writeStringField("date", this.date); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeltaSummaryRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeltaSummaryRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeltaSummaryRequest. + */ + @Generated + public static DeltaSummaryRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeltaSummaryRequest deserializedDeltaSummaryRequest = new DeltaSummaryRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priorDays".equals(fieldName)) { + deserializedDeltaSummaryRequest.priorDays = reader.getNullable(JsonReader::getInt); + } else if ("date".equals(fieldName)) { + deserializedDeltaSummaryRequest.date = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeltaSummaryRequest; + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryResult.java new file mode 100644 index 000000000000..c4c708143475 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryResult.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Define response body for getting delta summary. + */ +@Immutable +public final class DeltaSummaryResult implements JsonSerializable { + /* + * Contains added, removed, and difference values for the whole range either 7 or 30 days + */ + @Generated + private final DeltaRangeResult summary; + + /* + * Contains added, removed, count, and difference values for each day + */ + @Generated + private final List daily; + + /** + * Creates an instance of DeltaSummaryResult class. + * + * @param summary the summary value to set. + * @param daily the daily value to set. + */ + @Generated + private DeltaSummaryResult(DeltaRangeResult summary, List daily) { + this.summary = summary; + this.daily = daily; + } + + /** + * Get the summary property: Contains added, removed, and difference values for the whole range either 7 or 30 days. + * + * @return the summary value. + */ + @Generated + public DeltaRangeResult getSummary() { + return this.summary; + } + + /** + * Get the daily property: Contains added, removed, count, and difference values for each day. + * + * @return the daily value. + */ + @Generated + public List getDaily() { + return this.daily; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("summary", this.summary); + jsonWriter.writeArrayField("daily", this.daily, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeltaSummaryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeltaSummaryResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeltaSummaryResult. + */ + @Generated + public static DeltaSummaryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeltaRangeResult summary = null; + List daily = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("summary".equals(fieldName)) { + summary = DeltaRangeResult.fromJson(reader); + } else if ("daily".equals(fieldName)) { + daily = reader.readArray(reader1 -> DeltaDateResult.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new DeltaSummaryResult(summary, daily); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaTypeResponse.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaTypeResponse.java new file mode 100644 index 000000000000..0ea0b6287066 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaTypeResponse.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The type of Delta response for each asset kind. + */ +@Immutable +public class DeltaTypeResponse implements JsonSerializable { + /* + * The kind of asset + */ + @Generated + private final GlobalAssetType kind; + + /* + * The amount of assets removed for one asset kind + */ + @Generated + private final long removed; + + /* + * The amount of assets added for one asset kind + */ + @Generated + private final long added; + + /* + * The amount of assets changed for one asset kind + */ + @Generated + private final long difference; + + /** + * Creates an instance of DeltaTypeResponse class. + * + * @param kind the kind value to set. + * @param removed the removed value to set. + * @param added the added value to set. + * @param difference the difference value to set. + */ + @Generated + protected DeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference) { + this.kind = kind; + this.removed = removed; + this.added = added; + this.difference = difference; + } + + /** + * Get the kind property: The kind of asset. + * + * @return the kind value. + */ + @Generated + public GlobalAssetType getKind() { + return this.kind; + } + + /** + * Get the removed property: The amount of assets removed for one asset kind. + * + * @return the removed value. + */ + @Generated + public long getRemoved() { + return this.removed; + } + + /** + * Get the added property: The amount of assets added for one asset kind. + * + * @return the added value. + */ + @Generated + public long getAdded() { + return this.added; + } + + /** + * Get the difference property: The amount of assets changed for one asset kind. + * + * @return the difference value. + */ + @Generated + public long getDifference() { + return this.difference; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeLongField("removed", this.removed); + jsonWriter.writeLongField("added", this.added); + jsonWriter.writeLongField("difference", this.difference); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeltaTypeResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeltaTypeResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeltaTypeResponse. + */ + @Generated + public static DeltaTypeResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalAssetType kind = null; + long removed = 0L; + long added = 0L; + long difference = 0L; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + kind = GlobalAssetType.fromString(reader.getString()); + } else if ("removed".equals(fieldName)) { + removed = reader.getLong(); + } else if ("added".equals(fieldName)) { + added = reader.getLong(); + } else if ("difference".equals(fieldName)) { + difference = reader.getLong(); + } else { + reader.skipChildren(); + } + } + return new DeltaTypeResponse(kind, removed, added, difference); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DependentResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DependentResource.java index 665b98aa4cf9..fc190751ae26 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DependentResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DependentResource.java @@ -5,182 +5,164 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The DependentResource model. */ @Immutable -public final class DependentResource { +public final class DependentResource implements JsonSerializable { /* * The md5 property. */ @Generated - @JsonProperty(value = "md5") private String md5; /* * The responseBodySize property. */ @Generated - @JsonProperty(value = "responseBodySize") private Long responseBodySize; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The firstSeenCrawlGuid property. */ @Generated - @JsonProperty(value = "firstSeenCrawlGuid") private String firstSeenCrawlGuid; /* * The firstSeenPageGuid property. */ @Generated - @JsonProperty(value = "firstSeenPageGuid") private String firstSeenPageGuid; /* * The firstSeenResourceGuid property. */ @Generated - @JsonProperty(value = "firstSeenResourceGuid") private String firstSeenResourceGuid; /* * The lastSeenCrawlGuid property. */ @Generated - @JsonProperty(value = "lastSeenCrawlGuid") private String lastSeenCrawlGuid; /* * The lastSeenPageGuid property. */ @Generated - @JsonProperty(value = "lastSeenPageGuid") private String lastSeenPageGuid; /* * The lastSeenResourceGuid property. */ @Generated - @JsonProperty(value = "lastSeenResourceGuid") private String lastSeenResourceGuid; /* * The responseBodyMinhash property. */ @Generated - @JsonProperty(value = "responseBodyMinhash") private List responseBodyMinhash; /* * The contentType property. */ @Generated - @JsonProperty(value = "contentType") private String contentType; /* * The sha256 property. */ @Generated - @JsonProperty(value = "sha256") private String sha256; /* * The sha384 property. */ @Generated - @JsonProperty(value = "sha384") private String sha384; /* * The sha512 property. */ @Generated - @JsonProperty(value = "sha512") private String sha512; /* * The url property. */ @Generated - @JsonProperty(value = "url") private String url; /* * The cached property. */ @Generated - @JsonProperty(value = "cached") private Boolean cached; /* * The sriChecks property. */ @Generated - @JsonProperty(value = "sriChecks") private List sriChecks; /* * The host property. */ @Generated - @JsonProperty(value = "host") private String host; /* * The lastObservedViolation property. */ @Generated - @JsonProperty(value = "lastObservedViolation") private OffsetDateTime lastObservedViolation; /* * The lastObservedValidation property. */ @Generated - @JsonProperty(value = "lastObservedValidation") private OffsetDateTime lastObservedValidation; /* * The lastObservedActualSriHash property. */ @Generated - @JsonProperty(value = "lastObservedActualSriHash") private String lastObservedActualSriHash; /* * The lastObservedExpectedSriHash property. */ @Generated - @JsonProperty(value = "lastObservedExpectedSriHash") private String lastObservedExpectedSriHash; /** @@ -429,4 +411,125 @@ public String getLastObservedActualSriHash() { public String getLastObservedExpectedSriHash() { return this.lastObservedExpectedSriHash; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("md5", this.md5); + jsonWriter.writeNumberField("responseBodySize", this.responseBodySize); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeStringField("firstSeenCrawlGuid", this.firstSeenCrawlGuid); + jsonWriter.writeStringField("firstSeenPageGuid", this.firstSeenPageGuid); + jsonWriter.writeStringField("firstSeenResourceGuid", this.firstSeenResourceGuid); + jsonWriter.writeStringField("lastSeenCrawlGuid", this.lastSeenCrawlGuid); + jsonWriter.writeStringField("lastSeenPageGuid", this.lastSeenPageGuid); + jsonWriter.writeStringField("lastSeenResourceGuid", this.lastSeenResourceGuid); + jsonWriter.writeArrayField("responseBodyMinhash", this.responseBodyMinhash, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeStringField("sha256", this.sha256); + jsonWriter.writeStringField("sha384", this.sha384); + jsonWriter.writeStringField("sha512", this.sha512); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeBooleanField("cached", this.cached); + jsonWriter.writeArrayField("sriChecks", this.sriChecks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeStringField("lastObservedViolation", + this.lastObservedViolation == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastObservedViolation)); + jsonWriter.writeStringField("lastObservedValidation", + this.lastObservedValidation == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastObservedValidation)); + jsonWriter.writeStringField("lastObservedActualSriHash", this.lastObservedActualSriHash); + jsonWriter.writeStringField("lastObservedExpectedSriHash", this.lastObservedExpectedSriHash); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DependentResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DependentResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DependentResource. + */ + @Generated + public static DependentResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DependentResource deserializedDependentResource = new DependentResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("md5".equals(fieldName)) { + deserializedDependentResource.md5 = reader.getString(); + } else if ("responseBodySize".equals(fieldName)) { + deserializedDependentResource.responseBodySize = reader.getNullable(JsonReader::getLong); + } else if ("firstSeen".equals(fieldName)) { + deserializedDependentResource.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedDependentResource.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedDependentResource.count = reader.getNullable(JsonReader::getLong); + } else if ("firstSeenCrawlGuid".equals(fieldName)) { + deserializedDependentResource.firstSeenCrawlGuid = reader.getString(); + } else if ("firstSeenPageGuid".equals(fieldName)) { + deserializedDependentResource.firstSeenPageGuid = reader.getString(); + } else if ("firstSeenResourceGuid".equals(fieldName)) { + deserializedDependentResource.firstSeenResourceGuid = reader.getString(); + } else if ("lastSeenCrawlGuid".equals(fieldName)) { + deserializedDependentResource.lastSeenCrawlGuid = reader.getString(); + } else if ("lastSeenPageGuid".equals(fieldName)) { + deserializedDependentResource.lastSeenPageGuid = reader.getString(); + } else if ("lastSeenResourceGuid".equals(fieldName)) { + deserializedDependentResource.lastSeenResourceGuid = reader.getString(); + } else if ("responseBodyMinhash".equals(fieldName)) { + List responseBodyMinhash = reader.readArray(reader1 -> reader1.getInt()); + deserializedDependentResource.responseBodyMinhash = responseBodyMinhash; + } else if ("contentType".equals(fieldName)) { + deserializedDependentResource.contentType = reader.getString(); + } else if ("sha256".equals(fieldName)) { + deserializedDependentResource.sha256 = reader.getString(); + } else if ("sha384".equals(fieldName)) { + deserializedDependentResource.sha384 = reader.getString(); + } else if ("sha512".equals(fieldName)) { + deserializedDependentResource.sha512 = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedDependentResource.url = reader.getString(); + } else if ("cached".equals(fieldName)) { + deserializedDependentResource.cached = reader.getNullable(JsonReader::getBoolean); + } else if ("sriChecks".equals(fieldName)) { + List sriChecks + = reader.readArray(reader1 -> SubResourceIntegrityCheck.fromJson(reader1)); + deserializedDependentResource.sriChecks = sriChecks; + } else if ("host".equals(fieldName)) { + deserializedDependentResource.host = reader.getString(); + } else if ("lastObservedViolation".equals(fieldName)) { + deserializedDependentResource.lastObservedViolation = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastObservedValidation".equals(fieldName)) { + deserializedDependentResource.lastObservedValidation = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastObservedActualSriHash".equals(fieldName)) { + deserializedDependentResource.lastObservedActualSriHash = reader.getString(); + } else if ("lastObservedExpectedSriHash".equals(fieldName)) { + deserializedDependentResource.lastObservedExpectedSriHash = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedDependentResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroup.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroup.java index 220fb48052cb..09746ef35d34 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroup.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroup.java @@ -5,98 +5,92 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The DiscoGroup model. */ @Immutable -public final class DiscoGroup { +public final class DiscoGroup implements JsonSerializable { /* * The system generated unique id for the resource. */ @Generated - @JsonProperty(value = "id") private String id; /* * The caller provided unique name for the resource. */ @Generated - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The name that can be used for display purposes. */ @Generated - @JsonProperty(value = "displayName") private String displayName; /* * The description for a disco group. */ @Generated - @JsonProperty(value = "description") private String description; /* * The tier for the disco group which will affect the algorithm used for the disco runs in this group. */ @Generated - @JsonProperty(value = "tier") private String tier; /* * The frequency at which the disco group is supposed to be rerun in milliseconds. */ @Generated - @JsonProperty(value = "frequencyMilliseconds") private Long frequencyMilliseconds; /* * The list of seeds used for the disco group runs. */ @Generated - @JsonProperty(value = "seeds") private List seeds; /* * The list of names used for the disco group runs. */ @Generated - @JsonProperty(value = "names") private List names; /* * The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. */ @Generated - @JsonProperty(value = "excludes") private List excludes; /* * The latest run of this disco group with some limited information, null if the group has never been run. */ @Generated - @JsonProperty(value = "latestRun") private DiscoRunResult latestRun; /* * The date for the disco group was created. */ @Generated - @JsonProperty(value = "createdDate") private OffsetDateTime createdDate; /* * The unique identifier for the disco template used for the disco group creation. */ @Generated - @JsonProperty(value = "templateId") private String templateId; /** @@ -229,4 +223,78 @@ public OffsetDateTime getCreatedDate() { public String getTemplateId() { return this.templateId; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("tier", this.tier); + jsonWriter.writeNumberField("frequencyMilliseconds", this.frequencyMilliseconds); + jsonWriter.writeArrayField("seeds", this.seeds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("names", this.names, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("excludes", this.excludes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("latestRun", this.latestRun); + jsonWriter.writeStringField("createdDate", + this.createdDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDate)); + jsonWriter.writeStringField("templateId", this.templateId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoGroup if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DiscoGroup. + */ + @Generated + public static DiscoGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiscoGroup deserializedDiscoGroup = new DiscoGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedDiscoGroup.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedDiscoGroup.id = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedDiscoGroup.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDiscoGroup.description = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedDiscoGroup.tier = reader.getString(); + } else if ("frequencyMilliseconds".equals(fieldName)) { + deserializedDiscoGroup.frequencyMilliseconds = reader.getNullable(JsonReader::getLong); + } else if ("seeds".equals(fieldName)) { + List seeds = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); + deserializedDiscoGroup.seeds = seeds; + } else if ("names".equals(fieldName)) { + List names = reader.readArray(reader1 -> reader1.getString()); + deserializedDiscoGroup.names = names; + } else if ("excludes".equals(fieldName)) { + List excludes = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); + deserializedDiscoGroup.excludes = excludes; + } else if ("latestRun".equals(fieldName)) { + deserializedDiscoGroup.latestRun = DiscoRunResult.fromJson(reader); + } else if ("createdDate".equals(fieldName)) { + deserializedDiscoGroup.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("templateId".equals(fieldName)) { + deserializedDiscoGroup.templateId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedDiscoGroup; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupData.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupData.java index ac3ccb9cb5ad..3a92d1f107ef 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupData.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupData.java @@ -5,69 +5,65 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * A request body used to create a discovery group. */ @Fluent -public final class DiscoGroupData { +public final class DiscoGroupData implements JsonSerializable { /* * The name for a disco group. */ @Generated - @JsonProperty(value = "name") private String name; /* * The description for a disco group. */ @Generated - @JsonProperty(value = "description") private String description; /* * The tier for the disco group which will affect the algorithm used for the disco runs in this group. */ @Generated - @JsonProperty(value = "tier") private String tier; /* * The frequency at which the disco group is supposed to be rerun in milliseconds. */ @Generated - @JsonProperty(value = "frequencyMilliseconds") private Long frequencyMilliseconds; /* * The list of seeds used for the disco group runs. */ @Generated - @JsonProperty(value = "seeds") private List seeds; /* * The list of names used for the disco group runs. */ @Generated - @JsonProperty(value = "names") private List names; /* * The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. */ @Generated - @JsonProperty(value = "excludes") private List excludes; /* * The unique identifier for the disco template used for the disco group creation. */ @Generated - @JsonProperty(value = "templateId") private String templateId; /** @@ -258,4 +254,64 @@ public DiscoGroupData setTemplateId(String templateId) { this.templateId = templateId; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("tier", this.tier); + jsonWriter.writeNumberField("frequencyMilliseconds", this.frequencyMilliseconds); + jsonWriter.writeArrayField("seeds", this.seeds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("names", this.names, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("excludes", this.excludes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("templateId", this.templateId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoGroupData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoGroupData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiscoGroupData. + */ + @Generated + public static DiscoGroupData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiscoGroupData deserializedDiscoGroupData = new DiscoGroupData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedDiscoGroupData.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDiscoGroupData.description = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedDiscoGroupData.tier = reader.getString(); + } else if ("frequencyMilliseconds".equals(fieldName)) { + deserializedDiscoGroupData.frequencyMilliseconds = reader.getNullable(JsonReader::getLong); + } else if ("seeds".equals(fieldName)) { + List seeds = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); + deserializedDiscoGroupData.seeds = seeds; + } else if ("names".equals(fieldName)) { + List names = reader.readArray(reader1 -> reader1.getString()); + deserializedDiscoGroupData.names = names; + } else if ("excludes".equals(fieldName)) { + List excludes = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); + deserializedDiscoGroupData.excludes = excludes; + } else if ("templateId".equals(fieldName)) { + deserializedDiscoGroupData.templateId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedDiscoGroupData; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupSummaryResult.java new file mode 100644 index 000000000000..e8b4986b973b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupSummaryResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A list of disco group summaries. + */ +@Immutable +public final class DiscoGroupSummaryResult implements JsonSerializable { + /* + * The system generated unique id for the resource. + */ + @Generated + private final String id; + + /* + * The caller provided unique name for the resource. + */ + @Generated + private final String name; + + /* + * The name that can be used for display purposes. + */ + @Generated + private final String displayName; + + /** + * Creates an instance of DiscoGroupSummaryResult class. + * + * @param id the id value to set. + * @param name the name value to set. + * @param displayName the displayName value to set. + */ + @Generated + private DiscoGroupSummaryResult(String id, String name, String displayName) { + this.id = id; + this.name = name; + this.displayName = displayName; + } + + /** + * Get the id property: The system generated unique id for the resource. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoGroupSummaryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoGroupSummaryResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DiscoGroupSummaryResult. + */ + @Generated + public static DiscoGroupSummaryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String displayName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new DiscoGroupSummaryResult(id, name, displayName); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunResult.java index f3b4bf36bdaa..e3d160f2639b 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunResult.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunResult.java @@ -5,77 +5,74 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The latest run of this disco group with some limited information, null if the group has never been run. */ @Immutable -public final class DiscoRunResult { +public final class DiscoRunResult implements JsonSerializable { /* * The date for when the disco run was created in the system. */ @Generated - @JsonProperty(value = "submittedDate") private OffsetDateTime submittedDate; /* * The date for when the disco run was actually started by the system. */ @Generated - @JsonProperty(value = "startedDate") private OffsetDateTime startedDate; /* * The date for when the disco run was completed by the system. */ @Generated - @JsonProperty(value = "completedDate") private OffsetDateTime completedDate; /* * The tier which will affect the algorithm used for the disco run. */ @Generated - @JsonProperty(value = "tier") private String tier; /* * The State of the disco run. */ @Generated - @JsonProperty(value = "state") private DiscoRunState state; /* * The total count of assets that were found this disco run. */ @Generated - @JsonProperty(value = "totalAssetsFoundCount") private Long totalAssetsFoundCount; /* * The list of seeds used for the disco run. */ @Generated - @JsonProperty(value = "seeds") private List seeds; /* * The list of excludes used for the disco run, aka assets to exclude from the discovery algorithm. */ @Generated - @JsonProperty(value = "excludes") private List excludes; /* * The list of names used for the disco run. */ @Generated - @JsonProperty(value = "names") private List names; /** @@ -175,4 +172,73 @@ public List getExcludes() { public List getNames() { return this.names; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("submittedDate", + this.submittedDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.submittedDate)); + jsonWriter.writeStringField("startedDate", + this.startedDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startedDate)); + jsonWriter.writeStringField("completedDate", + this.completedDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.completedDate)); + jsonWriter.writeStringField("tier", this.tier); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeNumberField("totalAssetsFoundCount", this.totalAssetsFoundCount); + jsonWriter.writeArrayField("seeds", this.seeds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("excludes", this.excludes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("names", this.names, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoRunResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoRunResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiscoRunResult. + */ + @Generated + public static DiscoRunResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiscoRunResult deserializedDiscoRunResult = new DiscoRunResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("submittedDate".equals(fieldName)) { + deserializedDiscoRunResult.submittedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startedDate".equals(fieldName)) { + deserializedDiscoRunResult.startedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedDate".equals(fieldName)) { + deserializedDiscoRunResult.completedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("tier".equals(fieldName)) { + deserializedDiscoRunResult.tier = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedDiscoRunResult.state = DiscoRunState.fromString(reader.getString()); + } else if ("totalAssetsFoundCount".equals(fieldName)) { + deserializedDiscoRunResult.totalAssetsFoundCount = reader.getNullable(JsonReader::getLong); + } else if ("seeds".equals(fieldName)) { + List seeds = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); + deserializedDiscoRunResult.seeds = seeds; + } else if ("excludes".equals(fieldName)) { + List excludes = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); + deserializedDiscoRunResult.excludes = excludes; + } else if ("names".equals(fieldName)) { + List names = reader.readArray(reader1 -> reader1.getString()); + deserializedDiscoRunResult.names = names; + } else { + reader.skipChildren(); + } + } + return deserializedDiscoRunResult; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunState.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunState.java index f6890f898356..eee1c49fc0ff 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunState.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunState.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -54,7 +53,6 @@ public DiscoRunState() { * @return the corresponding DiscoRunState. */ @Generated - @JsonCreator public static DiscoRunState fromString(String name) { return fromString(name, DiscoRunState.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSource.java index dc7ff52a04f3..149ba735829c 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSource.java @@ -5,26 +5,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Source entity used to drive discovery. */ @Fluent -public final class DiscoSource { +public final class DiscoSource implements JsonSerializable { /* * The kind of disco source. */ @Generated - @JsonProperty(value = "kind") private DiscoSourceKind kind; /* * The name for the disco source. */ @Generated - @JsonProperty(value = "name") private String name; /** @@ -77,4 +79,43 @@ public DiscoSource setName(String name) { this.name = name; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoSource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiscoSource. + */ + @Generated + public static DiscoSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiscoSource deserializedDiscoSource = new DiscoSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedDiscoSource.kind = DiscoSourceKind.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedDiscoSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedDiscoSource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSourceKind.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSourceKind.java index 651df3cc24c9..e616330aa236 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSourceKind.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSourceKind.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -66,7 +65,6 @@ public DiscoSourceKind() { * @return the corresponding DiscoSourceKind. */ @Generated - @JsonCreator public static DiscoSourceKind fromString(String name) { return fromString(name, DiscoSourceKind.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplate.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplate.java index cc5c9c32a19a..21c0c2c1672b 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplate.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplate.java @@ -5,83 +5,77 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The items in the current page of results. */ @Immutable -public final class DiscoTemplate { +public final class DiscoTemplate implements JsonSerializable { /* * The system generated unique id for the resource. */ @Generated - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The caller provided unique name for the resource. */ @Generated - @JsonProperty(value = "name") private String name; /* * The name that can be used for display purposes. */ @Generated - @JsonProperty(value = "displayName") private String displayName; /* * The name of the industry. */ @Generated - @JsonProperty(value = "industry") private String industry; /* * The name of the region. */ @Generated - @JsonProperty(value = "region") private String region; /* * The country code. */ @Generated - @JsonProperty(value = "countryCode") private String countryCode; /* * The state code. */ @Generated - @JsonProperty(value = "stateCode") private String stateCode; /* * The name of the city. */ @Generated - @JsonProperty(value = "city") private String city; /* * The list of disco template seeds. */ @Generated - @JsonProperty(value = "seeds") private List seeds; /* * The list of disco template names. */ @Generated - @JsonProperty(value = "names") private List names; /** @@ -190,4 +184,69 @@ public List getSeeds() { public List getNames() { return this.names; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("industry", this.industry); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("countryCode", this.countryCode); + jsonWriter.writeStringField("stateCode", this.stateCode); + jsonWriter.writeStringField("city", this.city); + jsonWriter.writeArrayField("seeds", this.seeds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("names", this.names, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoTemplate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DiscoTemplate. + */ + @Generated + public static DiscoTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiscoTemplate deserializedDiscoTemplate = new DiscoTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedDiscoTemplate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDiscoTemplate.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedDiscoTemplate.displayName = reader.getString(); + } else if ("industry".equals(fieldName)) { + deserializedDiscoTemplate.industry = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedDiscoTemplate.region = reader.getString(); + } else if ("countryCode".equals(fieldName)) { + deserializedDiscoTemplate.countryCode = reader.getString(); + } else if ("stateCode".equals(fieldName)) { + deserializedDiscoTemplate.stateCode = reader.getString(); + } else if ("city".equals(fieldName)) { + deserializedDiscoTemplate.city = reader.getString(); + } else if ("seeds".equals(fieldName)) { + List seeds = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); + deserializedDiscoTemplate.seeds = seeds; + } else if ("names".equals(fieldName)) { + List names = reader.readArray(reader1 -> reader1.getString()); + deserializedDiscoTemplate.names = names; + } else { + reader.skipChildren(); + } + } + return deserializedDiscoTemplate; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAsset.java index fb7e7a6b0301..7f3d3820ecde 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAsset.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAsset.java @@ -5,231 +5,206 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The DomainAsset model. */ @Immutable -public final class DomainAsset extends InventoryAsset { +public final class DomainAsset implements JsonSerializable { /* * The domain property. */ @Generated - @JsonProperty(value = "domain") private String domain; /* * The whoisId property. */ @Generated - @JsonProperty(value = "whoisId") private Long whoisId; /* * The registrarIanaIds property. */ @Generated - @JsonProperty(value = "registrarIanaIds") private List registrarIanaIds; /* * The registrantContacts property. */ @Generated - @JsonProperty(value = "registrantContacts") private List registrantContacts; /* * The registrantOrgs property. */ @Generated - @JsonProperty(value = "registrantOrgs") private List registrantOrgs; /* * The adminContacts property. */ @Generated - @JsonProperty(value = "adminContacts") private List adminContacts; /* * The technicalContacts property. */ @Generated - @JsonProperty(value = "technicalContacts") private List technicalContacts; /* * The alexaInfos property. */ @Generated - @JsonProperty(value = "alexaInfos") private List alexaInfos; /* * The nameServers property. */ @Generated - @JsonProperty(value = "nameServers") private List nameServers; /* * The mailServers property. */ @Generated - @JsonProperty(value = "mailServers") private List mailServers; /* * The whoisServers property. */ @Generated - @JsonProperty(value = "whoisServers") private List whoisServers; /* * The domainStatuses property. */ @Generated - @JsonProperty(value = "domainStatuses") private List domainStatuses; /* * The registrarCreatedAt property. */ @Generated - @JsonProperty(value = "registrarCreatedAt") private List registrarCreatedAt; /* * The registrarUpdatedAt property. */ @Generated - @JsonProperty(value = "registrarUpdatedAt") private List registrarUpdatedAt; /* * The registrarExpiresAt property. */ @Generated - @JsonProperty(value = "registrarExpiresAt") private List registrarExpiresAt; /* * The soaRecords property. */ @Generated - @JsonProperty(value = "soaRecords") private List soaRecords; /* * The detailedFromWhoisAt property. */ @Generated - @JsonProperty(value = "detailedFromWhoisAt") private OffsetDateTime detailedFromWhoisAt; /* * The registrarNames property. */ @Generated - @JsonProperty(value = "registrarNames") private List registrarNames; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The parkedDomain property. */ @Generated - @JsonProperty(value = "parkedDomain") private List parkedDomain; /* * The registrantNames property. */ @Generated - @JsonProperty(value = "registrantNames") private List registrantNames; /* * The adminNames property. */ @Generated - @JsonProperty(value = "adminNames") private List adminNames; /* * The technicalNames property. */ @Generated - @JsonProperty(value = "technicalNames") private List technicalNames; /* * The adminOrgs property. */ @Generated - @JsonProperty(value = "adminOrgs") private List adminOrgs; /* * The technicalOrgs property. */ @Generated - @JsonProperty(value = "technicalOrgs") private List technicalOrgs; /* * The registrantPhones property. */ @Generated - @JsonProperty(value = "registrantPhones") private List registrantPhones; /* * The adminPhones property. */ @Generated - @JsonProperty(value = "adminPhones") private List adminPhones; /* * The technicalPhones property. */ @Generated - @JsonProperty(value = "technicalPhones") private List technicalPhones; /** @@ -548,4 +523,182 @@ public List getAdminPhones() { public List getTechnicalPhones() { return this.technicalPhones; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeNumberField("whoisId", this.whoisId); + jsonWriter.writeArrayField("registrarIanaIds", this.registrarIanaIds, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantContacts", this.registrantContacts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantOrgs", this.registrantOrgs, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminContacts", this.adminContacts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalContacts", this.technicalContacts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("alexaInfos", this.alexaInfos, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("nameServers", this.nameServers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("mailServers", this.mailServers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("whoisServers", this.whoisServers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("domainStatuses", this.domainStatuses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrarCreatedAt", this.registrarCreatedAt, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrarUpdatedAt", this.registrarUpdatedAt, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrarExpiresAt", this.registrarExpiresAt, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("soaRecords", this.soaRecords, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("detailedFromWhoisAt", + this.detailedFromWhoisAt == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.detailedFromWhoisAt)); + jsonWriter.writeArrayField("registrarNames", this.registrarNames, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeArrayField("parkedDomain", this.parkedDomain, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantNames", this.registrantNames, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminNames", this.adminNames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalNames", this.technicalNames, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminOrgs", this.adminOrgs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalOrgs", this.technicalOrgs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantPhones", this.registrantPhones, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminPhones", this.adminPhones, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalPhones", this.technicalPhones, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DomainAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DomainAsset if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DomainAsset. + */ + @Generated + public static DomainAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DomainAsset deserializedDomainAsset = new DomainAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("domain".equals(fieldName)) { + deserializedDomainAsset.domain = reader.getString(); + } else if ("whoisId".equals(fieldName)) { + deserializedDomainAsset.whoisId = reader.getNullable(JsonReader::getLong); + } else if ("registrarIanaIds".equals(fieldName)) { + List registrarIanaIds + = reader.readArray(reader1 -> ObservedInteger.fromJson(reader1)); + deserializedDomainAsset.registrarIanaIds = registrarIanaIds; + } else if ("registrantContacts".equals(fieldName)) { + List registrantContacts + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.registrantContacts = registrantContacts; + } else if ("registrantOrgs".equals(fieldName)) { + List registrantOrgs = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.registrantOrgs = registrantOrgs; + } else if ("adminContacts".equals(fieldName)) { + List adminContacts = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.adminContacts = adminContacts; + } else if ("technicalContacts".equals(fieldName)) { + List technicalContacts + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.technicalContacts = technicalContacts; + } else if ("alexaInfos".equals(fieldName)) { + List alexaInfos = reader.readArray(reader1 -> AlexaDetails.fromJson(reader1)); + deserializedDomainAsset.alexaInfos = alexaInfos; + } else if ("nameServers".equals(fieldName)) { + List nameServers = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.nameServers = nameServers; + } else if ("mailServers".equals(fieldName)) { + List mailServers = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.mailServers = mailServers; + } else if ("whoisServers".equals(fieldName)) { + List whoisServers = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.whoisServers = whoisServers; + } else if ("domainStatuses".equals(fieldName)) { + List domainStatuses = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.domainStatuses = domainStatuses; + } else if ("registrarCreatedAt".equals(fieldName)) { + List registrarCreatedAt = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedDomainAsset.registrarCreatedAt = registrarCreatedAt; + } else if ("registrarUpdatedAt".equals(fieldName)) { + List registrarUpdatedAt = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedDomainAsset.registrarUpdatedAt = registrarUpdatedAt; + } else if ("registrarExpiresAt".equals(fieldName)) { + List registrarExpiresAt = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedDomainAsset.registrarExpiresAt = registrarExpiresAt; + } else if ("soaRecords".equals(fieldName)) { + List soaRecords = reader.readArray(reader1 -> SoaRecord.fromJson(reader1)); + deserializedDomainAsset.soaRecords = soaRecords; + } else if ("detailedFromWhoisAt".equals(fieldName)) { + deserializedDomainAsset.detailedFromWhoisAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("registrarNames".equals(fieldName)) { + List registrarNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.registrarNames = registrarNames; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedDomainAsset.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedDomainAsset.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedDomainAsset.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedDomainAsset.count = reader.getNullable(JsonReader::getLong); + } else if ("parkedDomain".equals(fieldName)) { + List parkedDomain = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedDomainAsset.parkedDomain = parkedDomain; + } else if ("registrantNames".equals(fieldName)) { + List registrantNames + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.registrantNames = registrantNames; + } else if ("adminNames".equals(fieldName)) { + List adminNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.adminNames = adminNames; + } else if ("technicalNames".equals(fieldName)) { + List technicalNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.technicalNames = technicalNames; + } else if ("adminOrgs".equals(fieldName)) { + List adminOrgs = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.adminOrgs = adminOrgs; + } else if ("technicalOrgs".equals(fieldName)) { + List technicalOrgs = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.technicalOrgs = technicalOrgs; + } else if ("registrantPhones".equals(fieldName)) { + List registrantPhones + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.registrantPhones = registrantPhones; + } else if ("adminPhones".equals(fieldName)) { + List adminPhones = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.adminPhones = adminPhones; + } else if ("technicalPhones".equals(fieldName)) { + List technicalPhones + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedDomainAsset.technicalPhones = technicalPhones; + } else { + reader.skipChildren(); + } + } + return deserializedDomainAsset; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAssetResource.java index 5b980461361a..2891f5778d22 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAssetResource.java @@ -5,16 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; /** * The DomainAssetResource model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("domain") @Immutable public final class DomainAssetResource extends AssetResource { @@ -22,8 +24,7 @@ public final class DomainAssetResource extends AssetResource { * asset */ @Generated - @JsonProperty(value = "asset") - private DomainAsset asset; + private final DomainAsset asset; /** * Creates an instance of DomainAssetResource class. @@ -31,8 +32,7 @@ public final class DomainAssetResource extends AssetResource { * @param asset the asset value to set. */ @Generated - @JsonCreator - private DomainAssetResource(@JsonProperty(value = "asset") DomainAsset asset) { + private DomainAssetResource(DomainAsset asset) { this.asset = asset; } @@ -45,4 +45,338 @@ private DomainAssetResource(@JsonProperty(value = "asset") DomainAsset asset) { public DomainAsset getAsset() { return this.asset; } + + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "domain"; + + /* + * The caller provided unique name for the resource. + */ + @Generated + private String name; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * Global UUID for the asset. + */ + @Generated + private String uuid; + + /* + * The date this asset was first added to this workspace. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The date this asset was last updated for this workspace. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The state property. + */ + @Generated + private AssetState state; + + /* + * An optional customer provided identifier for this asset. + */ + @Generated + private String externalId; + + /* + * Customer labels assigned to this asset. + */ + @Generated + private List labels; + + /* + * An indicator of whether this asset represents a wildcard rollup of assets on this domain. + */ + @Generated + private Boolean wildcard; + + /* + * The name of the DiscoGroup that brought added this asset to the workspace. + */ + @Generated + private String discoGroupName; + + /* + * The history of how this asset was pulled into the workspace through the discovery process. + */ + @Generated + private List auditTrail; + + /* + * The reason property. + */ + @Generated + private String reason; + + /** + * Get the kind property: Discriminator property for AssetResource. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + @Override + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the uuid property: Global UUID for the asset. + * + * @return the uuid value. + */ + @Generated + @Override + public String getUuid() { + return this.uuid; + } + + /** + * Get the createdDate property: The date this asset was first added to this workspace. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the updatedDate property: The date this asset was last updated for this workspace. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + @Generated + @Override + public AssetState getState() { + return this.state; + } + + /** + * Get the externalId property: An optional customer provided identifier for this asset. + * + * @return the externalId value. + */ + @Generated + @Override + public String getExternalId() { + return this.externalId; + } + + /** + * Get the labels property: Customer labels assigned to this asset. + * + * @return the labels value. + */ + @Generated + @Override + public List getLabels() { + return this.labels; + } + + /** + * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. + * + * @return the wildcard value. + */ + @Generated + @Override + public Boolean isWildcard() { + return this.wildcard; + } + + /** + * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * + * @return the discoGroupName value. + */ + @Generated + @Override + public String getDiscoGroupName() { + return this.discoGroupName; + } + + /** + * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. + * + * @return the auditTrail value. + */ + @Generated + @Override + public List getAuditTrail() { + return this.auditTrail; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + @Override + public String getReason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("uuid", getUuid()); + jsonWriter.writeStringField("createdDate", + getCreatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCreatedDate())); + jsonWriter.writeStringField("updatedDate", + getUpdatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getUpdatedDate())); + jsonWriter.writeStringField("state", getState() == null ? null : getState().toString()); + jsonWriter.writeStringField("externalId", getExternalId()); + jsonWriter.writeArrayField("labels", getLabels(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("wildcard", isWildcard()); + jsonWriter.writeStringField("discoGroupName", getDiscoGroupName()); + jsonWriter.writeArrayField("auditTrail", getAuditTrail(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reason", getReason()); + jsonWriter.writeJsonField("asset", this.asset); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DomainAssetResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DomainAssetResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DomainAssetResource. + */ + @Generated + public static DomainAssetResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String displayName = null; + String uuid = null; + OffsetDateTime createdDate = null; + OffsetDateTime updatedDate = null; + AssetState state = null; + String externalId = null; + List labels = null; + Boolean wildcard = null; + String discoGroupName = null; + List auditTrail = null; + String reason = null; + DomainAsset asset = null; + String kind = "domain"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("uuid".equals(fieldName)) { + uuid = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + state = AssetState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + labels = reader.readArray(reader1 -> reader1.getString()); + } else if ("wildcard".equals(fieldName)) { + wildcard = reader.getNullable(JsonReader::getBoolean); + } else if ("discoGroupName".equals(fieldName)) { + discoGroupName = reader.getString(); + } else if ("auditTrail".equals(fieldName)) { + auditTrail = reader.readArray(reader1 -> AuditTrailItem.fromJson(reader1)); + } else if ("reason".equals(fieldName)) { + reason = reader.getString(); + } else if ("asset".equals(fieldName)) { + asset = DomainAsset.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + DomainAssetResource deserializedDomainAssetResource = new DomainAssetResource(asset); + deserializedDomainAssetResource.setId(id); + deserializedDomainAssetResource.name = name; + deserializedDomainAssetResource.displayName = displayName; + deserializedDomainAssetResource.uuid = uuid; + deserializedDomainAssetResource.createdDate = createdDate; + deserializedDomainAssetResource.updatedDate = updatedDate; + deserializedDomainAssetResource.state = state; + deserializedDomainAssetResource.externalId = externalId; + deserializedDomainAssetResource.labels = labels; + deserializedDomainAssetResource.wildcard = wildcard; + deserializedDomainAssetResource.discoGroupName = discoGroupName; + deserializedDomainAssetResource.auditTrail = auditTrail; + deserializedDomainAssetResource.reason = reason; + deserializedDomainAssetResource.kind = kind; + return deserializedDomainAssetResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorDetail.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorDetail.java index 558e1c5edbf0..292410ff3fc6 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorDetail.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorDetail.java @@ -5,49 +5,47 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * This is the top-level error object whose code matches the x-ms-error-code response header. */ @Immutable -public final class ErrorDetail { +public final class ErrorDetail implements JsonSerializable { /* * This is one of a server-defined set of error codes. */ @Generated - @JsonProperty(value = "code") - private String code; + private final String code; /* * This is a human-readable representation of the error. */ @Generated - @JsonProperty(value = "message") - private String message; + private final String message; /* * This is the error target. */ @Generated - @JsonProperty(value = "target") private String target; /* * This is an array of details about specific errors that led to this reported error. */ @Generated - @JsonProperty(value = "details") private List details; /* * This is an object containing more specific information than the current object about the error. */ @Generated - @JsonProperty(value = "innererror") private InnerError innererror; /** @@ -57,8 +55,7 @@ public final class ErrorDetail { * @param message the message value to set. */ @Generated - @JsonCreator - private ErrorDetail(@JsonProperty(value = "code") String code, @JsonProperty(value = "message") String message) { + private ErrorDetail(String code, String message) { this.code = code; this.message = message; } @@ -104,8 +101,8 @@ public List getDetails() { } /** - * Get the innererror property: This is an object containing more specific information than the current object - * about the error. + * Get the innererror property: This is an object containing more specific information than the current object about + * the error. * * @return the innererror value. */ @@ -113,4 +110,61 @@ public List getDetails() { public InnerError getInnererror() { return this.innererror; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("innererror", this.innererror); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorDetail if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ErrorDetail. + */ + @Generated + public static ErrorDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String code = null; + String message = null; + String target = null; + List details = null; + InnerError innererror = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + code = reader.getString(); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else if ("target".equals(fieldName)) { + target = reader.getString(); + } else if ("details".equals(fieldName)) { + details = reader.readArray(reader1 -> ErrorDetail.fromJson(reader1)); + } else if ("innererror".equals(fieldName)) { + innererror = InnerError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ErrorDetail deserializedErrorDetail = new ErrorDetail(code, message); + deserializedErrorDetail.target = target; + deserializedErrorDetail.details = details; + deserializedErrorDetail.innererror = innererror; + return deserializedErrorDetail; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorResponse.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorResponse.java new file mode 100644 index 000000000000..6b30828eaace --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorResponse.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.models.ResponseError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A response containing error details. + */ +@Immutable +public final class ErrorResponse implements JsonSerializable { + /* + * The error object. + */ + @Generated + private final ResponseError error; + + /** + * Creates an instance of ErrorResponse class. + * + * @param error the error value to set. + */ + @Generated + private ErrorResponse(ResponseError error) { + this.error = error; + } + + /** + * Get the error property: The error object. + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ErrorResponse. + */ + @Generated + public static ErrorResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResponseError error = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("error".equals(fieldName)) { + error = ResponseError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new ErrorResponse(error); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalAssetType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalAssetType.java new file mode 100644 index 000000000000..6757410ae238 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalAssetType.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A list of global asset type. + */ +public final class GlobalAssetType extends ExpandableStringEnum { + /** + * page. + */ + @Generated + public static final GlobalAssetType PAGE = fromString("page"); + + /** + * resource. + */ + @Generated + public static final GlobalAssetType RESOURCE = fromString("resource"); + + /** + * mail server. + */ + @Generated + public static final GlobalAssetType MAIL_SERVER = fromString("mailServer"); + + /** + * name server. + */ + @Generated + public static final GlobalAssetType NAME_SERVER = fromString("nameServer"); + + /** + * host. + */ + @Generated + public static final GlobalAssetType HOST = fromString("host"); + + /** + * domain. + */ + @Generated + public static final GlobalAssetType DOMAIN = fromString("domain"); + + /** + * ip address. + */ + @Generated + public static final GlobalAssetType IP_ADDRESS = fromString("ipAddress"); + + /** + * ip block. + */ + @Generated + public static final GlobalAssetType IP_BLOCK = fromString("ipBlock"); + + /** + * autonomous system number. + */ + @Generated + public static final GlobalAssetType AS = fromString("as"); + + /** + * contact. + */ + @Generated + public static final GlobalAssetType CONTACT = fromString("contact"); + + /** + * ssl certificate. + */ + @Generated + public static final GlobalAssetType SSL_CERT = fromString("sslCert"); + + /** + * Creates a new instance of GlobalAssetType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GlobalAssetType() { + } + + /** + * Creates or finds a GlobalAssetType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GlobalAssetType. + */ + @Generated + public static GlobalAssetType fromString(String name) { + return fromString(name, GlobalAssetType.class); + } + + /** + * Gets known GlobalAssetType values. + * + * @return known GlobalAssetType values. + */ + @Generated + public static Collection values() { + return values(GlobalAssetType.class); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalInventoryState.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalInventoryState.java new file mode 100644 index 000000000000..0ecfcdf46d6a --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalInventoryState.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A list of global inventory states. + */ +public final class GlobalInventoryState extends ExpandableStringEnum { + /** + * candidate. + */ + @Generated + public static final GlobalInventoryState CANDIDATE = fromString("candidate"); + + /** + * candidate investigate. + */ + @Generated + public static final GlobalInventoryState CANDIDATE_INVESTIGATE = fromString("candidateInvestigate"); + + /** + * confirmed. + */ + @Generated + public static final GlobalInventoryState CONFIRMED = fromString("confirmed"); + + /** + * associated. + */ + @Generated + public static final GlobalInventoryState ASSOCIATED = fromString("associated"); + + /** + * associated partner. + */ + @Generated + public static final GlobalInventoryState ASSOCIATED_PARTNER = fromString("associatedPartner"); + + /** + * associated third party. + */ + @Generated + public static final GlobalInventoryState ASSOCIATED_THIRD_PARTY = fromString("associatedThirdParty"); + + /** + * archived. + */ + @Generated + public static final GlobalInventoryState ARCHIVED = fromString("archived"); + + /** + * dismissed. + */ + @Generated + public static final GlobalInventoryState DISMISSED = fromString("dismissed"); + + /** + * auto confirmed. + */ + @Generated + public static final GlobalInventoryState AUTOCONFIRMED = fromString("autoconfirmed"); + + /** + * Creates a new instance of GlobalInventoryState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GlobalInventoryState() { + } + + /** + * Creates or finds a GlobalInventoryState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GlobalInventoryState. + */ + @Generated + public static GlobalInventoryState fromString(String name) { + return fromString(name, GlobalInventoryState.class); + } + + /** + * Gets known GlobalInventoryState values. + * + * @return known GlobalInventoryState values. + */ + @Generated + public static Collection values() { + return values(GlobalInventoryState.class); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GuidPair.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GuidPair.java index 92d80118e0f5..7257d01e4459 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GuidPair.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GuidPair.java @@ -5,41 +5,43 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The GuidPair model. */ @Immutable -public final class GuidPair { +public final class GuidPair implements JsonSerializable { /* * The pageGuid property. */ @Generated - @JsonProperty(value = "pageGuid") private String pageGuid; /* * The crawlStateGuid property. */ @Generated - @JsonProperty(value = "crawlStateGuid") private String crawlStateGuid; /* * The loadDate property. */ @Generated - @JsonProperty(value = "loadDate") private OffsetDateTime loadDate; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /** @@ -88,4 +90,51 @@ public OffsetDateTime getLoadDate() { public Boolean isRecent() { return this.recent; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pageGuid", this.pageGuid); + jsonWriter.writeStringField("crawlStateGuid", this.crawlStateGuid); + jsonWriter.writeStringField("loadDate", + this.loadDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.loadDate)); + jsonWriter.writeBooleanField("recent", this.recent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuidPair from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuidPair if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the GuidPair. + */ + @Generated + public static GuidPair fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuidPair deserializedGuidPair = new GuidPair(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("pageGuid".equals(fieldName)) { + deserializedGuidPair.pageGuid = reader.getString(); + } else if ("crawlStateGuid".equals(fieldName)) { + deserializedGuidPair.crawlStateGuid = reader.getString(); + } else if ("loadDate".equals(fieldName)) { + deserializedGuidPair.loadDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("recent".equals(fieldName)) { + deserializedGuidPair.recent = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedGuidPair; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAsset.java index 5b97ccfac964..341c210de1f3 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAsset.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAsset.java @@ -5,8 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -19,231 +24,198 @@ public final class HostAsset extends InventoryAsset { * The host property. */ @Generated - @JsonProperty(value = "host") private String host; /* * The domain property. */ @Generated - @JsonProperty(value = "domain") private String domain; /* * The ipAddresses property. */ @Generated - @JsonProperty(value = "ipAddresses") private List ipAddresses; /* * The webComponents property. */ @Generated - @JsonProperty(value = "webComponents") private List webComponents; /* * The headers property. */ @Generated - @JsonProperty(value = "headers") private List headers; /* * The attributes property. */ @Generated - @JsonProperty(value = "attributes") private List attributes; /* * The cookies property. */ @Generated - @JsonProperty(value = "cookies") private List cookies; /* * The sslCerts property. */ @Generated - @JsonProperty(value = "sslCerts") private List sslCerts; /* * The parentHosts property. */ @Generated - @JsonProperty(value = "parentHosts") private List parentHosts; /* * The childHosts property. */ @Generated - @JsonProperty(value = "childHosts") private List childHosts; /* * The hostCore property. */ @Generated - @JsonProperty(value = "hostCore") private HostCore hostCore; /* * The services property. */ @Generated - @JsonProperty(value = "services") private List services; /* * The cnames property. */ @Generated - @JsonProperty(value = "cnames") private List cnames; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The resourceUrls property. */ @Generated - @JsonProperty(value = "resourceUrls") private List resourceUrls; /* * The scanMetadata property. */ @Generated - @JsonProperty(value = "scanMetadata") private List scanMetadata; /* * The asns property. */ @Generated - @JsonProperty(value = "asns") private List asns; /* * The ipBlocks property. */ @Generated - @JsonProperty(value = "ipBlocks") private List ipBlocks; /* * The responseBodies property. */ @Generated - @JsonProperty(value = "responseBodies") private List responseBodies; /* * The domainAsset property. */ @Generated - @JsonProperty(value = "domainAsset") private DomainAsset domainAsset; /* * The nsRecord property. */ @Generated - @JsonProperty(value = "nsRecord") private List nsRecord; /* * The mxRecord property. */ @Generated - @JsonProperty(value = "mxRecord") private List mxRecord; /* * The webserver property. */ @Generated - @JsonProperty(value = "webserver") private List webserver; /* * The location property. */ @Generated - @JsonProperty(value = "location") private List location; /* * The nxdomain property. */ @Generated - @JsonProperty(value = "nxdomain") private List nxdomain; /* * The sslServerConfig property. */ @Generated - @JsonProperty(value = "sslServerConfig") private List sslServerConfig; /* * The isWildcard property. */ @Generated - @JsonProperty(value = "isWildcard") private List isWildcard; /* * The banners property. */ @Generated - @JsonProperty(value = "banners") private List banners; /* * The ipv4 property. */ @Generated - @JsonProperty(value = "ipv4") private List ipv4; /* * The ipv6 property. */ @Generated - @JsonProperty(value = "ipv6") private List ipv6; /** @@ -582,4 +554,169 @@ public List getIpv4() { public List getIpv6() { return this.ipv6; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeArrayField("ipAddresses", this.ipAddresses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("webComponents", this.webComponents, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("attributes", this.attributes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("cookies", this.cookies, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sslCerts", this.sslCerts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("parentHosts", this.parentHosts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("childHosts", this.childHosts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("hostCore", this.hostCore); + jsonWriter.writeArrayField("services", this.services, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("cnames", this.cnames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeArrayField("resourceUrls", this.resourceUrls, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("scanMetadata", this.scanMetadata, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("asns", this.asns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipBlocks", this.ipBlocks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("responseBodies", this.responseBodies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("domainAsset", this.domainAsset); + jsonWriter.writeArrayField("nsRecord", this.nsRecord, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("mxRecord", this.mxRecord, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("webserver", this.webserver, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("location", this.location, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("nxdomain", this.nxdomain, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sslServerConfig", this.sslServerConfig, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("isWildcard", this.isWildcard, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("banners", this.banners, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipv4", this.ipv4, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipv6", this.ipv6, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostAsset if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the HostAsset. + */ + @Generated + public static HostAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostAsset deserializedHostAsset = new HostAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("host".equals(fieldName)) { + deserializedHostAsset.host = reader.getString(); + } else if ("domain".equals(fieldName)) { + deserializedHostAsset.domain = reader.getString(); + } else if ("ipAddresses".equals(fieldName)) { + List ipAddresses = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedHostAsset.ipAddresses = ipAddresses; + } else if ("webComponents".equals(fieldName)) { + List webComponents = reader.readArray(reader1 -> WebComponent.fromJson(reader1)); + deserializedHostAsset.webComponents = webComponents; + } else if ("headers".equals(fieldName)) { + List headers = reader.readArray(reader1 -> ObservedHeader.fromJson(reader1)); + deserializedHostAsset.headers = headers; + } else if ("attributes".equals(fieldName)) { + List attributes = reader.readArray(reader1 -> Attribute.fromJson(reader1)); + deserializedHostAsset.attributes = attributes; + } else if ("cookies".equals(fieldName)) { + List cookies = reader.readArray(reader1 -> Cookie.fromJson(reader1)); + deserializedHostAsset.cookies = cookies; + } else if ("sslCerts".equals(fieldName)) { + List sslCerts = reader.readArray(reader1 -> SslCertAsset.fromJson(reader1)); + deserializedHostAsset.sslCerts = sslCerts; + } else if ("parentHosts".equals(fieldName)) { + List parentHosts = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedHostAsset.parentHosts = parentHosts; + } else if ("childHosts".equals(fieldName)) { + List childHosts = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedHostAsset.childHosts = childHosts; + } else if ("hostCore".equals(fieldName)) { + deserializedHostAsset.hostCore = HostCore.fromJson(reader); + } else if ("services".equals(fieldName)) { + List services = reader.readArray(reader1 -> Service.fromJson(reader1)); + deserializedHostAsset.services = services; + } else if ("cnames".equals(fieldName)) { + List cnames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedHostAsset.cnames = cnames; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedHostAsset.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedHostAsset.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedHostAsset.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedHostAsset.count = reader.getNullable(JsonReader::getLong); + } else if ("resourceUrls".equals(fieldName)) { + List resourceUrls = reader.readArray(reader1 -> ResourceUrl.fromJson(reader1)); + deserializedHostAsset.resourceUrls = resourceUrls; + } else if ("scanMetadata".equals(fieldName)) { + List scanMetadata = reader.readArray(reader1 -> ScanMetadata.fromJson(reader1)); + deserializedHostAsset.scanMetadata = scanMetadata; + } else if ("asns".equals(fieldName)) { + List asns = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedHostAsset.asns = asns; + } else if ("ipBlocks".equals(fieldName)) { + List ipBlocks = reader.readArray(reader1 -> IpBlock.fromJson(reader1)); + deserializedHostAsset.ipBlocks = ipBlocks; + } else if ("responseBodies".equals(fieldName)) { + List responseBodies = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedHostAsset.responseBodies = responseBodies; + } else if ("domainAsset".equals(fieldName)) { + deserializedHostAsset.domainAsset = DomainAsset.fromJson(reader); + } else if ("nsRecord".equals(fieldName)) { + List nsRecord = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedHostAsset.nsRecord = nsRecord; + } else if ("mxRecord".equals(fieldName)) { + List mxRecord = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedHostAsset.mxRecord = mxRecord; + } else if ("webserver".equals(fieldName)) { + List webserver = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedHostAsset.webserver = webserver; + } else if ("location".equals(fieldName)) { + List location = reader.readArray(reader1 -> ObservedLocation.fromJson(reader1)); + deserializedHostAsset.location = location; + } else if ("nxdomain".equals(fieldName)) { + List nxdomain = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedHostAsset.nxdomain = nxdomain; + } else if ("sslServerConfig".equals(fieldName)) { + List sslServerConfig + = reader.readArray(reader1 -> SslServerConfig.fromJson(reader1)); + deserializedHostAsset.sslServerConfig = sslServerConfig; + } else if ("isWildcard".equals(fieldName)) { + List isWildcard = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedHostAsset.isWildcard = isWildcard; + } else if ("banners".equals(fieldName)) { + List banners = reader.readArray(reader1 -> Banner.fromJson(reader1)); + deserializedHostAsset.banners = banners; + } else if ("ipv4".equals(fieldName)) { + List ipv4 = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedHostAsset.ipv4 = ipv4; + } else if ("ipv6".equals(fieldName)) { + List ipv6 = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedHostAsset.ipv6 = ipv6; + } else { + reader.skipChildren(); + } + } + return deserializedHostAsset; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAssetResource.java index f04bf6093763..4a6337895b4b 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAssetResource.java @@ -5,16 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; /** * The HostAssetResource model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("host") @Immutable public final class HostAssetResource extends AssetResource { @@ -22,8 +24,7 @@ public final class HostAssetResource extends AssetResource { * asset */ @Generated - @JsonProperty(value = "asset") - private HostAsset asset; + private final HostAsset asset; /** * Creates an instance of HostAssetResource class. @@ -31,8 +32,7 @@ public final class HostAssetResource extends AssetResource { * @param asset the asset value to set. */ @Generated - @JsonCreator - private HostAssetResource(@JsonProperty(value = "asset") HostAsset asset) { + private HostAssetResource(HostAsset asset) { this.asset = asset; } @@ -45,4 +45,338 @@ private HostAssetResource(@JsonProperty(value = "asset") HostAsset asset) { public HostAsset getAsset() { return this.asset; } + + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "host"; + + /* + * The caller provided unique name for the resource. + */ + @Generated + private String name; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * Global UUID for the asset. + */ + @Generated + private String uuid; + + /* + * The date this asset was first added to this workspace. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The date this asset was last updated for this workspace. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The state property. + */ + @Generated + private AssetState state; + + /* + * An optional customer provided identifier for this asset. + */ + @Generated + private String externalId; + + /* + * Customer labels assigned to this asset. + */ + @Generated + private List labels; + + /* + * An indicator of whether this asset represents a wildcard rollup of assets on this domain. + */ + @Generated + private Boolean wildcard; + + /* + * The name of the DiscoGroup that brought added this asset to the workspace. + */ + @Generated + private String discoGroupName; + + /* + * The history of how this asset was pulled into the workspace through the discovery process. + */ + @Generated + private List auditTrail; + + /* + * The reason property. + */ + @Generated + private String reason; + + /** + * Get the kind property: Discriminator property for AssetResource. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + @Override + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the uuid property: Global UUID for the asset. + * + * @return the uuid value. + */ + @Generated + @Override + public String getUuid() { + return this.uuid; + } + + /** + * Get the createdDate property: The date this asset was first added to this workspace. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the updatedDate property: The date this asset was last updated for this workspace. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + @Generated + @Override + public AssetState getState() { + return this.state; + } + + /** + * Get the externalId property: An optional customer provided identifier for this asset. + * + * @return the externalId value. + */ + @Generated + @Override + public String getExternalId() { + return this.externalId; + } + + /** + * Get the labels property: Customer labels assigned to this asset. + * + * @return the labels value. + */ + @Generated + @Override + public List getLabels() { + return this.labels; + } + + /** + * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. + * + * @return the wildcard value. + */ + @Generated + @Override + public Boolean isWildcard() { + return this.wildcard; + } + + /** + * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * + * @return the discoGroupName value. + */ + @Generated + @Override + public String getDiscoGroupName() { + return this.discoGroupName; + } + + /** + * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. + * + * @return the auditTrail value. + */ + @Generated + @Override + public List getAuditTrail() { + return this.auditTrail; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + @Override + public String getReason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("uuid", getUuid()); + jsonWriter.writeStringField("createdDate", + getCreatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCreatedDate())); + jsonWriter.writeStringField("updatedDate", + getUpdatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getUpdatedDate())); + jsonWriter.writeStringField("state", getState() == null ? null : getState().toString()); + jsonWriter.writeStringField("externalId", getExternalId()); + jsonWriter.writeArrayField("labels", getLabels(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("wildcard", isWildcard()); + jsonWriter.writeStringField("discoGroupName", getDiscoGroupName()); + jsonWriter.writeArrayField("auditTrail", getAuditTrail(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reason", getReason()); + jsonWriter.writeJsonField("asset", this.asset); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostAssetResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostAssetResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HostAssetResource. + */ + @Generated + public static HostAssetResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String displayName = null; + String uuid = null; + OffsetDateTime createdDate = null; + OffsetDateTime updatedDate = null; + AssetState state = null; + String externalId = null; + List labels = null; + Boolean wildcard = null; + String discoGroupName = null; + List auditTrail = null; + String reason = null; + HostAsset asset = null; + String kind = "host"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("uuid".equals(fieldName)) { + uuid = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + state = AssetState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + labels = reader.readArray(reader1 -> reader1.getString()); + } else if ("wildcard".equals(fieldName)) { + wildcard = reader.getNullable(JsonReader::getBoolean); + } else if ("discoGroupName".equals(fieldName)) { + discoGroupName = reader.getString(); + } else if ("auditTrail".equals(fieldName)) { + auditTrail = reader.readArray(reader1 -> AuditTrailItem.fromJson(reader1)); + } else if ("reason".equals(fieldName)) { + reason = reader.getString(); + } else if ("asset".equals(fieldName)) { + asset = HostAsset.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + HostAssetResource deserializedHostAssetResource = new HostAssetResource(asset); + deserializedHostAssetResource.setId(id); + deserializedHostAssetResource.name = name; + deserializedHostAssetResource.displayName = displayName; + deserializedHostAssetResource.uuid = uuid; + deserializedHostAssetResource.createdDate = createdDate; + deserializedHostAssetResource.updatedDate = updatedDate; + deserializedHostAssetResource.state = state; + deserializedHostAssetResource.externalId = externalId; + deserializedHostAssetResource.labels = labels; + deserializedHostAssetResource.wildcard = wildcard; + deserializedHostAssetResource.discoGroupName = discoGroupName; + deserializedHostAssetResource.auditTrail = auditTrail; + deserializedHostAssetResource.reason = reason; + deserializedHostAssetResource.kind = kind; + return deserializedHostAssetResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostCore.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostCore.java index b6a3d7c48bea..03118230af9c 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostCore.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostCore.java @@ -5,279 +5,247 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The HostCore model. */ @Immutable -public final class HostCore { +public final class HostCore implements JsonSerializable { /* * The host property. */ @Generated - @JsonProperty(value = "host") private String host; /* * The domain property. */ @Generated - @JsonProperty(value = "domain") private String domain; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The blacklistCauseFirstSeen property. */ @Generated - @JsonProperty(value = "blacklistCauseFirstSeen") private OffsetDateTime blacklistCauseFirstSeen; /* * The blacklistCauseLastSeen property. */ @Generated - @JsonProperty(value = "blacklistCauseLastSeen") private OffsetDateTime blacklistCauseLastSeen; /* * The blacklistCauseCount property. */ @Generated - @JsonProperty(value = "blacklistCauseCount") private Long blacklistCauseCount; /* * The blacklistResourceFirstSeen property. */ @Generated - @JsonProperty(value = "blacklistResourceFirstSeen") private OffsetDateTime blacklistResourceFirstSeen; /* * The blacklistResourceLastSeen property. */ @Generated - @JsonProperty(value = "blacklistResourceLastSeen") private OffsetDateTime blacklistResourceLastSeen; /* * The blacklistResourceCount property. */ @Generated - @JsonProperty(value = "blacklistResourceCount") private Long blacklistResourceCount; /* * The blacklistSequenceFirstSeen property. */ @Generated - @JsonProperty(value = "blacklistSequenceFirstSeen") private OffsetDateTime blacklistSequenceFirstSeen; /* * The blacklistSequenceLastSeen property. */ @Generated - @JsonProperty(value = "blacklistSequenceLastSeen") private OffsetDateTime blacklistSequenceLastSeen; /* * The blacklistSequenceCount property. */ @Generated - @JsonProperty(value = "blacklistSequenceCount") private Long blacklistSequenceCount; /* * The phishCauseCount property. */ @Generated - @JsonProperty(value = "phishCauseCount") private Long phishCauseCount; /* * The malwareCauseCount property. */ @Generated - @JsonProperty(value = "malwareCauseCount") private Long malwareCauseCount; /* * The spamCauseCount property. */ @Generated - @JsonProperty(value = "spamCauseCount") private Long spamCauseCount; /* * The scamCauseCount property. */ @Generated - @JsonProperty(value = "scamCauseCount") private Long scamCauseCount; /* * The phishResourceCount property. */ @Generated - @JsonProperty(value = "phishResourceCount") private Long phishResourceCount; /* * The malwareResourceCount property. */ @Generated - @JsonProperty(value = "malwareResourceCount") private Long malwareResourceCount; /* * The spamResourceCount property. */ @Generated - @JsonProperty(value = "spamResourceCount") private Long spamResourceCount; /* * The scamResourceCount property. */ @Generated - @JsonProperty(value = "scamResourceCount") private Long scamResourceCount; /* * The phishSequenceCount property. */ @Generated - @JsonProperty(value = "phishSequenceCount") private Long phishSequenceCount; /* * The malwareSequenceCount property. */ @Generated - @JsonProperty(value = "malwareSequenceCount") private Long malwareSequenceCount; /* * The spamSequenceCount property. */ @Generated - @JsonProperty(value = "spamSequenceCount") private Long spamSequenceCount; /* * The scamSequenceCount property. */ @Generated - @JsonProperty(value = "scamSequenceCount") private Long scamSequenceCount; /* * The alexaRank property. */ @Generated - @JsonProperty(value = "alexaRank") private Integer alexaRank; /* * The hostReputationScore property. */ @Generated - @JsonProperty(value = "hostReputationScore") private Integer hostReputationScore; /* * The hostPhishReputationScore property. */ @Generated - @JsonProperty(value = "hostPhishReputationScore") private Integer hostPhishReputationScore; /* * The hostMalwareReputationScore property. */ @Generated - @JsonProperty(value = "hostMalwareReputationScore") private Integer hostMalwareReputationScore; /* * The hostSpamReputationScore property. */ @Generated - @JsonProperty(value = "hostSpamReputationScore") private Integer hostSpamReputationScore; /* * The hostScamReputationScore property. */ @Generated - @JsonProperty(value = "hostScamReputationScore") private Integer hostScamReputationScore; /* * The domainReputationScore property. */ @Generated - @JsonProperty(value = "domainReputationScore") private Integer domainReputationScore; /* * The domainPhishReputationScore property. */ @Generated - @JsonProperty(value = "domainPhishReputationScore") private Integer domainPhishReputationScore; /* * The domainMalwareReputationScore property. */ @Generated - @JsonProperty(value = "domainMalwareReputationScore") private Integer domainMalwareReputationScore; /* * The domainSpamReputationScore property. */ @Generated - @JsonProperty(value = "domainSpamReputationScore") private Integer domainSpamReputationScore; /* * The domainScamReputationScore property. */ @Generated - @JsonProperty(value = "domainScamReputationScore") private Integer domainScamReputationScore; /* * The uuid property. */ @Generated - @JsonProperty(value = "uuid") private String uuid; /** @@ -666,4 +634,179 @@ public Integer getDomainScamReputationScore() { public String getUuid() { return this.uuid; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeStringField("blacklistCauseFirstSeen", + this.blacklistCauseFirstSeen == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.blacklistCauseFirstSeen)); + jsonWriter.writeStringField("blacklistCauseLastSeen", + this.blacklistCauseLastSeen == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.blacklistCauseLastSeen)); + jsonWriter.writeNumberField("blacklistCauseCount", this.blacklistCauseCount); + jsonWriter.writeStringField("blacklistResourceFirstSeen", + this.blacklistResourceFirstSeen == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.blacklistResourceFirstSeen)); + jsonWriter.writeStringField("blacklistResourceLastSeen", + this.blacklistResourceLastSeen == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.blacklistResourceLastSeen)); + jsonWriter.writeNumberField("blacklistResourceCount", this.blacklistResourceCount); + jsonWriter.writeStringField("blacklistSequenceFirstSeen", + this.blacklistSequenceFirstSeen == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.blacklistSequenceFirstSeen)); + jsonWriter.writeStringField("blacklistSequenceLastSeen", + this.blacklistSequenceLastSeen == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.blacklistSequenceLastSeen)); + jsonWriter.writeNumberField("blacklistSequenceCount", this.blacklistSequenceCount); + jsonWriter.writeNumberField("phishCauseCount", this.phishCauseCount); + jsonWriter.writeNumberField("malwareCauseCount", this.malwareCauseCount); + jsonWriter.writeNumberField("spamCauseCount", this.spamCauseCount); + jsonWriter.writeNumberField("scamCauseCount", this.scamCauseCount); + jsonWriter.writeNumberField("phishResourceCount", this.phishResourceCount); + jsonWriter.writeNumberField("malwareResourceCount", this.malwareResourceCount); + jsonWriter.writeNumberField("spamResourceCount", this.spamResourceCount); + jsonWriter.writeNumberField("scamResourceCount", this.scamResourceCount); + jsonWriter.writeNumberField("phishSequenceCount", this.phishSequenceCount); + jsonWriter.writeNumberField("malwareSequenceCount", this.malwareSequenceCount); + jsonWriter.writeNumberField("spamSequenceCount", this.spamSequenceCount); + jsonWriter.writeNumberField("scamSequenceCount", this.scamSequenceCount); + jsonWriter.writeNumberField("alexaRank", this.alexaRank); + jsonWriter.writeNumberField("hostReputationScore", this.hostReputationScore); + jsonWriter.writeNumberField("hostPhishReputationScore", this.hostPhishReputationScore); + jsonWriter.writeNumberField("hostMalwareReputationScore", this.hostMalwareReputationScore); + jsonWriter.writeNumberField("hostSpamReputationScore", this.hostSpamReputationScore); + jsonWriter.writeNumberField("hostScamReputationScore", this.hostScamReputationScore); + jsonWriter.writeNumberField("domainReputationScore", this.domainReputationScore); + jsonWriter.writeNumberField("domainPhishReputationScore", this.domainPhishReputationScore); + jsonWriter.writeNumberField("domainMalwareReputationScore", this.domainMalwareReputationScore); + jsonWriter.writeNumberField("domainSpamReputationScore", this.domainSpamReputationScore); + jsonWriter.writeNumberField("domainScamReputationScore", this.domainScamReputationScore); + jsonWriter.writeStringField("uuid", this.uuid); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostCore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostCore if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the HostCore. + */ + @Generated + public static HostCore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostCore deserializedHostCore = new HostCore(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("host".equals(fieldName)) { + deserializedHostCore.host = reader.getString(); + } else if ("domain".equals(fieldName)) { + deserializedHostCore.domain = reader.getString(); + } else if ("firstSeen".equals(fieldName)) { + deserializedHostCore.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedHostCore.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedHostCore.count = reader.getNullable(JsonReader::getLong); + } else if ("blacklistCauseFirstSeen".equals(fieldName)) { + deserializedHostCore.blacklistCauseFirstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("blacklistCauseLastSeen".equals(fieldName)) { + deserializedHostCore.blacklistCauseLastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("blacklistCauseCount".equals(fieldName)) { + deserializedHostCore.blacklistCauseCount = reader.getNullable(JsonReader::getLong); + } else if ("blacklistResourceFirstSeen".equals(fieldName)) { + deserializedHostCore.blacklistResourceFirstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("blacklistResourceLastSeen".equals(fieldName)) { + deserializedHostCore.blacklistResourceLastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("blacklistResourceCount".equals(fieldName)) { + deserializedHostCore.blacklistResourceCount = reader.getNullable(JsonReader::getLong); + } else if ("blacklistSequenceFirstSeen".equals(fieldName)) { + deserializedHostCore.blacklistSequenceFirstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("blacklistSequenceLastSeen".equals(fieldName)) { + deserializedHostCore.blacklistSequenceLastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("blacklistSequenceCount".equals(fieldName)) { + deserializedHostCore.blacklistSequenceCount = reader.getNullable(JsonReader::getLong); + } else if ("phishCauseCount".equals(fieldName)) { + deserializedHostCore.phishCauseCount = reader.getNullable(JsonReader::getLong); + } else if ("malwareCauseCount".equals(fieldName)) { + deserializedHostCore.malwareCauseCount = reader.getNullable(JsonReader::getLong); + } else if ("spamCauseCount".equals(fieldName)) { + deserializedHostCore.spamCauseCount = reader.getNullable(JsonReader::getLong); + } else if ("scamCauseCount".equals(fieldName)) { + deserializedHostCore.scamCauseCount = reader.getNullable(JsonReader::getLong); + } else if ("phishResourceCount".equals(fieldName)) { + deserializedHostCore.phishResourceCount = reader.getNullable(JsonReader::getLong); + } else if ("malwareResourceCount".equals(fieldName)) { + deserializedHostCore.malwareResourceCount = reader.getNullable(JsonReader::getLong); + } else if ("spamResourceCount".equals(fieldName)) { + deserializedHostCore.spamResourceCount = reader.getNullable(JsonReader::getLong); + } else if ("scamResourceCount".equals(fieldName)) { + deserializedHostCore.scamResourceCount = reader.getNullable(JsonReader::getLong); + } else if ("phishSequenceCount".equals(fieldName)) { + deserializedHostCore.phishSequenceCount = reader.getNullable(JsonReader::getLong); + } else if ("malwareSequenceCount".equals(fieldName)) { + deserializedHostCore.malwareSequenceCount = reader.getNullable(JsonReader::getLong); + } else if ("spamSequenceCount".equals(fieldName)) { + deserializedHostCore.spamSequenceCount = reader.getNullable(JsonReader::getLong); + } else if ("scamSequenceCount".equals(fieldName)) { + deserializedHostCore.scamSequenceCount = reader.getNullable(JsonReader::getLong); + } else if ("alexaRank".equals(fieldName)) { + deserializedHostCore.alexaRank = reader.getNullable(JsonReader::getInt); + } else if ("hostReputationScore".equals(fieldName)) { + deserializedHostCore.hostReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("hostPhishReputationScore".equals(fieldName)) { + deserializedHostCore.hostPhishReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("hostMalwareReputationScore".equals(fieldName)) { + deserializedHostCore.hostMalwareReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("hostSpamReputationScore".equals(fieldName)) { + deserializedHostCore.hostSpamReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("hostScamReputationScore".equals(fieldName)) { + deserializedHostCore.hostScamReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("domainReputationScore".equals(fieldName)) { + deserializedHostCore.domainReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("domainPhishReputationScore".equals(fieldName)) { + deserializedHostCore.domainPhishReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("domainMalwareReputationScore".equals(fieldName)) { + deserializedHostCore.domainMalwareReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("domainSpamReputationScore".equals(fieldName)) { + deserializedHostCore.domainSpamReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("domainScamReputationScore".equals(fieldName)) { + deserializedHostCore.domainScamReputationScore = reader.getNullable(JsonReader::getInt); + } else if ("uuid".equals(fieldName)) { + deserializedHostCore.uuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedHostCore; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InnerError.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InnerError.java index 56cb78b3f89f..91190d05931c 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InnerError.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InnerError.java @@ -5,26 +5,28 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * This is an object containing more specific information than the current object about the error. */ @Immutable -public final class InnerError { +public final class InnerError implements JsonSerializable { /* * This is a more specific error code than was provided by the containing error. */ @Generated - @JsonProperty(value = "code") private String code; /* * This is an additional field representing the value that caused the error to help with debugging. */ @Generated - @JsonProperty(value = "value") private Object value; /** @@ -54,4 +56,43 @@ public String getCode() { public Object getValue() { return this.value; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeUntypedField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InnerError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InnerError if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the InnerError. + */ + @Generated + public static InnerError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InnerError deserializedInnerError = new InnerError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + deserializedInnerError.code = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedInnerError.value = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + return deserializedInnerError; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InventoryAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InventoryAsset.java index 6c2733b2b67e..74688305fab1 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InventoryAsset.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InventoryAsset.java @@ -5,12 +5,17 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * The InventoryAsset model. + * A inventory base model created for swagger documentation purpose. */ @Immutable -public class InventoryAsset { +public class InventoryAsset implements JsonSerializable { /** * Creates an instance of InventoryAsset class. @@ -18,4 +23,35 @@ public class InventoryAsset { @Generated protected InventoryAsset() { } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InventoryAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InventoryAsset if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InventoryAsset. + */ + @Generated + public static InventoryAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InventoryAsset deserializedInventoryAsset = new InventoryAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + reader.skipChildren(); + } + return deserializedInventoryAsset; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAsset.java index eaf55f17626a..bc849e690111 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAsset.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAsset.java @@ -5,8 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -19,175 +24,150 @@ public final class IpAddressAsset extends InventoryAsset { * The ipAddress property. */ @Generated - @JsonProperty(value = "ipAddress") private String ipAddress; /* * The asns property. */ @Generated - @JsonProperty(value = "asns") private List asns; /* * The reputations property. */ @Generated - @JsonProperty(value = "reputations") private List reputations; /* * The webComponents property. */ @Generated - @JsonProperty(value = "webComponents") private List webComponents; /* * The netRanges property. */ @Generated - @JsonProperty(value = "netRanges") private List netRanges; /* * The headers property. */ @Generated - @JsonProperty(value = "headers") private List headers; /* * The attributes property. */ @Generated - @JsonProperty(value = "attributes") private List attributes; /* * The cookies property. */ @Generated - @JsonProperty(value = "cookies") private List cookies; /* * The sslCerts property. */ @Generated - @JsonProperty(value = "sslCerts") private List sslCerts; /* * The services property. */ @Generated - @JsonProperty(value = "services") private List services; /* * The ipBlocks property. */ @Generated - @JsonProperty(value = "ipBlocks") private List ipBlocks; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The banners property. */ @Generated - @JsonProperty(value = "banners") private List banners; /* * The scanMetadata property. */ @Generated - @JsonProperty(value = "scanMetadata") private List scanMetadata; /* * The nsRecord property. */ @Generated - @JsonProperty(value = "nsRecord") private List nsRecord; /* * The mxRecord property. */ @Generated - @JsonProperty(value = "mxRecord") private List mxRecord; /* * The location property. */ @Generated - @JsonProperty(value = "location") private List location; /* * The hosts property. */ @Generated - @JsonProperty(value = "hosts") private List hosts; /* * The nxdomain property. */ @Generated - @JsonProperty(value = "nxdomain") private List nxdomain; /* * The sslServerConfig property. */ @Generated - @JsonProperty(value = "sslServerConfig") private List sslServerConfig; /* * The ipv4 property. */ @Generated - @JsonProperty(value = "ipv4") private Boolean ipv4; /* * The ipv6 property. */ @Generated - @JsonProperty(value = "ipv6") private Boolean ipv6; /** @@ -446,4 +426,137 @@ public Boolean isIpv4() { public Boolean isIpv6() { return this.ipv6; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeArrayField("asns", this.asns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("reputations", this.reputations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("webComponents", this.webComponents, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("netRanges", this.netRanges, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("attributes", this.attributes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("cookies", this.cookies, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sslCerts", this.sslCerts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("services", this.services, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipBlocks", this.ipBlocks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeArrayField("banners", this.banners, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("scanMetadata", this.scanMetadata, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("nsRecord", this.nsRecord, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("mxRecord", this.mxRecord, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("location", this.location, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("hosts", this.hosts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("nxdomain", this.nxdomain, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sslServerConfig", this.sslServerConfig, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("ipv4", this.ipv4); + jsonWriter.writeBooleanField("ipv6", this.ipv6); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAddressAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAddressAsset if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpAddressAsset. + */ + @Generated + public static IpAddressAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAddressAsset deserializedIpAddressAsset = new IpAddressAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("ipAddress".equals(fieldName)) { + deserializedIpAddressAsset.ipAddress = reader.getString(); + } else if ("asns".equals(fieldName)) { + List asns = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedIpAddressAsset.asns = asns; + } else if ("reputations".equals(fieldName)) { + List reputations = reader.readArray(reader1 -> Reputation.fromJson(reader1)); + deserializedIpAddressAsset.reputations = reputations; + } else if ("webComponents".equals(fieldName)) { + List webComponents = reader.readArray(reader1 -> WebComponent.fromJson(reader1)); + deserializedIpAddressAsset.webComponents = webComponents; + } else if ("netRanges".equals(fieldName)) { + List netRanges = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpAddressAsset.netRanges = netRanges; + } else if ("headers".equals(fieldName)) { + List headers = reader.readArray(reader1 -> ObservedHeader.fromJson(reader1)); + deserializedIpAddressAsset.headers = headers; + } else if ("attributes".equals(fieldName)) { + List attributes = reader.readArray(reader1 -> Attribute.fromJson(reader1)); + deserializedIpAddressAsset.attributes = attributes; + } else if ("cookies".equals(fieldName)) { + List cookies = reader.readArray(reader1 -> Cookie.fromJson(reader1)); + deserializedIpAddressAsset.cookies = cookies; + } else if ("sslCerts".equals(fieldName)) { + List sslCerts = reader.readArray(reader1 -> SslCertAsset.fromJson(reader1)); + deserializedIpAddressAsset.sslCerts = sslCerts; + } else if ("services".equals(fieldName)) { + List services = reader.readArray(reader1 -> Service.fromJson(reader1)); + deserializedIpAddressAsset.services = services; + } else if ("ipBlocks".equals(fieldName)) { + List ipBlocks = reader.readArray(reader1 -> IpBlock.fromJson(reader1)); + deserializedIpAddressAsset.ipBlocks = ipBlocks; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedIpAddressAsset.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedIpAddressAsset.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedIpAddressAsset.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedIpAddressAsset.count = reader.getNullable(JsonReader::getLong); + } else if ("banners".equals(fieldName)) { + List banners = reader.readArray(reader1 -> Banner.fromJson(reader1)); + deserializedIpAddressAsset.banners = banners; + } else if ("scanMetadata".equals(fieldName)) { + List scanMetadata = reader.readArray(reader1 -> ScanMetadata.fromJson(reader1)); + deserializedIpAddressAsset.scanMetadata = scanMetadata; + } else if ("nsRecord".equals(fieldName)) { + List nsRecord = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedIpAddressAsset.nsRecord = nsRecord; + } else if ("mxRecord".equals(fieldName)) { + List mxRecord = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedIpAddressAsset.mxRecord = mxRecord; + } else if ("location".equals(fieldName)) { + List location = reader.readArray(reader1 -> ObservedLocation.fromJson(reader1)); + deserializedIpAddressAsset.location = location; + } else if ("hosts".equals(fieldName)) { + List hosts = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpAddressAsset.hosts = hosts; + } else if ("nxdomain".equals(fieldName)) { + List nxdomain = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedIpAddressAsset.nxdomain = nxdomain; + } else if ("sslServerConfig".equals(fieldName)) { + List sslServerConfig + = reader.readArray(reader1 -> SslServerConfig.fromJson(reader1)); + deserializedIpAddressAsset.sslServerConfig = sslServerConfig; + } else if ("ipv4".equals(fieldName)) { + deserializedIpAddressAsset.ipv4 = reader.getNullable(JsonReader::getBoolean); + } else if ("ipv6".equals(fieldName)) { + deserializedIpAddressAsset.ipv6 = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedIpAddressAsset; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAssetResource.java index 029cc6522c38..2125a18a80c0 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAssetResource.java @@ -5,16 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; /** * The IpAddressAssetResource model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("ipAddress") @Immutable public final class IpAddressAssetResource extends AssetResource { @@ -22,8 +24,7 @@ public final class IpAddressAssetResource extends AssetResource { * asset */ @Generated - @JsonProperty(value = "asset") - private IpAddressAsset asset; + private final IpAddressAsset asset; /** * Creates an instance of IpAddressAssetResource class. @@ -31,8 +32,7 @@ public final class IpAddressAssetResource extends AssetResource { * @param asset the asset value to set. */ @Generated - @JsonCreator - private IpAddressAssetResource(@JsonProperty(value = "asset") IpAddressAsset asset) { + private IpAddressAssetResource(IpAddressAsset asset) { this.asset = asset; } @@ -45,4 +45,338 @@ private IpAddressAssetResource(@JsonProperty(value = "asset") IpAddressAsset ass public IpAddressAsset getAsset() { return this.asset; } + + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "ipAddress"; + + /* + * The caller provided unique name for the resource. + */ + @Generated + private String name; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * Global UUID for the asset. + */ + @Generated + private String uuid; + + /* + * The date this asset was first added to this workspace. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The date this asset was last updated for this workspace. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The state property. + */ + @Generated + private AssetState state; + + /* + * An optional customer provided identifier for this asset. + */ + @Generated + private String externalId; + + /* + * Customer labels assigned to this asset. + */ + @Generated + private List labels; + + /* + * An indicator of whether this asset represents a wildcard rollup of assets on this domain. + */ + @Generated + private Boolean wildcard; + + /* + * The name of the DiscoGroup that brought added this asset to the workspace. + */ + @Generated + private String discoGroupName; + + /* + * The history of how this asset was pulled into the workspace through the discovery process. + */ + @Generated + private List auditTrail; + + /* + * The reason property. + */ + @Generated + private String reason; + + /** + * Get the kind property: Discriminator property for AssetResource. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + @Override + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the uuid property: Global UUID for the asset. + * + * @return the uuid value. + */ + @Generated + @Override + public String getUuid() { + return this.uuid; + } + + /** + * Get the createdDate property: The date this asset was first added to this workspace. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the updatedDate property: The date this asset was last updated for this workspace. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + @Generated + @Override + public AssetState getState() { + return this.state; + } + + /** + * Get the externalId property: An optional customer provided identifier for this asset. + * + * @return the externalId value. + */ + @Generated + @Override + public String getExternalId() { + return this.externalId; + } + + /** + * Get the labels property: Customer labels assigned to this asset. + * + * @return the labels value. + */ + @Generated + @Override + public List getLabels() { + return this.labels; + } + + /** + * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. + * + * @return the wildcard value. + */ + @Generated + @Override + public Boolean isWildcard() { + return this.wildcard; + } + + /** + * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * + * @return the discoGroupName value. + */ + @Generated + @Override + public String getDiscoGroupName() { + return this.discoGroupName; + } + + /** + * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. + * + * @return the auditTrail value. + */ + @Generated + @Override + public List getAuditTrail() { + return this.auditTrail; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + @Override + public String getReason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("uuid", getUuid()); + jsonWriter.writeStringField("createdDate", + getCreatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCreatedDate())); + jsonWriter.writeStringField("updatedDate", + getUpdatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getUpdatedDate())); + jsonWriter.writeStringField("state", getState() == null ? null : getState().toString()); + jsonWriter.writeStringField("externalId", getExternalId()); + jsonWriter.writeArrayField("labels", getLabels(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("wildcard", isWildcard()); + jsonWriter.writeStringField("discoGroupName", getDiscoGroupName()); + jsonWriter.writeArrayField("auditTrail", getAuditTrail(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reason", getReason()); + jsonWriter.writeJsonField("asset", this.asset); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAddressAssetResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAddressAssetResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IpAddressAssetResource. + */ + @Generated + public static IpAddressAssetResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String displayName = null; + String uuid = null; + OffsetDateTime createdDate = null; + OffsetDateTime updatedDate = null; + AssetState state = null; + String externalId = null; + List labels = null; + Boolean wildcard = null; + String discoGroupName = null; + List auditTrail = null; + String reason = null; + IpAddressAsset asset = null; + String kind = "ipAddress"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("uuid".equals(fieldName)) { + uuid = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + state = AssetState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + labels = reader.readArray(reader1 -> reader1.getString()); + } else if ("wildcard".equals(fieldName)) { + wildcard = reader.getNullable(JsonReader::getBoolean); + } else if ("discoGroupName".equals(fieldName)) { + discoGroupName = reader.getString(); + } else if ("auditTrail".equals(fieldName)) { + auditTrail = reader.readArray(reader1 -> AuditTrailItem.fromJson(reader1)); + } else if ("reason".equals(fieldName)) { + reason = reader.getString(); + } else if ("asset".equals(fieldName)) { + asset = IpAddressAsset.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + IpAddressAssetResource deserializedIpAddressAssetResource = new IpAddressAssetResource(asset); + deserializedIpAddressAssetResource.setId(id); + deserializedIpAddressAssetResource.name = name; + deserializedIpAddressAssetResource.displayName = displayName; + deserializedIpAddressAssetResource.uuid = uuid; + deserializedIpAddressAssetResource.createdDate = createdDate; + deserializedIpAddressAssetResource.updatedDate = updatedDate; + deserializedIpAddressAssetResource.state = state; + deserializedIpAddressAssetResource.externalId = externalId; + deserializedIpAddressAssetResource.labels = labels; + deserializedIpAddressAssetResource.wildcard = wildcard; + deserializedIpAddressAssetResource.discoGroupName = discoGroupName; + deserializedIpAddressAssetResource.auditTrail = auditTrail; + deserializedIpAddressAssetResource.reason = reason; + deserializedIpAddressAssetResource.kind = kind; + return deserializedIpAddressAssetResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlock.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlock.java index 5fcb98c8e52f..38c5b927c729 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlock.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlock.java @@ -5,56 +5,56 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The IpBlock model. */ @Immutable -public final class IpBlock { +public final class IpBlock implements JsonSerializable { /* * The ipBlock property. */ @Generated - @JsonProperty(value = "ipBlock") private String ipBlock; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /** @@ -123,4 +123,60 @@ public Long getCount() { public Boolean isRecent() { return this.recent; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipBlock", this.ipBlock); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeBooleanField("recent", this.recent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpBlock from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpBlock if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the IpBlock. + */ + @Generated + public static IpBlock fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpBlock deserializedIpBlock = new IpBlock(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("ipBlock".equals(fieldName)) { + deserializedIpBlock.ipBlock = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedIpBlock.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedIpBlock.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedIpBlock.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedIpBlock.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedIpBlock.recent = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedIpBlock; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAsset.java index 98127ba9d076..cf02fa09db86 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAsset.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAsset.java @@ -5,8 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -19,217 +24,186 @@ public final class IpBlockAsset extends InventoryAsset { * The ipBlock property. */ @Generated - @JsonProperty(value = "ipBlock") private String ipBlock; /* * The asns property. */ @Generated - @JsonProperty(value = "asns") private List asns; /* * The bgpPrefixes property. */ @Generated - @JsonProperty(value = "bgpPrefixes") private List bgpPrefixes; /* * The netNames property. */ @Generated - @JsonProperty(value = "netNames") private List netNames; /* * The registrantContacts property. */ @Generated - @JsonProperty(value = "registrantContacts") private List registrantContacts; /* * The registrantOrgs property. */ @Generated - @JsonProperty(value = "registrantOrgs") private List registrantOrgs; /* * The adminContacts property. */ @Generated - @JsonProperty(value = "adminContacts") private List adminContacts; /* * The technicalContacts property. */ @Generated - @JsonProperty(value = "technicalContacts") private List technicalContacts; /* * The registrarCreatedAt property. */ @Generated - @JsonProperty(value = "registrarCreatedAt") private List registrarCreatedAt; /* * The registrarUpdatedAt property. */ @Generated - @JsonProperty(value = "registrarUpdatedAt") private List registrarUpdatedAt; /* * The netRanges property. */ @Generated - @JsonProperty(value = "netRanges") private List netRanges; /* * The startIp property. */ @Generated - @JsonProperty(value = "startIp") private String startIp; /* * The endIp property. */ @Generated - @JsonProperty(value = "endIp") private String endIp; /* * The reputations property. */ @Generated - @JsonProperty(value = "reputations") private List reputations; /* * The detailedFromWhoisAt property. */ @Generated - @JsonProperty(value = "detailedFromWhoisAt") private OffsetDateTime detailedFromWhoisAt; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The location property. */ @Generated - @JsonProperty(value = "location") private List location; /* * The registrarExpiresAt property. */ @Generated - @JsonProperty(value = "registrarExpiresAt") private List registrarExpiresAt; /* * The registrantNames property. */ @Generated - @JsonProperty(value = "registrantNames") private List registrantNames; /* * The adminNames property. */ @Generated - @JsonProperty(value = "adminNames") private List adminNames; /* * The technicalNames property. */ @Generated - @JsonProperty(value = "technicalNames") private List technicalNames; /* * The adminOrgs property. */ @Generated - @JsonProperty(value = "adminOrgs") private List adminOrgs; /* * The technicalOrgs property. */ @Generated - @JsonProperty(value = "technicalOrgs") private List technicalOrgs; /* * The registrantPhones property. */ @Generated - @JsonProperty(value = "registrantPhones") private List registrantPhones; /* * The adminPhones property. */ @Generated - @JsonProperty(value = "adminPhones") private List adminPhones; /* * The technicalPhones property. */ @Generated - @JsonProperty(value = "technicalPhones") private List technicalPhones; /* * The ipv4 property. */ @Generated - @JsonProperty(value = "ipv4") private Boolean ipv4; /* * The ipv6 property. */ @Generated - @JsonProperty(value = "ipv6") private Boolean ipv6; /** @@ -548,4 +522,175 @@ public Boolean isIpv4() { public Boolean isIpv6() { return this.ipv6; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipBlock", this.ipBlock); + jsonWriter.writeArrayField("asns", this.asns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("bgpPrefixes", this.bgpPrefixes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("netNames", this.netNames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantContacts", this.registrantContacts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantOrgs", this.registrantOrgs, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminContacts", this.adminContacts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalContacts", this.technicalContacts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrarCreatedAt", this.registrarCreatedAt, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrarUpdatedAt", this.registrarUpdatedAt, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("netRanges", this.netRanges, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("startIp", this.startIp); + jsonWriter.writeStringField("endIp", this.endIp); + jsonWriter.writeArrayField("reputations", this.reputations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("detailedFromWhoisAt", + this.detailedFromWhoisAt == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.detailedFromWhoisAt)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeArrayField("location", this.location, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrarExpiresAt", this.registrarExpiresAt, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantNames", this.registrantNames, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminNames", this.adminNames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalNames", this.technicalNames, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminOrgs", this.adminOrgs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalOrgs", this.technicalOrgs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registrantPhones", this.registrantPhones, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("adminPhones", this.adminPhones, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("technicalPhones", this.technicalPhones, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("ipv4", this.ipv4); + jsonWriter.writeBooleanField("ipv6", this.ipv6); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpBlockAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpBlockAsset if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpBlockAsset. + */ + @Generated + public static IpBlockAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpBlockAsset deserializedIpBlockAsset = new IpBlockAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("ipBlock".equals(fieldName)) { + deserializedIpBlockAsset.ipBlock = reader.getString(); + } else if ("asns".equals(fieldName)) { + List asns = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedIpBlockAsset.asns = asns; + } else if ("bgpPrefixes".equals(fieldName)) { + List bgpPrefixes = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.bgpPrefixes = bgpPrefixes; + } else if ("netNames".equals(fieldName)) { + List netNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.netNames = netNames; + } else if ("registrantContacts".equals(fieldName)) { + List registrantContacts + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.registrantContacts = registrantContacts; + } else if ("registrantOrgs".equals(fieldName)) { + List registrantOrgs = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.registrantOrgs = registrantOrgs; + } else if ("adminContacts".equals(fieldName)) { + List adminContacts = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.adminContacts = adminContacts; + } else if ("technicalContacts".equals(fieldName)) { + List technicalContacts + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.technicalContacts = technicalContacts; + } else if ("registrarCreatedAt".equals(fieldName)) { + List registrarCreatedAt = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedIpBlockAsset.registrarCreatedAt = registrarCreatedAt; + } else if ("registrarUpdatedAt".equals(fieldName)) { + List registrarUpdatedAt = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedIpBlockAsset.registrarUpdatedAt = registrarUpdatedAt; + } else if ("netRanges".equals(fieldName)) { + List netRanges = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.netRanges = netRanges; + } else if ("startIp".equals(fieldName)) { + deserializedIpBlockAsset.startIp = reader.getString(); + } else if ("endIp".equals(fieldName)) { + deserializedIpBlockAsset.endIp = reader.getString(); + } else if ("reputations".equals(fieldName)) { + List reputations = reader.readArray(reader1 -> Reputation.fromJson(reader1)); + deserializedIpBlockAsset.reputations = reputations; + } else if ("detailedFromWhoisAt".equals(fieldName)) { + deserializedIpBlockAsset.detailedFromWhoisAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedIpBlockAsset.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedIpBlockAsset.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedIpBlockAsset.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedIpBlockAsset.count = reader.getNullable(JsonReader::getLong); + } else if ("location".equals(fieldName)) { + List location = reader.readArray(reader1 -> ObservedLocation.fromJson(reader1)); + deserializedIpBlockAsset.location = location; + } else if ("registrarExpiresAt".equals(fieldName)) { + List registrarExpiresAt = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedIpBlockAsset.registrarExpiresAt = registrarExpiresAt; + } else if ("registrantNames".equals(fieldName)) { + List registrantNames + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.registrantNames = registrantNames; + } else if ("adminNames".equals(fieldName)) { + List adminNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.adminNames = adminNames; + } else if ("technicalNames".equals(fieldName)) { + List technicalNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.technicalNames = technicalNames; + } else if ("adminOrgs".equals(fieldName)) { + List adminOrgs = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.adminOrgs = adminOrgs; + } else if ("technicalOrgs".equals(fieldName)) { + List technicalOrgs = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.technicalOrgs = technicalOrgs; + } else if ("registrantPhones".equals(fieldName)) { + List registrantPhones + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.registrantPhones = registrantPhones; + } else if ("adminPhones".equals(fieldName)) { + List adminPhones = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.adminPhones = adminPhones; + } else if ("technicalPhones".equals(fieldName)) { + List technicalPhones + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedIpBlockAsset.technicalPhones = technicalPhones; + } else if ("ipv4".equals(fieldName)) { + deserializedIpBlockAsset.ipv4 = reader.getNullable(JsonReader::getBoolean); + } else if ("ipv6".equals(fieldName)) { + deserializedIpBlockAsset.ipv6 = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedIpBlockAsset; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAssetResource.java index 4d8d6492fd71..3ac251454dab 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAssetResource.java @@ -5,16 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; /** * The IpBlockAssetResource model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("ipBlock") @Immutable public final class IpBlockAssetResource extends AssetResource { @@ -22,8 +24,7 @@ public final class IpBlockAssetResource extends AssetResource { * asset */ @Generated - @JsonProperty(value = "asset") - private IpBlockAsset asset; + private final IpBlockAsset asset; /** * Creates an instance of IpBlockAssetResource class. @@ -31,8 +32,7 @@ public final class IpBlockAssetResource extends AssetResource { * @param asset the asset value to set. */ @Generated - @JsonCreator - private IpBlockAssetResource(@JsonProperty(value = "asset") IpBlockAsset asset) { + private IpBlockAssetResource(IpBlockAsset asset) { this.asset = asset; } @@ -45,4 +45,338 @@ private IpBlockAssetResource(@JsonProperty(value = "asset") IpBlockAsset asset) public IpBlockAsset getAsset() { return this.asset; } + + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "ipBlock"; + + /* + * The caller provided unique name for the resource. + */ + @Generated + private String name; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * Global UUID for the asset. + */ + @Generated + private String uuid; + + /* + * The date this asset was first added to this workspace. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The date this asset was last updated for this workspace. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The state property. + */ + @Generated + private AssetState state; + + /* + * An optional customer provided identifier for this asset. + */ + @Generated + private String externalId; + + /* + * Customer labels assigned to this asset. + */ + @Generated + private List labels; + + /* + * An indicator of whether this asset represents a wildcard rollup of assets on this domain. + */ + @Generated + private Boolean wildcard; + + /* + * The name of the DiscoGroup that brought added this asset to the workspace. + */ + @Generated + private String discoGroupName; + + /* + * The history of how this asset was pulled into the workspace through the discovery process. + */ + @Generated + private List auditTrail; + + /* + * The reason property. + */ + @Generated + private String reason; + + /** + * Get the kind property: Discriminator property for AssetResource. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + @Override + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the uuid property: Global UUID for the asset. + * + * @return the uuid value. + */ + @Generated + @Override + public String getUuid() { + return this.uuid; + } + + /** + * Get the createdDate property: The date this asset was first added to this workspace. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the updatedDate property: The date this asset was last updated for this workspace. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + @Generated + @Override + public AssetState getState() { + return this.state; + } + + /** + * Get the externalId property: An optional customer provided identifier for this asset. + * + * @return the externalId value. + */ + @Generated + @Override + public String getExternalId() { + return this.externalId; + } + + /** + * Get the labels property: Customer labels assigned to this asset. + * + * @return the labels value. + */ + @Generated + @Override + public List getLabels() { + return this.labels; + } + + /** + * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. + * + * @return the wildcard value. + */ + @Generated + @Override + public Boolean isWildcard() { + return this.wildcard; + } + + /** + * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * + * @return the discoGroupName value. + */ + @Generated + @Override + public String getDiscoGroupName() { + return this.discoGroupName; + } + + /** + * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. + * + * @return the auditTrail value. + */ + @Generated + @Override + public List getAuditTrail() { + return this.auditTrail; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + @Override + public String getReason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("uuid", getUuid()); + jsonWriter.writeStringField("createdDate", + getCreatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCreatedDate())); + jsonWriter.writeStringField("updatedDate", + getUpdatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getUpdatedDate())); + jsonWriter.writeStringField("state", getState() == null ? null : getState().toString()); + jsonWriter.writeStringField("externalId", getExternalId()); + jsonWriter.writeArrayField("labels", getLabels(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("wildcard", isWildcard()); + jsonWriter.writeStringField("discoGroupName", getDiscoGroupName()); + jsonWriter.writeArrayField("auditTrail", getAuditTrail(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reason", getReason()); + jsonWriter.writeJsonField("asset", this.asset); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpBlockAssetResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpBlockAssetResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IpBlockAssetResource. + */ + @Generated + public static IpBlockAssetResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String displayName = null; + String uuid = null; + OffsetDateTime createdDate = null; + OffsetDateTime updatedDate = null; + AssetState state = null; + String externalId = null; + List labels = null; + Boolean wildcard = null; + String discoGroupName = null; + List auditTrail = null; + String reason = null; + IpBlockAsset asset = null; + String kind = "ipBlock"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("uuid".equals(fieldName)) { + uuid = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + state = AssetState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + labels = reader.readArray(reader1 -> reader1.getString()); + } else if ("wildcard".equals(fieldName)) { + wildcard = reader.getNullable(JsonReader::getBoolean); + } else if ("discoGroupName".equals(fieldName)) { + discoGroupName = reader.getString(); + } else if ("auditTrail".equals(fieldName)) { + auditTrail = reader.readArray(reader1 -> AuditTrailItem.fromJson(reader1)); + } else if ("reason".equals(fieldName)) { + reason = reader.getString(); + } else if ("asset".equals(fieldName)) { + asset = IpBlockAsset.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + IpBlockAssetResource deserializedIpBlockAssetResource = new IpBlockAssetResource(asset); + deserializedIpBlockAssetResource.setId(id); + deserializedIpBlockAssetResource.name = name; + deserializedIpBlockAssetResource.displayName = displayName; + deserializedIpBlockAssetResource.uuid = uuid; + deserializedIpBlockAssetResource.createdDate = createdDate; + deserializedIpBlockAssetResource.updatedDate = updatedDate; + deserializedIpBlockAssetResource.state = state; + deserializedIpBlockAssetResource.externalId = externalId; + deserializedIpBlockAssetResource.labels = labels; + deserializedIpBlockAssetResource.wildcard = wildcard; + deserializedIpBlockAssetResource.discoGroupName = discoGroupName; + deserializedIpBlockAssetResource.auditTrail = auditTrail; + deserializedIpBlockAssetResource.reason = reason; + deserializedIpBlockAssetResource.kind = kind; + return deserializedIpBlockAssetResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Location.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Location.java index 4ec7e4a3ae6f..299a820643e6 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Location.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Location.java @@ -5,89 +5,82 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The Location model. */ @Immutable -public final class Location { +public final class Location implements JsonSerializable { /* * The countryCode property. */ @Generated - @JsonProperty(value = "countryCode") private String countryCode; /* * The countryName property. */ @Generated - @JsonProperty(value = "countryName") private String countryName; /* * The region property. */ @Generated - @JsonProperty(value = "region") private String region; /* * The regionName property. */ @Generated - @JsonProperty(value = "regionName") private String regionName; /* * The city property. */ @Generated - @JsonProperty(value = "city") private String city; /* * The areaCode property. */ @Generated - @JsonProperty(value = "areaCode") private Integer areaCode; /* * The postalCode property. */ @Generated - @JsonProperty(value = "postalCode") private String postalCode; /* * The latitude property. */ @Generated - @JsonProperty(value = "latitude") private Double latitude; /* * The longitude property. */ @Generated - @JsonProperty(value = "longitude") private Double longitude; /* * The dmaCode property. */ @Generated - @JsonProperty(value = "dmaCode") private Integer dmaCode; /* * The metroCodeId property. */ @Generated - @JsonProperty(value = "metroCodeId") private Integer metroCodeId; /** @@ -206,4 +199,70 @@ public Integer getDmaCode() { public Integer getMetroCodeId() { return this.metroCodeId; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("countryCode", this.countryCode); + jsonWriter.writeStringField("countryName", this.countryName); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("regionName", this.regionName); + jsonWriter.writeStringField("city", this.city); + jsonWriter.writeNumberField("areaCode", this.areaCode); + jsonWriter.writeStringField("postalCode", this.postalCode); + jsonWriter.writeNumberField("latitude", this.latitude); + jsonWriter.writeNumberField("longitude", this.longitude); + jsonWriter.writeNumberField("dmaCode", this.dmaCode); + jsonWriter.writeNumberField("metroCodeId", this.metroCodeId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Location from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Location if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Location. + */ + @Generated + public static Location fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Location deserializedLocation = new Location(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("countryCode".equals(fieldName)) { + deserializedLocation.countryCode = reader.getString(); + } else if ("countryName".equals(fieldName)) { + deserializedLocation.countryName = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedLocation.region = reader.getString(); + } else if ("regionName".equals(fieldName)) { + deserializedLocation.regionName = reader.getString(); + } else if ("city".equals(fieldName)) { + deserializedLocation.city = reader.getString(); + } else if ("areaCode".equals(fieldName)) { + deserializedLocation.areaCode = reader.getNullable(JsonReader::getInt); + } else if ("postalCode".equals(fieldName)) { + deserializedLocation.postalCode = reader.getString(); + } else if ("latitude".equals(fieldName)) { + deserializedLocation.latitude = reader.getNullable(JsonReader::getDouble); + } else if ("longitude".equals(fieldName)) { + deserializedLocation.longitude = reader.getNullable(JsonReader::getDouble); + } else if ("dmaCode".equals(fieldName)) { + deserializedLocation.dmaCode = reader.getNullable(JsonReader::getInt); + } else if ("metroCodeId".equals(fieldName)) { + deserializedLocation.metroCodeId = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedLocation; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnection.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnection.java index b25ea5b035f7..bc663b717558 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnection.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnection.java @@ -5,16 +5,16 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; /** * The LogAnalyticsDataConnection model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("logAnalytics") @Immutable public final class LogAnalyticsDataConnection extends DataConnection { @@ -22,8 +22,7 @@ public final class LogAnalyticsDataConnection extends DataConnection { * properties */ @Generated - @JsonProperty(value = "properties") - private LogAnalyticsDataConnectionProperties properties; + private final LogAnalyticsDataConnectionProperties properties; /** * Creates an instance of LogAnalyticsDataConnection class. @@ -31,9 +30,7 @@ public final class LogAnalyticsDataConnection extends DataConnection { * @param properties the properties value to set. */ @Generated - @JsonCreator - private LogAnalyticsDataConnection( - @JsonProperty(value = "properties") LogAnalyticsDataConnectionProperties properties) { + private LogAnalyticsDataConnection(LogAnalyticsDataConnectionProperties properties) { this.properties = properties; } @@ -46,4 +43,288 @@ private LogAnalyticsDataConnection( public LogAnalyticsDataConnectionProperties getProperties() { return this.properties; } + + /* + * Discriminator property for DataConnection. + */ + @Generated + private String kind = "logAnalytics"; + + /* + * The system generated unique id for the resource. + */ + @Generated + private String id; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * The type of data the data connection will transfer + */ + @Generated + private DataConnectionContent content; + + /* + * The date the data connection was created. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The rate at which the data connection will receive updates. + */ + @Generated + private DataConnectionFrequency frequency; + + /* + * The day to update the data connection on. + */ + @Generated + private Integer frequencyOffset; + + /* + * The date the data connection was last updated. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The date the data connection was last updated by user. + */ + @Generated + private OffsetDateTime userUpdatedAt; + + /* + * An indicator of whether the data connection is active. + */ + @Generated + private Boolean active; + + /* + * A message that specifies details about data connection if inactive. + */ + @Generated + private String inactiveMessage; + + /** + * Get the kind property: Discriminator property for DataConnection. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the id property: The system generated unique id for the resource. + * + * @return the id value. + */ + @Generated + @Override + public String getId() { + return this.id; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the content property: The type of data the data connection will transfer. + * + * @return the content value. + */ + @Generated + @Override + public DataConnectionContent getContent() { + return this.content; + } + + /** + * Get the createdDate property: The date the data connection was created. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the frequency property: The rate at which the data connection will receive updates. + * + * @return the frequency value. + */ + @Generated + @Override + public DataConnectionFrequency getFrequency() { + return this.frequency; + } + + /** + * Get the frequencyOffset property: The day to update the data connection on. + * + * @return the frequencyOffset value. + */ + @Generated + @Override + public Integer getFrequencyOffset() { + return this.frequencyOffset; + } + + /** + * Get the updatedDate property: The date the data connection was last updated. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the userUpdatedAt property: The date the data connection was last updated by user. + * + * @return the userUpdatedAt value. + */ + @Generated + @Override + public OffsetDateTime getUserUpdatedAt() { + return this.userUpdatedAt; + } + + /** + * Get the active property: An indicator of whether the data connection is active. + * + * @return the active value. + */ + @Generated + @Override + public Boolean isActive() { + return this.active; + } + + /** + * Get the inactiveMessage property: A message that specifies details about data connection if inactive. + * + * @return the inactiveMessage value. + */ + @Generated + @Override + public String getInactiveMessage() { + return this.inactiveMessage; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("content", getContent() == null ? null : getContent().toString()); + jsonWriter.writeStringField("frequency", getFrequency() == null ? null : getFrequency().toString()); + jsonWriter.writeNumberField("frequencyOffset", getFrequencyOffset()); + jsonWriter.writeBooleanField("active", isActive()); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogAnalyticsDataConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogAnalyticsDataConnection if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogAnalyticsDataConnection. + */ + @Generated + public static LogAnalyticsDataConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String id = null; + String displayName = null; + DataConnectionContent content = null; + OffsetDateTime createdDate = null; + DataConnectionFrequency frequency = null; + Integer frequencyOffset = null; + OffsetDateTime updatedDate = null; + OffsetDateTime userUpdatedAt = null; + Boolean active = null; + String inactiveMessage = null; + LogAnalyticsDataConnectionProperties properties = null; + String kind = "logAnalytics"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("content".equals(fieldName)) { + content = DataConnectionContent.fromString(reader.getString()); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("frequency".equals(fieldName)) { + frequency = DataConnectionFrequency.fromString(reader.getString()); + } else if ("frequencyOffset".equals(fieldName)) { + frequencyOffset = reader.getNullable(JsonReader::getInt); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("userUpdatedAt".equals(fieldName)) { + userUpdatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("active".equals(fieldName)) { + active = reader.getNullable(JsonReader::getBoolean); + } else if ("inactiveMessage".equals(fieldName)) { + inactiveMessage = reader.getString(); + } else if ("properties".equals(fieldName)) { + properties = LogAnalyticsDataConnectionProperties.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + LogAnalyticsDataConnection deserializedLogAnalyticsDataConnection + = new LogAnalyticsDataConnection(properties); + deserializedLogAnalyticsDataConnection.setName(name); + deserializedLogAnalyticsDataConnection.id = id; + deserializedLogAnalyticsDataConnection.displayName = displayName; + deserializedLogAnalyticsDataConnection.content = content; + deserializedLogAnalyticsDataConnection.createdDate = createdDate; + deserializedLogAnalyticsDataConnection.frequency = frequency; + deserializedLogAnalyticsDataConnection.frequencyOffset = frequencyOffset; + deserializedLogAnalyticsDataConnection.updatedDate = updatedDate; + deserializedLogAnalyticsDataConnection.userUpdatedAt = userUpdatedAt; + deserializedLogAnalyticsDataConnection.active = active; + deserializedLogAnalyticsDataConnection.inactiveMessage = inactiveMessage; + deserializedLogAnalyticsDataConnection.kind = kind; + return deserializedLogAnalyticsDataConnection; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionData.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionData.java index abd036df7b33..e56aefcb231a 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionData.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionData.java @@ -5,16 +5,14 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The LogAnalyticsDataConnectionData model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("logAnalytics") @Fluent public final class LogAnalyticsDataConnectionData extends DataConnectionData { @@ -22,8 +20,7 @@ public final class LogAnalyticsDataConnectionData extends DataConnectionData { * properties */ @Generated - @JsonProperty(value = "properties") - private LogAnalyticsDataConnectionProperties properties; + private final LogAnalyticsDataConnectionProperties properties; /** * Creates an instance of LogAnalyticsDataConnectionData class. @@ -31,9 +28,7 @@ public final class LogAnalyticsDataConnectionData extends DataConnectionData { * @param properties the properties value to set. */ @Generated - @JsonCreator - public LogAnalyticsDataConnectionData( - @JsonProperty(value = "properties") LogAnalyticsDataConnectionProperties properties) { + public LogAnalyticsDataConnectionData(LogAnalyticsDataConnectionProperties properties) { this.properties = properties; } @@ -86,4 +81,85 @@ public LogAnalyticsDataConnectionData setFrequencyOffset(Integer frequencyOffset super.setFrequencyOffset(frequencyOffset); return this; } + + /* + * Discriminator property for DataConnectionData. + */ + @Generated + private String kind = "logAnalytics"; + + /** + * Get the kind property: Discriminator property for DataConnectionData. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("content", getContent() == null ? null : getContent().toString()); + jsonWriter.writeStringField("frequency", getFrequency() == null ? null : getFrequency().toString()); + jsonWriter.writeNumberField("frequencyOffset", getFrequencyOffset()); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogAnalyticsDataConnectionData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogAnalyticsDataConnectionData if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogAnalyticsDataConnectionData. + */ + @Generated + public static LogAnalyticsDataConnectionData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + DataConnectionContent content = null; + DataConnectionFrequency frequency = null; + Integer frequencyOffset = null; + LogAnalyticsDataConnectionProperties properties = null; + String kind = "logAnalytics"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("content".equals(fieldName)) { + content = DataConnectionContent.fromString(reader.getString()); + } else if ("frequency".equals(fieldName)) { + frequency = DataConnectionFrequency.fromString(reader.getString()); + } else if ("frequencyOffset".equals(fieldName)) { + frequencyOffset = reader.getNullable(JsonReader::getInt); + } else if ("properties".equals(fieldName)) { + properties = LogAnalyticsDataConnectionProperties.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + LogAnalyticsDataConnectionData deserializedLogAnalyticsDataConnectionData + = new LogAnalyticsDataConnectionData(properties); + deserializedLogAnalyticsDataConnectionData.setName(name); + deserializedLogAnalyticsDataConnectionData.setContent(content); + deserializedLogAnalyticsDataConnectionData.setFrequency(frequency); + deserializedLogAnalyticsDataConnectionData.setFrequencyOffset(frequencyOffset); + deserializedLogAnalyticsDataConnectionData.kind = kind; + return deserializedLogAnalyticsDataConnectionData; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionProperties.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionProperties.java index 2930c3aed109..d3886248c5af 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionProperties.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionProperties.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The LogAnalyticsDataConnectionProperties model. @@ -17,14 +20,12 @@ public final class LogAnalyticsDataConnectionProperties extends DataConnectionPr * log analytics api key */ @Generated - @JsonProperty(value = "apiKey") private String apiKey; /* * log analytics workspace id */ @Generated - @JsonProperty(value = "workspaceId") private String workspaceId; /** @@ -77,4 +78,44 @@ public LogAnalyticsDataConnectionProperties setWorkspaceId(String workspaceId) { this.workspaceId = workspaceId; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("apiKey", this.apiKey); + jsonWriter.writeStringField("workspaceId", this.workspaceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogAnalyticsDataConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogAnalyticsDataConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogAnalyticsDataConnectionProperties. + */ + @Generated + public static LogAnalyticsDataConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogAnalyticsDataConnectionProperties deserializedLogAnalyticsDataConnectionProperties + = new LogAnalyticsDataConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("apiKey".equals(fieldName)) { + deserializedLogAnalyticsDataConnectionProperties.apiKey = reader.getString(); + } else if ("workspaceId".equals(fieldName)) { + deserializedLogAnalyticsDataConnectionProperties.workspaceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedLogAnalyticsDataConnectionProperties; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPageResult.java new file mode 100644 index 000000000000..31c61455ba10 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPageResult.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The page result response for the observation. + */ +@Immutable +public final class ObservationPageResult implements JsonSerializable { + /* + * The total number of elements. + */ + @Generated + private final long totalElements; + + /* + * The summary of observation counts by priority. + */ + @Generated + private final Map prioritySummary; + + /* + * The list of observation results. + */ + @Generated + private final List value; + + /** + * Creates an instance of ObservationPageResult class. + * + * @param totalElements the totalElements value to set. + * @param prioritySummary the prioritySummary value to set. + * @param value the value value to set. + */ + @Generated + private ObservationPageResult(long totalElements, Map prioritySummary, + List value) { + this.totalElements = totalElements; + this.prioritySummary = prioritySummary; + this.value = value; + } + + /** + * Get the totalElements property: The total number of elements. + * + * @return the totalElements value. + */ + @Generated + public long getTotalElements() { + return this.totalElements; + } + + /** + * Get the prioritySummary property: The summary of observation counts by priority. + * + * @return the prioritySummary value. + */ + @Generated + public Map getPrioritySummary() { + return this.prioritySummary; + } + + /** + * Get the value property: The list of observation results. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("totalElements", this.totalElements); + jsonWriter.writeMapField("prioritySummary", this.prioritySummary, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservationPageResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservationPageResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ObservationPageResult. + */ + @Generated + public static ObservationPageResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + long totalElements = 0L; + Map prioritySummary = null; + List value = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalElements".equals(fieldName)) { + totalElements = reader.getLong(); + } else if ("prioritySummary".equals(fieldName)) { + prioritySummary = reader.readMap(reader1 -> reader1.getInt()); + } else if ("value".equals(fieldName)) { + value = reader.readArray(reader1 -> ObservationResult.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new ObservationPageResult(totalElements, prioritySummary, value); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPriority.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPriority.java new file mode 100644 index 000000000000..5cdc0a716fc0 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPriority.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A list of observation priorities. + */ +public final class ObservationPriority extends ExpandableStringEnum { + /** + * high. + */ + @Generated + public static final ObservationPriority HIGH = fromString("high"); + + /** + * medium. + */ + @Generated + public static final ObservationPriority MEDIUM = fromString("medium"); + + /** + * low. + */ + @Generated + public static final ObservationPriority LOW = fromString("low"); + + /** + * none. + */ + @Generated + public static final ObservationPriority NONE = fromString("none"); + + /** + * Creates a new instance of ObservationPriority value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ObservationPriority() { + } + + /** + * Creates or finds a ObservationPriority from its string representation. + * + * @param name a name to look for. + * @return the corresponding ObservationPriority. + */ + @Generated + public static ObservationPriority fromString(String name) { + return fromString(name, ObservationPriority.class); + } + + /** + * Gets known ObservationPriority values. + * + * @return known ObservationPriority values. + */ + @Generated + public static Collection values() { + return values(ObservationPriority.class); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationResult.java new file mode 100644 index 000000000000..471459abc68e --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationResult.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The result response for the observation. + */ +@Immutable +public final class ObservationResult implements JsonSerializable { + /* + * The name of the observation. + */ + @Generated + private final String name; + + /* + * The list of applicable types. + */ + @Generated + private final List types; + + /* + * The priority of the observation. + */ + @Generated + private final ObservationPriority priority; + + /* + * The CVSS v2 score. + */ + @Generated + private final double cvssScoreV2; + + /* + * The CVSS v3 score. + */ + @Generated + private final double cvssScoreV3; + + /** + * Creates an instance of ObservationResult class. + * + * @param name the name value to set. + * @param types the types value to set. + * @param priority the priority value to set. + * @param cvssScoreV2 the cvssScoreV2 value to set. + * @param cvssScoreV3 the cvssScoreV3 value to set. + */ + @Generated + private ObservationResult(String name, List types, ObservationPriority priority, + double cvssScoreV2, double cvssScoreV3) { + this.name = name; + this.types = types; + this.priority = priority; + this.cvssScoreV2 = cvssScoreV2; + this.cvssScoreV3 = cvssScoreV3; + } + + /** + * Get the name property: The name of the observation. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the types property: The list of applicable types. + * + * @return the types value. + */ + @Generated + public List getTypes() { + return this.types; + } + + /** + * Get the priority property: The priority of the observation. + * + * @return the priority value. + */ + @Generated + public ObservationPriority getPriority() { + return this.priority; + } + + /** + * Get the cvssScoreV2 property: The CVSS v2 score. + * + * @return the cvssScoreV2 value. + */ + @Generated + public double getCvssScoreV2() { + return this.cvssScoreV2; + } + + /** + * Get the cvssScoreV3 property: The CVSS v3 score. + * + * @return the cvssScoreV3 value. + */ + @Generated + public double getCvssScoreV3() { + return this.cvssScoreV3; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("types", this.types, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("priority", this.priority == null ? null : this.priority.toString()); + jsonWriter.writeDoubleField("cvssScoreV2", this.cvssScoreV2); + jsonWriter.writeDoubleField("cvssScoreV3", this.cvssScoreV3); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservationResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ObservationResult. + */ + @Generated + public static ObservationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + List types = null; + ObservationPriority priority = null; + double cvssScoreV2 = 0.0; + double cvssScoreV3 = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("types".equals(fieldName)) { + types = reader.readArray(reader1 -> ObservationType.fromString(reader1.getString())); + } else if ("priority".equals(fieldName)) { + priority = ObservationPriority.fromString(reader.getString()); + } else if ("cvssScoreV2".equals(fieldName)) { + cvssScoreV2 = reader.getDouble(); + } else if ("cvssScoreV3".equals(fieldName)) { + cvssScoreV3 = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new ObservationResult(name, types, priority, cvssScoreV2, cvssScoreV3); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationType.java new file mode 100644 index 000000000000..309086621717 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A list of observation types. + */ +public final class ObservationType extends ExpandableStringEnum { + /** + * common vulnerabilities and exposures. + */ + @Generated + public static final ObservationType CVE = fromString("cve"); + + /** + * insight. + */ + @Generated + public static final ObservationType INSIGHT = fromString("insight"); + + /** + * Creates a new instance of ObservationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ObservationType() { + } + + /** + * Creates or finds a ObservationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ObservationType. + */ + @Generated + public static ObservationType fromString(String name) { + return fromString(name, ObservationType.class); + } + + /** + * Gets known ObservationType values. + * + * @return known ObservationType values. + */ + @Generated + public static Collection values() { + return values(ObservationType.class); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedBoolean.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedBoolean.java index f57d558ca0cb..107d2d3a5a4c 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedBoolean.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedBoolean.java @@ -5,7 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -18,14 +24,12 @@ public final class ObservedBoolean extends ObservedValue { * The value property. */ @Generated - @JsonProperty(value = "value") private Boolean value; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /** @@ -54,4 +58,128 @@ public Boolean isValue() { public List getSources() { return this.sources; } + + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + @Override + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + @Override + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + @Override + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + @Override + public Boolean isRecent() { + return this.recent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstSeen", + getFirstSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getFirstSeen())); + jsonWriter.writeStringField("lastSeen", + getLastSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getLastSeen())); + jsonWriter.writeNumberField("count", getCount()); + jsonWriter.writeBooleanField("recent", isRecent()); + jsonWriter.writeBooleanField("value", this.value); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservedBoolean from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservedBoolean if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObservedBoolean. + */ + @Generated + public static ObservedBoolean fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservedBoolean deserializedObservedBoolean = new ObservedBoolean(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("firstSeen".equals(fieldName)) { + deserializedObservedBoolean.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedObservedBoolean.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedObservedBoolean.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedObservedBoolean.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("value".equals(fieldName)) { + deserializedObservedBoolean.value = reader.getNullable(JsonReader::getBoolean); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedObservedBoolean.sources = sources; + } else { + reader.skipChildren(); + } + } + return deserializedObservedBoolean; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedHeader.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedHeader.java index 9900e02b2a07..1be89b758f68 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedHeader.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedHeader.java @@ -5,7 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The ObservedHeader model. @@ -17,14 +23,12 @@ public final class ObservedHeader extends ObservedValue { * The headerName property. */ @Generated - @JsonProperty(value = "headerName") private String headerName; /* * The headerValue property. */ @Generated - @JsonProperty(value = "headerValue") private String headerValue; /** @@ -53,4 +57,127 @@ public String getHeaderName() { public String getHeaderValue() { return this.headerValue; } + + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + @Override + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + @Override + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + @Override + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + @Override + public Boolean isRecent() { + return this.recent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstSeen", + getFirstSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getFirstSeen())); + jsonWriter.writeStringField("lastSeen", + getLastSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getLastSeen())); + jsonWriter.writeNumberField("count", getCount()); + jsonWriter.writeBooleanField("recent", isRecent()); + jsonWriter.writeStringField("headerName", this.headerName); + jsonWriter.writeStringField("headerValue", this.headerValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservedHeader from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservedHeader if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObservedHeader. + */ + @Generated + public static ObservedHeader fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservedHeader deserializedObservedHeader = new ObservedHeader(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("firstSeen".equals(fieldName)) { + deserializedObservedHeader.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedObservedHeader.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedObservedHeader.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedObservedHeader.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("headerName".equals(fieldName)) { + deserializedObservedHeader.headerName = reader.getString(); + } else if ("headerValue".equals(fieldName)) { + deserializedObservedHeader.headerValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedObservedHeader; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedInteger.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedInteger.java index 354c6e49c38a..90741ad38e7b 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedInteger.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedInteger.java @@ -5,7 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -18,14 +24,12 @@ public final class ObservedInteger extends ObservedValue { * The value property. */ @Generated - @JsonProperty(value = "value") private Integer value; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /** @@ -54,4 +58,128 @@ public Integer getValue() { public List getSources() { return this.sources; } + + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + @Override + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + @Override + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + @Override + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + @Override + public Boolean isRecent() { + return this.recent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstSeen", + getFirstSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getFirstSeen())); + jsonWriter.writeStringField("lastSeen", + getLastSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getLastSeen())); + jsonWriter.writeNumberField("count", getCount()); + jsonWriter.writeBooleanField("recent", isRecent()); + jsonWriter.writeNumberField("value", this.value); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservedInteger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservedInteger if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObservedInteger. + */ + @Generated + public static ObservedInteger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservedInteger deserializedObservedInteger = new ObservedInteger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("firstSeen".equals(fieldName)) { + deserializedObservedInteger.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedObservedInteger.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedObservedInteger.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedObservedInteger.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("value".equals(fieldName)) { + deserializedObservedInteger.value = reader.getNullable(JsonReader::getInt); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedObservedInteger.sources = sources; + } else { + reader.skipChildren(); + } + } + return deserializedObservedInteger; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedIntegers.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedIntegers.java index fb054fc9848d..7ec8cc04d3d7 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedIntegers.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedIntegers.java @@ -5,7 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -18,14 +24,12 @@ public final class ObservedIntegers extends ObservedValue { * The values property. */ @Generated - @JsonProperty(value = "values") private List values; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /** @@ -54,4 +58,129 @@ public List getValues() { public List getSources() { return this.sources; } + + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + @Override + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + @Override + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + @Override + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + @Override + public Boolean isRecent() { + return this.recent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstSeen", + getFirstSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getFirstSeen())); + jsonWriter.writeStringField("lastSeen", + getLastSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getLastSeen())); + jsonWriter.writeNumberField("count", getCount()); + jsonWriter.writeBooleanField("recent", isRecent()); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservedIntegers from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservedIntegers if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObservedIntegers. + */ + @Generated + public static ObservedIntegers fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservedIntegers deserializedObservedIntegers = new ObservedIntegers(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("firstSeen".equals(fieldName)) { + deserializedObservedIntegers.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedObservedIntegers.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedObservedIntegers.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedObservedIntegers.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getInt()); + deserializedObservedIntegers.values = values; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedObservedIntegers.sources = sources; + } else { + reader.skipChildren(); + } + } + return deserializedObservedIntegers; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLocation.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLocation.java index 8ce15dbc2f44..4bd0886118d0 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLocation.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLocation.java @@ -5,7 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -18,14 +24,12 @@ public final class ObservedLocation extends ObservedValue { * The value property. */ @Generated - @JsonProperty(value = "value") private Location value; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /** @@ -54,4 +58,128 @@ public Location getValue() { public List getSources() { return this.sources; } + + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + @Override + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + @Override + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + @Override + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + @Override + public Boolean isRecent() { + return this.recent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstSeen", + getFirstSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getFirstSeen())); + jsonWriter.writeStringField("lastSeen", + getLastSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getLastSeen())); + jsonWriter.writeNumberField("count", getCount()); + jsonWriter.writeBooleanField("recent", isRecent()); + jsonWriter.writeJsonField("value", this.value); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservedLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservedLocation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObservedLocation. + */ + @Generated + public static ObservedLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservedLocation deserializedObservedLocation = new ObservedLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("firstSeen".equals(fieldName)) { + deserializedObservedLocation.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedObservedLocation.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedObservedLocation.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedObservedLocation.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("value".equals(fieldName)) { + deserializedObservedLocation.value = Location.fromJson(reader); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedObservedLocation.sources = sources; + } else { + reader.skipChildren(); + } + } + return deserializedObservedLocation; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLong.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLong.java index 1a24f738235d..555af2915938 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLong.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLong.java @@ -5,7 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -18,14 +24,12 @@ public final class ObservedLong extends ObservedValue { * The value property. */ @Generated - @JsonProperty(value = "value") private Long value; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /** @@ -54,4 +58,128 @@ public Long getValue() { public List getSources() { return this.sources; } + + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + @Override + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + @Override + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + @Override + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + @Override + public Boolean isRecent() { + return this.recent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstSeen", + getFirstSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getFirstSeen())); + jsonWriter.writeStringField("lastSeen", + getLastSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getLastSeen())); + jsonWriter.writeNumberField("count", getCount()); + jsonWriter.writeBooleanField("recent", isRecent()); + jsonWriter.writeNumberField("value", this.value); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservedLong from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservedLong if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObservedLong. + */ + @Generated + public static ObservedLong fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservedLong deserializedObservedLong = new ObservedLong(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("firstSeen".equals(fieldName)) { + deserializedObservedLong.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedObservedLong.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedObservedLong.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedObservedLong.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("value".equals(fieldName)) { + deserializedObservedLong.value = reader.getNullable(JsonReader::getLong); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedObservedLong.sources = sources; + } else { + reader.skipChildren(); + } + } + return deserializedObservedLong; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortState.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortState.java index f963d7753d79..579cb21edb23 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortState.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortState.java @@ -5,7 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The ObservedPortState model. @@ -17,14 +23,12 @@ public final class ObservedPortState extends ObservedValue { * The value property. */ @Generated - @JsonProperty(value = "value") private ObservedPortStateValue value; /* * The port property. */ @Generated - @JsonProperty(value = "port") private Integer port; /** @@ -53,4 +57,127 @@ public ObservedPortStateValue getValue() { public Integer getPort() { return this.port; } + + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + @Override + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + @Override + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + @Override + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + @Override + public Boolean isRecent() { + return this.recent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstSeen", + getFirstSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getFirstSeen())); + jsonWriter.writeStringField("lastSeen", + getLastSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getLastSeen())); + jsonWriter.writeNumberField("count", getCount()); + jsonWriter.writeBooleanField("recent", isRecent()); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservedPortState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservedPortState if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObservedPortState. + */ + @Generated + public static ObservedPortState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservedPortState deserializedObservedPortState = new ObservedPortState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("firstSeen".equals(fieldName)) { + deserializedObservedPortState.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedObservedPortState.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedObservedPortState.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedObservedPortState.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("value".equals(fieldName)) { + deserializedObservedPortState.value = ObservedPortStateValue.fromString(reader.getString()); + } else if ("port".equals(fieldName)) { + deserializedObservedPortState.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedObservedPortState; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortStateValue.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortStateValue.java index 9f338eca6e81..1c58dc57e5d4 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortStateValue.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortStateValue.java @@ -5,11 +5,10 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * Defines values for ObservedPortStateValue. + * state of observed port. */ public final class ObservedPortStateValue extends ExpandableStringEnum { @@ -48,7 +47,6 @@ public ObservedPortStateValue() { * @return the corresponding ObservedPortStateValue. */ @Generated - @JsonCreator public static ObservedPortStateValue fromString(String name) { return fromString(name, ObservedPortStateValue.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedString.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedString.java index 3255e5b281d6..0dbc65708a36 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedString.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedString.java @@ -5,7 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -18,14 +24,12 @@ public final class ObservedString extends ObservedValue { * The value property. */ @Generated - @JsonProperty(value = "value") private String value; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /** @@ -54,4 +58,128 @@ public String getValue() { public List getSources() { return this.sources; } + + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + @Override + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + @Override + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + @Override + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + @Override + public Boolean isRecent() { + return this.recent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstSeen", + getFirstSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getFirstSeen())); + jsonWriter.writeStringField("lastSeen", + getLastSeen() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getLastSeen())); + jsonWriter.writeNumberField("count", getCount()); + jsonWriter.writeBooleanField("recent", isRecent()); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservedString from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservedString if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObservedString. + */ + @Generated + public static ObservedString fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservedString deserializedObservedString = new ObservedString(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("firstSeen".equals(fieldName)) { + deserializedObservedString.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedObservedString.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedObservedString.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedObservedString.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("value".equals(fieldName)) { + deserializedObservedString.value = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedObservedString.sources = sources; + } else { + reader.skipChildren(); + } + } + return deserializedObservedString; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedValue.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedValue.java index ab0fdf306fb7..d0fb37f99b33 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedValue.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedValue.java @@ -5,41 +5,43 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Template model for observed values. */ @Immutable -public class ObservedValue { +public class ObservedValue implements JsonSerializable { /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /** @@ -88,4 +90,101 @@ public Long getCount() { public Boolean isRecent() { return this.recent; } + + /** + * Set the firstSeen property: The firstSeen property. + * + * @param firstSeen the firstSeen value to set. + * @return the ObservedValue object itself. + */ + @Generated + ObservedValue setFirstSeen(OffsetDateTime firstSeen) { + this.firstSeen = firstSeen; + return this; + } + + /** + * Set the lastSeen property: The lastSeen property. + * + * @param lastSeen the lastSeen value to set. + * @return the ObservedValue object itself. + */ + @Generated + ObservedValue setLastSeen(OffsetDateTime lastSeen) { + this.lastSeen = lastSeen; + return this; + } + + /** + * Set the count property: The count property. + * + * @param count the count value to set. + * @return the ObservedValue object itself. + */ + @Generated + ObservedValue setCount(Long count) { + this.count = count; + return this; + } + + /** + * Set the recent property: The recent property. + * + * @param recent the recent value to set. + * @return the ObservedValue object itself. + */ + @Generated + ObservedValue setRecent(Boolean recent) { + this.recent = recent; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeBooleanField("recent", this.recent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservedValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservedValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObservedValue. + */ + @Generated + public static ObservedValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservedValue deserializedObservedValue = new ObservedValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("firstSeen".equals(fieldName)) { + deserializedObservedValue.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedObservedValue.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedObservedValue.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedObservedValue.recent = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedObservedValue; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAsset.java index 77ad911f0dc3..c852952961c9 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAsset.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAsset.java @@ -5,8 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -19,427 +24,366 @@ public final class PageAsset extends InventoryAsset { * The url property. */ @Generated - @JsonProperty(value = "url") private String url; /* * The httpMethod property. */ @Generated - @JsonProperty(value = "httpMethod") private String httpMethod; /* * The service property. */ @Generated - @JsonProperty(value = "service") private String service; /* * The ipAddresses property. */ @Generated - @JsonProperty(value = "ipAddresses") private List ipAddresses; /* * The successful property. */ @Generated - @JsonProperty(value = "successful") private List successful; /* * The httpResponseCodes property. */ @Generated - @JsonProperty(value = "httpResponseCodes") private List httpResponseCodes; /* * The httpResponseMessages property. */ @Generated - @JsonProperty(value = "httpResponseMessages") private List httpResponseMessages; /* * The responseTimes property. */ @Generated - @JsonProperty(value = "responseTimes") private List responseTimes; /* * The frames property. */ @Generated - @JsonProperty(value = "frames") private List frames; /* * The windows property. */ @Generated - @JsonProperty(value = "windows") private List windows; /* * The nonHtmlFrames property. */ @Generated - @JsonProperty(value = "nonHtmlFrames") private List nonHtmlFrames; /* * The undirectedContent property. */ @Generated - @JsonProperty(value = "undirectedContent") private List undirectedContent; /* * The contentTypes property. */ @Generated - @JsonProperty(value = "contentTypes") private List contentTypes; /* * The contentLengths property. */ @Generated - @JsonProperty(value = "contentLengths") private List contentLengths; /* * The windowNames property. */ @Generated - @JsonProperty(value = "windowNames") private List windowNames; /* * The charsets property. */ @Generated - @JsonProperty(value = "charsets") private List charsets; /* * The titles property. */ @Generated - @JsonProperty(value = "titles") private List titles; /* * The languages property. */ @Generated - @JsonProperty(value = "languages") private List languages; /* * The responseHeaders property. */ @Generated - @JsonProperty(value = "responseHeaders") private List responseHeaders; /* * The cookies property. */ @Generated - @JsonProperty(value = "cookies") private List cookies; /* * The webComponents property. */ @Generated - @JsonProperty(value = "webComponents") private List webComponents; /* * The attributes property. */ @Generated - @JsonProperty(value = "attributes") private List attributes; /* * The assetSecurityPolicies property. */ @Generated - @JsonProperty(value = "assetSecurityPolicies") private List assetSecurityPolicies; /* * The responseBodyMinhashSignatures property. */ @Generated - @JsonProperty(value = "responseBodyMinhashSignatures") private List responseBodyMinhashSignatures; /* * The fullDomMinhashSignatures property. */ @Generated - @JsonProperty(value = "fullDomMinhashSignatures") private List fullDomMinhashSignatures; /* * The responseBodyHashSignatures property. */ @Generated - @JsonProperty(value = "responseBodyHashSignatures") private List responseBodyHashSignatures; /* * The errors property. */ @Generated - @JsonProperty(value = "errors") private List errors; /* * The sslCerts property. */ @Generated - @JsonProperty(value = "sslCerts") private List sslCerts; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The cause property. */ @Generated - @JsonProperty(value = "cause") private PageCause cause; /* * The referrer property. */ @Generated - @JsonProperty(value = "referrer") private String referrer; /* * The redirectUrls property. */ @Generated - @JsonProperty(value = "redirectUrls") private List redirectUrls; /* * The redirectType property. */ @Generated - @JsonProperty(value = "redirectType") private PageAssetRedirectType redirectType; /* * The finalUrls property. */ @Generated - @JsonProperty(value = "finalUrls") private List finalUrls; /* * The finalResponseCodes property. */ @Generated - @JsonProperty(value = "finalResponseCodes") private List finalResponseCodes; /* * The parkedPage property. */ @Generated - @JsonProperty(value = "parkedPage") private List parkedPage; /* * The resourceUrls property. */ @Generated - @JsonProperty(value = "resourceUrls") private List resourceUrls; /* * The guids property. */ @Generated - @JsonProperty(value = "guids") private List guids; /* * The finalIpAddresses property. */ @Generated - @JsonProperty(value = "finalIpAddresses") private List finalIpAddresses; /* * The asns property. */ @Generated - @JsonProperty(value = "asns") private List asns; /* * The ipBlocks property. */ @Generated - @JsonProperty(value = "ipBlocks") private List ipBlocks; /* * The finalAsns property. */ @Generated - @JsonProperty(value = "finalAsns") private List finalAsns; /* * The finalIpBlocks property. */ @Generated - @JsonProperty(value = "finalIpBlocks") private List finalIpBlocks; /* * The responseBodies property. */ @Generated - @JsonProperty(value = "responseBodies") private List responseBodies; /* * The domainAsset property. */ @Generated - @JsonProperty(value = "domainAsset") private DomainAsset domainAsset; /* * The rootUrl property. */ @Generated - @JsonProperty(value = "rootUrl") private ObservedBoolean rootUrl; /* * The isRootUrl property. */ @Generated - @JsonProperty(value = "isRootUrl") private Boolean isRootUrl; /* * The location property. */ @Generated - @JsonProperty(value = "location") private List location; /* * The services property. */ @Generated - @JsonProperty(value = "services") private List services; /* * The siteStatus property. */ @Generated - @JsonProperty(value = "siteStatus") private String siteStatus; /* * The cnames property. */ @Generated - @JsonProperty(value = "cnames") private List cnames; /* * The cdns property. */ @Generated - @JsonProperty(value = "cdns") private List cdns; /* * The host property. */ @Generated - @JsonProperty(value = "host") private String host; /* * The domain property. */ @Generated - @JsonProperty(value = "domain") private String domain; /* * The sslServerConfig property. */ @Generated - @JsonProperty(value = "sslServerConfig") private List sslServerConfig; /* * The gdprAssetSecurityPolicies property. */ @Generated - @JsonProperty(value = "gdprAssetSecurityPolicies") private List gdprAssetSecurityPolicies; /* * The ipv4 property. */ @Generated - @JsonProperty(value = "ipv4") private List ipv4; /* * The ipv6 property. */ @Generated - @JsonProperty(value = "ipv6") private List ipv6; /** @@ -1058,4 +1002,297 @@ public List getIpv4() { public List getIpv6() { return this.ipv6; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("httpMethod", this.httpMethod); + jsonWriter.writeStringField("service", this.service); + jsonWriter.writeArrayField("ipAddresses", this.ipAddresses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("successful", this.successful, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("httpResponseCodes", this.httpResponseCodes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("httpResponseMessages", this.httpResponseMessages, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("responseTimes", this.responseTimes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("frames", this.frames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("windows", this.windows, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("nonHtmlFrames", this.nonHtmlFrames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("undirectedContent", this.undirectedContent, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("contentTypes", this.contentTypes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("contentLengths", this.contentLengths, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("windowNames", this.windowNames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("charsets", this.charsets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("titles", this.titles, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("languages", this.languages, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("responseHeaders", this.responseHeaders, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("cookies", this.cookies, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("webComponents", this.webComponents, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("attributes", this.attributes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("assetSecurityPolicies", this.assetSecurityPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("responseBodyMinhashSignatures", this.responseBodyMinhashSignatures, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("fullDomMinhashSignatures", this.fullDomMinhashSignatures, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("responseBodyHashSignatures", this.responseBodyHashSignatures, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sslCerts", this.sslCerts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("cause", this.cause); + jsonWriter.writeStringField("referrer", this.referrer); + jsonWriter.writeArrayField("redirectUrls", this.redirectUrls, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("redirectType", this.redirectType == null ? null : this.redirectType.toString()); + jsonWriter.writeArrayField("finalUrls", this.finalUrls, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("finalResponseCodes", this.finalResponseCodes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("parkedPage", this.parkedPage, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("resourceUrls", this.resourceUrls, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("guids", this.guids, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("finalIpAddresses", this.finalIpAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("asns", this.asns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipBlocks", this.ipBlocks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("finalAsns", this.finalAsns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("finalIpBlocks", this.finalIpBlocks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("responseBodies", this.responseBodies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("domainAsset", this.domainAsset); + jsonWriter.writeJsonField("rootUrl", this.rootUrl); + jsonWriter.writeBooleanField("isRootUrl", this.isRootUrl); + jsonWriter.writeArrayField("location", this.location, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("services", this.services, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("siteStatus", this.siteStatus); + jsonWriter.writeArrayField("cnames", this.cnames, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("cdns", this.cdns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeArrayField("sslServerConfig", this.sslServerConfig, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("gdprAssetSecurityPolicies", this.gdprAssetSecurityPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipv4", this.ipv4, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipv6", this.ipv6, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PageAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PageAsset if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the PageAsset. + */ + @Generated + public static PageAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PageAsset deserializedPageAsset = new PageAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("url".equals(fieldName)) { + deserializedPageAsset.url = reader.getString(); + } else if ("httpMethod".equals(fieldName)) { + deserializedPageAsset.httpMethod = reader.getString(); + } else if ("service".equals(fieldName)) { + deserializedPageAsset.service = reader.getString(); + } else if ("ipAddresses".equals(fieldName)) { + List ipAddresses = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.ipAddresses = ipAddresses; + } else if ("successful".equals(fieldName)) { + List successful = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedPageAsset.successful = successful; + } else if ("httpResponseCodes".equals(fieldName)) { + List httpResponseCodes + = reader.readArray(reader1 -> ObservedInteger.fromJson(reader1)); + deserializedPageAsset.httpResponseCodes = httpResponseCodes; + } else if ("httpResponseMessages".equals(fieldName)) { + List httpResponseMessages + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.httpResponseMessages = httpResponseMessages; + } else if ("responseTimes".equals(fieldName)) { + List responseTimes = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedPageAsset.responseTimes = responseTimes; + } else if ("frames".equals(fieldName)) { + List frames = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedPageAsset.frames = frames; + } else if ("windows".equals(fieldName)) { + List windows = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedPageAsset.windows = windows; + } else if ("nonHtmlFrames".equals(fieldName)) { + List nonHtmlFrames + = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedPageAsset.nonHtmlFrames = nonHtmlFrames; + } else if ("undirectedContent".equals(fieldName)) { + List undirectedContent + = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedPageAsset.undirectedContent = undirectedContent; + } else if ("contentTypes".equals(fieldName)) { + List contentTypes = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.contentTypes = contentTypes; + } else if ("contentLengths".equals(fieldName)) { + List contentLengths = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedPageAsset.contentLengths = contentLengths; + } else if ("windowNames".equals(fieldName)) { + List windowNames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.windowNames = windowNames; + } else if ("charsets".equals(fieldName)) { + List charsets = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.charsets = charsets; + } else if ("titles".equals(fieldName)) { + List titles = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.titles = titles; + } else if ("languages".equals(fieldName)) { + List languages = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.languages = languages; + } else if ("responseHeaders".equals(fieldName)) { + List responseHeaders + = reader.readArray(reader1 -> ObservedHeader.fromJson(reader1)); + deserializedPageAsset.responseHeaders = responseHeaders; + } else if ("cookies".equals(fieldName)) { + List cookies = reader.readArray(reader1 -> Cookie.fromJson(reader1)); + deserializedPageAsset.cookies = cookies; + } else if ("webComponents".equals(fieldName)) { + List webComponents = reader.readArray(reader1 -> WebComponent.fromJson(reader1)); + deserializedPageAsset.webComponents = webComponents; + } else if ("attributes".equals(fieldName)) { + List attributes = reader.readArray(reader1 -> Attribute.fromJson(reader1)); + deserializedPageAsset.attributes = attributes; + } else if ("assetSecurityPolicies".equals(fieldName)) { + List assetSecurityPolicies + = reader.readArray(reader1 -> AssetSecurityPolicy.fromJson(reader1)); + deserializedPageAsset.assetSecurityPolicies = assetSecurityPolicies; + } else if ("responseBodyMinhashSignatures".equals(fieldName)) { + List responseBodyMinhashSignatures + = reader.readArray(reader1 -> ObservedIntegers.fromJson(reader1)); + deserializedPageAsset.responseBodyMinhashSignatures = responseBodyMinhashSignatures; + } else if ("fullDomMinhashSignatures".equals(fieldName)) { + List fullDomMinhashSignatures + = reader.readArray(reader1 -> ObservedIntegers.fromJson(reader1)); + deserializedPageAsset.fullDomMinhashSignatures = fullDomMinhashSignatures; + } else if ("responseBodyHashSignatures".equals(fieldName)) { + List responseBodyHashSignatures + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.responseBodyHashSignatures = responseBodyHashSignatures; + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.errors = errors; + } else if ("sslCerts".equals(fieldName)) { + List sslCerts = reader.readArray(reader1 -> SslCertAsset.fromJson(reader1)); + deserializedPageAsset.sslCerts = sslCerts; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedPageAsset.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedPageAsset.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedPageAsset.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedPageAsset.count = reader.getNullable(JsonReader::getLong); + } else if ("cause".equals(fieldName)) { + deserializedPageAsset.cause = PageCause.fromJson(reader); + } else if ("referrer".equals(fieldName)) { + deserializedPageAsset.referrer = reader.getString(); + } else if ("redirectUrls".equals(fieldName)) { + List redirectUrls = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.redirectUrls = redirectUrls; + } else if ("redirectType".equals(fieldName)) { + deserializedPageAsset.redirectType = PageAssetRedirectType.fromString(reader.getString()); + } else if ("finalUrls".equals(fieldName)) { + List finalUrls = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.finalUrls = finalUrls; + } else if ("finalResponseCodes".equals(fieldName)) { + List finalResponseCodes + = reader.readArray(reader1 -> ObservedInteger.fromJson(reader1)); + deserializedPageAsset.finalResponseCodes = finalResponseCodes; + } else if ("parkedPage".equals(fieldName)) { + List parkedPage = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedPageAsset.parkedPage = parkedPage; + } else if ("resourceUrls".equals(fieldName)) { + List resourceUrls = reader.readArray(reader1 -> ResourceUrl.fromJson(reader1)); + deserializedPageAsset.resourceUrls = resourceUrls; + } else if ("guids".equals(fieldName)) { + List guids = reader.readArray(reader1 -> GuidPair.fromJson(reader1)); + deserializedPageAsset.guids = guids; + } else if ("finalIpAddresses".equals(fieldName)) { + List finalIpAddresses + = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.finalIpAddresses = finalIpAddresses; + } else if ("asns".equals(fieldName)) { + List asns = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedPageAsset.asns = asns; + } else if ("ipBlocks".equals(fieldName)) { + List ipBlocks = reader.readArray(reader1 -> IpBlock.fromJson(reader1)); + deserializedPageAsset.ipBlocks = ipBlocks; + } else if ("finalAsns".equals(fieldName)) { + List finalAsns = reader.readArray(reader1 -> ObservedLong.fromJson(reader1)); + deserializedPageAsset.finalAsns = finalAsns; + } else if ("finalIpBlocks".equals(fieldName)) { + List finalIpBlocks = reader.readArray(reader1 -> IpBlock.fromJson(reader1)); + deserializedPageAsset.finalIpBlocks = finalIpBlocks; + } else if ("responseBodies".equals(fieldName)) { + List responseBodies = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.responseBodies = responseBodies; + } else if ("domainAsset".equals(fieldName)) { + deserializedPageAsset.domainAsset = DomainAsset.fromJson(reader); + } else if ("rootUrl".equals(fieldName)) { + deserializedPageAsset.rootUrl = ObservedBoolean.fromJson(reader); + } else if ("isRootUrl".equals(fieldName)) { + deserializedPageAsset.isRootUrl = reader.getNullable(JsonReader::getBoolean); + } else if ("location".equals(fieldName)) { + List location = reader.readArray(reader1 -> ObservedLocation.fromJson(reader1)); + deserializedPageAsset.location = location; + } else if ("services".equals(fieldName)) { + List services = reader.readArray(reader1 -> Service.fromJson(reader1)); + deserializedPageAsset.services = services; + } else if ("siteStatus".equals(fieldName)) { + deserializedPageAsset.siteStatus = reader.getString(); + } else if ("cnames".equals(fieldName)) { + List cnames = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.cnames = cnames; + } else if ("cdns".equals(fieldName)) { + List cdns = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedPageAsset.cdns = cdns; + } else if ("host".equals(fieldName)) { + deserializedPageAsset.host = reader.getString(); + } else if ("domain".equals(fieldName)) { + deserializedPageAsset.domain = reader.getString(); + } else if ("sslServerConfig".equals(fieldName)) { + List sslServerConfig + = reader.readArray(reader1 -> SslServerConfig.fromJson(reader1)); + deserializedPageAsset.sslServerConfig = sslServerConfig; + } else if ("gdprAssetSecurityPolicies".equals(fieldName)) { + List gdprAssetSecurityPolicies + = reader.readArray(reader1 -> AssetSecurityPolicy.fromJson(reader1)); + deserializedPageAsset.gdprAssetSecurityPolicies = gdprAssetSecurityPolicies; + } else if ("ipv4".equals(fieldName)) { + List ipv4 = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedPageAsset.ipv4 = ipv4; + } else if ("ipv6".equals(fieldName)) { + List ipv6 = reader.readArray(reader1 -> ObservedBoolean.fromJson(reader1)); + deserializedPageAsset.ipv6 = ipv6; + } else { + reader.skipChildren(); + } + } + return deserializedPageAsset; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetRedirectType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetRedirectType.java index 721cb1606eb9..e5c49c9623a3 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetRedirectType.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetRedirectType.java @@ -5,11 +5,10 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * Defines values for PageAssetRedirectType. + * The redirect type of a page. */ public final class PageAssetRedirectType extends ExpandableStringEnum { @@ -54,7 +53,6 @@ public PageAssetRedirectType() { * @return the corresponding PageAssetRedirectType. */ @Generated - @JsonCreator public static PageAssetRedirectType fromString(String name) { return fromString(name, PageAssetRedirectType.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetResource.java index d58f7b917de7..1fb0ddbfc83c 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetResource.java @@ -5,16 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; /** * The PageAssetResource model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("page") @Immutable public final class PageAssetResource extends AssetResource { @@ -22,8 +24,7 @@ public final class PageAssetResource extends AssetResource { * asset */ @Generated - @JsonProperty(value = "asset") - private PageAsset asset; + private final PageAsset asset; /** * Creates an instance of PageAssetResource class. @@ -31,8 +32,7 @@ public final class PageAssetResource extends AssetResource { * @param asset the asset value to set. */ @Generated - @JsonCreator - private PageAssetResource(@JsonProperty(value = "asset") PageAsset asset) { + private PageAssetResource(PageAsset asset) { this.asset = asset; } @@ -45,4 +45,338 @@ private PageAssetResource(@JsonProperty(value = "asset") PageAsset asset) { public PageAsset getAsset() { return this.asset; } + + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "page"; + + /* + * The caller provided unique name for the resource. + */ + @Generated + private String name; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * Global UUID for the asset. + */ + @Generated + private String uuid; + + /* + * The date this asset was first added to this workspace. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The date this asset was last updated for this workspace. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The state property. + */ + @Generated + private AssetState state; + + /* + * An optional customer provided identifier for this asset. + */ + @Generated + private String externalId; + + /* + * Customer labels assigned to this asset. + */ + @Generated + private List labels; + + /* + * An indicator of whether this asset represents a wildcard rollup of assets on this domain. + */ + @Generated + private Boolean wildcard; + + /* + * The name of the DiscoGroup that brought added this asset to the workspace. + */ + @Generated + private String discoGroupName; + + /* + * The history of how this asset was pulled into the workspace through the discovery process. + */ + @Generated + private List auditTrail; + + /* + * The reason property. + */ + @Generated + private String reason; + + /** + * Get the kind property: Discriminator property for AssetResource. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + @Override + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the uuid property: Global UUID for the asset. + * + * @return the uuid value. + */ + @Generated + @Override + public String getUuid() { + return this.uuid; + } + + /** + * Get the createdDate property: The date this asset was first added to this workspace. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the updatedDate property: The date this asset was last updated for this workspace. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + @Generated + @Override + public AssetState getState() { + return this.state; + } + + /** + * Get the externalId property: An optional customer provided identifier for this asset. + * + * @return the externalId value. + */ + @Generated + @Override + public String getExternalId() { + return this.externalId; + } + + /** + * Get the labels property: Customer labels assigned to this asset. + * + * @return the labels value. + */ + @Generated + @Override + public List getLabels() { + return this.labels; + } + + /** + * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. + * + * @return the wildcard value. + */ + @Generated + @Override + public Boolean isWildcard() { + return this.wildcard; + } + + /** + * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * + * @return the discoGroupName value. + */ + @Generated + @Override + public String getDiscoGroupName() { + return this.discoGroupName; + } + + /** + * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. + * + * @return the auditTrail value. + */ + @Generated + @Override + public List getAuditTrail() { + return this.auditTrail; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + @Override + public String getReason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("uuid", getUuid()); + jsonWriter.writeStringField("createdDate", + getCreatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCreatedDate())); + jsonWriter.writeStringField("updatedDate", + getUpdatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getUpdatedDate())); + jsonWriter.writeStringField("state", getState() == null ? null : getState().toString()); + jsonWriter.writeStringField("externalId", getExternalId()); + jsonWriter.writeArrayField("labels", getLabels(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("wildcard", isWildcard()); + jsonWriter.writeStringField("discoGroupName", getDiscoGroupName()); + jsonWriter.writeArrayField("auditTrail", getAuditTrail(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reason", getReason()); + jsonWriter.writeJsonField("asset", this.asset); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PageAssetResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PageAssetResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PageAssetResource. + */ + @Generated + public static PageAssetResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String displayName = null; + String uuid = null; + OffsetDateTime createdDate = null; + OffsetDateTime updatedDate = null; + AssetState state = null; + String externalId = null; + List labels = null; + Boolean wildcard = null; + String discoGroupName = null; + List auditTrail = null; + String reason = null; + PageAsset asset = null; + String kind = "page"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("uuid".equals(fieldName)) { + uuid = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + state = AssetState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + labels = reader.readArray(reader1 -> reader1.getString()); + } else if ("wildcard".equals(fieldName)) { + wildcard = reader.getNullable(JsonReader::getBoolean); + } else if ("discoGroupName".equals(fieldName)) { + discoGroupName = reader.getString(); + } else if ("auditTrail".equals(fieldName)) { + auditTrail = reader.readArray(reader1 -> AuditTrailItem.fromJson(reader1)); + } else if ("reason".equals(fieldName)) { + reason = reader.getString(); + } else if ("asset".equals(fieldName)) { + asset = PageAsset.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + PageAssetResource deserializedPageAssetResource = new PageAssetResource(asset); + deserializedPageAssetResource.setId(id); + deserializedPageAssetResource.name = name; + deserializedPageAssetResource.displayName = displayName; + deserializedPageAssetResource.uuid = uuid; + deserializedPageAssetResource.createdDate = createdDate; + deserializedPageAssetResource.updatedDate = updatedDate; + deserializedPageAssetResource.state = state; + deserializedPageAssetResource.externalId = externalId; + deserializedPageAssetResource.labels = labels; + deserializedPageAssetResource.wildcard = wildcard; + deserializedPageAssetResource.discoGroupName = discoGroupName; + deserializedPageAssetResource.auditTrail = auditTrail; + deserializedPageAssetResource.reason = reason; + deserializedPageAssetResource.kind = kind; + return deserializedPageAssetResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageCause.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageCause.java index 9ebb38da6b48..528eb0cd220c 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageCause.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageCause.java @@ -5,61 +5,58 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The PageCause model. */ @Immutable -public final class PageCause { +public final class PageCause implements JsonSerializable { /* * The cause property. */ @Generated - @JsonProperty(value = "cause") private String cause; /* * The causeElementXPath property. */ @Generated - @JsonProperty(value = "causeElementXPath") private String causeElementXPath; /* * The location property. */ @Generated - @JsonProperty(value = "location") private String location; /* * The possibleMatches property. */ @Generated - @JsonProperty(value = "possibleMatches") private Integer possibleMatches; /* * The loopDetected property. */ @Generated - @JsonProperty(value = "loopDetected") private Boolean loopDetected; /* * The version property. */ @Generated - @JsonProperty(value = "version") private Integer version; /* * The domChangeIndex property. */ @Generated - @JsonProperty(value = "domChangeIndex") private Integer domChangeIndex; /** @@ -138,4 +135,58 @@ public Integer getVersion() { public Integer getDomChangeIndex() { return this.domChangeIndex; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cause", this.cause); + jsonWriter.writeStringField("causeElementXPath", this.causeElementXPath); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeNumberField("possibleMatches", this.possibleMatches); + jsonWriter.writeBooleanField("loopDetected", this.loopDetected); + jsonWriter.writeNumberField("version", this.version); + jsonWriter.writeNumberField("domChangeIndex", this.domChangeIndex); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PageCause from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PageCause if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the PageCause. + */ + @Generated + public static PageCause fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PageCause deserializedPageCause = new PageCause(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("cause".equals(fieldName)) { + deserializedPageCause.cause = reader.getString(); + } else if ("causeElementXPath".equals(fieldName)) { + deserializedPageCause.causeElementXPath = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPageCause.location = reader.getString(); + } else if ("possibleMatches".equals(fieldName)) { + deserializedPageCause.possibleMatches = reader.getNullable(JsonReader::getInt); + } else if ("loopDetected".equals(fieldName)) { + deserializedPageCause.loopDetected = reader.getNullable(JsonReader::getBoolean); + } else if ("version".equals(fieldName)) { + deserializedPageCause.version = reader.getNullable(JsonReader::getInt); + } else if ("domChangeIndex".equals(fieldName)) { + deserializedPageCause.domChangeIndex = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedPageCause; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Port.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Port.java index 887dec8c7620..24a4da0e90af 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Port.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Port.java @@ -5,41 +5,43 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The Port model. */ @Immutable -public final class Port { +public final class Port implements JsonSerializable { /* * The port property. */ @Generated - @JsonProperty(value = "port") private Integer port; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /** @@ -88,4 +90,53 @@ public OffsetDateTime getLastSeen() { public Long getCount() { return this.count; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Port from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Port if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Port. + */ + @Generated + public static Port fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Port deserializedPort = new Port(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("port".equals(fieldName)) { + deserializedPort.port = reader.getNullable(JsonReader::getInt); + } else if ("firstSeen".equals(fieldName)) { + deserializedPort.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedPort.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedPort.count = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + return deserializedPort; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotExportRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotExportRequest.java new file mode 100644 index 000000000000..b8c243380bb1 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotExportRequest.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A request body used for an asset report snapshot export. + */ +@Fluent +public final class ReportAssetSnapshotExportRequest implements JsonSerializable { + /* + * The metric to retrieve a snapshot for. + */ + @Generated + private String metric; + + /* + * The filename of the exported file. + */ + @Generated + private String fileName; + + /* + * The columns to include in the export + */ + @Generated + private List columns; + + /** + * Creates an instance of ReportAssetSnapshotExportRequest class. + */ + @Generated + public ReportAssetSnapshotExportRequest() { + } + + /** + * Get the metric property: The metric to retrieve a snapshot for. + * + * @return the metric value. + */ + @Generated + public String getMetric() { + return this.metric; + } + + /** + * Set the metric property: The metric to retrieve a snapshot for. + * + * @param metric the metric value to set. + * @return the ReportAssetSnapshotExportRequest object itself. + */ + @Generated + public ReportAssetSnapshotExportRequest setMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the fileName property: The filename of the exported file. + * + * @return the fileName value. + */ + @Generated + public String getFileName() { + return this.fileName; + } + + /** + * Set the fileName property: The filename of the exported file. + * + * @param fileName the fileName value to set. + * @return the ReportAssetSnapshotExportRequest object itself. + */ + @Generated + public ReportAssetSnapshotExportRequest setFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Get the columns property: The columns to include in the export. + * + * @return the columns value. + */ + @Generated + public List getColumns() { + return this.columns; + } + + /** + * Set the columns property: The columns to include in the export. + * + * @param columns the columns value to set. + * @return the ReportAssetSnapshotExportRequest object itself. + */ + @Generated + public ReportAssetSnapshotExportRequest setColumns(List columns) { + this.columns = columns; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metric", this.metric); + jsonWriter.writeStringField("fileName", this.fileName); + jsonWriter.writeArrayField("columns", this.columns, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReportAssetSnapshotExportRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportAssetSnapshotExportRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReportAssetSnapshotExportRequest. + */ + @Generated + public static ReportAssetSnapshotExportRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportAssetSnapshotExportRequest deserializedReportAssetSnapshotExportRequest + = new ReportAssetSnapshotExportRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metric".equals(fieldName)) { + deserializedReportAssetSnapshotExportRequest.metric = reader.getString(); + } else if ("fileName".equals(fieldName)) { + deserializedReportAssetSnapshotExportRequest.fileName = reader.getString(); + } else if ("columns".equals(fieldName)) { + List columns = reader.readArray(reader1 -> reader1.getString()); + deserializedReportAssetSnapshotExportRequest.columns = columns; + } else { + reader.skipChildren(); + } + } + + return deserializedReportAssetSnapshotExportRequest; + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotRequest.java index 61440995da06..b0cc57d13e58 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotRequest.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotRequest.java @@ -5,40 +5,40 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * A request body used to retrieve an asset report snapshot. */ @Fluent -public final class ReportAssetSnapshotRequest { +public final class ReportAssetSnapshotRequest implements JsonSerializable { /* * The metric to retrieve a snapshot for. */ @Generated - @JsonProperty(value = "metric") private String metric; /* * The name of the label to retrieve a snapshot for. */ @Generated - @JsonProperty(value = "labelName") private String labelName; /* * The number of assets per page. */ @Generated - @JsonProperty(value = "size") private Integer size; /* * The page to retrieve. */ @Generated - @JsonProperty(value = "page") private Integer page; /** @@ -135,4 +135,49 @@ public ReportAssetSnapshotRequest setPage(Integer page) { this.page = page; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metric", this.metric); + jsonWriter.writeStringField("labelName", this.labelName); + jsonWriter.writeNumberField("size", this.size); + jsonWriter.writeNumberField("page", this.page); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReportAssetSnapshotRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportAssetSnapshotRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReportAssetSnapshotRequest. + */ + @Generated + public static ReportAssetSnapshotRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportAssetSnapshotRequest deserializedReportAssetSnapshotRequest = new ReportAssetSnapshotRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("metric".equals(fieldName)) { + deserializedReportAssetSnapshotRequest.metric = reader.getString(); + } else if ("labelName".equals(fieldName)) { + deserializedReportAssetSnapshotRequest.labelName = reader.getString(); + } else if ("size".equals(fieldName)) { + deserializedReportAssetSnapshotRequest.size = reader.getNullable(JsonReader::getInt); + } else if ("page".equals(fieldName)) { + deserializedReportAssetSnapshotRequest.page = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedReportAssetSnapshotRequest; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotResult.java index 065ac3fbcbf4..7207ae58f693 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotResult.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotResult.java @@ -5,56 +5,56 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** - * A snapshot of assets captured daily for the provided metric. Asset details only contain primary properties. - * Detailed asset data can be retrieved from the asset endpoints. + * A snapshot of assets captured daily for the provided metric. Asset details only contain primary properties. Detailed + * asset data can be retrieved from the asset endpoints. */ @Immutable -public final class ReportAssetSnapshotResult { +public final class ReportAssetSnapshotResult implements JsonSerializable { /* * The name of the metric. */ @Generated - @JsonProperty(value = "displayName") private String displayName; /* * The unique metric name. */ @Generated - @JsonProperty(value = "metric") private String metric; /* * The customer label that was filtered on, if one was provided. */ @Generated - @JsonProperty(value = "labelName") private String labelName; /* * The last time this asset data was updated on this metric. */ @Generated - @JsonProperty(value = "updatedAt") private OffsetDateTime updatedAt; /* * A description of what the metric represents. */ @Generated - @JsonProperty(value = "description") private String description; /* * The page of assets that match the provided metric. */ @Generated - @JsonProperty(value = "assets") private AssetPageResult assets; /** @@ -123,4 +123,57 @@ public String getDescription() { public AssetPageResult getAssets() { return this.assets; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("metric", this.metric); + jsonWriter.writeStringField("labelName", this.labelName); + jsonWriter.writeStringField("updatedAt", + this.updatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedAt)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("assets", this.assets); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReportAssetSnapshotResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportAssetSnapshotResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReportAssetSnapshotResult. + */ + @Generated + public static ReportAssetSnapshotResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportAssetSnapshotResult deserializedReportAssetSnapshotResult = new ReportAssetSnapshotResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("displayName".equals(fieldName)) { + deserializedReportAssetSnapshotResult.displayName = reader.getString(); + } else if ("metric".equals(fieldName)) { + deserializedReportAssetSnapshotResult.metric = reader.getString(); + } else if ("labelName".equals(fieldName)) { + deserializedReportAssetSnapshotResult.labelName = reader.getString(); + } else if ("updatedAt".equals(fieldName)) { + deserializedReportAssetSnapshotResult.updatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedReportAssetSnapshotResult.description = reader.getString(); + } else if ("assets".equals(fieldName)) { + deserializedReportAssetSnapshotResult.assets = AssetPageResult.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedReportAssetSnapshotResult; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryRequest.java index c2eecbd2e8da..0322a804f593 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryRequest.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryRequest.java @@ -5,35 +5,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** - * A request body used to retrieve summary asset information. One and only one collection of summary identifiers must - * be provided: filters, metrics, or metricCategories. + * A request body used to retrieve summary asset information. One and only one collection of summary identifiers must be + * provided: filters, metrics, or metricCategories. */ @Fluent -public final class ReportAssetSummaryRequest { +public final class ReportAssetSummaryRequest implements JsonSerializable { /* * Categories to retrieve risk reporting data for. */ @Generated - @JsonProperty(value = "metricCategories") private List metricCategories; /* * Metrics to retrieve risk reporting data for. */ @Generated - @JsonProperty(value = "metrics") private List metrics; /* * Query filters to apply to the asset summary. */ @Generated - @JsonProperty(value = "filters") private List filters; /* @@ -41,7 +42,6 @@ public final class ReportAssetSummaryRequest { * filters. */ @Generated - @JsonProperty(value = "groupBy") private String groupBy; /* @@ -49,14 +49,12 @@ public final class ReportAssetSummaryRequest { * filters. */ @Generated - @JsonProperty(value = "segmentBy") private String segmentBy; /* * Currently unused. */ @Generated - @JsonProperty(value = "labelName") private String labelName; /** @@ -133,8 +131,8 @@ public ReportAssetSummaryRequest setFilters(List filters) { } /** - * Get the groupBy property: A parameter to group the assets by (first level facet field), only used when the - * chosen summary identifier is filters. + * Get the groupBy property: A parameter to group the assets by (first level facet field), only used when the chosen + * summary identifier is filters. * * @return the groupBy value. */ @@ -144,8 +142,8 @@ public String getGroupBy() { } /** - * Set the groupBy property: A parameter to group the assets by (first level facet field), only used when the - * chosen summary identifier is filters. + * Set the groupBy property: A parameter to group the assets by (first level facet field), only used when the chosen + * summary identifier is filters. * * @param groupBy the groupBy value to set. * @return the ReportAssetSummaryRequest object itself. @@ -201,4 +199,59 @@ public ReportAssetSummaryRequest setLabelName(String labelName) { this.labelName = labelName; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("metricCategories", this.metricCategories, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("metrics", this.metrics, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("groupBy", this.groupBy); + jsonWriter.writeStringField("segmentBy", this.segmentBy); + jsonWriter.writeStringField("labelName", this.labelName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReportAssetSummaryRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportAssetSummaryRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReportAssetSummaryRequest. + */ + @Generated + public static ReportAssetSummaryRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportAssetSummaryRequest deserializedReportAssetSummaryRequest = new ReportAssetSummaryRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("metricCategories".equals(fieldName)) { + List metricCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedReportAssetSummaryRequest.metricCategories = metricCategories; + } else if ("metrics".equals(fieldName)) { + List metrics = reader.readArray(reader1 -> reader1.getString()); + deserializedReportAssetSummaryRequest.metrics = metrics; + } else if ("filters".equals(fieldName)) { + List filters = reader.readArray(reader1 -> reader1.getString()); + deserializedReportAssetSummaryRequest.filters = filters; + } else if ("groupBy".equals(fieldName)) { + deserializedReportAssetSummaryRequest.groupBy = reader.getString(); + } else if ("segmentBy".equals(fieldName)) { + deserializedReportAssetSummaryRequest.segmentBy = reader.getString(); + } else if ("labelName".equals(fieldName)) { + deserializedReportAssetSummaryRequest.labelName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedReportAssetSummaryRequest; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryResult.java index 741fc6ada32d..94e8f3ee0e3f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryResult.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryResult.java @@ -5,20 +5,23 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The ReportAssetSummaryResult model. */ @Immutable -public final class ReportAssetSummaryResult { +public final class ReportAssetSummaryResult implements JsonSerializable { /* * The collection of asset summaries. */ @Generated - @JsonProperty(value = "assetSummaries") private List assetSummaries; /** @@ -37,4 +40,43 @@ private ReportAssetSummaryResult() { public List getAssetSummaries() { return this.assetSummaries; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("assetSummaries", this.assetSummaries, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReportAssetSummaryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportAssetSummaryResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReportAssetSummaryResult. + */ + @Generated + public static ReportAssetSummaryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportAssetSummaryResult deserializedReportAssetSummaryResult = new ReportAssetSummaryResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("assetSummaries".equals(fieldName)) { + List assetSummaries + = reader.readArray(reader1 -> AssetSummaryResult.fromJson(reader1)); + deserializedReportAssetSummaryResult.assetSummaries = assetSummaries; + } else { + reader.skipChildren(); + } + } + return deserializedReportAssetSummaryResult; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdown.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdown.java index 2d45a7ad7307..ae0c727688a1 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdown.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdown.java @@ -5,26 +5,28 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The breakdown of billable asset counts for each asset type. */ @Immutable -public final class ReportBillableAssetBreakdown { +public final class ReportBillableAssetBreakdown implements JsonSerializable { /* * The kind of billable asset. */ @Generated - @JsonProperty(value = "kind") private ReportBillableAssetBreakdownKind kind; /* * The number of assets of this type. */ @Generated - @JsonProperty(value = "count") private Long count; /** @@ -53,4 +55,44 @@ public ReportBillableAssetBreakdownKind getKind() { public Long getCount() { return this.count; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeNumberField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReportBillableAssetBreakdown from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportBillableAssetBreakdown if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReportBillableAssetBreakdown. + */ + @Generated + public static ReportBillableAssetBreakdown fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportBillableAssetBreakdown deserializedReportBillableAssetBreakdown = new ReportBillableAssetBreakdown(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedReportBillableAssetBreakdown.kind + = ReportBillableAssetBreakdownKind.fromString(reader.getString()); + } else if ("count".equals(fieldName)) { + deserializedReportBillableAssetBreakdown.count = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + return deserializedReportBillableAssetBreakdown; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdownKind.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdownKind.java index 55229ae7b785..46dc3b743401 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdownKind.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdownKind.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public ReportBillableAssetBreakdownKind() { * @return the corresponding ReportBillableAssetBreakdownKind. */ @Generated - @JsonCreator public static ReportBillableAssetBreakdownKind fromString(String name) { return fromString(name, ReportBillableAssetBreakdownKind.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSnapshotResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSnapshotResult.java index 576253258e14..25c3747906ad 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSnapshotResult.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSnapshotResult.java @@ -5,35 +5,37 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.LocalDate; import java.util.List; +import java.util.Objects; /** * The ReportBillableAssetSnapshotResult model. */ @Immutable -public final class ReportBillableAssetSnapshotResult { +public final class ReportBillableAssetSnapshotResult implements JsonSerializable { /* * The date these assets were billed on. */ @Generated - @JsonProperty(value = "date") private LocalDate date; /* * The total number of billable assets for this date. */ @Generated - @JsonProperty(value = "total") private Long total; /* * The breakdown of billable asset counts for each asset type. */ @Generated - @JsonProperty(value = "assetBreakdown") private List assetBreakdown; /** @@ -72,4 +74,51 @@ public Long getTotal() { public List getAssetBreakdown() { return this.assetBreakdown; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("date", Objects.toString(this.date, null)); + jsonWriter.writeNumberField("total", this.total); + jsonWriter.writeArrayField("assetBreakdown", this.assetBreakdown, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReportBillableAssetSnapshotResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportBillableAssetSnapshotResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReportBillableAssetSnapshotResult. + */ + @Generated + public static ReportBillableAssetSnapshotResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportBillableAssetSnapshotResult deserializedReportBillableAssetSnapshotResult + = new ReportBillableAssetSnapshotResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("date".equals(fieldName)) { + deserializedReportBillableAssetSnapshotResult.date + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("total".equals(fieldName)) { + deserializedReportBillableAssetSnapshotResult.total = reader.getNullable(JsonReader::getLong); + } else if ("assetBreakdown".equals(fieldName)) { + List assetBreakdown + = reader.readArray(reader1 -> ReportBillableAssetBreakdown.fromJson(reader1)); + deserializedReportBillableAssetSnapshotResult.assetBreakdown = assetBreakdown; + } else { + reader.skipChildren(); + } + } + return deserializedReportBillableAssetSnapshotResult; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSummaryResult.java index 385bf08ede65..11db6f9232b1 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSummaryResult.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSummaryResult.java @@ -5,20 +5,23 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The ReportBillableAssetSummaryResult model. */ @Immutable -public final class ReportBillableAssetSummaryResult { +public final class ReportBillableAssetSummaryResult implements JsonSerializable { /* * The assetSummaries property. */ @Generated - @JsonProperty(value = "assetSummaries") private List assetSummaries; /** @@ -37,4 +40,44 @@ private ReportBillableAssetSummaryResult() { public List getAssetSummaries() { return this.assetSummaries; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("assetSummaries", this.assetSummaries, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReportBillableAssetSummaryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReportBillableAssetSummaryResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReportBillableAssetSummaryResult. + */ + @Generated + public static ReportBillableAssetSummaryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReportBillableAssetSummaryResult deserializedReportBillableAssetSummaryResult + = new ReportBillableAssetSummaryResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("assetSummaries".equals(fieldName)) { + List assetSummaries + = reader.readArray(reader1 -> ReportBillableAssetSnapshotResult.fromJson(reader1)); + deserializedReportBillableAssetSummaryResult.assetSummaries = assetSummaries; + } else { + reader.skipChildren(); + } + } + return deserializedReportBillableAssetSummaryResult; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Reputation.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Reputation.java index 7a1c2eb3519f..7010be593b72 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Reputation.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Reputation.java @@ -5,69 +5,67 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The Reputation model. */ @Immutable -public final class Reputation { +public final class Reputation implements JsonSerializable { /* * The listName property. */ @Generated - @JsonProperty(value = "listName") private String listName; /* * The threatType property. */ @Generated - @JsonProperty(value = "threatType") private String threatType; /* * The trusted property. */ @Generated - @JsonProperty(value = "trusted") private Boolean trusted; /* * The cidr property. */ @Generated - @JsonProperty(value = "cidr") private String cidr; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The listUpdatedAt property. */ @Generated - @JsonProperty(value = "listUpdatedAt") private OffsetDateTime listUpdatedAt; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /** @@ -156,4 +154,67 @@ public OffsetDateTime getListUpdatedAt() { public Boolean isRecent() { return this.recent; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("listName", this.listName); + jsonWriter.writeStringField("threatType", this.threatType); + jsonWriter.writeBooleanField("trusted", this.trusted); + jsonWriter.writeStringField("cidr", this.cidr); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeStringField("listUpdatedAt", + this.listUpdatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.listUpdatedAt)); + jsonWriter.writeBooleanField("recent", this.recent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Reputation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Reputation if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Reputation. + */ + @Generated + public static Reputation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Reputation deserializedReputation = new Reputation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("listName".equals(fieldName)) { + deserializedReputation.listName = reader.getString(); + } else if ("threatType".equals(fieldName)) { + deserializedReputation.threatType = reader.getString(); + } else if ("trusted".equals(fieldName)) { + deserializedReputation.trusted = reader.getNullable(JsonReader::getBoolean); + } else if ("cidr".equals(fieldName)) { + deserializedReputation.cidr = reader.getString(); + } else if ("firstSeen".equals(fieldName)) { + deserializedReputation.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedReputation.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("listUpdatedAt".equals(fieldName)) { + deserializedReputation.listUpdatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("recent".equals(fieldName)) { + deserializedReputation.recent = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedReputation; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ResourceUrl.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ResourceUrl.java index f5a19a5f77f3..92e76302f01b 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ResourceUrl.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ResourceUrl.java @@ -5,56 +5,56 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The ResourceUrl model. */ @Immutable -public final class ResourceUrl { +public final class ResourceUrl implements JsonSerializable { /* * The url property. */ @Generated - @JsonProperty(value = "url") private String url; /* * The resources property. */ @Generated - @JsonProperty(value = "resources") private List resources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /** @@ -123,4 +123,61 @@ public Long getCount() { public Boolean isRecent() { return this.recent; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeArrayField("resources", this.resources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeBooleanField("recent", this.recent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceUrl from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceUrl if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceUrl. + */ + @Generated + public static ResourceUrl fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceUrl deserializedResourceUrl = new ResourceUrl(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("url".equals(fieldName)) { + deserializedResourceUrl.url = reader.getString(); + } else if ("resources".equals(fieldName)) { + List resources + = reader.readArray(reader1 -> DependentResource.fromJson(reader1)); + deserializedResourceUrl.resources = resources; + } else if ("firstSeen".equals(fieldName)) { + deserializedResourceUrl.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedResourceUrl.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedResourceUrl.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedResourceUrl.recent = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedResourceUrl; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilter.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilter.java index a0e6a7024668..deb135f4c430 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilter.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilter.java @@ -5,47 +5,46 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The SavedFilter model. */ @Immutable -public final class SavedFilter { +public final class SavedFilter implements JsonSerializable { /* * The system generated unique id for the resource. */ @Generated - @JsonProperty(value = "id") private String id; /* * The caller provided unique name for the resource. */ @Generated - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The name that can be used for display purposes. */ @Generated - @JsonProperty(value = "displayName") private String displayName; /* * The filter property. */ @Generated - @JsonProperty(value = "filter") private String filter; /* * The description property. */ @Generated - @JsonProperty(value = "description") private String description; /** @@ -104,4 +103,52 @@ public String getFilter() { public String getDescription() { return this.description; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("filter", this.filter); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SavedFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SavedFilter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SavedFilter. + */ + @Generated + public static SavedFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SavedFilter deserializedSavedFilter = new SavedFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedSavedFilter.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSavedFilter.id = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedSavedFilter.displayName = reader.getString(); + } else if ("filter".equals(fieldName)) { + deserializedSavedFilter.filter = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedSavedFilter.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedSavedFilter; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterData.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterData.java index f6b93139db67..953bfe782235 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterData.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterData.java @@ -5,28 +5,29 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * A request body used to create a saved filter. */ @Immutable -public final class SavedFilterData { +public final class SavedFilterData implements JsonSerializable { /* * An expression on the resource type that selects the resources to be returned. */ @Generated - @JsonProperty(value = "filter") - private String filter; + private final String filter; /* * A human readable description of the saved filter. */ @Generated - @JsonProperty(value = "description") - private String description; + private final String description; /** * Creates an instance of SavedFilterData class. @@ -35,9 +36,7 @@ public final class SavedFilterData { * @param description the description value to set. */ @Generated - @JsonCreator - public SavedFilterData(@JsonProperty(value = "filter") String filter, - @JsonProperty(value = "description") String description) { + public SavedFilterData(String filter, String description) { this.filter = filter; this.description = description; } @@ -61,4 +60,45 @@ public String getFilter() { public String getDescription() { return this.description; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filter", this.filter); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SavedFilterData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SavedFilterData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SavedFilterData. + */ + @Generated + public static SavedFilterData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String filter = null; + String description = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("filter".equals(fieldName)) { + filter = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new SavedFilterData(filter, description); + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ScanMetadata.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ScanMetadata.java index fc511abe3aff..9da1fbcb97d7 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ScanMetadata.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ScanMetadata.java @@ -5,41 +5,43 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The ScanMetadata model. */ @Immutable -public final class ScanMetadata { +public final class ScanMetadata implements JsonSerializable { /* * The port property. */ @Generated - @JsonProperty(value = "port") private Integer port; /* * The bannerMetadata property. */ @Generated - @JsonProperty(value = "bannerMetadata") private String bannerMetadata; /* * The startScan property. */ @Generated - @JsonProperty(value = "startScan") private OffsetDateTime startScan; /* * The endScan property. */ @Generated - @JsonProperty(value = "endScan") private OffsetDateTime endScan; /** @@ -88,4 +90,53 @@ public OffsetDateTime getStartScan() { public OffsetDateTime getEndScan() { return this.endScan; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("bannerMetadata", this.bannerMetadata); + jsonWriter.writeStringField("startScan", + this.startScan == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startScan)); + jsonWriter.writeStringField("endScan", + this.endScan == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endScan)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScanMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScanMetadata if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScanMetadata. + */ + @Generated + public static ScanMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScanMetadata deserializedScanMetadata = new ScanMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("port".equals(fieldName)) { + deserializedScanMetadata.port = reader.getNullable(JsonReader::getInt); + } else if ("bannerMetadata".equals(fieldName)) { + deserializedScanMetadata.bannerMetadata = reader.getString(); + } else if ("startScan".equals(fieldName)) { + deserializedScanMetadata.startScan = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endScan".equals(fieldName)) { + deserializedScanMetadata.endScan = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + return deserializedScanMetadata; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Service.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Service.java index f545fdea9168..2d27f688079b 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Service.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Service.java @@ -5,91 +5,86 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The Service model. */ @Immutable -public final class Service { +public final class Service implements JsonSerializable { /* * The scheme property. */ @Generated - @JsonProperty(value = "scheme") private String scheme; /* * The port property. */ @Generated - @JsonProperty(value = "port") private Integer port; /* * The webComponents property. */ @Generated - @JsonProperty(value = "webComponents") private List webComponents; /* * The sslCerts property. */ @Generated - @JsonProperty(value = "sslCerts") private List sslCerts; /* * The exceptions property. */ @Generated - @JsonProperty(value = "exceptions") private List exceptions; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /* * The portStates property. */ @Generated - @JsonProperty(value = "portStates") private List portStates; /** @@ -208,4 +203,80 @@ public Boolean isRecent() { public List getPortStates() { return this.portStates; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scheme", this.scheme); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeArrayField("webComponents", this.webComponents, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sslCerts", this.sslCerts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("exceptions", this.exceptions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeBooleanField("recent", this.recent); + jsonWriter.writeArrayField("portStates", this.portStates, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Service from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Service if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Service. + */ + @Generated + public static Service fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Service deserializedService = new Service(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("scheme".equals(fieldName)) { + deserializedService.scheme = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedService.port = reader.getNullable(JsonReader::getInt); + } else if ("webComponents".equals(fieldName)) { + List webComponents = reader.readArray(reader1 -> WebComponent.fromJson(reader1)); + deserializedService.webComponents = webComponents; + } else if ("sslCerts".equals(fieldName)) { + List sslCerts = reader.readArray(reader1 -> SslCertAsset.fromJson(reader1)); + deserializedService.sslCerts = sslCerts; + } else if ("exceptions".equals(fieldName)) { + List exceptions = reader.readArray(reader1 -> ObservedString.fromJson(reader1)); + deserializedService.exceptions = exceptions; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedService.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedService.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedService.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedService.count = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedService.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("portStates".equals(fieldName)) { + List portStates + = reader.readArray(reader1 -> ObservedPortState.fromJson(reader1)); + deserializedService.portStates = portStates; + } else { + reader.skipChildren(); + } + } + return deserializedService; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SoaRecord.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SoaRecord.java index 495d426be3e6..b79b45c7c263 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SoaRecord.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SoaRecord.java @@ -5,62 +5,61 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The SoaRecord model. */ @Immutable -public final class SoaRecord { +public final class SoaRecord implements JsonSerializable { /* * The nameServer property. */ @Generated - @JsonProperty(value = "nameServer") private String nameServer; /* * The email property. */ @Generated - @JsonProperty(value = "email") private String email; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The serialNumber property. */ @Generated - @JsonProperty(value = "serialNumber") private Long serialNumber; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /** @@ -139,4 +138,62 @@ public Long getSerialNumber() { public Boolean isRecent() { return this.recent; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nameServer", this.nameServer); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeNumberField("serialNumber", this.serialNumber); + jsonWriter.writeBooleanField("recent", this.recent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoaRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoaRecord if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SoaRecord. + */ + @Generated + public static SoaRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoaRecord deserializedSoaRecord = new SoaRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("nameServer".equals(fieldName)) { + deserializedSoaRecord.nameServer = reader.getString(); + } else if ("email".equals(fieldName)) { + deserializedSoaRecord.email = reader.getString(); + } else if ("firstSeen".equals(fieldName)) { + deserializedSoaRecord.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedSoaRecord.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedSoaRecord.count = reader.getNullable(JsonReader::getLong); + } else if ("serialNumber".equals(fieldName)) { + deserializedSoaRecord.serialNumber = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedSoaRecord.recent = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedSoaRecord; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Source.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Source.java index 017c05a3a6d1..bcc9e9f28452 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Source.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Source.java @@ -5,48 +5,49 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The Source model. */ @Immutable -public final class Source { +public final class Source implements JsonSerializable { /* * The source property. */ @Generated - @JsonProperty(value = "source") private String source; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The reason property. */ @Generated - @JsonProperty(value = "reason") private String reason; /** @@ -105,4 +106,56 @@ public Long getCount() { public String getReason() { return this.reason; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("source", this.source); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeStringField("reason", this.reason); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Source from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Source if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Source. + */ + @Generated + public static Source fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Source deserializedSource = new Source(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("source".equals(fieldName)) { + deserializedSource.source = reader.getString(); + } else if ("firstSeen".equals(fieldName)) { + deserializedSource.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedSource.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedSource.count = reader.getNullable(JsonReader::getLong); + } else if ("reason".equals(fieldName)) { + deserializedSource.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedSource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAsset.java index 6af69ffcd8d0..86e0c6a8631c 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAsset.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAsset.java @@ -5,8 +5,13 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -19,231 +24,198 @@ public final class SslCertAsset extends InventoryAsset { * The sha1 property. */ @Generated - @JsonProperty(value = "sha1") private String sha1; /* * The subjectCommonNames property. */ @Generated - @JsonProperty(value = "subjectCommonNames") private List subjectCommonNames; /* * The organizations property. */ @Generated - @JsonProperty(value = "organizations") private List organizations; /* * The organizationalUnits property. */ @Generated - @JsonProperty(value = "organizationalUnits") private List organizationalUnits; /* * The issuerCommonNames property. */ @Generated - @JsonProperty(value = "issuerCommonNames") private List issuerCommonNames; /* * The sigAlgName property. */ @Generated - @JsonProperty(value = "sigAlgName") private String sigAlgName; /* * The invalidAfter property. */ @Generated - @JsonProperty(value = "invalidAfter") private OffsetDateTime invalidAfter; /* * The serialNumber property. */ @Generated - @JsonProperty(value = "serialNumber") private String serialNumber; /* * The subjectAlternativeNames property. */ @Generated - @JsonProperty(value = "subjectAlternativeNames") private List subjectAlternativeNames; /* * The issuerAlternativeNames property. */ @Generated - @JsonProperty(value = "issuerAlternativeNames") private List issuerAlternativeNames; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The invalidBefore property. */ @Generated - @JsonProperty(value = "invalidBefore") private OffsetDateTime invalidBefore; /* * The keySize property. */ @Generated - @JsonProperty(value = "keySize") private Integer keySize; /* * The keyAlgorithm property. */ @Generated - @JsonProperty(value = "keyAlgorithm") private String keyAlgorithm; /* * The subjectLocality property. */ @Generated - @JsonProperty(value = "subjectLocality") private List subjectLocality; /* * The subjectState property. */ @Generated - @JsonProperty(value = "subjectState") private List subjectState; /* * The subjectCountry property. */ @Generated - @JsonProperty(value = "subjectCountry") private List subjectCountry; /* * The issuerLocality property. */ @Generated - @JsonProperty(value = "issuerLocality") private List issuerLocality; /* * The issuerState property. */ @Generated - @JsonProperty(value = "issuerState") private List issuerState; /* * The issuerCountry property. */ @Generated - @JsonProperty(value = "issuerCountry") private List issuerCountry; /* * The subjectOrganizations property. */ @Generated - @JsonProperty(value = "subjectOrganizations") private List subjectOrganizations; /* * The subjectOrganizationalUnits property. */ @Generated - @JsonProperty(value = "subjectOrganizationalUnits") private List subjectOrganizationalUnits; /* * The issuerOrganizations property. */ @Generated - @JsonProperty(value = "issuerOrganizations") private List issuerOrganizations; /* * The issuerOrganizationalUnits property. */ @Generated - @JsonProperty(value = "issuerOrganizationalUnits") private List issuerOrganizationalUnits; /* * The version property. */ @Generated - @JsonProperty(value = "version") private Integer version; /* * The certificateAuthority property. */ @Generated - @JsonProperty(value = "certificateAuthority") private Boolean certificateAuthority; /* * The selfSigned property. */ @Generated - @JsonProperty(value = "selfSigned") private Boolean selfSigned; /* * The sigAlgOid property. */ @Generated - @JsonProperty(value = "sigAlgOid") private String sigAlgOid; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /* * The validationType property. */ @Generated - @JsonProperty(value = "validationType") private SslCertAssetValidationType validationType; /** @@ -582,4 +554,176 @@ public Boolean isRecent() { public SslCertAssetValidationType getValidationType() { return this.validationType; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sha1", this.sha1); + jsonWriter.writeArrayField("subjectCommonNames", this.subjectCommonNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("organizations", this.organizations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("organizationalUnits", this.organizationalUnits, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("issuerCommonNames", this.issuerCommonNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("sigAlgName", this.sigAlgName); + jsonWriter.writeStringField("invalidAfter", + this.invalidAfter == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.invalidAfter)); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + jsonWriter.writeArrayField("subjectAlternativeNames", this.subjectAlternativeNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("issuerAlternativeNames", this.issuerAlternativeNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeStringField("invalidBefore", + this.invalidBefore == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.invalidBefore)); + jsonWriter.writeNumberField("keySize", this.keySize); + jsonWriter.writeStringField("keyAlgorithm", this.keyAlgorithm); + jsonWriter.writeArrayField("subjectLocality", this.subjectLocality, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subjectState", this.subjectState, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subjectCountry", this.subjectCountry, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("issuerLocality", this.issuerLocality, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("issuerState", this.issuerState, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("issuerCountry", this.issuerCountry, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subjectOrganizations", this.subjectOrganizations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subjectOrganizationalUnits", this.subjectOrganizationalUnits, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("issuerOrganizations", this.issuerOrganizations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("issuerOrganizationalUnits", this.issuerOrganizationalUnits, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("version", this.version); + jsonWriter.writeBooleanField("certificateAuthority", this.certificateAuthority); + jsonWriter.writeBooleanField("selfSigned", this.selfSigned); + jsonWriter.writeStringField("sigAlgOid", this.sigAlgOid); + jsonWriter.writeBooleanField("recent", this.recent); + jsonWriter.writeStringField("validationType", + this.validationType == null ? null : this.validationType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SslCertAsset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SslCertAsset if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SslCertAsset. + */ + @Generated + public static SslCertAsset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SslCertAsset deserializedSslCertAsset = new SslCertAsset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("sha1".equals(fieldName)) { + deserializedSslCertAsset.sha1 = reader.getString(); + } else if ("subjectCommonNames".equals(fieldName)) { + List subjectCommonNames = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.subjectCommonNames = subjectCommonNames; + } else if ("organizations".equals(fieldName)) { + List organizations = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.organizations = organizations; + } else if ("organizationalUnits".equals(fieldName)) { + List organizationalUnits = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.organizationalUnits = organizationalUnits; + } else if ("issuerCommonNames".equals(fieldName)) { + List issuerCommonNames = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.issuerCommonNames = issuerCommonNames; + } else if ("sigAlgName".equals(fieldName)) { + deserializedSslCertAsset.sigAlgName = reader.getString(); + } else if ("invalidAfter".equals(fieldName)) { + deserializedSslCertAsset.invalidAfter = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("serialNumber".equals(fieldName)) { + deserializedSslCertAsset.serialNumber = reader.getString(); + } else if ("subjectAlternativeNames".equals(fieldName)) { + List subjectAlternativeNames = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.subjectAlternativeNames = subjectAlternativeNames; + } else if ("issuerAlternativeNames".equals(fieldName)) { + List issuerAlternativeNames = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.issuerAlternativeNames = issuerAlternativeNames; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedSslCertAsset.sources = sources; + } else if ("firstSeen".equals(fieldName)) { + deserializedSslCertAsset.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedSslCertAsset.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedSslCertAsset.count = reader.getNullable(JsonReader::getLong); + } else if ("invalidBefore".equals(fieldName)) { + deserializedSslCertAsset.invalidBefore = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("keySize".equals(fieldName)) { + deserializedSslCertAsset.keySize = reader.getNullable(JsonReader::getInt); + } else if ("keyAlgorithm".equals(fieldName)) { + deserializedSslCertAsset.keyAlgorithm = reader.getString(); + } else if ("subjectLocality".equals(fieldName)) { + List subjectLocality = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.subjectLocality = subjectLocality; + } else if ("subjectState".equals(fieldName)) { + List subjectState = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.subjectState = subjectState; + } else if ("subjectCountry".equals(fieldName)) { + List subjectCountry = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.subjectCountry = subjectCountry; + } else if ("issuerLocality".equals(fieldName)) { + List issuerLocality = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.issuerLocality = issuerLocality; + } else if ("issuerState".equals(fieldName)) { + List issuerState = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.issuerState = issuerState; + } else if ("issuerCountry".equals(fieldName)) { + List issuerCountry = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.issuerCountry = issuerCountry; + } else if ("subjectOrganizations".equals(fieldName)) { + List subjectOrganizations = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.subjectOrganizations = subjectOrganizations; + } else if ("subjectOrganizationalUnits".equals(fieldName)) { + List subjectOrganizationalUnits = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.subjectOrganizationalUnits = subjectOrganizationalUnits; + } else if ("issuerOrganizations".equals(fieldName)) { + List issuerOrganizations = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.issuerOrganizations = issuerOrganizations; + } else if ("issuerOrganizationalUnits".equals(fieldName)) { + List issuerOrganizationalUnits = reader.readArray(reader1 -> reader1.getString()); + deserializedSslCertAsset.issuerOrganizationalUnits = issuerOrganizationalUnits; + } else if ("version".equals(fieldName)) { + deserializedSslCertAsset.version = reader.getNullable(JsonReader::getInt); + } else if ("certificateAuthority".equals(fieldName)) { + deserializedSslCertAsset.certificateAuthority = reader.getNullable(JsonReader::getBoolean); + } else if ("selfSigned".equals(fieldName)) { + deserializedSslCertAsset.selfSigned = reader.getNullable(JsonReader::getBoolean); + } else if ("sigAlgOid".equals(fieldName)) { + deserializedSslCertAsset.sigAlgOid = reader.getString(); + } else if ("recent".equals(fieldName)) { + deserializedSslCertAsset.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("validationType".equals(fieldName)) { + deserializedSslCertAsset.validationType = SslCertAssetValidationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedSslCertAsset; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetResource.java index 6b5fe624b3a5..9829d6e48bf2 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetResource.java @@ -5,16 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; /** * The SslCertAssetResource model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("sslCert") @Immutable public final class SslCertAssetResource extends AssetResource { @@ -22,8 +24,7 @@ public final class SslCertAssetResource extends AssetResource { * asset */ @Generated - @JsonProperty(value = "asset") - private SslCertAsset asset; + private final SslCertAsset asset; /** * Creates an instance of SslCertAssetResource class. @@ -31,8 +32,7 @@ public final class SslCertAssetResource extends AssetResource { * @param asset the asset value to set. */ @Generated - @JsonCreator - private SslCertAssetResource(@JsonProperty(value = "asset") SslCertAsset asset) { + private SslCertAssetResource(SslCertAsset asset) { this.asset = asset; } @@ -45,4 +45,338 @@ private SslCertAssetResource(@JsonProperty(value = "asset") SslCertAsset asset) public SslCertAsset getAsset() { return this.asset; } + + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "sslCert"; + + /* + * The caller provided unique name for the resource. + */ + @Generated + private String name; + + /* + * The name that can be used for display purposes. + */ + @Generated + private String displayName; + + /* + * Global UUID for the asset. + */ + @Generated + private String uuid; + + /* + * The date this asset was first added to this workspace. + */ + @Generated + private OffsetDateTime createdDate; + + /* + * The date this asset was last updated for this workspace. + */ + @Generated + private OffsetDateTime updatedDate; + + /* + * The state property. + */ + @Generated + private AssetState state; + + /* + * An optional customer provided identifier for this asset. + */ + @Generated + private String externalId; + + /* + * Customer labels assigned to this asset. + */ + @Generated + private List labels; + + /* + * An indicator of whether this asset represents a wildcard rollup of assets on this domain. + */ + @Generated + private Boolean wildcard; + + /* + * The name of the DiscoGroup that brought added this asset to the workspace. + */ + @Generated + private String discoGroupName; + + /* + * The history of how this asset was pulled into the workspace through the discovery process. + */ + @Generated + private List auditTrail; + + /* + * The reason property. + */ + @Generated + private String reason; + + /** + * Get the kind property: Discriminator property for AssetResource. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + @Override + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + @Override + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the uuid property: Global UUID for the asset. + * + * @return the uuid value. + */ + @Generated + @Override + public String getUuid() { + return this.uuid; + } + + /** + * Get the createdDate property: The date this asset was first added to this workspace. + * + * @return the createdDate value. + */ + @Generated + @Override + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the updatedDate property: The date this asset was last updated for this workspace. + * + * @return the updatedDate value. + */ + @Generated + @Override + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + @Generated + @Override + public AssetState getState() { + return this.state; + } + + /** + * Get the externalId property: An optional customer provided identifier for this asset. + * + * @return the externalId value. + */ + @Generated + @Override + public String getExternalId() { + return this.externalId; + } + + /** + * Get the labels property: Customer labels assigned to this asset. + * + * @return the labels value. + */ + @Generated + @Override + public List getLabels() { + return this.labels; + } + + /** + * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. + * + * @return the wildcard value. + */ + @Generated + @Override + public Boolean isWildcard() { + return this.wildcard; + } + + /** + * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * + * @return the discoGroupName value. + */ + @Generated + @Override + public String getDiscoGroupName() { + return this.discoGroupName; + } + + /** + * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. + * + * @return the auditTrail value. + */ + @Generated + @Override + public List getAuditTrail() { + return this.auditTrail; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + @Override + public String getReason() { + return this.reason; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("uuid", getUuid()); + jsonWriter.writeStringField("createdDate", + getCreatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCreatedDate())); + jsonWriter.writeStringField("updatedDate", + getUpdatedDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getUpdatedDate())); + jsonWriter.writeStringField("state", getState() == null ? null : getState().toString()); + jsonWriter.writeStringField("externalId", getExternalId()); + jsonWriter.writeArrayField("labels", getLabels(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("wildcard", isWildcard()); + jsonWriter.writeStringField("discoGroupName", getDiscoGroupName()); + jsonWriter.writeArrayField("auditTrail", getAuditTrail(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reason", getReason()); + jsonWriter.writeJsonField("asset", this.asset); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SslCertAssetResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SslCertAssetResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SslCertAssetResource. + */ + @Generated + public static SslCertAssetResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String displayName = null; + String uuid = null; + OffsetDateTime createdDate = null; + OffsetDateTime updatedDate = null; + AssetState state = null; + String externalId = null; + List labels = null; + Boolean wildcard = null; + String discoGroupName = null; + List auditTrail = null; + String reason = null; + SslCertAsset asset = null; + String kind = "sslCert"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("uuid".equals(fieldName)) { + uuid = reader.getString(); + } else if ("createdDate".equals(fieldName)) { + createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedDate".equals(fieldName)) { + updatedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + state = AssetState.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + externalId = reader.getString(); + } else if ("labels".equals(fieldName)) { + labels = reader.readArray(reader1 -> reader1.getString()); + } else if ("wildcard".equals(fieldName)) { + wildcard = reader.getNullable(JsonReader::getBoolean); + } else if ("discoGroupName".equals(fieldName)) { + discoGroupName = reader.getString(); + } else if ("auditTrail".equals(fieldName)) { + auditTrail = reader.readArray(reader1 -> AuditTrailItem.fromJson(reader1)); + } else if ("reason".equals(fieldName)) { + reason = reader.getString(); + } else if ("asset".equals(fieldName)) { + asset = SslCertAsset.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + SslCertAssetResource deserializedSslCertAssetResource = new SslCertAssetResource(asset); + deserializedSslCertAssetResource.setId(id); + deserializedSslCertAssetResource.name = name; + deserializedSslCertAssetResource.displayName = displayName; + deserializedSslCertAssetResource.uuid = uuid; + deserializedSslCertAssetResource.createdDate = createdDate; + deserializedSslCertAssetResource.updatedDate = updatedDate; + deserializedSslCertAssetResource.state = state; + deserializedSslCertAssetResource.externalId = externalId; + deserializedSslCertAssetResource.labels = labels; + deserializedSslCertAssetResource.wildcard = wildcard; + deserializedSslCertAssetResource.discoGroupName = discoGroupName; + deserializedSslCertAssetResource.auditTrail = auditTrail; + deserializedSslCertAssetResource.reason = reason; + deserializedSslCertAssetResource.kind = kind; + return deserializedSslCertAssetResource; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetValidationType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetValidationType.java index 036d92554a38..3ee94e7a0c4c 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetValidationType.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetValidationType.java @@ -5,11 +5,10 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * Defines values for SslCertAssetValidationType. + * The validation type of a Ssl certificate. */ public final class SslCertAssetValidationType extends ExpandableStringEnum { @@ -48,7 +47,6 @@ public SslCertAssetValidationType() { * @return the corresponding SslCertAssetValidationType. */ @Generated - @JsonCreator public static SslCertAssetValidationType fromString(String name) { return fromString(name, SslCertAssetValidationType.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslServerConfig.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslServerConfig.java index be22285e63a1..1b6662df4348 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslServerConfig.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslServerConfig.java @@ -5,56 +5,56 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The SslServerConfig model. */ @Immutable -public final class SslServerConfig { +public final class SslServerConfig implements JsonSerializable { /* * The tlsVersions property. */ @Generated - @JsonProperty(value = "tlsVersions") private List tlsVersions; /* * The cipherSuites property. */ @Generated - @JsonProperty(value = "cipherSuites") private List cipherSuites; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /** @@ -123,4 +123,62 @@ public Long getCount() { public List getSources() { return this.sources; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tlsVersions", this.tlsVersions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("cipherSuites", this.cipherSuites, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SslServerConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SslServerConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SslServerConfig. + */ + @Generated + public static SslServerConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SslServerConfig deserializedSslServerConfig = new SslServerConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("tlsVersions".equals(fieldName)) { + List tlsVersions = reader.readArray(reader1 -> reader1.getString()); + deserializedSslServerConfig.tlsVersions = tlsVersions; + } else if ("cipherSuites".equals(fieldName)) { + List cipherSuites = reader.readArray(reader1 -> reader1.getString()); + deserializedSslServerConfig.cipherSuites = cipherSuites; + } else if ("firstSeen".equals(fieldName)) { + deserializedSslServerConfig.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedSslServerConfig.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedSslServerConfig.count = reader.getNullable(JsonReader::getLong); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedSslServerConfig.sources = sources; + } else { + reader.skipChildren(); + } + } + return deserializedSslServerConfig; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SubResourceIntegrityCheck.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SubResourceIntegrityCheck.java index eb4a4eee6269..ba2f115c193f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SubResourceIntegrityCheck.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SubResourceIntegrityCheck.java @@ -5,76 +5,73 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The SubResourceIntegrityCheck model. */ @Immutable -public final class SubResourceIntegrityCheck { +public final class SubResourceIntegrityCheck implements JsonSerializable { /* * The violation property. */ @Generated - @JsonProperty(value = "violation") private Boolean violation; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The causePageUrl property. */ @Generated - @JsonProperty(value = "causePageUrl") private String causePageUrl; /* * The crawlGuid property. */ @Generated - @JsonProperty(value = "crawlGuid") private String crawlGuid; /* * The pageGuid property. */ @Generated - @JsonProperty(value = "pageGuid") private String pageGuid; /* * The resourceGuid property. */ @Generated - @JsonProperty(value = "resourceGuid") private String resourceGuid; /* * The expectedHash property. */ @Generated - @JsonProperty(value = "expectedHash") private String expectedHash; /** @@ -173,4 +170,68 @@ public String getResourceGuid() { public String getExpectedHash() { return this.expectedHash; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("violation", this.violation); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeStringField("causePageUrl", this.causePageUrl); + jsonWriter.writeStringField("crawlGuid", this.crawlGuid); + jsonWriter.writeStringField("pageGuid", this.pageGuid); + jsonWriter.writeStringField("resourceGuid", this.resourceGuid); + jsonWriter.writeStringField("expectedHash", this.expectedHash); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubResourceIntegrityCheck from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubResourceIntegrityCheck if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubResourceIntegrityCheck. + */ + @Generated + public static SubResourceIntegrityCheck fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubResourceIntegrityCheck deserializedSubResourceIntegrityCheck = new SubResourceIntegrityCheck(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("violation".equals(fieldName)) { + deserializedSubResourceIntegrityCheck.violation = reader.getNullable(JsonReader::getBoolean); + } else if ("firstSeen".equals(fieldName)) { + deserializedSubResourceIntegrityCheck.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedSubResourceIntegrityCheck.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedSubResourceIntegrityCheck.count = reader.getNullable(JsonReader::getLong); + } else if ("causePageUrl".equals(fieldName)) { + deserializedSubResourceIntegrityCheck.causePageUrl = reader.getString(); + } else if ("crawlGuid".equals(fieldName)) { + deserializedSubResourceIntegrityCheck.crawlGuid = reader.getString(); + } else if ("pageGuid".equals(fieldName)) { + deserializedSubResourceIntegrityCheck.pageGuid = reader.getString(); + } else if ("resourceGuid".equals(fieldName)) { + deserializedSubResourceIntegrityCheck.resourceGuid = reader.getString(); + } else if ("expectedHash".equals(fieldName)) { + deserializedSubResourceIntegrityCheck.expectedHash = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedSubResourceIntegrityCheck; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Task.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Task.java index 997c8ac9d655..5cf4bcb06a80 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Task.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Task.java @@ -5,70 +5,68 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Map; /** * The Task model. */ @Immutable -public final class Task { +public final class Task implements JsonSerializable { /* * The unique identifier of the task. */ @Generated - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The time the task started. */ @Generated - @JsonProperty(value = "startedAt") private OffsetDateTime startedAt; /* * The time the task completed. */ @Generated - @JsonProperty(value = "completedAt") private OffsetDateTime completedAt; /* * The last time the status of the task was updated. */ @Generated - @JsonProperty(value = "lastPolledAt") private OffsetDateTime lastPolledAt; /* * The state the task is in. */ @Generated - @JsonProperty(value = "state") private TaskState state; /* * The phase the task is in. */ @Generated - @JsonProperty(value = "phase") private TaskPhase phase; /* * The reason the task was moved into its current state, if the task wasn't completed. */ @Generated - @JsonProperty(value = "reason") private String reason; /* * Attributes unique to the task. This differs by task type. */ @Generated - @JsonProperty(value = "metadata") private Map metadata; /** @@ -157,4 +155,68 @@ public String getReason() { public Map getMetadata() { return this.metadata; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startedAt", + this.startedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startedAt)); + jsonWriter.writeStringField("completedAt", + this.completedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.completedAt)); + jsonWriter.writeStringField("lastPolledAt", + this.lastPolledAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastPolledAt)); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("phase", this.phase == null ? null : this.phase.toString()); + jsonWriter.writeStringField("reason", this.reason); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Task from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Task if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Task. + */ + @Generated + public static Task fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Task deserializedTask = new Task(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedTask.id = reader.getString(); + } else if ("startedAt".equals(fieldName)) { + deserializedTask.startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedAt".equals(fieldName)) { + deserializedTask.completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastPolledAt".equals(fieldName)) { + deserializedTask.lastPolledAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedTask.state = TaskState.fromString(reader.getString()); + } else if ("phase".equals(fieldName)) { + deserializedTask.phase = TaskPhase.fromString(reader.getString()); + } else if ("reason".equals(fieldName)) { + deserializedTask.reason = reader.getString(); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedTask.metadata = metadata; + } else { + reader.skipChildren(); + } + } + return deserializedTask; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPhase.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPhase.java index b5e76a5ea727..8d78ebecfe85 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPhase.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPhase.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public TaskPhase() { * @return the corresponding TaskPhase. */ @Generated - @JsonCreator public static TaskPhase fromString(String name) { return fromString(name, TaskPhase.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskState.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskState.java index 1276ae239723..173c4e162a34 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskState.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskState.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -72,7 +71,6 @@ public TaskState() { * @return the corresponding TaskState. */ @Generated - @JsonCreator public static TaskState fromString(String name) { return fromString(name, TaskState.class); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ValidateResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ValidateResult.java index aa7c7fa0ed1d..5daa1dbefa56 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ValidateResult.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ValidateResult.java @@ -5,19 +5,22 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * The ValidateResult model. + * Validate result for validate action endpoints. */ @Immutable -public final class ValidateResult { +public final class ValidateResult implements JsonSerializable { /* * This is the top-level error object whose code matches the x-ms-error-code response header. */ @Generated - @JsonProperty(value = "error") private ErrorDetail error; /** @@ -37,4 +40,40 @@ private ValidateResult() { public ErrorDetail getError() { return this.error; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateResult. + */ + @Generated + public static ValidateResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateResult deserializedValidateResult = new ValidateResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("error".equals(fieldName)) { + deserializedValidateResult.error = ErrorDetail.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedValidateResult; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/WebComponent.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/WebComponent.java index be1f5502a81a..8199e16e5f50 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/WebComponent.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/WebComponent.java @@ -5,105 +5,98 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * The WebComponent model. */ @Immutable -public final class WebComponent { +public final class WebComponent implements JsonSerializable { /* * The name property. */ @Generated - @JsonProperty(value = "name") private String name; /* * The type property. */ @Generated - @JsonProperty(value = "type") private String type; /* * The version property. */ @Generated - @JsonProperty(value = "version") private String version; /* * The ruleId property. */ @Generated - @JsonProperty(value = "ruleId") private List ruleId; /* * The firstSeen property. */ @Generated - @JsonProperty(value = "firstSeen") private OffsetDateTime firstSeen; /* * The lastSeen property. */ @Generated - @JsonProperty(value = "lastSeen") private OffsetDateTime lastSeen; /* * The count property. */ @Generated - @JsonProperty(value = "count") private Long count; /* * The cve property. */ @Generated - @JsonProperty(value = "cve") private List cve; /* * The endOfLife property. */ @Generated - @JsonProperty(value = "endOfLife") private Long endOfLife; /* * The recent property. */ @Generated - @JsonProperty(value = "recent") private Boolean recent; /* * The ports property. */ @Generated - @JsonProperty(value = "ports") private List ports; /* * The sources property. */ @Generated - @JsonProperty(value = "sources") private List sources; /* * The service property. */ @Generated - @JsonProperty(value = "service") private String service; /** @@ -242,4 +235,84 @@ public List getSources() { public String getService() { return this.service; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeArrayField("ruleId", this.ruleId, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firstSeen", + this.firstSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstSeen)); + jsonWriter.writeStringField("lastSeen", + this.lastSeen == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSeen)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeArrayField("cve", this.cve, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("endOfLife", this.endOfLife); + jsonWriter.writeBooleanField("recent", this.recent); + jsonWriter.writeArrayField("ports", this.ports, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("service", this.service); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebComponent if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WebComponent. + */ + @Generated + public static WebComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebComponent deserializedWebComponent = new WebComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedWebComponent.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWebComponent.type = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedWebComponent.version = reader.getString(); + } else if ("ruleId".equals(fieldName)) { + List ruleId = reader.readArray(reader1 -> reader1.getString()); + deserializedWebComponent.ruleId = ruleId; + } else if ("firstSeen".equals(fieldName)) { + deserializedWebComponent.firstSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSeen".equals(fieldName)) { + deserializedWebComponent.lastSeen = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + deserializedWebComponent.count = reader.getNullable(JsonReader::getLong); + } else if ("cve".equals(fieldName)) { + List cve = reader.readArray(reader1 -> Cve.fromJson(reader1)); + deserializedWebComponent.cve = cve; + } else if ("endOfLife".equals(fieldName)) { + deserializedWebComponent.endOfLife = reader.getNullable(JsonReader::getLong); + } else if ("recent".equals(fieldName)) { + deserializedWebComponent.recent = reader.getNullable(JsonReader::getBoolean); + } else if ("ports".equals(fieldName)) { + List ports = reader.readArray(reader1 -> Port.fromJson(reader1)); + deserializedWebComponent.ports = ports; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> Source.fromJson(reader1)); + deserializedWebComponent.sources = sources; + } else if ("service".equals(fieldName)) { + deserializedWebComponent.service = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedWebComponent; + }); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/module-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/module-info.java index c69025e9c546..6f8c05d19d31 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/module-info.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/module-info.java @@ -6,5 +6,6 @@ requires transitive com.azure.core; exports com.azure.analytics.defender.easm; exports com.azure.analytics.defender.easm.models; - opens com.azure.analytics.defender.easm.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.analytics.defender.easm.models to com.azure.core; + opens com.azure.analytics.defender.easm.implementation.models to com.azure.core; } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json b/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json new file mode 100644 index 000000000000..d485bdeb600a --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json @@ -0,0 +1,265 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.analytics.defender.easm.EasmAsyncClient": "Easm.EasmClient", + "com.azure.analytics.defender.easm.EasmAsyncClient.cancelTask": "Customizations.EasmClient.cancelTask", + "com.azure.analytics.defender.easm.EasmAsyncClient.cancelTaskWithResponse": "Customizations.EasmClient.cancelTask", + "com.azure.analytics.defender.easm.EasmAsyncClient.createOrReplaceDataConnection": "Customizations.EasmClient.createOrReplaceDataConnection", + "com.azure.analytics.defender.easm.EasmAsyncClient.createOrReplaceDataConnectionWithResponse": "Customizations.EasmClient.createOrReplaceDataConnection", + "com.azure.analytics.defender.easm.EasmAsyncClient.createOrReplaceDiscoGroup": "Customizations.EasmClient.createOrReplaceDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.createOrReplaceDiscoGroupWithResponse": "Customizations.EasmClient.createOrReplaceDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.createOrReplaceSavedFilter": "Customizations.EasmClient.createOrReplaceSavedFilter", + "com.azure.analytics.defender.easm.EasmAsyncClient.createOrReplaceSavedFilterWithResponse": "Customizations.EasmClient.createOrReplaceSavedFilter", + "com.azure.analytics.defender.easm.EasmAsyncClient.deleteDataConnection": "Customizations.EasmClient.deleteDataConnection", + "com.azure.analytics.defender.easm.EasmAsyncClient.deleteDataConnectionWithResponse": "Customizations.EasmClient.deleteDataConnection", + "com.azure.analytics.defender.easm.EasmAsyncClient.deleteDiscoGroup": "Customizations.EasmClient.deleteDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.deleteDiscoGroupWithResponse": "Customizations.EasmClient.deleteDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.deleteSavedFilter": "Customizations.EasmClient.deleteSavedFilter", + "com.azure.analytics.defender.easm.EasmAsyncClient.deleteSavedFilterWithResponse": "Customizations.EasmClient.deleteSavedFilter", + "com.azure.analytics.defender.easm.EasmAsyncClient.dismissAssetChain": "Customizations.EasmClient.dismissAssetChain", + "com.azure.analytics.defender.easm.EasmAsyncClient.dismissAssetChainWithResponse": "Customizations.EasmClient.dismissAssetChain", + "com.azure.analytics.defender.easm.EasmAsyncClient.downloadTask": "Customizations.EasmClient.downloadTask", + "com.azure.analytics.defender.easm.EasmAsyncClient.downloadTaskWithResponse": "Customizations.EasmClient.downloadTask", + "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetChainSummary": "Customizations.EasmClient.getAssetChainSummary", + "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetChainSummaryWithResponse": "Customizations.EasmClient.getAssetChainSummary", + "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetResource": "Customizations.EasmClient.getAssetResource", + "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetResourceWithResponse": "Customizations.EasmClient.getAssetResource", + "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetsExport": "Customizations.EasmClient.getAssetsExport", + "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetsExportWithResponse": "Customizations.EasmClient.getAssetsExport", + "com.azure.analytics.defender.easm.EasmAsyncClient.getBillable": "Customizations.EasmClient.getBillable", + "com.azure.analytics.defender.easm.EasmAsyncClient.getBillableWithResponse": "Customizations.EasmClient.getBillable", + "com.azure.analytics.defender.easm.EasmAsyncClient.getCisaCve": "Customizations.EasmClient.getCisaCve", + "com.azure.analytics.defender.easm.EasmAsyncClient.getCisaCveWithResponse": "Customizations.EasmClient.getCisaCve", + "com.azure.analytics.defender.easm.EasmAsyncClient.getCisaCves": "Customizations.EasmClient.getCisaCves", + "com.azure.analytics.defender.easm.EasmAsyncClient.getDataConnection": "Customizations.EasmClient.getDataConnection", + "com.azure.analytics.defender.easm.EasmAsyncClient.getDataConnectionWithResponse": "Customizations.EasmClient.getDataConnection", + "com.azure.analytics.defender.easm.EasmAsyncClient.getDeltaDetails": "Customizations.EasmClient.getDeltaDetails", + "com.azure.analytics.defender.easm.EasmAsyncClient.getDeltaSummary": "Customizations.EasmClient.getDeltaSummary", + "com.azure.analytics.defender.easm.EasmAsyncClient.getDeltaSummaryWithResponse": "Customizations.EasmClient.getDeltaSummary", + "com.azure.analytics.defender.easm.EasmAsyncClient.getDiscoGroup": "Customizations.EasmClient.getDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.getDiscoGroupWithResponse": "Customizations.EasmClient.getDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.getDiscoTemplate": "Customizations.EasmClient.getDiscoTemplate", + "com.azure.analytics.defender.easm.EasmAsyncClient.getDiscoTemplateWithResponse": "Customizations.EasmClient.getDiscoTemplate", + "com.azure.analytics.defender.easm.EasmAsyncClient.getObservations": "Customizations.EasmClient.getObservations", + "com.azure.analytics.defender.easm.EasmAsyncClient.getObservationsWithResponse": "Customizations.EasmClient.getObservations", + "com.azure.analytics.defender.easm.EasmAsyncClient.getSavedFilter": "Customizations.EasmClient.getSavedFilter", + "com.azure.analytics.defender.easm.EasmAsyncClient.getSavedFilterWithResponse": "Customizations.EasmClient.getSavedFilter", + "com.azure.analytics.defender.easm.EasmAsyncClient.getSnapshot": "Customizations.EasmClient.getSnapshot", + "com.azure.analytics.defender.easm.EasmAsyncClient.getSnapshotExport": "Customizations.EasmClient.getSnapshotExport", + "com.azure.analytics.defender.easm.EasmAsyncClient.getSnapshotExportWithResponse": "Customizations.EasmClient.getSnapshotExport", + "com.azure.analytics.defender.easm.EasmAsyncClient.getSnapshotWithResponse": "Customizations.EasmClient.getSnapshot", + "com.azure.analytics.defender.easm.EasmAsyncClient.getSummary": "Customizations.EasmClient.getSummary", + "com.azure.analytics.defender.easm.EasmAsyncClient.getSummaryWithResponse": "Customizations.EasmClient.getSummary", + "com.azure.analytics.defender.easm.EasmAsyncClient.getTask": "Customizations.EasmClient.getTask", + "com.azure.analytics.defender.easm.EasmAsyncClient.getTaskWithResponse": "Customizations.EasmClient.getTask", + "com.azure.analytics.defender.easm.EasmAsyncClient.listAssetResource": "Customizations.EasmClient.listAssetResource", + "com.azure.analytics.defender.easm.EasmAsyncClient.listDataConnection": "Customizations.EasmClient.listDataConnection", + "com.azure.analytics.defender.easm.EasmAsyncClient.listDiscoGroup": "Customizations.EasmClient.listDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.listDiscoTemplate": "Customizations.EasmClient.listDiscoTemplate", + "com.azure.analytics.defender.easm.EasmAsyncClient.listRuns": "Customizations.EasmClient.listRuns", + "com.azure.analytics.defender.easm.EasmAsyncClient.listSavedFilter": "Customizations.EasmClient.listSavedFilter", + "com.azure.analytics.defender.easm.EasmAsyncClient.listTask": "Customizations.EasmClient.listTask", + "com.azure.analytics.defender.easm.EasmAsyncClient.runDiscoGroup": "Customizations.EasmClient.runDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.runDiscoGroupWithResponse": "Customizations.EasmClient.runDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.runTask": "Customizations.EasmClient.runTask", + "com.azure.analytics.defender.easm.EasmAsyncClient.runTaskWithResponse": "Customizations.EasmClient.runTask", + "com.azure.analytics.defender.easm.EasmAsyncClient.updateAssets": "Customizations.EasmClient.updateAssets", + "com.azure.analytics.defender.easm.EasmAsyncClient.updateAssetsWithResponse": "Customizations.EasmClient.updateAssets", + "com.azure.analytics.defender.easm.EasmAsyncClient.validateDataConnection": "Customizations.EasmClient.validateDataConnection", + "com.azure.analytics.defender.easm.EasmAsyncClient.validateDataConnectionWithResponse": "Customizations.EasmClient.validateDataConnection", + "com.azure.analytics.defender.easm.EasmAsyncClient.validateDiscoGroup": "Customizations.EasmClient.validateDiscoGroup", + "com.azure.analytics.defender.easm.EasmAsyncClient.validateDiscoGroupWithResponse": "Customizations.EasmClient.validateDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient": "Easm.EasmClient", + "com.azure.analytics.defender.easm.EasmClient.cancelTask": "Customizations.EasmClient.cancelTask", + "com.azure.analytics.defender.easm.EasmClient.cancelTaskWithResponse": "Customizations.EasmClient.cancelTask", + "com.azure.analytics.defender.easm.EasmClient.createOrReplaceDataConnection": "Customizations.EasmClient.createOrReplaceDataConnection", + "com.azure.analytics.defender.easm.EasmClient.createOrReplaceDataConnectionWithResponse": "Customizations.EasmClient.createOrReplaceDataConnection", + "com.azure.analytics.defender.easm.EasmClient.createOrReplaceDiscoGroup": "Customizations.EasmClient.createOrReplaceDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.createOrReplaceDiscoGroupWithResponse": "Customizations.EasmClient.createOrReplaceDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.createOrReplaceSavedFilter": "Customizations.EasmClient.createOrReplaceSavedFilter", + "com.azure.analytics.defender.easm.EasmClient.createOrReplaceSavedFilterWithResponse": "Customizations.EasmClient.createOrReplaceSavedFilter", + "com.azure.analytics.defender.easm.EasmClient.deleteDataConnection": "Customizations.EasmClient.deleteDataConnection", + "com.azure.analytics.defender.easm.EasmClient.deleteDataConnectionWithResponse": "Customizations.EasmClient.deleteDataConnection", + "com.azure.analytics.defender.easm.EasmClient.deleteDiscoGroup": "Customizations.EasmClient.deleteDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.deleteDiscoGroupWithResponse": "Customizations.EasmClient.deleteDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.deleteSavedFilter": "Customizations.EasmClient.deleteSavedFilter", + "com.azure.analytics.defender.easm.EasmClient.deleteSavedFilterWithResponse": "Customizations.EasmClient.deleteSavedFilter", + "com.azure.analytics.defender.easm.EasmClient.dismissAssetChain": "Customizations.EasmClient.dismissAssetChain", + "com.azure.analytics.defender.easm.EasmClient.dismissAssetChainWithResponse": "Customizations.EasmClient.dismissAssetChain", + "com.azure.analytics.defender.easm.EasmClient.downloadTask": "Customizations.EasmClient.downloadTask", + "com.azure.analytics.defender.easm.EasmClient.downloadTaskWithResponse": "Customizations.EasmClient.downloadTask", + "com.azure.analytics.defender.easm.EasmClient.getAssetChainSummary": "Customizations.EasmClient.getAssetChainSummary", + "com.azure.analytics.defender.easm.EasmClient.getAssetChainSummaryWithResponse": "Customizations.EasmClient.getAssetChainSummary", + "com.azure.analytics.defender.easm.EasmClient.getAssetResource": "Customizations.EasmClient.getAssetResource", + "com.azure.analytics.defender.easm.EasmClient.getAssetResourceWithResponse": "Customizations.EasmClient.getAssetResource", + "com.azure.analytics.defender.easm.EasmClient.getAssetsExport": "Customizations.EasmClient.getAssetsExport", + "com.azure.analytics.defender.easm.EasmClient.getAssetsExportWithResponse": "Customizations.EasmClient.getAssetsExport", + "com.azure.analytics.defender.easm.EasmClient.getBillable": "Customizations.EasmClient.getBillable", + "com.azure.analytics.defender.easm.EasmClient.getBillableWithResponse": "Customizations.EasmClient.getBillable", + "com.azure.analytics.defender.easm.EasmClient.getCisaCve": "Customizations.EasmClient.getCisaCve", + "com.azure.analytics.defender.easm.EasmClient.getCisaCveWithResponse": "Customizations.EasmClient.getCisaCve", + "com.azure.analytics.defender.easm.EasmClient.getCisaCves": "Customizations.EasmClient.getCisaCves", + "com.azure.analytics.defender.easm.EasmClient.getDataConnection": "Customizations.EasmClient.getDataConnection", + "com.azure.analytics.defender.easm.EasmClient.getDataConnectionWithResponse": "Customizations.EasmClient.getDataConnection", + "com.azure.analytics.defender.easm.EasmClient.getDeltaDetails": "Customizations.EasmClient.getDeltaDetails", + "com.azure.analytics.defender.easm.EasmClient.getDeltaSummary": "Customizations.EasmClient.getDeltaSummary", + "com.azure.analytics.defender.easm.EasmClient.getDeltaSummaryWithResponse": "Customizations.EasmClient.getDeltaSummary", + "com.azure.analytics.defender.easm.EasmClient.getDiscoGroup": "Customizations.EasmClient.getDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.getDiscoGroupWithResponse": "Customizations.EasmClient.getDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.getDiscoTemplate": "Customizations.EasmClient.getDiscoTemplate", + "com.azure.analytics.defender.easm.EasmClient.getDiscoTemplateWithResponse": "Customizations.EasmClient.getDiscoTemplate", + "com.azure.analytics.defender.easm.EasmClient.getObservations": "Customizations.EasmClient.getObservations", + "com.azure.analytics.defender.easm.EasmClient.getObservationsWithResponse": "Customizations.EasmClient.getObservations", + "com.azure.analytics.defender.easm.EasmClient.getSavedFilter": "Customizations.EasmClient.getSavedFilter", + "com.azure.analytics.defender.easm.EasmClient.getSavedFilterWithResponse": "Customizations.EasmClient.getSavedFilter", + "com.azure.analytics.defender.easm.EasmClient.getSnapshot": "Customizations.EasmClient.getSnapshot", + "com.azure.analytics.defender.easm.EasmClient.getSnapshotExport": "Customizations.EasmClient.getSnapshotExport", + "com.azure.analytics.defender.easm.EasmClient.getSnapshotExportWithResponse": "Customizations.EasmClient.getSnapshotExport", + "com.azure.analytics.defender.easm.EasmClient.getSnapshotWithResponse": "Customizations.EasmClient.getSnapshot", + "com.azure.analytics.defender.easm.EasmClient.getSummary": "Customizations.EasmClient.getSummary", + "com.azure.analytics.defender.easm.EasmClient.getSummaryWithResponse": "Customizations.EasmClient.getSummary", + "com.azure.analytics.defender.easm.EasmClient.getTask": "Customizations.EasmClient.getTask", + "com.azure.analytics.defender.easm.EasmClient.getTaskWithResponse": "Customizations.EasmClient.getTask", + "com.azure.analytics.defender.easm.EasmClient.listAssetResource": "Customizations.EasmClient.listAssetResource", + "com.azure.analytics.defender.easm.EasmClient.listDataConnection": "Customizations.EasmClient.listDataConnection", + "com.azure.analytics.defender.easm.EasmClient.listDiscoGroup": "Customizations.EasmClient.listDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.listDiscoTemplate": "Customizations.EasmClient.listDiscoTemplate", + "com.azure.analytics.defender.easm.EasmClient.listRuns": "Customizations.EasmClient.listRuns", + "com.azure.analytics.defender.easm.EasmClient.listSavedFilter": "Customizations.EasmClient.listSavedFilter", + "com.azure.analytics.defender.easm.EasmClient.listTask": "Customizations.EasmClient.listTask", + "com.azure.analytics.defender.easm.EasmClient.runDiscoGroup": "Customizations.EasmClient.runDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.runDiscoGroupWithResponse": "Customizations.EasmClient.runDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.runTask": "Customizations.EasmClient.runTask", + "com.azure.analytics.defender.easm.EasmClient.runTaskWithResponse": "Customizations.EasmClient.runTask", + "com.azure.analytics.defender.easm.EasmClient.updateAssets": "Customizations.EasmClient.updateAssets", + "com.azure.analytics.defender.easm.EasmClient.updateAssetsWithResponse": "Customizations.EasmClient.updateAssets", + "com.azure.analytics.defender.easm.EasmClient.validateDataConnection": "Customizations.EasmClient.validateDataConnection", + "com.azure.analytics.defender.easm.EasmClient.validateDataConnectionWithResponse": "Customizations.EasmClient.validateDataConnection", + "com.azure.analytics.defender.easm.EasmClient.validateDiscoGroup": "Customizations.EasmClient.validateDiscoGroup", + "com.azure.analytics.defender.easm.EasmClient.validateDiscoGroupWithResponse": "Customizations.EasmClient.validateDiscoGroup", + "com.azure.analytics.defender.easm.EasmClientBuilder": "Easm.EasmClient", + "com.azure.analytics.defender.easm.implementation.models.CreateOrReplaceDiscoGroupRequest": "createOrReplaceDiscoGroup.Request.anonymous", + "com.azure.analytics.defender.easm.models.AlexaDetails": "Easm.AlexaInfo", + "com.azure.analytics.defender.easm.models.AsAsset": "Easm.AsAsset", + "com.azure.analytics.defender.easm.models.AsAssetResource": "Easm.AsAssetResource", + "com.azure.analytics.defender.easm.models.AssetChainKindSummaryResult": "Easm.AssetChainKindSummaryResult", + "com.azure.analytics.defender.easm.models.AssetChainRequest": "Easm.AssetChainRequest", + "com.azure.analytics.defender.easm.models.AssetChainSource": "Easm.AssetChainSource", + "com.azure.analytics.defender.easm.models.AssetChainSummaryResult": "Easm.AssetChainSummaryResult", + "com.azure.analytics.defender.easm.models.AssetKind": "Easm.AssetKind", + "com.azure.analytics.defender.easm.models.AssetPageResult": "Easm.AssetPageResult", + "com.azure.analytics.defender.easm.models.AssetResource": "Easm.AssetResource", + "com.azure.analytics.defender.easm.models.AssetResponseType": "Easm.AssetResponseType", + "com.azure.analytics.defender.easm.models.AssetSecurityPolicy": "Easm.AssetSecurityPolicy", + "com.azure.analytics.defender.easm.models.AssetState": "Easm.AssetState", + "com.azure.analytics.defender.easm.models.AssetSummaryResult": "Easm.AssetSummaryResult", + "com.azure.analytics.defender.easm.models.AssetUpdateData": "Easm.AssetUpdateData", + "com.azure.analytics.defender.easm.models.AssetUpdateState": "Easm.AssetUpdateState", + "com.azure.analytics.defender.easm.models.AssetUpdateTransfers": "Easm.AssetUpdateTransfers", + "com.azure.analytics.defender.easm.models.AssetsExportRequest": "Easm.AssetsExportRequest", + "com.azure.analytics.defender.easm.models.Attribute": "Easm.Attribute", + "com.azure.analytics.defender.easm.models.AuditTrailItem": "Easm.AuditTrailItem", + "com.azure.analytics.defender.easm.models.AuditTrailItemKind": "Easm.AuditTrailItemKind", + "com.azure.analytics.defender.easm.models.AzureDataExplorerDataConnection": "Easm.AzureDataExplorerDataConnection", + "com.azure.analytics.defender.easm.models.AzureDataExplorerDataConnectionData": "Easm.AzureDataExplorerDataConnectionData", + "com.azure.analytics.defender.easm.models.AzureDataExplorerDataConnectionProperties": "Easm.AzureDataExplorerDataConnectionProperties", + "com.azure.analytics.defender.easm.models.Banner": "Easm.Banner", + "com.azure.analytics.defender.easm.models.CisaCveResult": "Easm.CisaCveResult", + "com.azure.analytics.defender.easm.models.ContactAsset": "Easm.ContactAsset", + "com.azure.analytics.defender.easm.models.ContactAssetResource": "Easm.ContactAssetResource", + "com.azure.analytics.defender.easm.models.Cookie": "Easm.Cookie", + "com.azure.analytics.defender.easm.models.CreateOrReplaceDiscoGroupOptions": "null", + "com.azure.analytics.defender.easm.models.Cve": "Easm.Cve", + "com.azure.analytics.defender.easm.models.Cvss3Summary": "Easm.Cvss3Summary", + "com.azure.analytics.defender.easm.models.DailyDeltaTypeResponse": "Easm.DailyDeltaTypeResponse", + "com.azure.analytics.defender.easm.models.DataConnection": "Easm.DataConnection", + "com.azure.analytics.defender.easm.models.DataConnectionContent": "Easm.DataConnectionContent", + "com.azure.analytics.defender.easm.models.DataConnectionData": "Easm.DataConnectionData", + "com.azure.analytics.defender.easm.models.DataConnectionFrequency": "Easm.DataConnectionFrequency", + "com.azure.analytics.defender.easm.models.DataConnectionProperties": "Easm.DataConnectionProperties", + "com.azure.analytics.defender.easm.models.DeltaDateResult": "Easm.DeltaDateResult", + "com.azure.analytics.defender.easm.models.DeltaDetailType": "Easm.DeltaDetailType", + "com.azure.analytics.defender.easm.models.DeltaDetailsRequest": "Easm.DeltaDetailsRequest", + "com.azure.analytics.defender.easm.models.DeltaRangeResult": "Easm.DeltaRangeResult", + "com.azure.analytics.defender.easm.models.DeltaResult": "Easm.DeltaResult", + "com.azure.analytics.defender.easm.models.DeltaSummaryRequest": "Easm.DeltaSummaryRequest", + "com.azure.analytics.defender.easm.models.DeltaSummaryResult": "Easm.DeltaSummaryResult", + "com.azure.analytics.defender.easm.models.DeltaTypeResponse": "Easm.DeltaTypeResponse", + "com.azure.analytics.defender.easm.models.DependentResource": "Easm.DependentResource", + "com.azure.analytics.defender.easm.models.DiscoGroup": "Easm.DiscoGroup", + "com.azure.analytics.defender.easm.models.DiscoGroupData": "Easm.DiscoGroupData", + "com.azure.analytics.defender.easm.models.DiscoGroupSummaryResult": "Easm.DiscoGroupSummaryResult", + "com.azure.analytics.defender.easm.models.DiscoRunResult": "Easm.DiscoRunResult", + "com.azure.analytics.defender.easm.models.DiscoRunState": "Easm.DiscoRunState", + "com.azure.analytics.defender.easm.models.DiscoSource": "Easm.DiscoSource", + "com.azure.analytics.defender.easm.models.DiscoSourceKind": "Easm.DiscoSourceKind", + "com.azure.analytics.defender.easm.models.DiscoTemplate": "Easm.DiscoTemplate", + "com.azure.analytics.defender.easm.models.DomainAsset": "Easm.DomainAsset", + "com.azure.analytics.defender.easm.models.DomainAssetResource": "Easm.DomainAssetResource", + "com.azure.analytics.defender.easm.models.ErrorDetail": "Easm.ErrorDetail", + "com.azure.analytics.defender.easm.models.ErrorResponse": "Azure.Core.Foundations.ErrorResponse", + "com.azure.analytics.defender.easm.models.GlobalAssetType": "Easm.GlobalAssetType", + "com.azure.analytics.defender.easm.models.GlobalInventoryState": "Easm.GlobalInventoryState", + "com.azure.analytics.defender.easm.models.GuidPair": "Easm.GuidPair", + "com.azure.analytics.defender.easm.models.HostAsset": "Easm.HostAsset", + "com.azure.analytics.defender.easm.models.HostAssetResource": "Easm.HostAssetResource", + "com.azure.analytics.defender.easm.models.HostCore": "Easm.HostCore", + "com.azure.analytics.defender.easm.models.InnerError": "Easm.InnerError", + "com.azure.analytics.defender.easm.models.InventoryAsset": "Easm.InventoryAsset", + "com.azure.analytics.defender.easm.models.IpAddressAsset": "Easm.IpAddressAsset", + "com.azure.analytics.defender.easm.models.IpAddressAssetResource": "Easm.IpAddressAssetResource", + "com.azure.analytics.defender.easm.models.IpBlock": "Easm.IpBlock", + "com.azure.analytics.defender.easm.models.IpBlockAsset": "Easm.IpBlockAsset", + "com.azure.analytics.defender.easm.models.IpBlockAssetResource": "Easm.IpBlockAssetResource", + "com.azure.analytics.defender.easm.models.Location": "Easm.Location", + "com.azure.analytics.defender.easm.models.LogAnalyticsDataConnection": "Easm.LogAnalyticsDataConnection", + "com.azure.analytics.defender.easm.models.LogAnalyticsDataConnectionData": "Easm.LogAnalyticsDataConnectionData", + "com.azure.analytics.defender.easm.models.LogAnalyticsDataConnectionProperties": "Easm.LogAnalyticsDataConnectionProperties", + "com.azure.analytics.defender.easm.models.ObservationPageResult": "Easm.ObservationPageResult", + "com.azure.analytics.defender.easm.models.ObservationPriority": "Easm.ObservationPriority", + "com.azure.analytics.defender.easm.models.ObservationResult": "Easm.ObservationResult", + "com.azure.analytics.defender.easm.models.ObservationType": "Easm.ObservationType", + "com.azure.analytics.defender.easm.models.ObservedBoolean": "Easm.ObservedBoolean", + "com.azure.analytics.defender.easm.models.ObservedHeader": "Easm.ObservedHeader", + "com.azure.analytics.defender.easm.models.ObservedInteger": "Easm.ObservedInteger", + "com.azure.analytics.defender.easm.models.ObservedIntegers": "Easm.ObservedIntegers", + "com.azure.analytics.defender.easm.models.ObservedLocation": "Easm.ObservedLocation", + "com.azure.analytics.defender.easm.models.ObservedLong": "Easm.ObservedLong", + "com.azure.analytics.defender.easm.models.ObservedPortState": "Easm.ObservedPortState", + "com.azure.analytics.defender.easm.models.ObservedPortStateValue": "Easm.ObservedPortStateValue", + "com.azure.analytics.defender.easm.models.ObservedString": "Easm.ObservedString", + "com.azure.analytics.defender.easm.models.ObservedValue": "Easm.ObservedValue", + "com.azure.analytics.defender.easm.models.PageAsset": "Easm.PageAsset", + "com.azure.analytics.defender.easm.models.PageAssetRedirectType": "Easm.PageAssetRedirectType", + "com.azure.analytics.defender.easm.models.PageAssetResource": "Easm.PageAssetResource", + "com.azure.analytics.defender.easm.models.PageCause": "Easm.PageCause", + "com.azure.analytics.defender.easm.models.Port": "Easm.Port", + "com.azure.analytics.defender.easm.models.ReportAssetSnapshotExportRequest": "Easm.ReportAssetSnapshotExportRequest", + "com.azure.analytics.defender.easm.models.ReportAssetSnapshotRequest": "Easm.ReportAssetSnapshotRequest", + "com.azure.analytics.defender.easm.models.ReportAssetSnapshotResult": "Easm.ReportAssetSnapshotResult", + "com.azure.analytics.defender.easm.models.ReportAssetSummaryRequest": "Easm.ReportAssetSummaryRequest", + "com.azure.analytics.defender.easm.models.ReportAssetSummaryResult": "Easm.ReportAssetSummaryResult", + "com.azure.analytics.defender.easm.models.ReportBillableAssetBreakdown": "Easm.ReportBillableAssetBreakdown", + "com.azure.analytics.defender.easm.models.ReportBillableAssetBreakdownKind": "Easm.ReportBillableAssetBreakdownKind", + "com.azure.analytics.defender.easm.models.ReportBillableAssetSnapshotResult": "Easm.ReportBillableAssetSnapshotResult", + "com.azure.analytics.defender.easm.models.ReportBillableAssetSummaryResult": "Easm.ReportBillableAssetSummaryResult", + "com.azure.analytics.defender.easm.models.Reputation": "Easm.Reputation", + "com.azure.analytics.defender.easm.models.ResourceUrl": "Easm.ResourceUrl", + "com.azure.analytics.defender.easm.models.SavedFilter": "Easm.SavedFilter", + "com.azure.analytics.defender.easm.models.SavedFilterData": "Easm.SavedFilterData", + "com.azure.analytics.defender.easm.models.ScanMetadata": "Easm.ScanMetadata", + "com.azure.analytics.defender.easm.models.Service": "Easm.Service", + "com.azure.analytics.defender.easm.models.SoaRecord": "Easm.SoaRecord", + "com.azure.analytics.defender.easm.models.Source": "Easm.Source", + "com.azure.analytics.defender.easm.models.SslCertAsset": "Easm.SslCertAsset", + "com.azure.analytics.defender.easm.models.SslCertAssetResource": "Easm.SslCertAssetResource", + "com.azure.analytics.defender.easm.models.SslCertAssetValidationType": "Easm.SslCertAssetValidationType", + "com.azure.analytics.defender.easm.models.SslServerConfig": "Easm.SslServerConfig", + "com.azure.analytics.defender.easm.models.SubResourceIntegrityCheck": "Easm.SubResourceIntegrityCheck", + "com.azure.analytics.defender.easm.models.Task": "Easm.Task", + "com.azure.analytics.defender.easm.models.TaskPhase": "Easm.TaskPhase", + "com.azure.analytics.defender.easm.models.TaskState": "Easm.TaskState", + "com.azure.analytics.defender.easm.models.ValidateResult": "Easm.ValidateResult", + "com.azure.analytics.defender.easm.models.WebComponent": "Easm.WebComponent" + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/generated/EasmClientTestBase.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/generated/EasmClientTestBase.java new file mode 100644 index 000000000000..70fa30fec094 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/generated/EasmClientTestBase.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.analytics.defender.easm.EasmClient; +import com.azure.analytics.defender.easm.EasmClientBuilder; +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +class EasmClientTestBase extends TestProxyTestBase { + protected EasmClient easmClient; + + @Override + protected void beforeTest() { + EasmClientBuilder easmClientbuilder + = new EasmClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + easmClientbuilder.httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + easmClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + easmClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + easmClient = easmClientbuilder.buildClient(); + + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml b/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml index 8bfebcbc2679..e2abe3bc972c 100644 --- a/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml +++ b/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/riskiq/Easm -commit: 11dd0dbfb9bec989f3a9a3536ae526407ff17c78 +commit: df3cd3e3d50eec1d1da593750e1ea3a4db3f541d repo: Azure/azure-rest-api-specs From 7edf1423da36b3b00273976b8e03593be8e5cb75 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 16 Jul 2024 12:03:10 +0800 Subject: [PATCH 02/11] fix test --- .../analytics/defender/easm/DiscoTemplateSample.java | 9 +-------- .../analytics/defender/easm/DiscoveryRunsSample.java | 11 +---------- .../defender/easm/ManagingExternalIdsSample.java | 9 +-------- .../azure/analytics/defender/easm/ReadmeSamples.java | 6 ------ .../analytics/defender/easm/SavedFilterSample.java | 9 +-------- .../analytics/defender/easm/EasmClientTestBase.java | 6 +----- 6 files changed, 5 insertions(+), 45 deletions(-) diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java index d518cba2f470..28c5b21b5ae9 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java @@ -23,17 +23,10 @@ */ public class DiscoTemplateSample { public static void main(String[] args) { - String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); - String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); - String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); - String region = Configuration.getGlobalConfiguration().get("REGION"); - String endpoint = "https://" + region + ".easm.defender.microsoft.com"; + String endpoint = Configuration.getGlobalConfiguration().get("ENDPOINT"); EasmClient easmClient = new EasmClientBuilder() .endpoint(endpoint) - .subscriptionId(subscriptionId) - .workspaceName(workspaceName) - .resourceGroupName(resourceGroupName) .credential(new InteractiveBrowserCredentialBuilder().build()) .buildClient(); diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java index b3d186b93e71..c0ad6c44d25a 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java @@ -27,21 +27,12 @@ */ public class DiscoveryRunsSample { public static void main(String[] args) { - - // To create an easmClient, you need your subscription ID, endpoint, and some sort of credential. - String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); - String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); - String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); - String region = Configuration.getGlobalConfiguration().get("REGION"); - String endpoint = "https://" + region + ".easm.defender.microsoft.com"; + String endpoint = Configuration.getGlobalConfiguration().get("ENDPOINT"); String discoveryGroupName = "Sample Disco"; String discoveryGroupDescription = "This is a sample description for a discovery group"; EasmClient easmClient = new EasmClientBuilder() .endpoint(endpoint) - .subscriptionId(subscriptionId) - .workspaceName(workspaceName) - .resourceGroupName(resourceGroupName) // For the purposes of this demo, I've chosen the InteractiveBrowserCredential but any credential will work. .credential(new InteractiveBrowserCredentialBuilder().build()) .buildClient(); diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ManagingExternalIdsSample.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ManagingExternalIdsSample.java index efae63ec03a9..b9a3d4ada917 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ManagingExternalIdsSample.java +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ManagingExternalIdsSample.java @@ -41,18 +41,11 @@ */ public class ManagingExternalIdsSample { public static void main(String[] args) throws JsonProcessingException { - String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); - String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); - String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); - String region = Configuration.getGlobalConfiguration().get("REGION"); - String endpoint = "https://" + region + ".easm.defender.microsoft.com"; + String endpoint = Configuration.getGlobalConfiguration().get("ENDPOINT"); String externalIdMapping = Configuration.getGlobalConfiguration().get("MAPPING"); EasmClient easmClient = new EasmClientBuilder() .endpoint(endpoint) - .subscriptionId(subscriptionId) - .workspaceName(workspaceName) - .resourceGroupName(resourceGroupName) // For the purposes of this demo, I've chosen the InteractiveBrowserCredential but any credential will work. .credential(new InteractiveBrowserCredentialBuilder().build()) .buildClient(); diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ReadmeSamples.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ReadmeSamples.java index 5a3c3b413ebd..39688cb8fa99 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ReadmeSamples.java +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ReadmeSamples.java @@ -10,16 +10,10 @@ public final class ReadmeSamples { public void readmeSamples() { // BEGIN: readme-sample-createDefenderEasmClient - String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); - String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); - String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); String endpoint = Configuration.getGlobalConfiguration().get("ENDPOINT"); EasmClient easmClient = new EasmClientBuilder() .endpoint(endpoint) - .subscriptionId(subscriptionId) - .workspaceName(workspaceName) - .resourceGroupName(resourceGroupName) .credential(new DefaultAzureCredentialBuilder().build()) .buildClient(); // END: readme-sample-createDefenderEasmClient diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java index d3a9e76620d3..b1cb82474e93 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java @@ -30,17 +30,10 @@ private static void monitor(SavedFilter response){ public static void main(String[] args) { - String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); - String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); - String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); - String region = Configuration.getGlobalConfiguration().get("REGION"); - String endpoint = "https://" + region + ".easm.defender.microsoft.com"; + String endpoint = Configuration.getGlobalConfiguration().get("ENDPOINT"); EasmClient easmClient = new EasmClientBuilder() .endpoint(endpoint) - .subscriptionId(subscriptionId) - .workspaceName(workspaceName) - .resourceGroupName(resourceGroupName) // For the purposes of this demo, I've chosen the InteractiveBrowserCredential but any credential will work. .credential(new InteractiveBrowserCredentialBuilder().build()) .buildClient(); diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/EasmClientTestBase.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/EasmClientTestBase.java index 0e62765baea1..757c87f5babc 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/EasmClientTestBase.java +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/EasmClientTestBase.java @@ -40,11 +40,7 @@ protected void beforeTest() { List customSanitizers = new ArrayList<>(); EasmClientBuilder easmClientbuilder = new EasmClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "https://REDACTED")) - .subscriptionId(Configuration.getGlobalConfiguration().get("SUBSCRIPTIONID", "00000000-0000-0000-0000-000000000000")) - .resourceGroupName( - Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME", "REDACTED")) - .workspaceName(Configuration.getGlobalConfiguration().get("WORKSPACENAME", "REDACTED")) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "https://REDACTED/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/REDACTED/workspaces/REDACTED")) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { From ad4af380395c47cd37db1adc3d32efd056ab5267 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 16 Jul 2024 12:08:16 +0800 Subject: [PATCH 03/11] regen --- .../defender/easm/EasmAsyncClient.java | 1649 +++------------ .../analytics/defender/easm/EasmClient.java | 1836 ++++------------ .../defender/easm/EasmClientBuilder.java | 14 +- .../defender/easm/EasmServiceVersion.java | 9 +- .../easm/implementation/EasmClientImpl.java | 1855 +---------------- .../CreateOrReplaceDiscoGroupRequest.java | 38 +- .../implementation/models/package-info.java | 1 - .../easm/implementation/package-info.java | 11 +- .../defender/easm/models/AsAssetResource.java | 48 +- .../models/AssetChainKindSummaryResult.java | 105 - .../easm/models/AssetChainRequest.java | 107 - .../easm/models/AssetChainSource.java | 57 - .../easm/models/AssetChainSummaryResult.java | 133 -- .../defender/easm/models/AssetKind.java | 93 - .../defender/easm/models/AssetResource.java | 252 +-- .../easm/models/AssetResponseType.java | 69 - .../easm/models/AssetsExportRequest.java | 106 - .../AzureDataExplorerDataConnection.java | 48 +- .../AzureDataExplorerDataConnectionData.java | 34 +- .../defender/easm/models/CisaCveResult.java | 317 --- .../easm/models/ContactAssetResource.java | 48 +- .../CreateOrReplaceDiscoGroupOptions.java | 38 +- .../easm/models/DailyDeltaTypeResponse.java | 103 - .../defender/easm/models/DataConnection.java | 208 +- .../easm/models/DataConnectionData.java | 32 +- .../defender/easm/models/DeltaDateResult.java | 111 - .../defender/easm/models/DeltaDetailType.java | 57 - .../easm/models/DeltaDetailsRequest.java | 174 -- .../easm/models/DeltaRangeResult.java | 173 -- .../defender/easm/models/DeltaResult.java | 180 -- .../easm/models/DeltaSummaryRequest.java | 123 -- .../easm/models/DeltaSummaryResult.java | 106 - .../easm/models/DeltaTypeResponse.java | 149 -- .../easm/models/DiscoGroupSummaryResult.java | 127 -- .../easm/models/DiscoRunPageResult.java | 69 - .../easm/models/DomainAssetResource.java | 48 +- .../defender/easm/models/ErrorResponse.java | 84 - .../defender/easm/models/GlobalAssetType.java | 111 - .../easm/models/GlobalInventoryState.java | 99 - .../easm/models/HostAssetResource.java | 48 +- .../easm/models/IpAddressAssetResource.java | 48 +- .../easm/models/IpBlockAssetResource.java | 48 +- .../models/LogAnalyticsDataConnection.java | 48 +- .../LogAnalyticsDataConnectionData.java | 34 +- .../easm/models/ObservationPageResult.java | 131 -- .../easm/models/ObservationPriority.java | 69 - .../easm/models/ObservationResult.java | 174 -- .../defender/easm/models/ObservationType.java | 57 - .../defender/easm/models/ObservedBoolean.java | 48 +- .../defender/easm/models/ObservedHeader.java | 48 +- .../defender/easm/models/ObservedInteger.java | 48 +- .../easm/models/ObservedIntegers.java | 48 +- .../easm/models/ObservedLocation.java | 48 +- .../defender/easm/models/ObservedLong.java | 48 +- .../easm/models/ObservedPortState.java | 48 +- .../defender/easm/models/ObservedString.java | 48 +- .../defender/easm/models/ObservedValue.java | 56 +- .../easm/models/PageAssetResource.java | 48 +- .../ReportAssetSnapshotExportRequest.java | 157 -- .../easm/models/SslCertAssetResource.java | 48 +- .../defender/easm/models/package-info.java | 11 +- .../analytics/defender/easm/package-info.java | 11 +- ...tics-defender-easm_apiview_properties.json | 70 - 63 files changed, 1562 insertions(+), 8702 deletions(-) delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainKindSummaryResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainRequest.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSource.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSummaryResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetKind.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResponseType.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetsExportRequest.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CisaCveResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DailyDeltaTypeResponse.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDateResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailType.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailsRequest.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaRangeResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryRequest.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaTypeResponse.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupSummaryResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunPageResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorResponse.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalAssetType.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalInventoryState.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPageResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPriority.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationType.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotExportRequest.java diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java index ec4ce9f22f07..829bc4c87050 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java @@ -4,24 +4,16 @@ package com.azure.analytics.defender.easm; import com.azure.analytics.defender.easm.implementation.EasmClientImpl; -import com.azure.analytics.defender.easm.models.AssetChainRequest; -import com.azure.analytics.defender.easm.models.AssetChainSummaryResult; +import com.azure.analytics.defender.easm.implementation.models.CreateOrReplaceDiscoGroupRequest; import com.azure.analytics.defender.easm.models.AssetResource; -import com.azure.analytics.defender.easm.models.AssetsExportRequest; import com.azure.analytics.defender.easm.models.AssetUpdateData; -import com.azure.analytics.defender.easm.models.CisaCveResult; +import com.azure.analytics.defender.easm.models.CreateOrReplaceDiscoGroupOptions; import com.azure.analytics.defender.easm.models.DataConnection; import com.azure.analytics.defender.easm.models.DataConnectionData; -import com.azure.analytics.defender.easm.models.DeltaDetailsRequest; -import com.azure.analytics.defender.easm.models.DeltaResult; -import com.azure.analytics.defender.easm.models.DeltaSummaryRequest; -import com.azure.analytics.defender.easm.models.DeltaSummaryResult; import com.azure.analytics.defender.easm.models.DiscoGroup; import com.azure.analytics.defender.easm.models.DiscoGroupData; import com.azure.analytics.defender.easm.models.DiscoRunResult; import com.azure.analytics.defender.easm.models.DiscoTemplate; -import com.azure.analytics.defender.easm.models.ObservationPageResult; -import com.azure.analytics.defender.easm.models.ReportAssetSnapshotExportRequest; import com.azure.analytics.defender.easm.models.ReportAssetSnapshotRequest; import com.azure.analytics.defender.easm.models.ReportAssetSnapshotResult; import com.azure.analytics.defender.easm.models.ReportAssetSummaryRequest; @@ -71,58 +63,24 @@ public final class EasmAsyncClient { /** * Retrieve a list of assets for the provided search parameters. - * - *

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent - * values are returned in the response.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based + * searching. Initial value is '*' and subsequent values are returned in the response.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -156,21 +114,10 @@ public final class EasmAsyncClient {
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return paged collection of AssetResource items as paginated response with {@link PagedFlux}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listAssetResource(RequestOptions requestOptions) {
-        PagedFlux pagedFluxResponse = this.serviceClient.listAssetResourceAsync(requestOptions);
-        return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
-                : pagedFluxResponse.byPage(continuationToken).take(1);
-            return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
-                    .map(protocolMethodData -> cleanUp(protocolMethodData))
-                    .collect(Collectors.toList()),
-                pagedResponse.getContinuationToken(), null));
-        });
+        return this.serviceClient.listAssetResourceAsync(requestOptions);
     }
 
     /**
@@ -271,39 +218,19 @@ public Mono> getAssetResourceWithResponse(String assetId, R
 
     /**
      * Retrieve a list of data connections.
-     *
-     * 

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -325,21 +252,10 @@ public Mono> getAssetResourceWithResponse(String assetId, R
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return paged collection of DataConnection items as paginated response with {@link PagedFlux}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listDataConnection(RequestOptions requestOptions) {
-        PagedFlux pagedFluxResponse = this.serviceClient.listDataConnectionAsync(requestOptions);
-        return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
-                : pagedFluxResponse.byPage(continuationToken).take(1);
-            return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
-                    .map(protocolMethodData -> cleanUp(protocolMethodData))
-                    .collect(Collectors.toList()),
-                pagedResponse.getContinuationToken(), null));
-        });
+        return this.serviceClient.listDataConnectionAsync(requestOptions);
     }
 
     /**
@@ -497,43 +413,17 @@ public Mono> deleteDataConnectionWithResponse(String dataConnecti
 
     /**
      * Retrieve a list of discovery group for the provided search parameters.
-     *
-     * 

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -583,21 +473,10 @@ public Mono> deleteDataConnectionWithResponse(String dataConnecti
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return paged collection of DiscoGroup items as paginated response with {@link PagedFlux}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listDiscoGroup(RequestOptions requestOptions) {
-        PagedFlux pagedFluxResponse = this.serviceClient.listDiscoGroupAsync(requestOptions);
-        return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
-                : pagedFluxResponse.byPage(continuationToken).take(1);
-            return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
-                    .map(protocolMethodData -> cleanUp(protocolMethodData))
-                    .collect(Collectors.toList()),
-                pagedResponse.getContinuationToken(), null));
-        });
+        return this.serviceClient.listDiscoGroupAsync(requestOptions);
     }
 
     /**
@@ -825,44 +704,68 @@ public Mono> runDiscoGroupWithResponse(String groupName, RequestO
     }
 
     /**
-     * Retrieve a list of disco templates for the provided search parameters.
-     *
-     * 

- * Query Parameters - * + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     submittedDate: OffsetDateTime (Optional)
+     *     startedDate: OffsetDateTime (Optional)
+     *     completedDate: OffsetDateTime (Optional)
+     *     tier: String (Optional)
+     *     state: String(pending/running/completed/failed) (Optional)
+     *     totalAssetsFoundCount: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
* - *

- * Response Body Schema - * + * @param groupName The unique identifier for the discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRuns(String groupName, RequestOptions requestOptions) { + return this.serviceClient.listRunsAsync(groupName, requestOptions); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -892,21 +795,10 @@ public Mono> runDiscoGroupWithResponse(String groupName, RequestO
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return paged collection of DiscoTemplate items as paginated response with {@link PagedFlux}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listDiscoTemplate(RequestOptions requestOptions) {
-        PagedFlux pagedFluxResponse = this.serviceClient.listDiscoTemplateAsync(requestOptions);
-        return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
-                : pagedFluxResponse.byPage(continuationToken).take(1);
-            return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
-                    .map(protocolMethodData -> cleanUp(protocolMethodData))
-                    .collect(Collectors.toList()),
-                pagedResponse.getContinuationToken(), null));
-        });
+        return this.serviceClient.listDiscoTemplateAsync(requestOptions);
     }
 
     /**
@@ -1119,43 +1011,17 @@ public Mono> getSummaryWithResponse(BinaryData body, Reques
 
     /**
      * Retrieve a list of saved filters for the provided search parameters.
-     *
-     * 

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -1173,21 +1039,10 @@ public Mono> getSummaryWithResponse(BinaryData body, Reques
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return paged collection of SavedFilter items as paginated response with {@link PagedFlux}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listSavedFilter(RequestOptions requestOptions) {
-        PagedFlux pagedFluxResponse = this.serviceClient.listSavedFilterAsync(requestOptions);
-        return PagedFlux.create(() -> (continuationToken, pageSize) -> {
-            Flux> flux = (continuationToken == null)
-                ? pagedFluxResponse.byPage().take(1)
-                : pagedFluxResponse.byPage(continuationToken).take(1);
-            return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
-                    .map(protocolMethodData -> cleanUp(protocolMethodData))
-                    .collect(Collectors.toList()),
-                pagedResponse.getContinuationToken(), null));
-        });
+        return this.serviceClient.listSavedFilterAsync(requestOptions);
     }
 
     /**
@@ -1276,49 +1131,19 @@ public Mono> deleteSavedFilterWithResponse(String filterName, Req
 
     /**
      * Retrieve a list of tasks for the provided search parameters.
-     *
-     * 

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -1329,7 +1154,7 @@ public Mono> deleteSavedFilterWithResponse(String filterName, Req
      *     phase: String(running/polling/complete) (Optional)
      *     reason: String (Optional)
      *     metadata (Optional): {
-     *         String: Object (Optional)
+     *         String: Object (Required)
      *     }
      * }
      * }
@@ -1341,21 +1166,10 @@ public Mono> deleteSavedFilterWithResponse(String filterName, Req * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return paged collection of Task items as paginated response with {@link PagedFlux}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listTask(RequestOptions requestOptions) { - PagedFlux pagedFluxResponse = this.serviceClient.listTaskAsync(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> cleanUp(protocolMethodData)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); + return this.serviceClient.listTaskAsync(requestOptions); } /** @@ -1424,6 +1238,54 @@ public Mono> cancelTaskWithResponse(String taskId, RequestO return this.serviceClient.cancelTaskWithResponseAsync(taskId, requestOptions); } + /** + * Retrieve a list of assets for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @param skip The number of result items to skip. + * @param mark Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and + * subsequent values are returned in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of AssetResource items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAssetResource(String filter, String orderBy, Integer skip, String mark) { + // Generated convenience method for listAssetResource + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (mark != null) { + requestOptions.addQueryParam("mark", mark, false); + } + PagedFlux pagedFluxResponse = listAssetResource(requestOptions); + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(AssetResource.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + /** * Retrieve a list of assets for the provided search parameters. * @@ -1458,7 +1320,7 @@ public PagedFlux listAssetResource() { * Update labels on assets matching the provided filter. * * @param filter An expression on the resource type that selects the resources to be returned. - * @param assetUpdateData A request body used to update an asset. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1467,13 +1329,13 @@ public PagedFlux listAssetResource() { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAssets(String filter, AssetUpdateData assetUpdateData) { + public Mono updateAssets(String filter, AssetUpdateData body) { // Generated convenience method for updateAssetsWithResponse RequestOptions requestOptions = new RequestOptions(); - return updateAssetsWithResponse(filter, BinaryData.fromObject(assetUpdateData), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(Task.class)); + return updateAssetsWithResponse(filter, BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); } /** @@ -1488,12 +1350,13 @@ public Mono updateAssets(String filter, AssetUpdateData assetUpdateData) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the items in the current page of results on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAssetResource(String assetId) { // Generated convenience method for getAssetResourceWithResponse RequestOptions requestOptions = new RequestOptions(); return getAssetResourceWithResponse(assetId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(AssetResource.class)); + .map(protocolMethodData -> protocolMethodData.toObject(AssetResource.class)); } /** @@ -1508,6 +1371,7 @@ public Mono getAssetResource(String assetId) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DataConnection items as paginated response with {@link PagedFlux}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDataConnection(Integer skip) { // Generated convenience method for listDataConnection @@ -1540,6 +1404,7 @@ public PagedFlux listDataConnection(Integer skip) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DataConnection items as paginated response with {@link PagedFlux}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDataConnection() { // Generated convenience method for listDataConnection @@ -1562,22 +1427,22 @@ public PagedFlux listDataConnection() { /** * Validate a data connection with a given dataConnectionName. * - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @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 validate result for validate action endpoints on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateDataConnection(DataConnectionData dataConnectionData) { + public Mono validateDataConnection(DataConnectionData body) { // Generated convenience method for validateDataConnectionWithResponse RequestOptions requestOptions = new RequestOptions(); - return validateDataConnectionWithResponse(BinaryData.fromObject(dataConnectionData), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(ValidateResult.class)); + return validateDataConnectionWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ValidateResult.class)); } /** @@ -1592,19 +1457,20 @@ public Mono validateDataConnection(DataConnectionData dataConnec * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getDataConnection(String dataConnectionName) { // Generated convenience method for getDataConnectionWithResponse RequestOptions requestOptions = new RequestOptions(); return getDataConnectionWithResponse(dataConnectionName, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DataConnection.class)); + .map(protocolMethodData -> protocolMethodData.toObject(DataConnection.class)); } /** * Create or replace a data connection with a given dataConnectionName. * * @param dataConnectionName The caller provided unique name for the resource. - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1613,14 +1479,14 @@ public Mono getDataConnection(String dataConnectionName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrReplaceDataConnection(String dataConnectionName, - DataConnectionData dataConnectionData) { + public Mono createOrReplaceDataConnection(String dataConnectionName, DataConnectionData body) { // Generated convenience method for createOrReplaceDataConnectionWithResponse RequestOptions requestOptions = new RequestOptions(); - return createOrReplaceDataConnectionWithResponse(dataConnectionName, BinaryData.fromObject(dataConnectionData), + return createOrReplaceDataConnectionWithResponse(dataConnectionName, BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DataConnection.class)); + .map(protocolMethodData -> protocolMethodData.toObject(DataConnection.class)); } /** @@ -1692,6 +1558,7 @@ public PagedFlux listDiscoGroup(String filter, Integer skip) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DiscoGroup items as paginated response with {@link PagedFlux}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDiscoGroup() { // Generated convenience method for listDiscoGroup @@ -1714,22 +1581,22 @@ public PagedFlux listDiscoGroup() { /** * Validate a discovery group with a given groupName. * - * @param discoGroupData A request body used to create a discovery group. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @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 validate result for validate action endpoints on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateDiscoGroup(DiscoGroupData discoGroupData) { + public Mono validateDiscoGroup(DiscoGroupData body) { // Generated convenience method for validateDiscoGroupWithResponse RequestOptions requestOptions = new RequestOptions(); - return validateDiscoGroupWithResponse(BinaryData.fromObject(discoGroupData), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(ValidateResult.class)); + return validateDiscoGroupWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ValidateResult.class)); } /** @@ -1744,19 +1611,19 @@ public Mono validateDiscoGroup(DiscoGroupData discoGroupData) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getDiscoGroup(String groupName) { // Generated convenience method for getDiscoGroupWithResponse RequestOptions requestOptions = new RequestOptions(); return getDiscoGroupWithResponse(groupName, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DiscoGroup.class)); + .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class)); } /** * Create a discovery group with a given groupName. * - * @param groupName The caller provided unique name for the resource. - * @param discoGroupData A request body used to create a discovery group. + * @param options Options for createOrReplaceDiscoGroup API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1765,13 +1632,25 @@ public Mono getDiscoGroup(String groupName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrReplaceDiscoGroup(String groupName, DiscoGroupData discoGroupData) { + public Mono createOrReplaceDiscoGroup(CreateOrReplaceDiscoGroupOptions options) { // Generated convenience method for createOrReplaceDiscoGroupWithResponse RequestOptions requestOptions = new RequestOptions(); - return createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(discoGroupData), requestOptions) + String groupName = options.getGroupName(); + CreateOrReplaceDiscoGroupRequest createOrReplaceDiscoGroupRequestObj + = new CreateOrReplaceDiscoGroupRequest().setName(options.getName()) + .setDescription(options.getDescription()) + .setTier(options.getTier()) + .setFrequencyMilliseconds(options.getFrequencyMilliseconds()) + .setSeeds(options.getSeeds()) + .setNames(options.getNames()) + .setExcludes(options.getExcludes()) + .setTemplateId(options.getTemplateId()); + BinaryData createOrReplaceDiscoGroupRequest = BinaryData.fromObject(createOrReplaceDiscoGroupRequestObj); + return createOrReplaceDiscoGroupWithResponse(groupName, createOrReplaceDiscoGroupRequest, requestOptions) .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DiscoGroup.class)); + .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class)); } /** @@ -1794,6 +1673,46 @@ public Mono runDiscoGroup(String groupName) { return runDiscoGroupWithResponse(groupName, requestOptions).flatMap(FluxUtil::toMono); } + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + * @param groupName The unique identifier for the discovery group. + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRuns(String groupName, String filter, Integer skip) { + // Generated convenience method for listRuns + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listRuns(groupName, requestOptions); + return PagedFlux.create(() -> (continuationToken, pageSize) -> { + Flux> flux = (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DiscoRunResult.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + /** * Retrieve a collection of discovery run results for a discovery group with a given groupName. * @@ -1839,6 +1758,7 @@ public PagedFlux listRuns(String groupName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DiscoTemplate items as paginated response with {@link PagedFlux}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDiscoTemplate(String filter, Integer skip) { // Generated convenience method for listDiscoTemplate @@ -1874,6 +1794,7 @@ public PagedFlux listDiscoTemplate(String filter, Integer skip) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DiscoTemplate items as paginated response with {@link PagedFlux}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDiscoTemplate() { // Generated convenience method for listDiscoTemplate @@ -1905,12 +1826,13 @@ public PagedFlux listDiscoTemplate() { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the items in the current page of results on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getDiscoTemplate(String templateId) { // Generated convenience method for getDiscoTemplateWithResponse RequestOptions requestOptions = new RequestOptions(); return getDiscoTemplateWithResponse(templateId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DiscoTemplate.class)); + .map(protocolMethodData -> protocolMethodData.toObject(DiscoTemplate.class)); } /** @@ -1923,18 +1845,19 @@ public Mono getDiscoTemplate(String templateId) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return billable assets summary for the workspace on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getBillable() { // Generated convenience method for getBillableWithResponse RequestOptions requestOptions = new RequestOptions(); return getBillableWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(ReportBillableAssetSummaryResult.class)); + .map(protocolMethodData -> protocolMethodData.toObject(ReportBillableAssetSummaryResult.class)); } /** * Get the most recent snapshot of asset summary values for the snapshot request. * - * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1944,20 +1867,19 @@ public Mono getBillable() { * @return the most recent snapshot of asset summary values for the snapshot request on successful completion of * {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSnapshot(ReportAssetSnapshotRequest reportAssetSnapshotRequest) { + public Mono getSnapshot(ReportAssetSnapshotRequest body) { // Generated convenience method for getSnapshotWithResponse RequestOptions requestOptions = new RequestOptions(); - return getSnapshotWithResponse(BinaryData.fromObject(reportAssetSnapshotRequest), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(ReportAssetSnapshotResult.class)); + return getSnapshotWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ReportAssetSnapshotResult.class)); } /** * Get asset summary details for the summary request. * - * @param reportAssetSummaryRequest A request body used to retrieve summary asset information. One and only one - * collection of summary identifiers must be provided: filters, metrics, or metricCategories. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1966,13 +1888,13 @@ public Mono getSnapshot(ReportAssetSnapshotRequest re * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return asset summary details for the summary request on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSummary(ReportAssetSummaryRequest reportAssetSummaryRequest) { + public Mono getSummary(ReportAssetSummaryRequest body) { // Generated convenience method for getSummaryWithResponse RequestOptions requestOptions = new RequestOptions(); - return getSummaryWithResponse(BinaryData.fromObject(reportAssetSummaryRequest), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(ReportAssetSummaryResult.class)); + return getSummaryWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ReportAssetSummaryResult.class)); } /** @@ -2056,19 +1978,20 @@ public PagedFlux listSavedFilter() { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getSavedFilter(String filterName) { // Generated convenience method for getSavedFilterWithResponse RequestOptions requestOptions = new RequestOptions(); return getSavedFilterWithResponse(filterName, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(SavedFilter.class)); + .map(protocolMethodData -> protocolMethodData.toObject(SavedFilter.class)); } /** * Create or replace a saved filter with a given filterName. * * @param filterName The caller provided unique name for the resource. - * @param savedFilterData A request body used to create a saved filter. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2077,13 +2000,14 @@ public Mono getSavedFilter(String filterName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrReplaceSavedFilter(String filterName, SavedFilterData savedFilterData) { + public Mono createOrReplaceSavedFilter(String filterName, SavedFilterData body) { // Generated convenience method for createOrReplaceSavedFilterWithResponse RequestOptions requestOptions = new RequestOptions(); - return createOrReplaceSavedFilterWithResponse(filterName, BinaryData.fromObject(savedFilterData), - requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(SavedFilter.class)); + return createOrReplaceSavedFilterWithResponse(filterName, BinaryData.fromObject(body), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SavedFilter.class)); } /** @@ -2191,12 +2115,13 @@ public PagedFlux listTask() { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getTask(String taskId) { // Generated convenience method for getTaskWithResponse RequestOptions requestOptions = new RequestOptions(); return getTaskWithResponse(taskId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(Task.class)); + .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); } /** @@ -2211,1034 +2136,12 @@ public Mono getTask(String taskId) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response body on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelTask(String taskId) { // Generated convenience method for cancelTaskWithResponse RequestOptions requestOptions = new RequestOptions(); return cancelTaskWithResponse(taskId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(Task.class)); - } - - private BinaryData cleanUp(BinaryData input) { - return BinaryData.fromString(input.toString().replaceAll("\\+0000", "+00:00")); - } - - /** - * Retrieve a collection of discovery run results for a discovery group with a given groupName. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * - *

{@code
-     * {
-     *     submittedDate: OffsetDateTime (Optional)
-     *     startedDate: OffsetDateTime (Optional)
-     *     completedDate: OffsetDateTime (Optional)
-     *     tier: String (Optional)
-     *     state: String(pending/running/completed/failed) (Optional)
-     *     totalAssetsFoundCount: Long (Optional)
-     *     seeds (Optional): [
-     *          (Optional){
-     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
-     *             name: String (Optional)
-     *         }
-     *     ]
-     *     excludes (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - * @param groupName The unique identifier for the discovery group. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listRuns(String groupName, RequestOptions requestOptions) { - PagedFlux pagedFluxResponse = this.serviceClient.listRunsAsync(groupName, requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> cleanUp(protocolMethodData)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Retrieve a collection of discovery run results for a discovery group with a given groupName. - * - * @param groupName The unique identifier for the discovery group. - * @param filter Filter the result list using the given expression. - * @param skip The number of result items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listRuns(String groupName, String filter, Integer skip) { - // Generated convenience method for listRuns - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - PagedFlux pagedFluxResponse = listRuns(groupName, requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(DiscoRunResult.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Export a list of assets for the provided search parameters. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned - * resources.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     fileName: String (Required)
-     *     columns (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAssetsExportWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getAssetsExportWithResponseAsync(body, requestOptions); - } - - /** - * Retrieve observations on an asset. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned - * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
{@code
-     * {
-     *     totalElements: long (Required)
-     *     prioritySummary (Required): {
-     *         String: int (Required)
-     *     }
-     *     value (Required): [
-     *          (Required){
-     *             name: String (Required)
-     *             types (Required): [
-     *                 String(cve/insight) (Required)
-     *             ]
-     *             priority: String(high/medium/low/none) (Required)
-     *             cvssScoreV2: double (Required)
-     *             cvssScoreV3: double (Required)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param assetId The system generated unique id for the resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the page result response for the observation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getObservationsWithResponse(String assetId, RequestOptions requestOptions) { - return this.serviceClient.getObservationsWithResponseAsync(assetId, requestOptions); - } - - /** - * Retrieve a list of deltas for the provided time range. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     deltaDetailType: String(added/removed) (Required)
-     *     priorDays: Integer (Optional)
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     name: String (Required)
-     *     createdAt: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getDeltaDetails(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getDeltaDetailsAsync(body, requestOptions); - } - - /** - * Retrieve a list of deltas with overall summary changes for the provided time range. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     priorDays: Integer (Optional)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     summary (Required): {
-     *         range: long (Required)
-     *         removed: long (Required)
-     *         added: long (Required)
-     *         difference: long (Required)
-     *         kindSummaries (Required): [
-     *              (Required){
-     *                 kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *                 removed: long (Required)
-     *                 added: long (Required)
-     *                 difference: long (Required)
-     *             }
-     *         ]
-     *     }
-     *     daily (Required): [
-     *          (Required){
-     *             date: OffsetDateTime (Required)
-     *             deltas (Required): [
-     *                  (Required){
-     *                     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *                     removed: long (Required)
-     *                     added: long (Required)
-     *                     difference: long (Required)
-     *                     count: long (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return define response body for getting delta summary along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeltaSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getDeltaSummaryWithResponseAsync(body, requestOptions); - } - - /** - * Delete a discovery group with a given discovery group name. - * - * @param groupName The caller provided unique name for the resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { - return this.serviceClient.deleteDiscoGroupWithResponseAsync(groupName, requestOptions); - } - - /** - * Retrieve an asset chain summary. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
-     *     sourceIds (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     affectedAssetsSummary (Required): [
-     *          (Required){
-     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Required)
-     *             affectedCount: long (Required)
-     *         }
-     *     ]
-     *     affectedGroupsSummary (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             name: String (Required)
-     *             displayName: String (Required)
-     *         }
-     *     ]
-     *     errors (Optional): [
-     *          (Optional){
-     *             error (Required): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 innererror (Optional): {
-     *                     code: String (Optional)
-     *                     innererror (Optional): (recursive schema, see innererror above)
-     *                 }
-     *             }
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response for the asset chain summary along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAssetChainSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getAssetChainSummaryWithResponseAsync(body, requestOptions); - } - - /** - * Dismiss discovery chain for a given asset chain source. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
-     *     sourceIds (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> dismissAssetChainWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.dismissAssetChainWithResponseAsync(body, requestOptions); - } - - /** - * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     metric: String (Optional)
-     *     fileName: String (Optional)
-     *     columns (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the most recent snapshot of asset summary values for the snapshot request exported to a file along with - * {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotExportWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getSnapshotExportWithResponseAsync(body, requestOptions); - } - - /** - * Run a task by taskId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param taskId The unique identifier of the task. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> runTaskWithResponse(String taskId, RequestOptions requestOptions) { - return this.serviceClient.runTaskWithResponseAsync(taskId, requestOptions); - } - - /** - * Download a task. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param taskId The unique identifier of the task. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadTaskWithResponse(String taskId, RequestOptions requestOptions) { - return this.serviceClient.downloadTaskWithResponseAsync(taskId, requestOptions); - } - - /** - * Retrieve a list of CisaCves for the provided search parameters. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of CisaCveResult items as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getCisaCves(RequestOptions requestOptions) { - return this.serviceClient.getCisaCvesAsync(requestOptions); - } - - /** - * Retrieve details of CisaCve by cveId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have - * more than 4 digits. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cisa cve in a given workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCisaCveWithResponse(String cveId, RequestOptions requestOptions) { - return this.serviceClient.getCisaCveWithResponseAsync(cveId, requestOptions); - } - - /** - * Export a list of assets for the provided search parameters. - * - * @param body Body parameter. - * @param filter Filter the result list using the given expression. - * @param orderBy A list of expressions that specify the order of the returned resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAssetsExport(AssetsExportRequest body, String filter, String orderBy) { - // Generated convenience method for getAssetsExportWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (orderBy != null) { - requestOptions.addQueryParam("orderby", orderBy, false); - } - return getAssetsExportWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); - } - - /** - * Export a list of assets for the provided search parameters. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAssetsExport(AssetsExportRequest body) { - // Generated convenience method for getAssetsExportWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getAssetsExportWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); - } - - /** - * Retrieve observations on an asset. - * - * @param assetId The system generated unique id for the resource. - * @param filter Filter the result list using the given expression. - * @param orderBy A list of expressions that specify the order of the returned resources. - * @param skip The number of result items to skip. - * @param maxPageSize The maximum number of result items per page. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the page result response for the observation on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getObservations(String assetId, String filter, String orderBy, Integer skip, - Integer maxPageSize) { - // Generated convenience method for getObservationsWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (orderBy != null) { - requestOptions.addQueryParam("orderby", orderBy, false); - } - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - if (maxPageSize != null) { - requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); - } - return getObservationsWithResponse(assetId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ObservationPageResult.class)); - } - - /** - * Retrieve observations on an asset. - * - * @param assetId The system generated unique id for the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the page result response for the observation on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getObservations(String assetId) { - // Generated convenience method for getObservationsWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getObservationsWithResponse(assetId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(ObservationPageResult.class)); - } - - /** - * Retrieve a list of deltas for the provided time range. - * - * @param body Body parameter. - * @param skip The number of result items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getDeltaDetails(DeltaDetailsRequest body, Integer skip) { - // Generated convenience method for getDeltaDetails - RequestOptions requestOptions = new RequestOptions(); - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - PagedFlux pagedFluxResponse = getDeltaDetails(BinaryData.fromObject(body), requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(DeltaResult.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Retrieve a list of deltas for the provided time range. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getDeltaDetails(DeltaDetailsRequest body) { - // Generated convenience method for getDeltaDetails - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = getDeltaDetails(BinaryData.fromObject(body), requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(DeltaResult.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Retrieve a list of deltas with overall summary changes for the provided time range. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define response body for getting delta summary on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDeltaSummary(DeltaSummaryRequest body) { - // Generated convenience method for getDeltaSummaryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getDeltaSummaryWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(DeltaSummaryResult.class)); - } - - /** - * Delete a discovery group with a given discovery group name. - * - * @param groupName The caller provided unique name for the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteDiscoGroup(String groupName) { - // Generated convenience method for deleteDiscoGroupWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteDiscoGroupWithResponse(groupName, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Retrieve an asset chain summary. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the asset chain summary on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAssetChainSummary(AssetChainRequest body) { - // Generated convenience method for getAssetChainSummaryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getAssetChainSummaryWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AssetChainSummaryResult.class)); - } - - /** - * Dismiss discovery chain for a given asset chain source. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono dismissAssetChain(AssetChainRequest body) { - // Generated convenience method for dismissAssetChainWithResponse - RequestOptions requestOptions = new RequestOptions(); - return dismissAssetChainWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); - } - - /** - * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the most recent snapshot of asset summary values for the snapshot request exported to a file on - * successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSnapshotExport(ReportAssetSnapshotExportRequest body) { - // Generated convenience method for getSnapshotExportWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getSnapshotExportWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); - } - - /** - * Run a task by taskId. - * - * @param taskId The unique identifier of the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono runTask(String taskId) { - // Generated convenience method for runTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - return runTaskWithResponse(taskId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); - } - - /** - * Download a task. - * - * @param taskId The unique identifier of the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono downloadTask(String taskId) { - // Generated convenience method for downloadTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - return downloadTaskWithResponse(taskId, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); } - - /** - * Retrieve a list of CisaCves for the provided search parameters. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of CisaCveResult items as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getCisaCves() { - // Generated convenience method for getCisaCves - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = getCisaCves(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(CisaCveResult.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Retrieve details of CisaCve by cveId. - * - * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have - * more than 4 digits. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cisa cve in a given workspace on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCisaCve(String cveId) { - // Generated convenience method for getCisaCveWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getCisaCveWithResponse(cveId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(CisaCveResult.class)); - } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java index 23a838afc9cd..22cc64591411 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java @@ -4,24 +4,16 @@ package com.azure.analytics.defender.easm; import com.azure.analytics.defender.easm.implementation.EasmClientImpl; -import com.azure.analytics.defender.easm.models.AssetChainRequest; -import com.azure.analytics.defender.easm.models.AssetChainSummaryResult; +import com.azure.analytics.defender.easm.implementation.models.CreateOrReplaceDiscoGroupRequest; import com.azure.analytics.defender.easm.models.AssetResource; -import com.azure.analytics.defender.easm.models.AssetsExportRequest; import com.azure.analytics.defender.easm.models.AssetUpdateData; -import com.azure.analytics.defender.easm.models.CisaCveResult; +import com.azure.analytics.defender.easm.models.CreateOrReplaceDiscoGroupOptions; import com.azure.analytics.defender.easm.models.DataConnection; import com.azure.analytics.defender.easm.models.DataConnectionData; -import com.azure.analytics.defender.easm.models.DeltaDetailsRequest; -import com.azure.analytics.defender.easm.models.DeltaResult; -import com.azure.analytics.defender.easm.models.DeltaSummaryRequest; -import com.azure.analytics.defender.easm.models.DeltaSummaryResult; import com.azure.analytics.defender.easm.models.DiscoGroup; import com.azure.analytics.defender.easm.models.DiscoGroupData; import com.azure.analytics.defender.easm.models.DiscoRunResult; import com.azure.analytics.defender.easm.models.DiscoTemplate; -import com.azure.analytics.defender.easm.models.ObservationPageResult; -import com.azure.analytics.defender.easm.models.ReportAssetSnapshotExportRequest; import com.azure.analytics.defender.easm.models.ReportAssetSnapshotRequest; import com.azure.analytics.defender.easm.models.ReportAssetSnapshotResult; import com.azure.analytics.defender.easm.models.ReportAssetSummaryRequest; @@ -65,58 +57,24 @@ public final class EasmClient { /** * Retrieve a list of assets for the provided search parameters. - * - *

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent - * values are returned in the response.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
markStringNoSpecify this value instead of 'skip' to use cursor-based + * searching. Initial value is '*' and subsequent values are returned in the response.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Required)
      *     name: String (Optional)
      *     displayName: String (Optional)
@@ -150,9 +108,10 @@ public final class EasmClient {
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return paged collection of AssetResource items as paginated response with {@link PagedIterable}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listAssetResource(RequestOptions requestOptions) {
-        return this.serviceClient.listAssetResource(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue));
+        return this.serviceClient.listAssetResource(requestOptions);
     }
 
     /**
@@ -252,39 +211,19 @@ public Response getAssetResourceWithResponse(String assetId, Request
 
     /**
      * Retrieve a list of data connections.
-     *
-     * 

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -306,9 +245,10 @@ public Response getAssetResourceWithResponse(String assetId, Request
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return paged collection of DataConnection items as paginated response with {@link PagedIterable}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listDataConnection(RequestOptions requestOptions) {
-        return this.serviceClient.listDataConnection(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue));
+        return this.serviceClient.listDataConnection(requestOptions);
     }
 
     /**
@@ -460,6 +400,74 @@ public Response deleteDataConnectionWithResponse(String dataConnectionName
         return this.serviceClient.deleteDataConnectionWithResponse(dataConnectionName, requestOptions);
     }
 
+    /**
+     * Retrieve a list of discovery group for the provided search parameters.
+     * 

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoGroup(RequestOptions requestOptions) { + return this.serviceClient.listDiscoGroup(requestOptions); + } + /** * Validate a discovery group with a given groupName. *

Request Body Schema

@@ -685,43 +693,17 @@ public Response runDiscoGroupWithResponse(String groupName, RequestOptions /** * Retrieve a collection of discovery run results for a discovery group with a given groupName. - * - *

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
      *     submittedDate: OffsetDateTime (Optional)
@@ -753,50 +735,25 @@ public Response runDiscoGroupWithResponse(String groupName, RequestOptions
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return the paginated response with {@link PagedIterable}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listRuns(String groupName, RequestOptions requestOptions) {
-        return this.serviceClient.listRuns(groupName, requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue));
+        return this.serviceClient.listRuns(groupName, requestOptions);
     }
 
     /**
      * Retrieve a list of disco templates for the provided search parameters.
-     *
-     * 

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -826,9 +783,10 @@ public PagedIterable listRuns(String groupName, RequestOptions reque
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return paged collection of DiscoTemplate items as paginated response with {@link PagedIterable}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listDiscoTemplate(RequestOptions requestOptions) {
-        return this.serviceClient.listDiscoTemplate(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue));
+        return this.serviceClient.listDiscoTemplate(requestOptions);
     }
 
     /**
@@ -1037,43 +995,17 @@ public Response getSummaryWithResponse(BinaryData body, RequestOptio
 
     /**
      * Retrieve a list of saved filters for the provided search parameters.
-     *
-     * 

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -1091,9 +1023,10 @@ public Response getSummaryWithResponse(BinaryData body, RequestOptio
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
      * @return paged collection of SavedFilter items as paginated response with {@link PagedIterable}.
      */
+    @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listSavedFilter(RequestOptions requestOptions) {
-        return this.serviceClient.listSavedFilter(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue));
+        return this.serviceClient.listSavedFilter(requestOptions);
     }
 
     /**
@@ -1182,49 +1115,19 @@ public Response deleteSavedFilterWithResponse(String filterName, RequestOp
 
     /**
      * Retrieve a list of tasks for the provided search parameters.
-     *
-     * 

- * Query Parameters - * + *

Query Parameters

* * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned + * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -1235,7 +1138,7 @@ public Response deleteSavedFilterWithResponse(String filterName, RequestOp
      *     phase: String(running/polling/complete) (Optional)
      *     reason: String (Optional)
      *     metadata (Optional): {
-     *         String: Object (Optional)
+     *         String: Object (Required)
      *     }
      * }
      * }
@@ -1247,9 +1150,10 @@ public Response deleteSavedFilterWithResponse(String filterName, RequestOp * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return paged collection of Task items as paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listTask(RequestOptions requestOptions) { - return this.serviceClient.listTask(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue)); + return this.serviceClient.listTask(requestOptions); } /** @@ -1318,6 +1222,43 @@ public Response cancelTaskWithResponse(String taskId, RequestOptions return this.serviceClient.cancelTaskWithResponse(taskId, requestOptions); } + /** + * Retrieve a list of assets for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @param skip The number of result items to skip. + * @param mark Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and + * subsequent values are returned in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of AssetResource items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssetResource(String filter, String orderBy, Integer skip, String mark) { + // Generated convenience method for listAssetResource + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (mark != null) { + requestOptions.addQueryParam("mark", mark, false); + } + return serviceClient.listAssetResource(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(AssetResource.class)); + } + /** * Retrieve a list of assets for the provided search parameters. * @@ -1328,19 +1269,20 @@ public Response cancelTaskWithResponse(String taskId, RequestOptions * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of AssetResource items as paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAssetResource() { // Generated convenience method for listAssetResource RequestOptions requestOptions = new RequestOptions(); return serviceClient.listAssetResource(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(AssetResource.class)); + .mapPage(bodyItemValue -> bodyItemValue.toObject(AssetResource.class)); } /** * Update labels on assets matching the provided filter. * * @param filter An expression on the resource type that selects the resources to be returned. - * @param assetUpdateData A request body used to update an asset. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1349,12 +1291,12 @@ public PagedIterable listAssetResource() { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Task updateAssets(String filter, AssetUpdateData assetUpdateData) { + public Task updateAssets(String filter, AssetUpdateData body) { // Generated convenience method for updateAssetsWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp( - updateAssetsWithResponse(filter, BinaryData.fromObject(assetUpdateData), requestOptions).getValue()) + return updateAssetsWithResponse(filter, BinaryData.fromObject(body), requestOptions).getValue() .toObject(Task.class); } @@ -1370,11 +1312,36 @@ public Task updateAssets(String filter, AssetUpdateData assetUpdateData) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the items in the current page of results. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public AssetResource getAssetResource(String assetId) { // Generated convenience method for getAssetResourceWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp(getAssetResourceWithResponse(assetId, requestOptions).getValue()).toObject(AssetResource.class); + return getAssetResourceWithResponse(assetId, requestOptions).getValue().toObject(AssetResource.class); + } + + /** + * Retrieve a list of data connections. + * + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DataConnection items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDataConnection(Integer skip) { + // Generated convenience method for listDataConnection + RequestOptions requestOptions = new RequestOptions(); + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listDataConnection(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DataConnection.class)); } /** @@ -1387,32 +1354,33 @@ public AssetResource getAssetResource(String assetId) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DataConnection items as paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDataConnection() { // Generated convenience method for listDataConnection RequestOptions requestOptions = new RequestOptions(); return serviceClient.listDataConnection(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DataConnection.class)); + .mapPage(bodyItemValue -> bodyItemValue.toObject(DataConnection.class)); } /** * Validate a data connection with a given dataConnectionName. * - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return validate result for validate action endpoints. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateResult validateDataConnection(DataConnectionData dataConnectionData) { + public ValidateResult validateDataConnection(DataConnectionData body) { // Generated convenience method for validateDataConnectionWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp( - validateDataConnectionWithResponse(BinaryData.fromObject(dataConnectionData), requestOptions).getValue()) + return validateDataConnectionWithResponse(BinaryData.fromObject(body), requestOptions).getValue() .toObject(ValidateResult.class); } @@ -1428,19 +1396,20 @@ public ValidateResult validateDataConnection(DataConnectionData dataConnectionDa * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public DataConnection getDataConnection(String dataConnectionName) { // Generated convenience method for getDataConnectionWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp(getDataConnectionWithResponse(dataConnectionName, requestOptions).getValue()) + return getDataConnectionWithResponse(dataConnectionName, requestOptions).getValue() .toObject(DataConnection.class); } /** - * Create or update a data connection with a given dataConnectionName. + * Create or replace a data connection with a given dataConnectionName. * * @param dataConnectionName The caller provided unique name for the resource. - * @param dataConnectionData The dataConnectionData parameter. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1449,13 +1418,13 @@ public DataConnection getDataConnection(String dataConnectionName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public DataConnection createOrReplaceDataConnection(String dataConnectionName, - DataConnectionData dataConnectionData) { + public DataConnection createOrReplaceDataConnection(String dataConnectionName, DataConnectionData body) { // Generated convenience method for createOrReplaceDataConnectionWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp(createOrReplaceDataConnectionWithResponse(dataConnectionName, - BinaryData.fromObject(dataConnectionData), requestOptions).getValue()).toObject(DataConnection.class); + return createOrReplaceDataConnectionWithResponse(dataConnectionName, BinaryData.fromObject(body), + requestOptions).getValue().toObject(DataConnection.class); } /** @@ -1477,6 +1446,34 @@ public void deleteDataConnection(String dataConnectionName) { deleteDataConnectionWithResponse(dataConnectionName, requestOptions).getValue(); } + /** + * Retrieve a list of discovery group for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoGroup(String filter, Integer skip) { + // Generated convenience method for listDiscoGroup + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listDiscoGroup(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DiscoGroup.class)); + } + /** * Retrieve a list of discovery group for the provided search parameters. * @@ -1487,31 +1484,33 @@ public void deleteDataConnection(String dataConnectionName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DiscoGroup items as paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDiscoGroup() { // Generated convenience method for listDiscoGroup RequestOptions requestOptions = new RequestOptions(); return serviceClient.listDiscoGroup(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoGroup.class)); + .mapPage(bodyItemValue -> bodyItemValue.toObject(DiscoGroup.class)); } /** * Validate a discovery group with a given groupName. * - * @param discoGroupData A request body used to create a discovery group. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return validate result for validate action endpoints. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateResult validateDiscoGroup(DiscoGroupData discoGroupData) { + public ValidateResult validateDiscoGroup(DiscoGroupData body) { // Generated convenience method for validateDiscoGroupWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp(validateDiscoGroupWithResponse(BinaryData.fromObject(discoGroupData), requestOptions).getValue()) + return validateDiscoGroupWithResponse(BinaryData.fromObject(body), requestOptions).getValue() .toObject(ValidateResult.class); } @@ -1527,18 +1526,18 @@ public ValidateResult validateDiscoGroup(DiscoGroupData discoGroupData) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public DiscoGroup getDiscoGroup(String groupName) { // Generated convenience method for getDiscoGroupWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp(getDiscoGroupWithResponse(groupName, requestOptions).getValue()).toObject(DiscoGroup.class); + return getDiscoGroupWithResponse(groupName, requestOptions).getValue().toObject(DiscoGroup.class); } /** * Create a discovery group with a given groupName. * - * @param groupName The caller provided unique name for the resource. - * @param discoGroupData A request body used to create a discovery group. + * @param options Options for createOrReplaceDiscoGroup API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1547,20 +1546,27 @@ public DiscoGroup getDiscoGroup(String groupName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoGroup createOrReplaceDiscoGroup(String groupName, DiscoGroupData discoGroupData) { + public DiscoGroup createOrReplaceDiscoGroup(CreateOrReplaceDiscoGroupOptions options) { // Generated convenience method for createOrReplaceDiscoGroupWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp( - createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(discoGroupData), requestOptions) - .getValue()) + String groupName = options.getGroupName(); + CreateOrReplaceDiscoGroupRequest createOrReplaceDiscoGroupRequestObj + = new CreateOrReplaceDiscoGroupRequest().setName(options.getName()) + .setDescription(options.getDescription()) + .setTier(options.getTier()) + .setFrequencyMilliseconds(options.getFrequencyMilliseconds()) + .setSeeds(options.getSeeds()) + .setNames(options.getNames()) + .setExcludes(options.getExcludes()) + .setTemplateId(options.getTemplateId()); + BinaryData createOrReplaceDiscoGroupRequest = BinaryData.fromObject(createOrReplaceDiscoGroupRequestObj); + return createOrReplaceDiscoGroupWithResponse(groupName, createOrReplaceDiscoGroupRequest, requestOptions) + .getValue() .toObject(DiscoGroup.class); } - private BinaryData cleanUp(BinaryData input) { - return BinaryData.fromString(input.toString().replaceAll("\\+0000", "+00:00")); - } - /** * Run a discovery group with a given groupName. * @@ -1580,6 +1586,35 @@ public void runDiscoGroup(String groupName) { runDiscoGroupWithResponse(groupName, requestOptions).getValue(); } + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + * @param groupName The unique identifier for the discovery group. + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRuns(String groupName, String filter, Integer skip) { + // Generated convenience method for listRuns + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listRuns(groupName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DiscoRunResult.class)); + } + /** * Retrieve a collection of discovery run results for a discovery group with a given groupName. * @@ -1592,12 +1627,41 @@ public void runDiscoGroup(String groupName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listRuns(String groupName) { // Generated convenience method for listRuns RequestOptions requestOptions = new RequestOptions(); return serviceClient.listRuns(groupName, requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoRunResult.class)); + .mapPage(bodyItemValue -> bodyItemValue.toObject(DiscoRunResult.class)); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoTemplate items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoTemplate(String filter, Integer skip) { + // Generated convenience method for listDiscoTemplate + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listDiscoTemplate(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DiscoTemplate.class)); } /** @@ -1610,12 +1674,13 @@ public PagedIterable listRuns(String groupName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DiscoTemplate items as paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDiscoTemplate() { // Generated convenience method for listDiscoTemplate RequestOptions requestOptions = new RequestOptions(); return serviceClient.listDiscoTemplate(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoTemplate.class)); + .mapPage(bodyItemValue -> bodyItemValue.toObject(DiscoTemplate.class)); } /** @@ -1648,18 +1713,18 @@ public DiscoTemplate getDiscoTemplate(String templateId) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return billable assets summary for the workspace. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public ReportBillableAssetSummaryResult getBillable() { // Generated convenience method for getBillableWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp(getBillableWithResponse(requestOptions).getValue()) - .toObject(ReportBillableAssetSummaryResult.class); + return getBillableWithResponse(requestOptions).getValue().toObject(ReportBillableAssetSummaryResult.class); } /** * Get the most recent snapshot of asset summary values for the snapshot request. * - * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1668,20 +1733,19 @@ public ReportBillableAssetSummaryResult getBillable() { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the most recent snapshot of asset summary values for the snapshot request. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ReportAssetSnapshotResult getSnapshot(ReportAssetSnapshotRequest reportAssetSnapshotRequest) { + public ReportAssetSnapshotResult getSnapshot(ReportAssetSnapshotRequest body) { // Generated convenience method for getSnapshotWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp( - getSnapshotWithResponse(BinaryData.fromObject(reportAssetSnapshotRequest), requestOptions).getValue()) + return getSnapshotWithResponse(BinaryData.fromObject(body), requestOptions).getValue() .toObject(ReportAssetSnapshotResult.class); } /** * Get asset summary details for the summary request. * - * @param reportAssetSummaryRequest A request body used to retrieve summary asset information. One and only one - * collection of summary identifiers must be provided: filters, metrics, or metricCategories. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1690,15 +1754,43 @@ public ReportAssetSnapshotResult getSnapshot(ReportAssetSnapshotRequest reportAs * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return asset summary details for the summary request. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ReportAssetSummaryResult getSummary(ReportAssetSummaryRequest reportAssetSummaryRequest) { + public ReportAssetSummaryResult getSummary(ReportAssetSummaryRequest body) { // Generated convenience method for getSummaryWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp( - getSummaryWithResponse(BinaryData.fromObject(reportAssetSummaryRequest), requestOptions).getValue()) + return getSummaryWithResponse(BinaryData.fromObject(body), requestOptions).getValue() .toObject(ReportAssetSummaryResult.class); } + /** + * Retrieve a list of saved filters for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of SavedFilter items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSavedFilter(String filter, Integer skip) { + // Generated convenience method for listSavedFilter + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listSavedFilter(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(SavedFilter.class)); + } + /** * Retrieve a list of saved filters for the provided search parameters. * @@ -1709,12 +1801,13 @@ public ReportAssetSummaryResult getSummary(ReportAssetSummaryRequest reportAsset * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of SavedFilter items as paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSavedFilter() { // Generated convenience method for listSavedFilter RequestOptions requestOptions = new RequestOptions(); return serviceClient.listSavedFilter(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(SavedFilter.class)); + .mapPage(bodyItemValue -> bodyItemValue.toObject(SavedFilter.class)); } /** @@ -1729,18 +1822,19 @@ public PagedIterable listSavedFilter() { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public SavedFilter getSavedFilter(String filterName) { // Generated convenience method for getSavedFilterWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp(getSavedFilterWithResponse(filterName, requestOptions).getValue()).toObject(SavedFilter.class); + return getSavedFilterWithResponse(filterName, requestOptions).getValue().toObject(SavedFilter.class); } /** - * Create or update a saved filter with a given filterName. + * Create or replace a saved filter with a given filterName. * * @param filterName The caller provided unique name for the resource. - * @param savedFilterData A request body used to create a saved filter. + * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1749,13 +1843,13 @@ public SavedFilter getSavedFilter(String filterName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SavedFilter createOrReplaceSavedFilter(String filterName, SavedFilterData savedFilterData) { + public SavedFilter createOrReplaceSavedFilter(String filterName, SavedFilterData body) { // Generated convenience method for createOrReplaceSavedFilterWithResponse RequestOptions requestOptions = new RequestOptions(); - return cleanUp( - createOrReplaceSavedFilterWithResponse(filterName, BinaryData.fromObject(savedFilterData), requestOptions) - .getValue()) + return createOrReplaceSavedFilterWithResponse(filterName, BinaryData.fromObject(body), requestOptions) + .getValue() .toObject(SavedFilter.class); } @@ -1781,6 +1875,10 @@ public void deleteSavedFilter(String filterName) { /** * Retrieve a list of tasks for the provided search parameters. * + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -1788,35 +1886,43 @@ public void deleteSavedFilter(String filterName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of Task items as paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTask() { + public PagedIterable listTask(String filter, String orderBy, Integer skip) { // Generated convenience method for listTask RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listTask(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(Task.class)); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listTask(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Task.class)); } /** - * Retrieve a task by taskId. + * Retrieve a list of tasks for the provided search parameters. * - * @param taskId The unique identifier of the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return paged collection of Task items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Task getTask(String taskId) { - // Generated convenience method for getTaskWithResponse + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTask() { + // Generated convenience method for listTask RequestOptions requestOptions = new RequestOptions(); - return cleanUp(getTaskWithResponse(taskId, requestOptions).getValue()).toObject(Task.class); + return serviceClient.listTask(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Task.class)); } /** - * Cancel a task by taskId. + * Retrieve a task by taskId. * * @param taskId The unique identifier of the task. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1827,1149 +1933,31 @@ public Task getTask(String taskId) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Task cancelTask(String taskId) { - // Generated convenience method for cancelTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - return cleanUp(cancelTaskWithResponse(taskId, requestOptions).getValue()).toObject(Task.class); - } - - /** - * Retrieve a list of discovery group for the provided search parameters. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Optional)
-     *     name: String (Required)
-     *     displayName: String (Optional)
-     *     description: String (Optional)
-     *     tier: String (Optional)
-     *     frequencyMilliseconds: Long (Optional)
-     *     seeds (Optional): [
-     *          (Optional){
-     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
-     *             name: String (Optional)
-     *         }
-     *     ]
-     *     names (Optional): [
-     *         String (Optional)
-     *     ]
-     *     excludes (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     latestRun (Optional): {
-     *         submittedDate: OffsetDateTime (Optional)
-     *         startedDate: OffsetDateTime (Optional)
-     *         completedDate: OffsetDateTime (Optional)
-     *         tier: String (Optional)
-     *         state: String(pending/running/completed/failed) (Optional)
-     *         totalAssetsFoundCount: Long (Optional)
-     *         seeds (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *         excludes (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *         names (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     *     createdDate: OffsetDateTime (Optional)
-     *     templateId: String (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of DiscoGroup items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDiscoGroup(RequestOptions requestOptions) { - return this.serviceClient.listDiscoGroup(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue)); - } - - /** - * Retrieve a list of assets for the provided search parameters. - * - * @param filter Filter the result list using the given expression. - * @param orderBy A list of expressions that specify the order of the returned resources. - * @param skip The number of result items to skip. - * @param mark Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and - * subsequent values are returned in the response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of AssetResource items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAssetResource(String filter, String orderBy, Integer skip, String mark) { - // Generated convenience method for listAssetResource + public Task getTask(String taskId) { + // Generated convenience method for getTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (orderBy != null) { - requestOptions.addQueryParam("orderby", orderBy, false); - } - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - if (mark != null) { - requestOptions.addQueryParam("mark", mark, false); - } - return serviceClient.listAssetResource(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(AssetResource.class)); + return getTaskWithResponse(taskId, requestOptions).getValue().toObject(Task.class); } /** - * Retrieve a list of data connections. + * Cancel a task by taskId. * - * @param skip The number of result items to skip. + * @param taskId The unique identifier of the task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of DataConnection items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDataConnection(Integer skip) { - // Generated convenience method for listDataConnection - RequestOptions requestOptions = new RequestOptions(); - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - return serviceClient.listDataConnection(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DataConnection.class)); - } - - /** - * Retrieve a list of discovery group for the provided search parameters. - * - * @param filter Filter the result list using the given expression. - * @param skip The number of result items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of DiscoGroup items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDiscoGroup(String filter, Integer skip) { - // Generated convenience method for listDiscoGroup - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - return serviceClient.listDiscoGroup(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoGroup.class)); - } - - /** - * Retrieve a list of disco templates for the provided search parameters. - * - * @param filter Filter the result list using the given expression. - * @param skip The number of result items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of DiscoTemplate items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDiscoTemplate(String filter, Integer skip) { - // Generated convenience method for listDiscoTemplate - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - return serviceClient.listDiscoTemplate(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoTemplate.class)); - } - - /** - * Retrieve a list of saved filters for the provided search parameters. - * - * @param filter Filter the result list using the given expression. - * @param skip The number of result items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of SavedFilter items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSavedFilter(String filter, Integer skip) { - // Generated convenience method for listSavedFilter - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - return serviceClient.listSavedFilter(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(SavedFilter.class)); - } - - /** - * Retrieve a list of tasks for the provided search parameters. - * - * @param filter Filter the result list using the given expression. - * @param orderBy A list of expressions that specify the order of the returned resources. - * @param skip The number of result items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of Task items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTask(String filter, String orderBy, Integer skip) { - // Generated convenience method for listTask - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (orderBy != null) { - requestOptions.addQueryParam("orderby", orderBy, false); - } - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - return serviceClient.listTask(requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(Task.class)); - } - - /** - * Retrieve a collection of discovery run results for a discovery group with a given groupName. - * - * @param groupName The unique identifier for the discovery group. - * @param filter Filter the result list using the given expression. - * @param skip The number of result items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRuns(String groupName, String filter, Integer skip) { - // Generated convenience method for listRuns - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - return serviceClient.listRuns(groupName, requestOptions) - .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoRunResult.class)); - } - - /** - * Export a list of assets for the provided search parameters. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned - * resources.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     fileName: String (Required)
-     *     columns (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAssetsExportWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getAssetsExportWithResponse(body, requestOptions); - } - - /** - * Retrieve observations on an asset. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned - * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
{@code
-     * {
-     *     totalElements: long (Required)
-     *     prioritySummary (Required): {
-     *         String: int (Required)
-     *     }
-     *     value (Required): [
-     *          (Required){
-     *             name: String (Required)
-     *             types (Required): [
-     *                 String(cve/insight) (Required)
-     *             ]
-     *             priority: String(high/medium/low/none) (Required)
-     *             cvssScoreV2: double (Required)
-     *             cvssScoreV3: double (Required)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param assetId The system generated unique id for the resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the page result response for the observation along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getObservationsWithResponse(String assetId, RequestOptions requestOptions) { - return this.serviceClient.getObservationsWithResponse(assetId, requestOptions); - } - - /** - * Retrieve a list of deltas for the provided time range. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     deltaDetailType: String(added/removed) (Required)
-     *     priorDays: Integer (Optional)
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     name: String (Required)
-     *     createdAt: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getDeltaDetails(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getDeltaDetails(body, requestOptions); - } - - /** - * Retrieve a list of deltas with overall summary changes for the provided time range. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     priorDays: Integer (Optional)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     summary (Required): {
-     *         range: long (Required)
-     *         removed: long (Required)
-     *         added: long (Required)
-     *         difference: long (Required)
-     *         kindSummaries (Required): [
-     *              (Required){
-     *                 kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *                 removed: long (Required)
-     *                 added: long (Required)
-     *                 difference: long (Required)
-     *             }
-     *         ]
-     *     }
-     *     daily (Required): [
-     *          (Required){
-     *             date: OffsetDateTime (Required)
-     *             deltas (Required): [
-     *                  (Required){
-     *                     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *                     removed: long (Required)
-     *                     added: long (Required)
-     *                     difference: long (Required)
-     *                     count: long (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return define response body for getting delta summary along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeltaSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getDeltaSummaryWithResponse(body, requestOptions); - } - - /** - * Delete a discovery group with a given discovery group name. - * - * @param groupName The caller provided unique name for the resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { - return this.serviceClient.deleteDiscoGroupWithResponse(groupName, requestOptions); - } - - /** - * Retrieve an asset chain summary. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
-     *     sourceIds (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     affectedAssetsSummary (Required): [
-     *          (Required){
-     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Required)
-     *             affectedCount: long (Required)
-     *         }
-     *     ]
-     *     affectedGroupsSummary (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             name: String (Required)
-     *             displayName: String (Required)
-     *         }
-     *     ]
-     *     errors (Optional): [
-     *          (Optional){
-     *             error (Required): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 innererror (Optional): {
-     *                     code: String (Optional)
-     *                     innererror (Optional): (recursive schema, see innererror above)
-     *                 }
-     *             }
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response for the asset chain summary along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAssetChainSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getAssetChainSummaryWithResponse(body, requestOptions); - } - - /** - * Dismiss discovery chain for a given asset chain source. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
-     *     sourceIds (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response dismissAssetChainWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.dismissAssetChainWithResponse(body, requestOptions); - } - - /** - * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     metric: String (Optional)
-     *     fileName: String (Optional)
-     *     columns (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the most recent snapshot of asset summary values for the snapshot request exported to a file along with - * {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSnapshotExportWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getSnapshotExportWithResponse(body, requestOptions); - } - - /** - * Run a task by taskId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param taskId The unique identifier of the task. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response runTaskWithResponse(String taskId, RequestOptions requestOptions) { - return this.serviceClient.runTaskWithResponse(taskId, requestOptions); - } - - /** - * Download a task. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param taskId The unique identifier of the task. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadTaskWithResponse(String taskId, RequestOptions requestOptions) { - return this.serviceClient.downloadTaskWithResponse(taskId, requestOptions); - } - - /** - * Retrieve a list of CisaCves for the provided search parameters. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of CisaCveResult items as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getCisaCves(RequestOptions requestOptions) { - return this.serviceClient.getCisaCves(requestOptions); - } - - /** - * Retrieve details of CisaCve by cveId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have - * more than 4 digits. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cisa cve in a given workspace along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCisaCveWithResponse(String cveId, RequestOptions requestOptions) { - return this.serviceClient.getCisaCveWithResponse(cveId, requestOptions); - } - - /** - * Export a list of assets for the provided search parameters. - * - * @param body Body parameter. - * @param filter Filter the result list using the given expression. - * @param orderBy A list of expressions that specify the order of the returned resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Task getAssetsExport(AssetsExportRequest body, String filter, String orderBy) { - // Generated convenience method for getAssetsExportWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (orderBy != null) { - requestOptions.addQueryParam("orderby", orderBy, false); - } - return getAssetsExportWithResponse(BinaryData.fromObject(body), requestOptions).getValue().toObject(Task.class); - } - - /** - * Export a list of assets for the provided search parameters. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Task getAssetsExport(AssetsExportRequest body) { - // Generated convenience method for getAssetsExportWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getAssetsExportWithResponse(BinaryData.fromObject(body), requestOptions).getValue().toObject(Task.class); - } - - /** - * Retrieve observations on an asset. - * - * @param assetId The system generated unique id for the resource. - * @param filter Filter the result list using the given expression. - * @param orderBy A list of expressions that specify the order of the returned resources. - * @param skip The number of result items to skip. - * @param maxPageSize The maximum number of result items per page. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the page result response for the observation. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public ObservationPageResult getObservations(String assetId, String filter, String orderBy, Integer skip, - Integer maxPageSize) { - // Generated convenience method for getObservationsWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (filter != null) { - requestOptions.addQueryParam("filter", filter, false); - } - if (orderBy != null) { - requestOptions.addQueryParam("orderby", orderBy, false); - } - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - if (maxPageSize != null) { - requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); - } - return getObservationsWithResponse(assetId, requestOptions).getValue().toObject(ObservationPageResult.class); - } - - /** - * Retrieve observations on an asset. - * - * @param assetId The system generated unique id for the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the page result response for the observation. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public ObservationPageResult getObservations(String assetId) { - // Generated convenience method for getObservationsWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getObservationsWithResponse(assetId, requestOptions).getValue().toObject(ObservationPageResult.class); - } - - /** - * Retrieve a list of deltas for the provided time range. - * - * @param body Body parameter. - * @param skip The number of result items to skip. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getDeltaDetails(DeltaDetailsRequest body, Integer skip) { - // Generated convenience method for getDeltaDetails - RequestOptions requestOptions = new RequestOptions(); - if (skip != null) { - requestOptions.addQueryParam("skip", String.valueOf(skip), false); - } - return serviceClient.getDeltaDetails(BinaryData.fromObject(body), requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(DeltaResult.class)); - } - - /** - * Retrieve a list of deltas for the provided time range. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getDeltaDetails(DeltaDetailsRequest body) { - // Generated convenience method for getDeltaDetails - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.getDeltaDetails(BinaryData.fromObject(body), requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(DeltaResult.class)); - } - - /** - * Retrieve a list of deltas with overall summary changes for the provided time range. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return define response body for getting delta summary. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public DeltaSummaryResult getDeltaSummary(DeltaSummaryRequest body) { - // Generated convenience method for getDeltaSummaryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getDeltaSummaryWithResponse(BinaryData.fromObject(body), requestOptions).getValue() - .toObject(DeltaSummaryResult.class); - } - - /** - * Delete a discovery group with a given discovery group name. - * - * @param groupName The caller provided unique name for the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteDiscoGroup(String groupName) { - // Generated convenience method for deleteDiscoGroupWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteDiscoGroupWithResponse(groupName, requestOptions).getValue(); - } - - /** - * Retrieve an asset chain summary. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for the asset chain summary. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AssetChainSummaryResult getAssetChainSummary(AssetChainRequest body) { - // Generated convenience method for getAssetChainSummaryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getAssetChainSummaryWithResponse(BinaryData.fromObject(body), requestOptions).getValue() - .toObject(AssetChainSummaryResult.class); - } - - /** - * Dismiss discovery chain for a given asset chain source. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Task dismissAssetChain(AssetChainRequest body) { - // Generated convenience method for dismissAssetChainWithResponse - RequestOptions requestOptions = new RequestOptions(); - return dismissAssetChainWithResponse(BinaryData.fromObject(body), requestOptions).getValue() - .toObject(Task.class); - } - - /** - * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the most recent snapshot of asset summary values for the snapshot request exported to a file. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Task getSnapshotExport(ReportAssetSnapshotExportRequest body) { - // Generated convenience method for getSnapshotExportWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getSnapshotExportWithResponse(BinaryData.fromObject(body), requestOptions).getValue() - .toObject(Task.class); - } - - /** - * Run a task by taskId. - * - * @param taskId The unique identifier of the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Task runTask(String taskId) { - // Generated convenience method for runTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - return runTaskWithResponse(taskId, requestOptions).getValue().toObject(Task.class); - } - - /** - * Download a task. - * - * @param taskId The unique identifier of the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Task downloadTask(String taskId) { - // Generated convenience method for downloadTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - return downloadTaskWithResponse(taskId, requestOptions).getValue().toObject(Task.class); - } - - /** - * Retrieve a list of CisaCves for the provided search parameters. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of CisaCveResult items as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getCisaCves() { - // Generated convenience method for getCisaCves - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.getCisaCves(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(CisaCveResult.class)); - } - - /** - * Retrieve details of CisaCve by cveId. - * - * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have - * more than 4 digits. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cisa cve in a given workspace. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public CisaCveResult getCisaCve(String cveId) { - // Generated convenience method for getCisaCveWithResponse + public Task cancelTask(String taskId) { + // Generated convenience method for cancelTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - return getCisaCveWithResponse(cveId, requestOptions).getValue().toObject(CisaCveResult.class); + return cancelTaskWithResponse(taskId, requestOptions).getValue().toObject(Task.class); } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClientBuilder.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClientBuilder.java index 80ac279331fe..603366b22c3d 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClientBuilder.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClientBuilder.java @@ -264,6 +264,13 @@ private EasmClientImpl buildInnerClient() { return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration @@ -323,11 +330,4 @@ public EasmClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(EasmClientBuilder.class); - - @Generated - private void validateClient() { - // This method is invoked from 'buildInnerClient'/'buildClient' method. - // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java index 21bb4f99a506..d117819faf17 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java @@ -13,12 +13,7 @@ public enum EasmServiceVersion implements ServiceVersion { /** * Enum value 2023-03-01-preview. */ - V2023_03_01_PREVIEW("2023-03-01-preview"), - - /** - * Enum value 2024-03-01-preview. - */ - V2024_03_01_PREVIEW("2024-03-01-preview"); + V2023_03_01_PREVIEW("2023-03-01-preview"); private final String version; @@ -40,6 +35,6 @@ public String getVersion() { * @return The latest {@link EasmServiceVersion}. */ public static EasmServiceVersion getLatest() { - return V2024_03_01_PREVIEW; + return V2023_03_01_PREVIEW; } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java index 2b7874bc15b3..44dde899f121 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java @@ -223,86 +223,6 @@ Response getAssetResourceSync(@HostParam("endpoint") String endpoint @QueryParam("api-version") String apiVersion, @PathParam("assetId") String assetId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Post("/assets:export") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAssetsExport(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/assets:export") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAssetsExportSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/assets/{assetId}:getObservations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getObservations(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("assetId") String assetId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/assets/{assetId}:getObservations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getObservationsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("assetId") String assetId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/assets:getDeltaDetails") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeltaDetails(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/assets:getDeltaDetails") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDeltaDetailsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/assets:getDeltaSummary") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeltaSummary(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/assets:getDeltaSummary") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDeltaSummarySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - @Get("/dataConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -465,26 +385,6 @@ Response getDiscoGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Delete("/discoGroups/{groupName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteDiscoGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/discoGroups/{groupName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteDiscoGroupSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Put("/discoGroups/{groupName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -549,46 +449,6 @@ Response listRunsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Post("/discoGroups:getAssetChainSummary") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAssetChainSummary(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/discoGroups:getAssetChainSummary") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAssetChainSummarySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/discoGroups:dismissAssetChain") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> dismissAssetChain(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/discoGroups:dismissAssetChain") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response dismissAssetChainSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - @Get("/discoTemplates") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -689,26 +549,6 @@ Response getSummarySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - @Post("/reports/assets:getSnapshotExport") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSnapshotExport(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/reports/assets:getSnapshotExport") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSnapshotExportSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - @Get("/savedFilters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -851,86 +691,6 @@ Response cancelTaskSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Post("/tasks/{taskId}:run") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> runTask(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/tasks/{taskId}:run") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response runTaskSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/tasks/{taskId}:download") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> downloadTask(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Post("/tasks/{taskId}:download") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response downloadTaskSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("taskId") String taskId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/cisaCves") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCisaCves(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/cisaCves") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getCisaCvesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/cisaCves/{cveId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCisaCve(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("cveId") String cveId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/cisaCves/{cveId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getCisaCveSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("cveId") String cveId, - @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -951,26 +711,6 @@ Response listAssetResourceNextSync(@PathParam(value = "nextLink", en @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeltaDetailsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getDeltaDetailsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); - @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -1090,26 +830,6 @@ Mono> listTaskNext(@PathParam(value = "nextLink", encoded = Response listTaskNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCisaCvesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getCisaCvesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions, - Context context); } /** @@ -1125,11 +845,6 @@ Response getCisaCvesNextSync(@PathParam(value = "nextLink", encoded * maxpagesizeIntegerNoThe maximum number of result items per page. * markStringNoSpecify this value instead of 'skip' to use cursor-based * searching. Initial value is '*' and subsequent values are returned in the response. - * responseTypeStringNoSpecify the response type. The possible values are: ID, - * STANDARD, FULL, REDUCED. Allowed values: "id", "standard", "full", "reduced". - * responseIncludesList<String>NoThe properties to include in the response. - * In the form of "," separated string. - * recentOnlyBooleanNoIf it's recent only. * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

@@ -1194,11 +909,6 @@ private Mono> listAssetResourceSinglePageAsync(Request * maxpagesizeIntegerNoThe maximum number of result items per page. * markStringNoSpecify this value instead of 'skip' to use cursor-based * searching. Initial value is '*' and subsequent values are returned in the response. - * responseTypeStringNoSpecify the response type. The possible values are: ID, - * STANDARD, FULL, REDUCED. Allowed values: "id", "standard", "full", "reduced". - * responseIncludesList<String>NoThe properties to include in the response. - * In the form of "," separated string. - * recentOnlyBooleanNoIf it's recent only. * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

@@ -1281,11 +991,6 @@ public PagedFlux listAssetResourceAsync(RequestOptions requestOption * maxpagesizeIntegerNoThe maximum number of result items per page. * markStringNoSpecify this value instead of 'skip' to use cursor-based * searching. Initial value is '*' and subsequent values are returned in the response. - * responseTypeStringNoSpecify the response type. The possible values are: ID, - * STANDARD, FULL, REDUCED. Allowed values: "id", "standard", "full", "reduced". - * responseIncludesList<String>NoThe properties to include in the response. - * In the form of "," separated string. - * recentOnlyBooleanNoIf it's recent only. * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

@@ -1348,11 +1053,6 @@ private PagedResponse listAssetResourceSinglePage(RequestOptions req * maxpagesizeIntegerNoThe maximum number of result items per page. * markStringNoSpecify this value instead of 'skip' to use cursor-based * searching. Initial value is '*' and subsequent values are returned in the response. - * responseTypeStringNoSpecify the response type. The possible values are: ID, - * STANDARD, FULL, REDUCED. Allowed values: "id", "standard", "full", "reduced". - * responseIncludesList<String>NoThe properties to include in the response. - * In the form of "," separated string. - * recentOnlyBooleanNoIf it's recent only. * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

@@ -1618,605 +1318,31 @@ public Response getAssetResourceWithResponse(String assetId, Request } /** - * Export a list of assets for the provided search parameters. + * Retrieve a list of data connections. *

Query Parameters

* * * - * - * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned - * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

+ *

Response Body Schema

* *
{@code
      * {
-     *     fileName: String (Required)
-     *     columns (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAssetsExportWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAssetsExport(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); - } - - /** - * Export a list of assets for the provided search parameters. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned - * resources.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     fileName: String (Required)
-     *     columns (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAssetsExportWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getAssetsExportSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, - requestOptions, Context.NONE); - } - - /** - * Retrieve observations on an asset. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned - * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
{@code
-     * {
-     *     totalElements: long (Required)
-     *     prioritySummary (Required): {
-     *         String: int (Required)
-     *     }
-     *     value (Required): [
-     *          (Required){
-     *             name: String (Required)
-     *             types (Required): [
-     *                 String(cve/insight) (Required)
-     *             ]
-     *             priority: String(high/medium/low/none) (Required)
-     *             cvssScoreV2: double (Required)
-     *             cvssScoreV3: double (Required)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param assetId The system generated unique id for the resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the page result response for the observation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getObservationsWithResponseAsync(String assetId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getObservations(this.getEndpoint(), - this.getServiceVersion().getVersion(), assetId, accept, requestOptions, context)); - } - - /** - * Retrieve observations on an asset. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned - * resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
{@code
-     * {
-     *     totalElements: long (Required)
-     *     prioritySummary (Required): {
-     *         String: int (Required)
-     *     }
-     *     value (Required): [
-     *          (Required){
-     *             name: String (Required)
-     *             types (Required): [
-     *                 String(cve/insight) (Required)
-     *             ]
-     *             priority: String(high/medium/low/none) (Required)
-     *             cvssScoreV2: double (Required)
-     *             cvssScoreV3: double (Required)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param assetId The system generated unique id for the resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the page result response for the observation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getObservationsWithResponse(String assetId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getObservationsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), assetId, accept, - requestOptions, Context.NONE); - } - - /** - * Retrieve a list of deltas for the provided time range. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     deltaDetailType: String(added/removed) (Required)
-     *     priorDays: Integer (Optional)
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     name: String (Required)
-     *     createdAt: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeltaDetailsSinglePageAsync(BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getDeltaDetails(this.getEndpoint(), this.getServiceVersion().getVersion(), - accept, body, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Retrieve a list of deltas for the provided time range. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     deltaDetailType: String(added/removed) (Required)
-     *     priorDays: Integer (Optional)
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     name: String (Required)
-     *     createdAt: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getDeltaDetailsAsync(BinaryData body, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return getDeltaDetailsSinglePageAsync(body, requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return getDeltaDetailsNextSinglePageAsync(nextLink, requestOptionsLocal); - }); - } - - /** - * Retrieve a list of deltas for the provided time range. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     deltaDetailType: String(added/removed) (Required)
-     *     priorDays: Integer (Optional)
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     name: String (Required)
-     *     createdAt: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getDeltaDetailsSinglePage(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.getDeltaDetailsSync(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Retrieve a list of deltas for the provided time range. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
{@code
-     * {
-     *     deltaDetailType: String(added/removed) (Required)
-     *     priorDays: Integer (Optional)
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     name: String (Required)
-     *     createdAt: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getDeltaDetails(BinaryData body, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return getDeltaDetailsSinglePage(body, requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return getDeltaDetailsNextSinglePage(nextLink, requestOptionsLocal); - }); - } - - /** - * Retrieve a list of deltas with overall summary changes for the provided time range. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     priorDays: Integer (Optional)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     summary (Required): {
-     *         range: long (Required)
-     *         removed: long (Required)
-     *         added: long (Required)
-     *         difference: long (Required)
-     *         kindSummaries (Required): [
-     *              (Required){
-     *                 kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *                 removed: long (Required)
-     *                 added: long (Required)
-     *                 difference: long (Required)
-     *             }
-     *         ]
-     *     }
-     *     daily (Required): [
-     *          (Required){
-     *             date: OffsetDateTime (Required)
-     *             deltas (Required): [
-     *                  (Required){
-     *                     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *                     removed: long (Required)
-     *                     added: long (Required)
-     *                     difference: long (Required)
-     *                     count: long (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return define response body for getting delta summary along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeltaSummaryWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDeltaSummary(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); - } - - /** - * Retrieve a list of deltas with overall summary changes for the provided time range. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     priorDays: Integer (Optional)
-     *     date: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     summary (Required): {
-     *         range: long (Required)
-     *         removed: long (Required)
-     *         added: long (Required)
-     *         difference: long (Required)
-     *         kindSummaries (Required): [
-     *              (Required){
-     *                 kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *                 removed: long (Required)
-     *                 added: long (Required)
-     *                 difference: long (Required)
-     *             }
-     *         ]
-     *     }
-     *     daily (Required): [
-     *          (Required){
-     *             date: OffsetDateTime (Required)
-     *             deltas (Required): [
-     *                  (Required){
-     *                     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *                     removed: long (Required)
-     *                     added: long (Required)
-     *                     difference: long (Required)
-     *                     count: long (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return define response body for getting delta summary along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeltaSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getDeltaSummarySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, - requestOptions, Context.NONE); - } - - /** - * Retrieve a list of data connections. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
{@code
-     * {
-     *     kind: String (Required)
-     *     id: String (Optional)
-     *     name: String (Required)
-     *     displayName: String (Optional)
-     *     content: String(assets/attackSurfaceInsights) (Optional)
-     *     createdDate: OffsetDateTime (Optional)
-     *     frequency: String(daily/weekly/monthly) (Optional)
-     *     frequencyOffset: Integer (Optional)
-     *     updatedDate: OffsetDateTime (Optional)
-     *     userUpdatedAt: OffsetDateTime (Optional)
-     *     active: Boolean (Optional)
-     *     inactiveMessage: String (Optional)
+     *     kind: String (Required)
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
      * }
      * }
* @@ -3292,42 +2418,6 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO requestOptions, Context.NONE); } - /** - * Delete a discovery group with a given discovery group name. - * - * @param groupName The caller provided unique name for the resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDiscoGroupWithResponseAsync(String groupName, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteDiscoGroup(this.getEndpoint(), - this.getServiceVersion().getVersion(), groupName, accept, requestOptions, context)); - } - - /** - * Delete a discovery group with a given discovery group name. - * - * @param groupName The caller provided unique name for the resource. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), groupName, - accept, requestOptions, Context.NONE); - } - /** * Create a discovery group with a given groupName. *

Request Body Schema

@@ -3773,244 +2863,23 @@ public PagedIterable listRuns(String groupName, RequestOptions reque if (pageSize != null) { requestOptionsLocal.addRequestCallback(requestLocal -> { UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listRunsSinglePage(groupName, requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listRunsNextSinglePage(nextLink, requestOptionsLocal); - }); - } - - /** - * Retrieve an asset chain summary. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
-     *     sourceIds (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     affectedAssetsSummary (Required): [
-     *          (Required){
-     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Required)
-     *             affectedCount: long (Required)
-     *         }
-     *     ]
-     *     affectedGroupsSummary (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             name: String (Required)
-     *             displayName: String (Required)
-     *         }
-     *     ]
-     *     errors (Optional): [
-     *          (Optional){
-     *             error (Required): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 innererror (Optional): {
-     *                     code: String (Optional)
-     *                     innererror (Optional): (recursive schema, see innererror above)
-     *                 }
-     *             }
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response for the asset chain summary along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAssetChainSummaryWithResponseAsync(BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAssetChainSummary(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); - } - - /** - * Retrieve an asset chain summary. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
-     *     sourceIds (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     affectedAssetsSummary (Required): [
-     *          (Required){
-     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Required)
-     *             affectedCount: long (Required)
-     *         }
-     *     ]
-     *     affectedGroupsSummary (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             name: String (Required)
-     *             displayName: String (Required)
-     *         }
-     *     ]
-     *     errors (Optional): [
-     *          (Optional){
-     *             error (Required): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 innererror (Optional): {
-     *                     code: String (Optional)
-     *                     innererror (Optional): (recursive schema, see innererror above)
-     *                 }
-     *             }
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response for the asset chain summary along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAssetChainSummaryWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getAssetChainSummarySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, - requestOptions, Context.NONE); - } - - /** - * Dismiss discovery chain for a given asset chain source. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
-     *     sourceIds (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> dismissAssetChainWithResponseAsync(BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.dismissAssetChain(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); - } - - /** - * Dismiss discovery chain for a given asset chain source. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     assetChainSource: String(DISCO_GROUP/ASSET) (Required)
-     *     sourceIds (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response dismissAssetChainWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.dismissAssetChainSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, - requestOptions, Context.NONE); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listRunsSinglePage(groupName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listRunsNextSinglePage(nextLink, requestOptionsLocal); + }); } /** @@ -4680,101 +3549,6 @@ public Response getSummaryWithResponse(BinaryData body, RequestOptio requestOptions, Context.NONE); } - /** - * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     metric: String (Optional)
-     *     fileName: String (Optional)
-     *     columns (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the most recent snapshot of asset summary values for the snapshot request exported to a file along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotExportWithResponseAsync(BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSnapshotExport(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, body, requestOptions, context)); - } - - /** - * Get the most recent snapshot of asset summary values for the snapshot request exported to a file. - *

Request Body Schema

- * - *
{@code
-     * {
-     *     metric: String (Optional)
-     *     fileName: String (Optional)
-     *     columns (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param body Body parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the most recent snapshot of asset summary values for the snapshot request exported to a file along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSnapshotExportWithResponse(BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getSnapshotExportSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, body, - requestOptions, Context.NONE); - } - /** * Retrieve a list of saved filters for the provided search parameters. *

Query Parameters

@@ -5349,168 +4123,32 @@ public PagedIterable listTask(RequestOptions requestOptions) { RequestOptions requestOptionsForNextPage = new RequestOptions(); requestOptionsForNextPage.setContext( requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTaskSinglePage(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTaskNextSinglePage(nextLink, requestOptionsLocal); - }); - } - - /** - * Retrieve a task by taskId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param taskId The unique identifier of the task. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTaskWithResponseAsync(String taskId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTask(this.getEndpoint(), - this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context)); - } - - /** - * Retrieve a task by taskId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param taskId The unique identifier of the task. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTaskWithResponse(String taskId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept, - requestOptions, Context.NONE); - } - - /** - * Cancel a task by taskId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param taskId The unique identifier of the task. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelTaskWithResponseAsync(String taskId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.cancelTask(this.getEndpoint(), - this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context)); - } - - /** - * Cancel a task by taskId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     startedAt: OffsetDateTime (Optional)
-     *     completedAt: OffsetDateTime (Optional)
-     *     lastPolledAt: OffsetDateTime (Optional)
-     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
-     *     phase: String(running/polling/complete) (Optional)
-     *     reason: String (Optional)
-     *     metadata (Optional): {
-     *         String: Object (Required)
-     *     }
-     * }
-     * }
- * - * @param taskId The unique identifier of the task. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelTaskWithResponse(String taskId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.cancelTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept, - requestOptions, Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTaskSinglePage(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTaskNextSinglePage(nextLink, requestOptionsLocal); + }); } /** - * Run a task by taskId. + * Retrieve a task by taskId. *

Response Body Schema

* *
{@code
@@ -5537,14 +4175,14 @@ public Response cancelTaskWithResponse(String taskId, RequestOptions
      * @return the response body along with {@link Response} on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> runTaskWithResponseAsync(String taskId, RequestOptions requestOptions) {
+    public Mono> getTaskWithResponseAsync(String taskId, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.runTask(this.getEndpoint(),
+        return FluxUtil.withContext(context -> service.getTask(this.getEndpoint(),
             this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context));
     }
 
     /**
-     * Run a task by taskId.
+     * Retrieve a task by taskId.
      * 

Response Body Schema

* *
{@code
@@ -5571,14 +4209,14 @@ public Mono> runTaskWithResponseAsync(String taskId, Reques
      * @return the response body along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Response runTaskWithResponse(String taskId, RequestOptions requestOptions) {
+    public Response getTaskWithResponse(String taskId, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return service.runTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept,
+        return service.getTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept,
             requestOptions, Context.NONE);
     }
 
     /**
-     * Download a task.
+     * Cancel a task by taskId.
      * 

Response Body Schema

* *
{@code
@@ -5605,14 +4243,14 @@ public Response runTaskWithResponse(String taskId, RequestOptions re
      * @return the response body along with {@link Response} on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> downloadTaskWithResponseAsync(String taskId, RequestOptions requestOptions) {
+    public Mono> cancelTaskWithResponseAsync(String taskId, RequestOptions requestOptions) {
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.downloadTask(this.getEndpoint(),
+        return FluxUtil.withContext(context -> service.cancelTask(this.getEndpoint(),
             this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context));
     }
 
     /**
-     * Download a task.
+     * Cancel a task by taskId.
      * 

Response Body Schema

* *
{@code
@@ -5639,227 +4277,9 @@ public Mono> downloadTaskWithResponseAsync(String taskId, R
      * @return the response body along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Response downloadTaskWithResponse(String taskId, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.downloadTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept,
-            requestOptions, Context.NONE);
-    }
-
-    /**
-     * Retrieve a list of CisaCves for the provided search parameters.
-     * 

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of CisaCveResult items along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCisaCvesSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getCisaCves(this.getEndpoint(), this.getServiceVersion().getVersion(), - accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Retrieve a list of CisaCves for the provided search parameters. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of CisaCveResult items as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getCisaCvesAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> getCisaCvesSinglePageAsync(requestOptions), - nextLink -> getCisaCvesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Retrieve a list of CisaCves for the provided search parameters. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of CisaCveResult items along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getCisaCvesSinglePage(RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.getCisaCvesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Retrieve a list of CisaCves for the provided search parameters. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of CisaCveResult items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getCisaCves(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> getCisaCvesSinglePage(requestOptions), - nextLink -> getCisaCvesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Retrieve details of CisaCve by cveId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have - * more than 4 digits. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cisa cve in a given workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCisaCveWithResponseAsync(String cveId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getCisaCve(this.getEndpoint(), - this.getServiceVersion().getVersion(), cveId, accept, requestOptions, context)); - } - - /** - * Retrieve details of CisaCve by cveId. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param cveId The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have - * more than 4 digits. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return cisa cve in a given workspace along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCisaCveWithResponse(String cveId, RequestOptions requestOptions) { + public Response cancelTaskWithResponse(String taskId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getCisaCveSync(this.getEndpoint(), this.getServiceVersion().getVersion(), cveId, accept, + return service.cancelTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept, requestOptions, Context.NONE); } @@ -5966,70 +4386,6 @@ private PagedResponse listAssetResourceNextSinglePage(String nextLin getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } - /** - * Get the next page of items. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     name: String (Required)
-     *     createdAt: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeltaDetailsNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getDeltaDetailsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     kind: String(page/resource/mailServer/nameServer/host/domain/ipAddress/ipBlock/as/contact/sslCert) (Required)
-     *     name: String (Required)
-     *     createdAt: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     state: String(candidate/candidateInvestigate/confirmed/associated/associatedPartner/associatedThirdParty/archived/dismissed/autoconfirmed) (Required)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getDeltaDetailsNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.getDeltaDetailsNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - /** * Get the next page of items. *

Response Body Schema

@@ -6553,83 +4909,6 @@ private PagedResponse listTaskNextSinglePage(String nextLink, Reques getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } - /** - * Get the next page of items. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of CisaCveResult items along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCisaCvesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getCisaCvesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
{@code
-     * {
-     *     cveId: String (Required)
-     *     vendorProject: String (Required)
-     *     product: String (Required)
-     *     vulnerabilityName: String (Required)
-     *     shortDescription: String (Required)
-     *     requiredAction: String (Required)
-     *     notes: String (Required)
-     *     dateAdded: OffsetDateTime (Required)
-     *     dueDate: OffsetDateTime (Required)
-     *     updatedAt: OffsetDateTime (Required)
-     *     count: long (Required)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of CisaCveResult items along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getCisaCvesNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.getCisaCvesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - private List getValues(BinaryData binaryData, String path) { try { Map obj = binaryData.toObject(Map.class); diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java index c920b7cd6a26..0059ef20b2f6 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.analytics.defender.easm.implementation.models; import com.azure.analytics.defender.easm.models.DiscoSource; @@ -19,6 +18,7 @@ */ @Fluent public final class CreateOrReplaceDiscoGroupRequest implements JsonSerializable { + /* * The name for a disco group. */ @@ -76,7 +76,7 @@ public CreateOrReplaceDiscoGroupRequest() { /** * Get the name property: The name for a disco group. - * + * * @return the name value. */ @Generated @@ -86,7 +86,7 @@ public String getName() { /** * Set the name property: The name for a disco group. - * + * * @param name the name value to set. * @return the CreateOrReplaceDiscoGroupRequest object itself. */ @@ -98,7 +98,7 @@ public CreateOrReplaceDiscoGroupRequest setName(String name) { /** * Get the description property: The description for a disco group. - * + * * @return the description value. */ @Generated @@ -108,7 +108,7 @@ public String getDescription() { /** * Set the description property: The description for a disco group. - * + * * @param description the description value to set. * @return the CreateOrReplaceDiscoGroupRequest object itself. */ @@ -121,7 +121,7 @@ public CreateOrReplaceDiscoGroupRequest setDescription(String description) { /** * Get the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in * this group. - * + * * @return the tier value. */ @Generated @@ -132,7 +132,7 @@ public String getTier() { /** * Set the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in * this group. - * + * * @param tier the tier value to set. * @return the CreateOrReplaceDiscoGroupRequest object itself. */ @@ -145,7 +145,7 @@ public CreateOrReplaceDiscoGroupRequest setTier(String tier) { /** * Get the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in * milliseconds. - * + * * @return the frequencyMilliseconds value. */ @Generated @@ -156,7 +156,7 @@ public Long getFrequencyMilliseconds() { /** * Set the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in * milliseconds. - * + * * @param frequencyMilliseconds the frequencyMilliseconds value to set. * @return the CreateOrReplaceDiscoGroupRequest object itself. */ @@ -168,7 +168,7 @@ public CreateOrReplaceDiscoGroupRequest setFrequencyMilliseconds(Long frequencyM /** * Get the seeds property: The list of seeds used for the disco group runs. - * + * * @return the seeds value. */ @Generated @@ -178,7 +178,7 @@ public List getSeeds() { /** * Set the seeds property: The list of seeds used for the disco group runs. - * + * * @param seeds the seeds value to set. * @return the CreateOrReplaceDiscoGroupRequest object itself. */ @@ -190,7 +190,7 @@ public CreateOrReplaceDiscoGroupRequest setSeeds(List seeds) { /** * Get the names property: The list of names used for the disco group runs. - * + * * @return the names value. */ @Generated @@ -200,7 +200,7 @@ public List getNames() { /** * Set the names property: The list of names used for the disco group runs. - * + * * @param names the names value to set. * @return the CreateOrReplaceDiscoGroupRequest object itself. */ @@ -213,7 +213,7 @@ public CreateOrReplaceDiscoGroupRequest setNames(List names) { /** * Get the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the * discovery algorithm. - * + * * @return the excludes value. */ @Generated @@ -224,7 +224,7 @@ public List getExcludes() { /** * Set the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the * discovery algorithm. - * + * * @param excludes the excludes value to set. * @return the CreateOrReplaceDiscoGroupRequest object itself. */ @@ -236,7 +236,7 @@ public CreateOrReplaceDiscoGroupRequest setExcludes(List excludes) /** * Get the templateId property: The unique identifier for the disco template used for the disco group creation. - * + * * @return the templateId value. */ @Generated @@ -246,7 +246,7 @@ public String getTemplateId() { /** * Set the templateId property: The unique identifier for the disco template used for the disco group creation. - * + * * @param templateId the templateId value to set. * @return the CreateOrReplaceDiscoGroupRequest object itself. */ @@ -276,7 +276,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of CreateOrReplaceDiscoGroupRequest from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of CreateOrReplaceDiscoGroupRequest if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. @@ -290,7 +290,6 @@ public static CreateOrReplaceDiscoGroupRequest fromJson(JsonReader jsonReader) t while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("name".equals(fieldName)) { deserializedCreateOrReplaceDiscoGroupRequest.name = reader.getString(); } else if ("description".equals(fieldName)) { @@ -315,7 +314,6 @@ public static CreateOrReplaceDiscoGroupRequest fromJson(JsonReader jsonReader) t reader.skipChildren(); } } - return deserializedCreateOrReplaceDiscoGroupRequest; }); } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java index 017e4c30a6af..18557bc0a362 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - /** * * Package containing the data models for Easm. diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/package-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/package-info.java index cee2f129eda2..792f332edbf4 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/package-info.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/package-info.java @@ -2,9 +2,12 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for Easm. Defender EASM discovers and maps your digital attack surface to - * provide an "outside-in" perspective using probes to discover assets. The assets are provided with detailed metadata - * associated, including vulnerabilities, configurations and web components, allowing customers to view and prioritize - * external risk. The EASM REST API enables you to develop clients that integrate with your application. + * + * Package containing the implementations for Easm. + * Defender EASM discovers and maps your digital attack surface to provide an "outside-in" perspective using probes to + * discover assets. The assets are provided with detailed metadata associated, including vulnerabilities, configurations + * and web components, allowing customers to view and prioritize external risk. The EASM REST API enables you to develop + * clients that integrate with your application. + * */ package com.azure.analytics.defender.easm.implementation; diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAssetResource.java index f63765d6b1a2..f9607a015fac 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAssetResource.java @@ -21,36 +21,16 @@ public final class AsAssetResource extends AssetResource { /* - * asset - */ - @Generated - private final AsAsset asset; - - /** - * Creates an instance of AsAssetResource class. - * - * @param asset the asset value to set. - */ - @Generated - private AsAssetResource(AsAsset asset) { - this.asset = asset; - } - - /** - * Get the asset property: asset. - * - * @return the asset value. + * Discriminator property for AssetResource. */ @Generated - public AsAsset getAsset() { - return this.asset; - } + private String kind = "as"; /* - * Discriminator property for AssetResource. + * asset */ @Generated - private String kind = "as"; + private final AsAsset asset; /* * The caller provided unique name for the resource. @@ -124,6 +104,16 @@ public AsAsset getAsset() { @Generated private String reason; + /** + * Creates an instance of AsAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + private AsAssetResource(AsAsset asset) { + this.asset = asset; + } + /** * Get the kind property: Discriminator property for AssetResource. * @@ -135,6 +125,16 @@ public String getKind() { return this.kind; } + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public AsAsset getAsset() { + return this.asset; + } + /** * Get the name property: The caller provided unique name for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainKindSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainKindSummaryResult.java deleted file mode 100644 index 87def650d21c..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainKindSummaryResult.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A list of asset chain summaries per asset kind. - */ -@Immutable -public final class AssetChainKindSummaryResult implements JsonSerializable { - /* - * The kind of asset - */ - @Generated - private final AssetKind kind; - - /* - * The amount of assets affected for a given asset kind - */ - @Generated - private final long affectedCount; - - /** - * Creates an instance of AssetChainKindSummaryResult class. - * - * @param kind the kind value to set. - * @param affectedCount the affectedCount value to set. - */ - @Generated - private AssetChainKindSummaryResult(AssetKind kind, long affectedCount) { - this.kind = kind; - this.affectedCount = affectedCount; - } - - /** - * Get the kind property: The kind of asset. - * - * @return the kind value. - */ - @Generated - public AssetKind getKind() { - return this.kind; - } - - /** - * Get the affectedCount property: The amount of assets affected for a given asset kind. - * - * @return the affectedCount value. - */ - @Generated - public long getAffectedCount() { - return this.affectedCount; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeLongField("affectedCount", this.affectedCount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssetChainKindSummaryResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssetChainKindSummaryResult if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AssetChainKindSummaryResult. - */ - @Generated - public static AssetChainKindSummaryResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssetKind kind = null; - long affectedCount = 0L; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kind".equals(fieldName)) { - kind = AssetKind.fromString(reader.getString()); - } else if ("affectedCount".equals(fieldName)) { - affectedCount = reader.getLong(); - } else { - reader.skipChildren(); - } - } - return new AssetChainKindSummaryResult(kind, affectedCount); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainRequest.java deleted file mode 100644 index a3b8f293ed71..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainRequest.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * AssetChainRequest containing information needed for the retrieval of the asset chain summary. - */ -@Immutable -public final class AssetChainRequest implements JsonSerializable { - /* - * Asset chain source. - */ - @Generated - private final AssetChainSource assetChainSource; - - /* - * A collection of asset chain source ids. - */ - @Generated - private final List sourceIds; - - /** - * Creates an instance of AssetChainRequest class. - * - * @param assetChainSource the assetChainSource value to set. - * @param sourceIds the sourceIds value to set. - */ - @Generated - public AssetChainRequest(AssetChainSource assetChainSource, List sourceIds) { - this.assetChainSource = assetChainSource; - this.sourceIds = sourceIds; - } - - /** - * Get the assetChainSource property: Asset chain source. - * - * @return the assetChainSource value. - */ - @Generated - public AssetChainSource getAssetChainSource() { - return this.assetChainSource; - } - - /** - * Get the sourceIds property: A collection of asset chain source ids. - * - * @return the sourceIds value. - */ - @Generated - public List getSourceIds() { - return this.sourceIds; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("assetChainSource", - this.assetChainSource == null ? null : this.assetChainSource.toString()); - jsonWriter.writeArrayField("sourceIds", this.sourceIds, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssetChainRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssetChainRequest if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AssetChainRequest. - */ - @Generated - public static AssetChainRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssetChainSource assetChainSource = null; - List sourceIds = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assetChainSource".equals(fieldName)) { - assetChainSource = AssetChainSource.fromString(reader.getString()); - } else if ("sourceIds".equals(fieldName)) { - sourceIds = reader.readArray(reader1 -> reader1.getString()); - } else { - reader.skipChildren(); - } - } - return new AssetChainRequest(assetChainSource, sourceIds); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSource.java deleted file mode 100644 index 9f7c5b9ec8b6..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSource.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * A list of asset chain sources. - */ -public final class AssetChainSource extends ExpandableStringEnum { - /** - * discovery group. - */ - @Generated - public static final AssetChainSource DISCO_GROUP = fromString("DISCO_GROUP"); - - /** - * asset. - */ - @Generated - public static final AssetChainSource ASSET = fromString("ASSET"); - - /** - * Creates a new instance of AssetChainSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public AssetChainSource() { - } - - /** - * Creates or finds a AssetChainSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssetChainSource. - */ - @Generated - public static AssetChainSource fromString(String name) { - return fromString(name, AssetChainSource.class); - } - - /** - * Gets known AssetChainSource values. - * - * @return known AssetChainSource values. - */ - @Generated - public static Collection values() { - return values(AssetChainSource.class); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSummaryResult.java deleted file mode 100644 index ae441bc42ca3..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetChainSummaryResult.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Response for the asset chain summary. - */ -@Immutable -public final class AssetChainSummaryResult implements JsonSerializable { - /* - * A list of asset chain summaries per asset kind - */ - @Generated - private final List affectedAssetsSummary; - - /* - * A list of disco group summaries - */ - @Generated - private final List affectedGroupsSummary; - - /* - * The list of exceptions - */ - @Generated - private List errors; - - /** - * Creates an instance of AssetChainSummaryResult class. - * - * @param affectedAssetsSummary the affectedAssetsSummary value to set. - * @param affectedGroupsSummary the affectedGroupsSummary value to set. - */ - @Generated - private AssetChainSummaryResult(List affectedAssetsSummary, - List affectedGroupsSummary) { - this.affectedAssetsSummary = affectedAssetsSummary; - this.affectedGroupsSummary = affectedGroupsSummary; - } - - /** - * Get the affectedAssetsSummary property: A list of asset chain summaries per asset kind. - * - * @return the affectedAssetsSummary value. - */ - @Generated - public List getAffectedAssetsSummary() { - return this.affectedAssetsSummary; - } - - /** - * Get the affectedGroupsSummary property: A list of disco group summaries. - * - * @return the affectedGroupsSummary value. - */ - @Generated - public List getAffectedGroupsSummary() { - return this.affectedGroupsSummary; - } - - /** - * Get the errors property: The list of exceptions. - * - * @return the errors value. - */ - @Generated - public List getErrors() { - return this.errors; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("affectedAssetsSummary", this.affectedAssetsSummary, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("affectedGroupsSummary", this.affectedGroupsSummary, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssetChainSummaryResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssetChainSummaryResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AssetChainSummaryResult. - */ - @Generated - public static AssetChainSummaryResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - List affectedAssetsSummary = null; - List affectedGroupsSummary = null; - List errors = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("affectedAssetsSummary".equals(fieldName)) { - affectedAssetsSummary = reader.readArray(reader1 -> AssetChainKindSummaryResult.fromJson(reader1)); - } else if ("affectedGroupsSummary".equals(fieldName)) { - affectedGroupsSummary = reader.readArray(reader1 -> DiscoGroupSummaryResult.fromJson(reader1)); - } else if ("errors".equals(fieldName)) { - errors = reader.readArray(reader1 -> ErrorResponse.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - AssetChainSummaryResult deserializedAssetChainSummaryResult - = new AssetChainSummaryResult(affectedAssetsSummary, affectedGroupsSummary); - deserializedAssetChainSummaryResult.errors = errors; - - return deserializedAssetChainSummaryResult; - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetKind.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetKind.java deleted file mode 100644 index 2506067282e0..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetKind.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The kind of asset. - */ -public final class AssetKind extends ExpandableStringEnum { - /** - * Static value as for AssetKind. - */ - @Generated - public static final AssetKind AS = fromString("as"); - - /** - * Static value contact for AssetKind. - */ - @Generated - public static final AssetKind CONTACT = fromString("contact"); - - /** - * Static value domain for AssetKind. - */ - @Generated - public static final AssetKind DOMAIN = fromString("domain"); - - /** - * Static value host for AssetKind. - */ - @Generated - public static final AssetKind HOST = fromString("host"); - - /** - * Static value ipAddress for AssetKind. - */ - @Generated - public static final AssetKind IP_ADDRESS = fromString("ipAddress"); - - /** - * Static value ipBlock for AssetKind. - */ - @Generated - public static final AssetKind IP_BLOCK = fromString("ipBlock"); - - /** - * Static value page for AssetKind. - */ - @Generated - public static final AssetKind PAGE = fromString("page"); - - /** - * Static value sslCert for AssetKind. - */ - @Generated - public static final AssetKind SSL_CERT = fromString("sslCert"); - - /** - * Creates a new instance of AssetKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public AssetKind() { - } - - /** - * Creates or finds a AssetKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssetKind. - */ - @Generated - public static AssetKind fromString(String name) { - return fromString(name, AssetKind.class); - } - - /** - * Gets known AssetKind values. - * - * @return known AssetKind values. - */ - @Generated - public static Collection values() { - return values(AssetKind.class); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java index 9bff56883a00..e24ea259e548 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java @@ -21,6 +21,12 @@ @Immutable public class AssetResource implements JsonSerializable { + /* + * Discriminator property for AssetResource. + */ + @Generated + private String kind = "AssetResource"; + /* * The system generated unique id for the resource. */ @@ -107,297 +113,291 @@ protected AssetResource() { } /** - * Get the id property: The system generated unique id for the resource. + * Get the kind property: Discriminator property for AssetResource. * - * @return the id value. + * @return the kind value. */ @Generated - public String getId() { - return this.id; + public String getKind() { + return this.kind; } /** - * Get the name property: The caller provided unique name for the resource. + * Get the id property: The system generated unique id for the resource. * - * @return the name value. + * @return the id value. */ @Generated - public String getName() { - return this.name; + public String getId() { + return this.id; } /** - * Get the displayName property: The name that can be used for display purposes. + * Set the id property: The system generated unique id for the resource. * - * @return the displayName value. + * @param id the id value to set. + * @return the AssetResource object itself. */ @Generated - public String getDisplayName() { - return this.displayName; + AssetResource setId(String id) { + this.id = id; + return this; } /** - * Get the uuid property: Global UUID for the asset. + * Get the name property: The caller provided unique name for the resource. * - * @return the uuid value. + * @return the name value. */ @Generated - public String getUuid() { - return this.uuid; + public String getName() { + return this.name; } /** - * Get the createdDate property: The date this asset was first added to this workspace. + * Set the name property: The caller provided unique name for the resource. * - * @return the createdDate value. + * @param name the name value to set. + * @return the AssetResource object itself. */ @Generated - public OffsetDateTime getCreatedDate() { - return this.createdDate; + AssetResource setName(String name) { + this.name = name; + return this; } /** - * Get the updatedDate property: The date this asset was last updated for this workspace. + * Get the displayName property: The name that can be used for display purposes. * - * @return the updatedDate value. + * @return the displayName value. */ @Generated - public OffsetDateTime getUpdatedDate() { - return this.updatedDate; + public String getDisplayName() { + return this.displayName; } /** - * Get the state property: The state property. + * Set the displayName property: The name that can be used for display purposes. * - * @return the state value. + * @param displayName the displayName value to set. + * @return the AssetResource object itself. */ @Generated - public AssetState getState() { - return this.state; + AssetResource setDisplayName(String displayName) { + this.displayName = displayName; + return this; } /** - * Get the externalId property: An optional customer provided identifier for this asset. + * Get the uuid property: Global UUID for the asset. * - * @return the externalId value. + * @return the uuid value. */ @Generated - public String getExternalId() { - return this.externalId; + public String getUuid() { + return this.uuid; } /** - * Get the labels property: Customer labels assigned to this asset. + * Set the uuid property: Global UUID for the asset. * - * @return the labels value. + * @param uuid the uuid value to set. + * @return the AssetResource object itself. */ @Generated - public List getLabels() { - return this.labels; + AssetResource setUuid(String uuid) { + this.uuid = uuid; + return this; } /** - * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this - * domain. + * Get the createdDate property: The date this asset was first added to this workspace. * - * @return the wildcard value. + * @return the createdDate value. */ @Generated - public Boolean isWildcard() { - return this.wildcard; + public OffsetDateTime getCreatedDate() { + return this.createdDate; } /** - * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * Set the createdDate property: The date this asset was first added to this workspace. * - * @return the discoGroupName value. + * @param createdDate the createdDate value to set. + * @return the AssetResource object itself. */ @Generated - public String getDiscoGroupName() { - return this.discoGroupName; + AssetResource setCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; } /** - * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery - * process. + * Get the updatedDate property: The date this asset was last updated for this workspace. * - * @return the auditTrail value. + * @return the updatedDate value. */ @Generated - public List getAuditTrail() { - return this.auditTrail; + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; } /** - * Get the reason property: The reason property. + * Set the updatedDate property: The date this asset was last updated for this workspace. * - * @return the reason value. + * @param updatedDate the updatedDate value to set. + * @return the AssetResource object itself. */ @Generated - public String getReason() { - return this.reason; + AssetResource setUpdatedDate(OffsetDateTime updatedDate) { + this.updatedDate = updatedDate; + return this; } - /* - * Discriminator property for AssetResource. - */ - @Generated - private String kind = "AssetResource"; - /** - * Get the kind property: Discriminator property for AssetResource. + * Get the state property: The state property. * - * @return the kind value. + * @return the state value. */ @Generated - public String getKind() { - return this.kind; + public AssetState getState() { + return this.state; } /** - * Set the id property: The system generated unique id for the resource. + * Set the state property: The state property. * - * @param id the id value to set. + * @param state the state value to set. * @return the AssetResource object itself. */ @Generated - AssetResource setId(String id) { - this.id = id; + AssetResource setState(AssetState state) { + this.state = state; return this; } /** - * Set the name property: The caller provided unique name for the resource. + * Get the externalId property: An optional customer provided identifier for this asset. * - * @param name the name value to set. - * @return the AssetResource object itself. + * @return the externalId value. */ @Generated - AssetResource setName(String name) { - this.name = name; - return this; + public String getExternalId() { + return this.externalId; } /** - * Set the displayName property: The name that can be used for display purposes. + * Set the externalId property: An optional customer provided identifier for this asset. * - * @param displayName the displayName value to set. + * @param externalId the externalId value to set. * @return the AssetResource object itself. */ @Generated - AssetResource setDisplayName(String displayName) { - this.displayName = displayName; + AssetResource setExternalId(String externalId) { + this.externalId = externalId; return this; } /** - * Set the uuid property: Global UUID for the asset. + * Get the labels property: Customer labels assigned to this asset. * - * @param uuid the uuid value to set. - * @return the AssetResource object itself. + * @return the labels value. */ @Generated - AssetResource setUuid(String uuid) { - this.uuid = uuid; - return this; + public List getLabels() { + return this.labels; } /** - * Set the createdDate property: The date this asset was first added to this workspace. + * Set the labels property: Customer labels assigned to this asset. * - * @param createdDate the createdDate value to set. + * @param labels the labels value to set. * @return the AssetResource object itself. */ @Generated - AssetResource setCreatedDate(OffsetDateTime createdDate) { - this.createdDate = createdDate; + AssetResource setLabels(List labels) { + this.labels = labels; return this; } /** - * Set the updatedDate property: The date this asset was last updated for this workspace. + * Get the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. * - * @param updatedDate the updatedDate value to set. - * @return the AssetResource object itself. + * @return the wildcard value. */ @Generated - AssetResource setUpdatedDate(OffsetDateTime updatedDate) { - this.updatedDate = updatedDate; - return this; + public Boolean isWildcard() { + return this.wildcard; } /** - * Set the state property: The state property. + * Set the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this + * domain. * - * @param state the state value to set. + * @param wildcard the wildcard value to set. * @return the AssetResource object itself. */ @Generated - AssetResource setState(AssetState state) { - this.state = state; + AssetResource setWildcard(Boolean wildcard) { + this.wildcard = wildcard; return this; } /** - * Set the externalId property: An optional customer provided identifier for this asset. + * Get the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. * - * @param externalId the externalId value to set. - * @return the AssetResource object itself. + * @return the discoGroupName value. */ @Generated - AssetResource setExternalId(String externalId) { - this.externalId = externalId; - return this; + public String getDiscoGroupName() { + return this.discoGroupName; } /** - * Set the labels property: Customer labels assigned to this asset. + * Set the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. * - * @param labels the labels value to set. + * @param discoGroupName the discoGroupName value to set. * @return the AssetResource object itself. */ @Generated - AssetResource setLabels(List labels) { - this.labels = labels; + AssetResource setDiscoGroupName(String discoGroupName) { + this.discoGroupName = discoGroupName; return this; } /** - * Set the wildcard property: An indicator of whether this asset represents a wildcard rollup of assets on this - * domain. + * Get the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. * - * @param wildcard the wildcard value to set. - * @return the AssetResource object itself. + * @return the auditTrail value. */ @Generated - AssetResource setWildcard(Boolean wildcard) { - this.wildcard = wildcard; - return this; + public List getAuditTrail() { + return this.auditTrail; } /** - * Set the discoGroupName property: The name of the DiscoGroup that brought added this asset to the workspace. + * Set the auditTrail property: The history of how this asset was pulled into the workspace through the discovery + * process. * - * @param discoGroupName the discoGroupName value to set. + * @param auditTrail the auditTrail value to set. * @return the AssetResource object itself. */ @Generated - AssetResource setDiscoGroupName(String discoGroupName) { - this.discoGroupName = discoGroupName; + AssetResource setAuditTrail(List auditTrail) { + this.auditTrail = auditTrail; return this; } /** - * Set the auditTrail property: The history of how this asset was pulled into the workspace through the discovery - * process. + * Get the reason property: The reason property. * - * @param auditTrail the auditTrail value to set. - * @return the AssetResource object itself. + * @return the reason value. */ @Generated - AssetResource setAuditTrail(List auditTrail) { - this.auditTrail = auditTrail; - return this; + public String getReason() { + return this.reason; } /** diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResponseType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResponseType.java deleted file mode 100644 index 1f951abcaa86..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResponseType.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * A list of asset response type. - */ -public final class AssetResponseType extends ExpandableStringEnum { - /** - * Return only the asset id. - */ - @Generated - public static final AssetResponseType ID = fromString("id"); - - /** - * Return the standard set of asset fields. - */ - @Generated - public static final AssetResponseType STANDARD = fromString("standard"); - - /** - * Return the full set of asset fields. - */ - @Generated - public static final AssetResponseType FULL = fromString("full"); - - /** - * Return a reduced set of fields. - */ - @Generated - public static final AssetResponseType REDUCED = fromString("reduced"); - - /** - * Creates a new instance of AssetResponseType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public AssetResponseType() { - } - - /** - * Creates or finds a AssetResponseType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssetResponseType. - */ - @Generated - public static AssetResponseType fromString(String name) { - return fromString(name, AssetResponseType.class); - } - - /** - * Gets known AssetResponseType values. - * - * @return known AssetResponseType values. - */ - @Generated - public static Collection values() { - return values(AssetResponseType.class); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetsExportRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetsExportRequest.java deleted file mode 100644 index 7f8b54b5d94b..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetsExportRequest.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A request body used to export an asset. - */ -@Immutable -public final class AssetsExportRequest implements JsonSerializable { - /* - * The name of the file to export. - */ - @Generated - private final String fileName; - - /* - * The columns to export. - */ - @Generated - private final List columns; - - /** - * Creates an instance of AssetsExportRequest class. - * - * @param fileName the fileName value to set. - * @param columns the columns value to set. - */ - @Generated - public AssetsExportRequest(String fileName, List columns) { - this.fileName = fileName; - this.columns = columns; - } - - /** - * Get the fileName property: The name of the file to export. - * - * @return the fileName value. - */ - @Generated - public String getFileName() { - return this.fileName; - } - - /** - * Get the columns property: The columns to export. - * - * @return the columns value. - */ - @Generated - public List getColumns() { - return this.columns; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("fileName", this.fileName); - jsonWriter.writeArrayField("columns", this.columns, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssetsExportRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssetsExportRequest if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AssetsExportRequest. - */ - @Generated - public static AssetsExportRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String fileName = null; - List columns = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("fileName".equals(fieldName)) { - fileName = reader.getString(); - } else if ("columns".equals(fieldName)) { - columns = reader.readArray(reader1 -> reader1.getString()); - } else { - reader.skipChildren(); - } - } - return new AssetsExportRequest(fileName, columns); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnection.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnection.java index 853718455b22..4e51ec6a9908 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnection.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnection.java @@ -19,36 +19,16 @@ public final class AzureDataExplorerDataConnection extends DataConnection { /* - * properties - */ - @Generated - private final AzureDataExplorerDataConnectionProperties properties; - - /** - * Creates an instance of AzureDataExplorerDataConnection class. - * - * @param properties the properties value to set. - */ - @Generated - private AzureDataExplorerDataConnection(AzureDataExplorerDataConnectionProperties properties) { - this.properties = properties; - } - - /** - * Get the properties property: properties. - * - * @return the properties value. + * Discriminator property for DataConnection. */ @Generated - public AzureDataExplorerDataConnectionProperties getProperties() { - return this.properties; - } + private String kind = "azureDataExplorer"; /* - * Discriminator property for DataConnection. + * properties */ @Generated - private String kind = "azureDataExplorer"; + private final AzureDataExplorerDataConnectionProperties properties; /* * The system generated unique id for the resource. @@ -110,6 +90,16 @@ public AzureDataExplorerDataConnectionProperties getProperties() { @Generated private String inactiveMessage; + /** + * Creates an instance of AzureDataExplorerDataConnection class. + * + * @param properties the properties value to set. + */ + @Generated + private AzureDataExplorerDataConnection(AzureDataExplorerDataConnectionProperties properties) { + this.properties = properties; + } + /** * Get the kind property: Discriminator property for DataConnection. * @@ -121,6 +111,16 @@ public String getKind() { return this.kind; } + /** + * Get the properties property: properties. + * + * @return the properties value. + */ + @Generated + public AzureDataExplorerDataConnectionProperties getProperties() { + return this.properties; + } + /** * Get the id property: The system generated unique id for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionData.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionData.java index 9220ac452b8d..4e02c1a2874e 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionData.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionData.java @@ -16,6 +16,12 @@ @Fluent public final class AzureDataExplorerDataConnectionData extends DataConnectionData { + /* + * Discriminator property for DataConnectionData. + */ + @Generated + private String kind = "azureDataExplorer"; + /* * properties */ @@ -32,6 +38,17 @@ public AzureDataExplorerDataConnectionData(AzureDataExplorerDataConnectionProper this.properties = properties; } + /** + * Get the kind property: Discriminator property for DataConnectionData. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + /** * Get the properties property: properties. * @@ -82,23 +99,6 @@ public AzureDataExplorerDataConnectionData setFrequencyOffset(Integer frequencyO return this; } - /* - * Discriminator property for DataConnectionData. - */ - @Generated - private String kind = "azureDataExplorer"; - - /** - * Get the kind property: Discriminator property for DataConnectionData. - * - * @return the kind value. - */ - @Generated - @Override - public String getKind() { - return this.kind; - } - /** * {@inheritDoc} */ diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CisaCveResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CisaCveResult.java deleted file mode 100644 index b25448456d40..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CisaCveResult.java +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * cisa cve in a given workspace. - */ -@Immutable -public final class CisaCveResult implements JsonSerializable { - /* - * The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 - * digits. - */ - @Generated - private String cveId; - - /* - * The vendor or project name for the vulnerability. - */ - @Generated - private final String vendorProject; - - /* - * The vulnerability product - */ - @Generated - private final String product; - - /* - * The name of the vulnerability - */ - @Generated - private final String vulnerabilityName; - - /* - * A short description of the vulnerability - */ - @Generated - private final String shortDescription; - - /* - * The required action to address the vulnerability - */ - @Generated - private final String requiredAction; - - /* - * Any additional notes about the vulnerability - */ - @Generated - private final String notes; - - /* - * The date the vulnerability was added to the catalog in the format YYYY-MM-DD - */ - @Generated - private final OffsetDateTime dateAdded; - - /* - * The date the required action is due in the format YYYY-MM-DD - */ - @Generated - private final OffsetDateTime dueDate; - - /* - * The date the vulnerability was updated - */ - @Generated - private final OffsetDateTime updatedAt; - - /* - * The number of assets affected by the vulnerability - */ - @Generated - private final long count; - - /** - * Creates an instance of CisaCveResult class. - * - * @param vendorProject the vendorProject value to set. - * @param product the product value to set. - * @param vulnerabilityName the vulnerabilityName value to set. - * @param shortDescription the shortDescription value to set. - * @param requiredAction the requiredAction value to set. - * @param notes the notes value to set. - * @param dateAdded the dateAdded value to set. - * @param dueDate the dueDate value to set. - * @param updatedAt the updatedAt value to set. - * @param count the count value to set. - */ - @Generated - private CisaCveResult(String vendorProject, String product, String vulnerabilityName, String shortDescription, - String requiredAction, String notes, OffsetDateTime dateAdded, OffsetDateTime dueDate, OffsetDateTime updatedAt, - long count) { - this.vendorProject = vendorProject; - this.product = product; - this.vulnerabilityName = vulnerabilityName; - this.shortDescription = shortDescription; - this.requiredAction = requiredAction; - this.notes = notes; - this.dateAdded = dateAdded; - this.dueDate = dueDate; - this.updatedAt = updatedAt; - this.count = count; - } - - /** - * Get the cveId property: The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion - * can have more than 4 digits. - * - * @return the cveId value. - */ - @Generated - public String getCveId() { - return this.cveId; - } - - /** - * Get the vendorProject property: The vendor or project name for the vulnerability. - * - * @return the vendorProject value. - */ - @Generated - public String getVendorProject() { - return this.vendorProject; - } - - /** - * Get the product property: The vulnerability product. - * - * @return the product value. - */ - @Generated - public String getProduct() { - return this.product; - } - - /** - * Get the vulnerabilityName property: The name of the vulnerability. - * - * @return the vulnerabilityName value. - */ - @Generated - public String getVulnerabilityName() { - return this.vulnerabilityName; - } - - /** - * Get the shortDescription property: A short description of the vulnerability. - * - * @return the shortDescription value. - */ - @Generated - public String getShortDescription() { - return this.shortDescription; - } - - /** - * Get the requiredAction property: The required action to address the vulnerability. - * - * @return the requiredAction value. - */ - @Generated - public String getRequiredAction() { - return this.requiredAction; - } - - /** - * Get the notes property: Any additional notes about the vulnerability. - * - * @return the notes value. - */ - @Generated - public String getNotes() { - return this.notes; - } - - /** - * Get the dateAdded property: The date the vulnerability was added to the catalog in the format YYYY-MM-DD. - * - * @return the dateAdded value. - */ - @Generated - public OffsetDateTime getDateAdded() { - return this.dateAdded; - } - - /** - * Get the dueDate property: The date the required action is due in the format YYYY-MM-DD. - * - * @return the dueDate value. - */ - @Generated - public OffsetDateTime getDueDate() { - return this.dueDate; - } - - /** - * Get the updatedAt property: The date the vulnerability was updated. - * - * @return the updatedAt value. - */ - @Generated - public OffsetDateTime getUpdatedAt() { - return this.updatedAt; - } - - /** - * Get the count property: The number of assets affected by the vulnerability. - * - * @return the count value. - */ - @Generated - public long getCount() { - return this.count; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("vendorProject", this.vendorProject); - jsonWriter.writeStringField("product", this.product); - jsonWriter.writeStringField("vulnerabilityName", this.vulnerabilityName); - jsonWriter.writeStringField("shortDescription", this.shortDescription); - jsonWriter.writeStringField("requiredAction", this.requiredAction); - jsonWriter.writeStringField("notes", this.notes); - jsonWriter.writeStringField("dateAdded", - this.dateAdded == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dateAdded)); - jsonWriter.writeStringField("dueDate", - this.dueDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dueDate)); - jsonWriter.writeStringField("updatedAt", - this.updatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedAt)); - jsonWriter.writeLongField("count", this.count); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CisaCveResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CisaCveResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CisaCveResult. - */ - @Generated - public static CisaCveResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String cveId = null; - String vendorProject = null; - String product = null; - String vulnerabilityName = null; - String shortDescription = null; - String requiredAction = null; - String notes = null; - OffsetDateTime dateAdded = null; - OffsetDateTime dueDate = null; - OffsetDateTime updatedAt = null; - long count = 0L; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cveId".equals(fieldName)) { - cveId = reader.getString(); - } else if ("vendorProject".equals(fieldName)) { - vendorProject = reader.getString(); - } else if ("product".equals(fieldName)) { - product = reader.getString(); - } else if ("vulnerabilityName".equals(fieldName)) { - vulnerabilityName = reader.getString(); - } else if ("shortDescription".equals(fieldName)) { - shortDescription = reader.getString(); - } else if ("requiredAction".equals(fieldName)) { - requiredAction = reader.getString(); - } else if ("notes".equals(fieldName)) { - notes = reader.getString(); - } else if ("dateAdded".equals(fieldName)) { - dateAdded = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("dueDate".equals(fieldName)) { - dueDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedAt".equals(fieldName)) { - updatedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("count".equals(fieldName)) { - count = reader.getLong(); - } else { - reader.skipChildren(); - } - } - CisaCveResult deserializedCisaCveResult = new CisaCveResult(vendorProject, product, vulnerabilityName, - shortDescription, requiredAction, notes, dateAdded, dueDate, updatedAt, count); - deserializedCisaCveResult.cveId = cveId; - - return deserializedCisaCveResult; - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAssetResource.java index 94f049bf870f..2c09f5082746 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAssetResource.java @@ -21,36 +21,16 @@ public final class ContactAssetResource extends AssetResource { /* - * asset - */ - @Generated - private final ContactAsset asset; - - /** - * Creates an instance of ContactAssetResource class. - * - * @param asset the asset value to set. - */ - @Generated - private ContactAssetResource(ContactAsset asset) { - this.asset = asset; - } - - /** - * Get the asset property: asset. - * - * @return the asset value. + * Discriminator property for AssetResource. */ @Generated - public ContactAsset getAsset() { - return this.asset; - } + private String kind = "contact"; /* - * Discriminator property for AssetResource. + * asset */ @Generated - private String kind = "contact"; + private final ContactAsset asset; /* * The caller provided unique name for the resource. @@ -124,6 +104,16 @@ public ContactAsset getAsset() { @Generated private String reason; + /** + * Creates an instance of ContactAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + private ContactAssetResource(ContactAsset asset) { + this.asset = asset; + } + /** * Get the kind property: Discriminator property for AssetResource. * @@ -135,6 +125,16 @@ public String getKind() { return this.kind; } + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public ContactAsset getAsset() { + return this.asset; + } + /** * Get the name property: The caller provided unique name for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java index 03d23d2e2f93..c61c8a688a02 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.analytics.defender.easm.models; import com.azure.core.annotation.Fluent; @@ -13,6 +12,7 @@ */ @Fluent public final class CreateOrReplaceDiscoGroupOptions { + /* * The caller provided unique name for the resource. */ @@ -69,7 +69,7 @@ public final class CreateOrReplaceDiscoGroupOptions { /** * Creates an instance of CreateOrReplaceDiscoGroupOptions class. - * + * * @param groupName the groupName value to set. */ @Generated @@ -79,7 +79,7 @@ public CreateOrReplaceDiscoGroupOptions(String groupName) { /** * Get the groupName property: The caller provided unique name for the resource. - * + * * @return the groupName value. */ @Generated @@ -89,7 +89,7 @@ public String getGroupName() { /** * Get the name property: The name for a disco group. - * + * * @return the name value. */ @Generated @@ -99,7 +99,7 @@ public String getName() { /** * Set the name property: The name for a disco group. - * + * * @param name the name value to set. * @return the CreateOrReplaceDiscoGroupOptions object itself. */ @@ -111,7 +111,7 @@ public CreateOrReplaceDiscoGroupOptions setName(String name) { /** * Get the description property: The description for a disco group. - * + * * @return the description value. */ @Generated @@ -121,7 +121,7 @@ public String getDescription() { /** * Set the description property: The description for a disco group. - * + * * @param description the description value to set. * @return the CreateOrReplaceDiscoGroupOptions object itself. */ @@ -134,7 +134,7 @@ public CreateOrReplaceDiscoGroupOptions setDescription(String description) { /** * Get the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in * this group. - * + * * @return the tier value. */ @Generated @@ -145,7 +145,7 @@ public String getTier() { /** * Set the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in * this group. - * + * * @param tier the tier value to set. * @return the CreateOrReplaceDiscoGroupOptions object itself. */ @@ -158,7 +158,7 @@ public CreateOrReplaceDiscoGroupOptions setTier(String tier) { /** * Get the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in * milliseconds. - * + * * @return the frequencyMilliseconds value. */ @Generated @@ -169,7 +169,7 @@ public Long getFrequencyMilliseconds() { /** * Set the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in * milliseconds. - * + * * @param frequencyMilliseconds the frequencyMilliseconds value to set. * @return the CreateOrReplaceDiscoGroupOptions object itself. */ @@ -181,7 +181,7 @@ public CreateOrReplaceDiscoGroupOptions setFrequencyMilliseconds(Long frequencyM /** * Get the seeds property: The list of seeds used for the disco group runs. - * + * * @return the seeds value. */ @Generated @@ -191,7 +191,7 @@ public List getSeeds() { /** * Set the seeds property: The list of seeds used for the disco group runs. - * + * * @param seeds the seeds value to set. * @return the CreateOrReplaceDiscoGroupOptions object itself. */ @@ -203,7 +203,7 @@ public CreateOrReplaceDiscoGroupOptions setSeeds(List seeds) { /** * Get the names property: The list of names used for the disco group runs. - * + * * @return the names value. */ @Generated @@ -213,7 +213,7 @@ public List getNames() { /** * Set the names property: The list of names used for the disco group runs. - * + * * @param names the names value to set. * @return the CreateOrReplaceDiscoGroupOptions object itself. */ @@ -226,7 +226,7 @@ public CreateOrReplaceDiscoGroupOptions setNames(List names) { /** * Get the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the * discovery algorithm. - * + * * @return the excludes value. */ @Generated @@ -237,7 +237,7 @@ public List getExcludes() { /** * Set the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the * discovery algorithm. - * + * * @param excludes the excludes value to set. * @return the CreateOrReplaceDiscoGroupOptions object itself. */ @@ -249,7 +249,7 @@ public CreateOrReplaceDiscoGroupOptions setExcludes(List excludes) /** * Get the templateId property: The unique identifier for the disco template used for the disco group creation. - * + * * @return the templateId value. */ @Generated @@ -259,7 +259,7 @@ public String getTemplateId() { /** * Set the templateId property: The unique identifier for the disco template used for the disco group creation. - * + * * @param templateId the templateId value to set. * @return the CreateOrReplaceDiscoGroupOptions object itself. */ diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DailyDeltaTypeResponse.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DailyDeltaTypeResponse.java deleted file mode 100644 index 3386bc65ef6a..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DailyDeltaTypeResponse.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Delta response for each day. - */ -@Immutable -public final class DailyDeltaTypeResponse extends DeltaTypeResponse { - /* - * The current number of assets for one asset kind - */ - @Generated - private final long count; - - /** - * Creates an instance of DailyDeltaTypeResponse class. - * - * @param kind the kind value to set. - * @param removed the removed value to set. - * @param added the added value to set. - * @param difference the difference value to set. - * @param count the count value to set. - */ - @Generated - private DailyDeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference, long count) { - super(kind, removed, added, difference); - this.count = count; - } - - /** - * Get the count property: The current number of assets for one asset kind. - * - * @return the count value. - */ - @Generated - public long getCount() { - return this.count; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", getKind() == null ? null : getKind().toString()); - jsonWriter.writeLongField("removed", getRemoved()); - jsonWriter.writeLongField("added", getAdded()); - jsonWriter.writeLongField("difference", getDifference()); - jsonWriter.writeLongField("count", this.count); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DailyDeltaTypeResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DailyDeltaTypeResponse if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DailyDeltaTypeResponse. - */ - @Generated - public static DailyDeltaTypeResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GlobalAssetType kind = null; - long removed = 0L; - long added = 0L; - long difference = 0L; - long count = 0L; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kind".equals(fieldName)) { - kind = GlobalAssetType.fromString(reader.getString()); - } else if ("removed".equals(fieldName)) { - removed = reader.getLong(); - } else if ("added".equals(fieldName)) { - added = reader.getLong(); - } else if ("difference".equals(fieldName)) { - difference = reader.getLong(); - } else if ("count".equals(fieldName)) { - count = reader.getLong(); - } else { - reader.skipChildren(); - } - } - return new DailyDeltaTypeResponse(kind, removed, added, difference, count); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnection.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnection.java index 99a8aa061564..2b218f6c398f 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnection.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnection.java @@ -19,6 +19,12 @@ @Immutable public class DataConnection implements JsonSerializable { + /* + * Discriminator property for DataConnection. + */ + @Generated + private String kind = "DataConnection"; + /* * The system generated unique id for the resource. */ @@ -93,249 +99,243 @@ protected DataConnection() { } /** - * Get the id property: The system generated unique id for the resource. + * Get the kind property: Discriminator property for DataConnection. * - * @return the id value. + * @return the kind value. */ @Generated - public String getId() { - return this.id; + public String getKind() { + return this.kind; } /** - * Get the name property: The caller provided unique name for the resource. + * Get the id property: The system generated unique id for the resource. * - * @return the name value. + * @return the id value. */ @Generated - public String getName() { - return this.name; + public String getId() { + return this.id; } /** - * Get the displayName property: The name that can be used for display purposes. + * Set the id property: The system generated unique id for the resource. * - * @return the displayName value. + * @param id the id value to set. + * @return the DataConnection object itself. */ @Generated - public String getDisplayName() { - return this.displayName; + DataConnection setId(String id) { + this.id = id; + return this; } /** - * Get the content property: The type of data the data connection will transfer. + * Get the name property: The caller provided unique name for the resource. * - * @return the content value. + * @return the name value. */ @Generated - public DataConnectionContent getContent() { - return this.content; + public String getName() { + return this.name; } /** - * Get the createdDate property: The date the data connection was created. + * Set the name property: The caller provided unique name for the resource. * - * @return the createdDate value. + * @param name the name value to set. + * @return the DataConnection object itself. */ @Generated - public OffsetDateTime getCreatedDate() { - return this.createdDate; + DataConnection setName(String name) { + this.name = name; + return this; } /** - * Get the frequency property: The rate at which the data connection will receive updates. + * Get the displayName property: The name that can be used for display purposes. * - * @return the frequency value. + * @return the displayName value. */ @Generated - public DataConnectionFrequency getFrequency() { - return this.frequency; + public String getDisplayName() { + return this.displayName; } /** - * Get the frequencyOffset property: The day to update the data connection on. + * Set the displayName property: The name that can be used for display purposes. * - * @return the frequencyOffset value. + * @param displayName the displayName value to set. + * @return the DataConnection object itself. */ @Generated - public Integer getFrequencyOffset() { - return this.frequencyOffset; + DataConnection setDisplayName(String displayName) { + this.displayName = displayName; + return this; } /** - * Get the updatedDate property: The date the data connection was last updated. + * Get the content property: The type of data the data connection will transfer. * - * @return the updatedDate value. + * @return the content value. */ @Generated - public OffsetDateTime getUpdatedDate() { - return this.updatedDate; + public DataConnectionContent getContent() { + return this.content; } /** - * Get the userUpdatedAt property: The date the data connection was last updated by user. + * Set the content property: The type of data the data connection will transfer. * - * @return the userUpdatedAt value. + * @param content the content value to set. + * @return the DataConnection object itself. */ @Generated - public OffsetDateTime getUserUpdatedAt() { - return this.userUpdatedAt; + DataConnection setContent(DataConnectionContent content) { + this.content = content; + return this; } /** - * Get the active property: An indicator of whether the data connection is active. + * Get the createdDate property: The date the data connection was created. * - * @return the active value. + * @return the createdDate value. */ @Generated - public Boolean isActive() { - return this.active; + public OffsetDateTime getCreatedDate() { + return this.createdDate; } /** - * Get the inactiveMessage property: A message that specifies details about data connection if inactive. + * Set the createdDate property: The date the data connection was created. * - * @return the inactiveMessage value. + * @param createdDate the createdDate value to set. + * @return the DataConnection object itself. */ @Generated - public String getInactiveMessage() { - return this.inactiveMessage; + DataConnection setCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; } - /* - * Discriminator property for DataConnection. - */ - @Generated - private String kind = "DataConnection"; - /** - * Get the kind property: Discriminator property for DataConnection. + * Get the frequency property: The rate at which the data connection will receive updates. * - * @return the kind value. + * @return the frequency value. */ @Generated - public String getKind() { - return this.kind; + public DataConnectionFrequency getFrequency() { + return this.frequency; } /** - * Set the id property: The system generated unique id for the resource. + * Set the frequency property: The rate at which the data connection will receive updates. * - * @param id the id value to set. + * @param frequency the frequency value to set. * @return the DataConnection object itself. */ @Generated - DataConnection setId(String id) { - this.id = id; + DataConnection setFrequency(DataConnectionFrequency frequency) { + this.frequency = frequency; return this; } /** - * Set the name property: The caller provided unique name for the resource. + * Get the frequencyOffset property: The day to update the data connection on. * - * @param name the name value to set. - * @return the DataConnection object itself. + * @return the frequencyOffset value. */ @Generated - DataConnection setName(String name) { - this.name = name; - return this; + public Integer getFrequencyOffset() { + return this.frequencyOffset; } /** - * Set the displayName property: The name that can be used for display purposes. + * Set the frequencyOffset property: The day to update the data connection on. * - * @param displayName the displayName value to set. + * @param frequencyOffset the frequencyOffset value to set. * @return the DataConnection object itself. */ @Generated - DataConnection setDisplayName(String displayName) { - this.displayName = displayName; + DataConnection setFrequencyOffset(Integer frequencyOffset) { + this.frequencyOffset = frequencyOffset; return this; } /** - * Set the content property: The type of data the data connection will transfer. + * Get the updatedDate property: The date the data connection was last updated. * - * @param content the content value to set. - * @return the DataConnection object itself. + * @return the updatedDate value. */ @Generated - DataConnection setContent(DataConnectionContent content) { - this.content = content; - return this; + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; } /** - * Set the createdDate property: The date the data connection was created. + * Set the updatedDate property: The date the data connection was last updated. * - * @param createdDate the createdDate value to set. + * @param updatedDate the updatedDate value to set. * @return the DataConnection object itself. */ @Generated - DataConnection setCreatedDate(OffsetDateTime createdDate) { - this.createdDate = createdDate; + DataConnection setUpdatedDate(OffsetDateTime updatedDate) { + this.updatedDate = updatedDate; return this; } /** - * Set the frequency property: The rate at which the data connection will receive updates. + * Get the userUpdatedAt property: The date the data connection was last updated by user. * - * @param frequency the frequency value to set. - * @return the DataConnection object itself. + * @return the userUpdatedAt value. */ @Generated - DataConnection setFrequency(DataConnectionFrequency frequency) { - this.frequency = frequency; - return this; + public OffsetDateTime getUserUpdatedAt() { + return this.userUpdatedAt; } /** - * Set the frequencyOffset property: The day to update the data connection on. + * Set the userUpdatedAt property: The date the data connection was last updated by user. * - * @param frequencyOffset the frequencyOffset value to set. + * @param userUpdatedAt the userUpdatedAt value to set. * @return the DataConnection object itself. */ @Generated - DataConnection setFrequencyOffset(Integer frequencyOffset) { - this.frequencyOffset = frequencyOffset; + DataConnection setUserUpdatedAt(OffsetDateTime userUpdatedAt) { + this.userUpdatedAt = userUpdatedAt; return this; } /** - * Set the updatedDate property: The date the data connection was last updated. + * Get the active property: An indicator of whether the data connection is active. * - * @param updatedDate the updatedDate value to set. - * @return the DataConnection object itself. + * @return the active value. */ @Generated - DataConnection setUpdatedDate(OffsetDateTime updatedDate) { - this.updatedDate = updatedDate; - return this; + public Boolean isActive() { + return this.active; } /** - * Set the userUpdatedAt property: The date the data connection was last updated by user. + * Set the active property: An indicator of whether the data connection is active. * - * @param userUpdatedAt the userUpdatedAt value to set. + * @param active the active value to set. * @return the DataConnection object itself. */ @Generated - DataConnection setUserUpdatedAt(OffsetDateTime userUpdatedAt) { - this.userUpdatedAt = userUpdatedAt; + DataConnection setActive(Boolean active) { + this.active = active; return this; } /** - * Set the active property: An indicator of whether the data connection is active. + * Get the inactiveMessage property: A message that specifies details about data connection if inactive. * - * @param active the active value to set. - * @return the DataConnection object itself. + * @return the inactiveMessage value. */ @Generated - DataConnection setActive(Boolean active) { - this.active = active; - return this; + public String getInactiveMessage() { + return this.inactiveMessage; } /** diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionData.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionData.java index c239540abc40..8097bf4d0d40 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionData.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionData.java @@ -17,6 +17,12 @@ @Fluent public class DataConnectionData implements JsonSerializable { + /* + * Discriminator property for DataConnectionData. + */ + @Generated + private String kind = "DataConnectionData"; + /* * The name of data connection */ @@ -48,6 +54,16 @@ public class DataConnectionData implements JsonSerializable public DataConnectionData() { } + /** + * Get the kind property: Discriminator property for DataConnectionData. + * + * @return the kind value. + */ + @Generated + public String getKind() { + return this.kind; + } + /** * Get the name property: The name of data connection. * @@ -136,22 +152,6 @@ public DataConnectionData setFrequencyOffset(Integer frequencyOffset) { return this; } - /* - * Discriminator property for DataConnectionData. - */ - @Generated - private String kind = "DataConnectionData"; - - /** - * Get the kind property: Discriminator property for DataConnectionData. - * - * @return the kind value. - */ - @Generated - public String getKind() { - return this.kind; - } - /** * {@inheritDoc} */ diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDateResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDateResult.java deleted file mode 100644 index 6aa57f96d21b..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDateResult.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Date information for the delta response. - */ -@Immutable -public final class DeltaDateResult implements JsonSerializable { - /* - * The date that is being requested - */ - @Generated - private final OffsetDateTime date; - - /* - * A list of summary counts per day - */ - @Generated - private final List deltas; - - /** - * Creates an instance of DeltaDateResult class. - * - * @param date the date value to set. - * @param deltas the deltas value to set. - */ - @Generated - private DeltaDateResult(OffsetDateTime date, List deltas) { - this.date = date; - this.deltas = deltas; - } - - /** - * Get the date property: The date that is being requested. - * - * @return the date value. - */ - @Generated - public OffsetDateTime getDate() { - return this.date; - } - - /** - * Get the deltas property: A list of summary counts per day. - * - * @return the deltas value. - */ - @Generated - public List getDeltas() { - return this.deltas; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("date", - this.date == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.date)); - jsonWriter.writeArrayField("deltas", this.deltas, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeltaDateResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeltaDateResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DeltaDateResult. - */ - @Generated - public static DeltaDateResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OffsetDateTime date = null; - List deltas = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("date".equals(fieldName)) { - date = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("deltas".equals(fieldName)) { - deltas = reader.readArray(reader1 -> DailyDeltaTypeResponse.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - return new DeltaDateResult(date, deltas); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailType.java deleted file mode 100644 index 1c407ab2ab31..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailType.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * A list of delta detail type. - */ -public final class DeltaDetailType extends ExpandableStringEnum { - /** - * added. - */ - @Generated - public static final DeltaDetailType ADDED = fromString("added"); - - /** - * removed. - */ - @Generated - public static final DeltaDetailType REMOVED = fromString("removed"); - - /** - * Creates a new instance of DeltaDetailType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public DeltaDetailType() { - } - - /** - * Creates or finds a DeltaDetailType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeltaDetailType. - */ - @Generated - public static DeltaDetailType fromString(String name) { - return fromString(name, DeltaDetailType.class); - } - - /** - * Gets known DeltaDetailType values. - * - * @return known DeltaDetailType values. - */ - @Generated - public static Collection values() { - return values(DeltaDetailType.class); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailsRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailsRequest.java deleted file mode 100644 index f49f86be42ae..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaDetailsRequest.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A request body used to retrieve a list of deltas. - */ -@Fluent -public final class DeltaDetailsRequest implements JsonSerializable { - /* - * The type of delta detail to retrieve. - */ - @Generated - private final DeltaDetailType deltaDetailType; - - /* - * The number of days prior to retrieve deltas for. - */ - @Generated - private Integer priorDays; - - /* - * The type of asset - */ - @Generated - private final GlobalAssetType kind; - - /* - * expected format to be: yyyy-MM-dd - */ - @Generated - private String date; - - /** - * Creates an instance of DeltaDetailsRequest class. - * - * @param deltaDetailType the deltaDetailType value to set. - * @param kind the kind value to set. - */ - @Generated - public DeltaDetailsRequest(DeltaDetailType deltaDetailType, GlobalAssetType kind) { - this.deltaDetailType = deltaDetailType; - this.kind = kind; - } - - /** - * Get the deltaDetailType property: The type of delta detail to retrieve. - * - * @return the deltaDetailType value. - */ - @Generated - public DeltaDetailType getDeltaDetailType() { - return this.deltaDetailType; - } - - /** - * Get the priorDays property: The number of days prior to retrieve deltas for. - * - * @return the priorDays value. - */ - @Generated - public Integer getPriorDays() { - return this.priorDays; - } - - /** - * Set the priorDays property: The number of days prior to retrieve deltas for. - * - * @param priorDays the priorDays value to set. - * @return the DeltaDetailsRequest object itself. - */ - @Generated - public DeltaDetailsRequest setPriorDays(Integer priorDays) { - this.priorDays = priorDays; - return this; - } - - /** - * Get the kind property: The type of asset. - * - * @return the kind value. - */ - @Generated - public GlobalAssetType getKind() { - return this.kind; - } - - /** - * Get the date property: expected format to be: yyyy-MM-dd. - * - * @return the date value. - */ - @Generated - public String getDate() { - return this.date; - } - - /** - * Set the date property: expected format to be: yyyy-MM-dd. - * - * @param date the date value to set. - * @return the DeltaDetailsRequest object itself. - */ - @Generated - public DeltaDetailsRequest setDate(String date) { - this.date = date; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("deltaDetailType", - this.deltaDetailType == null ? null : this.deltaDetailType.toString()); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeNumberField("priorDays", this.priorDays); - jsonWriter.writeStringField("date", this.date); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeltaDetailsRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeltaDetailsRequest if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DeltaDetailsRequest. - */ - @Generated - public static DeltaDetailsRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeltaDetailType deltaDetailType = null; - GlobalAssetType kind = null; - Integer priorDays = null; - String date = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deltaDetailType".equals(fieldName)) { - deltaDetailType = DeltaDetailType.fromString(reader.getString()); - } else if ("kind".equals(fieldName)) { - kind = GlobalAssetType.fromString(reader.getString()); - } else if ("priorDays".equals(fieldName)) { - priorDays = reader.getNullable(JsonReader::getInt); - } else if ("date".equals(fieldName)) { - date = reader.getString(); - } else { - reader.skipChildren(); - } - } - DeltaDetailsRequest deserializedDeltaDetailsRequest = new DeltaDetailsRequest(deltaDetailType, kind); - deserializedDeltaDetailsRequest.priorDays = priorDays; - deserializedDeltaDetailsRequest.date = date; - - return deserializedDeltaDetailsRequest; - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaRangeResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaRangeResult.java deleted file mode 100644 index 966071d925e1..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaRangeResult.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Contains added, removed, and difference values for the whole range either 7 or 30 days. - */ -@Immutable -public final class DeltaRangeResult implements JsonSerializable { - /* - * The range of dates requested - */ - @Generated - private final long range; - - /* - * The total amount of assets removed over a date range - */ - @Generated - private final long removed; - - /* - * The total amount of assets added over a date range - */ - @Generated - private final long added; - - /* - * The total amount of assets changed removed over a date range - */ - @Generated - private final long difference; - - /* - * A list of summary changes per asset kind - */ - @Generated - private final List kindSummaries; - - /** - * Creates an instance of DeltaRangeResult class. - * - * @param range the range value to set. - * @param removed the removed value to set. - * @param added the added value to set. - * @param difference the difference value to set. - * @param kindSummaries the kindSummaries value to set. - */ - @Generated - private DeltaRangeResult(long range, long removed, long added, long difference, - List kindSummaries) { - this.range = range; - this.removed = removed; - this.added = added; - this.difference = difference; - this.kindSummaries = kindSummaries; - } - - /** - * Get the range property: The range of dates requested. - * - * @return the range value. - */ - @Generated - public long getRange() { - return this.range; - } - - /** - * Get the removed property: The total amount of assets removed over a date range. - * - * @return the removed value. - */ - @Generated - public long getRemoved() { - return this.removed; - } - - /** - * Get the added property: The total amount of assets added over a date range. - * - * @return the added value. - */ - @Generated - public long getAdded() { - return this.added; - } - - /** - * Get the difference property: The total amount of assets changed removed over a date range. - * - * @return the difference value. - */ - @Generated - public long getDifference() { - return this.difference; - } - - /** - * Get the kindSummaries property: A list of summary changes per asset kind. - * - * @return the kindSummaries value. - */ - @Generated - public List getKindSummaries() { - return this.kindSummaries; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("range", this.range); - jsonWriter.writeLongField("removed", this.removed); - jsonWriter.writeLongField("added", this.added); - jsonWriter.writeLongField("difference", this.difference); - jsonWriter.writeArrayField("kindSummaries", this.kindSummaries, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeltaRangeResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeltaRangeResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DeltaRangeResult. - */ - @Generated - public static DeltaRangeResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - long range = 0L; - long removed = 0L; - long added = 0L; - long difference = 0L; - List kindSummaries = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("range".equals(fieldName)) { - range = reader.getLong(); - } else if ("removed".equals(fieldName)) { - removed = reader.getLong(); - } else if ("added".equals(fieldName)) { - added = reader.getLong(); - } else if ("difference".equals(fieldName)) { - difference = reader.getLong(); - } else if ("kindSummaries".equals(fieldName)) { - kindSummaries = reader.readArray(reader1 -> DeltaTypeResponse.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - return new DeltaRangeResult(range, removed, added, difference, kindSummaries); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaResult.java deleted file mode 100644 index 82ff4bf98945..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaResult.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Result for each of the delta detail response. - */ -@Immutable -public final class DeltaResult implements JsonSerializable { - /* - * Shows the asset kind - */ - @Generated - private final GlobalAssetType kind; - - /* - * Shows the asset name - */ - @Generated - private final String name; - - /* - * Shows the date when the asset was originally created - */ - @Generated - private final OffsetDateTime createdAt; - - /* - * Shows the date when the asset was last updated, usually the date the we trying to pull up the results for - */ - @Generated - private final OffsetDateTime updatedAt; - - /* - * Shows the inventory state - */ - @Generated - private final GlobalInventoryState state; - - /** - * Creates an instance of DeltaResult class. - * - * @param kind the kind value to set. - * @param name the name value to set. - * @param createdAt the createdAt value to set. - * @param updatedAt the updatedAt value to set. - * @param state the state value to set. - */ - @Generated - private DeltaResult(GlobalAssetType kind, String name, OffsetDateTime createdAt, OffsetDateTime updatedAt, - GlobalInventoryState state) { - this.kind = kind; - this.name = name; - this.createdAt = createdAt; - this.updatedAt = updatedAt; - this.state = state; - } - - /** - * Get the kind property: Shows the asset kind. - * - * @return the kind value. - */ - @Generated - public GlobalAssetType getKind() { - return this.kind; - } - - /** - * Get the name property: Shows the asset name. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the createdAt property: Shows the date when the asset was originally created. - * - * @return the createdAt value. - */ - @Generated - public OffsetDateTime getCreatedAt() { - return this.createdAt; - } - - /** - * Get the updatedAt property: Shows the date when the asset was last updated, usually the date the we trying to - * pull up the results for. - * - * @return the updatedAt value. - */ - @Generated - public OffsetDateTime getUpdatedAt() { - return this.updatedAt; - } - - /** - * Get the state property: Shows the inventory state. - * - * @return the state value. - */ - @Generated - public GlobalInventoryState getState() { - return this.state; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("createdAt", - this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); - jsonWriter.writeStringField("updatedAt", - this.updatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedAt)); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeltaResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeltaResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DeltaResult. - */ - @Generated - public static DeltaResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GlobalAssetType kind = null; - String name = null; - OffsetDateTime createdAt = null; - OffsetDateTime updatedAt = null; - GlobalInventoryState state = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kind".equals(fieldName)) { - kind = GlobalAssetType.fromString(reader.getString()); - } else if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("createdAt".equals(fieldName)) { - createdAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("updatedAt".equals(fieldName)) { - updatedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("state".equals(fieldName)) { - state = GlobalInventoryState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return new DeltaResult(kind, name, createdAt, updatedAt, state); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryRequest.java deleted file mode 100644 index 3ad46c061d51..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryRequest.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A request body used to retrieve a delta summary. - */ -@Fluent -public final class DeltaSummaryRequest implements JsonSerializable { - /* - * The number of days prior to retrieve deltas for. - */ - @Generated - private Integer priorDays; - - /* - * expected format to be: yyyy-MM-dd - */ - @Generated - private String date; - - /** - * Creates an instance of DeltaSummaryRequest class. - */ - @Generated - public DeltaSummaryRequest() { - } - - /** - * Get the priorDays property: The number of days prior to retrieve deltas for. - * - * @return the priorDays value. - */ - @Generated - public Integer getPriorDays() { - return this.priorDays; - } - - /** - * Set the priorDays property: The number of days prior to retrieve deltas for. - * - * @param priorDays the priorDays value to set. - * @return the DeltaSummaryRequest object itself. - */ - @Generated - public DeltaSummaryRequest setPriorDays(Integer priorDays) { - this.priorDays = priorDays; - return this; - } - - /** - * Get the date property: expected format to be: yyyy-MM-dd. - * - * @return the date value. - */ - @Generated - public String getDate() { - return this.date; - } - - /** - * Set the date property: expected format to be: yyyy-MM-dd. - * - * @param date the date value to set. - * @return the DeltaSummaryRequest object itself. - */ - @Generated - public DeltaSummaryRequest setDate(String date) { - this.date = date; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("priorDays", this.priorDays); - jsonWriter.writeStringField("date", this.date); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeltaSummaryRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeltaSummaryRequest if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the DeltaSummaryRequest. - */ - @Generated - public static DeltaSummaryRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeltaSummaryRequest deserializedDeltaSummaryRequest = new DeltaSummaryRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("priorDays".equals(fieldName)) { - deserializedDeltaSummaryRequest.priorDays = reader.getNullable(JsonReader::getInt); - } else if ("date".equals(fieldName)) { - deserializedDeltaSummaryRequest.date = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDeltaSummaryRequest; - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryResult.java deleted file mode 100644 index c4c708143475..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaSummaryResult.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Define response body for getting delta summary. - */ -@Immutable -public final class DeltaSummaryResult implements JsonSerializable { - /* - * Contains added, removed, and difference values for the whole range either 7 or 30 days - */ - @Generated - private final DeltaRangeResult summary; - - /* - * Contains added, removed, count, and difference values for each day - */ - @Generated - private final List daily; - - /** - * Creates an instance of DeltaSummaryResult class. - * - * @param summary the summary value to set. - * @param daily the daily value to set. - */ - @Generated - private DeltaSummaryResult(DeltaRangeResult summary, List daily) { - this.summary = summary; - this.daily = daily; - } - - /** - * Get the summary property: Contains added, removed, and difference values for the whole range either 7 or 30 days. - * - * @return the summary value. - */ - @Generated - public DeltaRangeResult getSummary() { - return this.summary; - } - - /** - * Get the daily property: Contains added, removed, count, and difference values for each day. - * - * @return the daily value. - */ - @Generated - public List getDaily() { - return this.daily; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("summary", this.summary); - jsonWriter.writeArrayField("daily", this.daily, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeltaSummaryResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeltaSummaryResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DeltaSummaryResult. - */ - @Generated - public static DeltaSummaryResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeltaRangeResult summary = null; - List daily = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("summary".equals(fieldName)) { - summary = DeltaRangeResult.fromJson(reader); - } else if ("daily".equals(fieldName)) { - daily = reader.readArray(reader1 -> DeltaDateResult.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - return new DeltaSummaryResult(summary, daily); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaTypeResponse.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaTypeResponse.java deleted file mode 100644 index 0ea0b6287066..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DeltaTypeResponse.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The type of Delta response for each asset kind. - */ -@Immutable -public class DeltaTypeResponse implements JsonSerializable { - /* - * The kind of asset - */ - @Generated - private final GlobalAssetType kind; - - /* - * The amount of assets removed for one asset kind - */ - @Generated - private final long removed; - - /* - * The amount of assets added for one asset kind - */ - @Generated - private final long added; - - /* - * The amount of assets changed for one asset kind - */ - @Generated - private final long difference; - - /** - * Creates an instance of DeltaTypeResponse class. - * - * @param kind the kind value to set. - * @param removed the removed value to set. - * @param added the added value to set. - * @param difference the difference value to set. - */ - @Generated - protected DeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference) { - this.kind = kind; - this.removed = removed; - this.added = added; - this.difference = difference; - } - - /** - * Get the kind property: The kind of asset. - * - * @return the kind value. - */ - @Generated - public GlobalAssetType getKind() { - return this.kind; - } - - /** - * Get the removed property: The amount of assets removed for one asset kind. - * - * @return the removed value. - */ - @Generated - public long getRemoved() { - return this.removed; - } - - /** - * Get the added property: The amount of assets added for one asset kind. - * - * @return the added value. - */ - @Generated - public long getAdded() { - return this.added; - } - - /** - * Get the difference property: The amount of assets changed for one asset kind. - * - * @return the difference value. - */ - @Generated - public long getDifference() { - return this.difference; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeLongField("removed", this.removed); - jsonWriter.writeLongField("added", this.added); - jsonWriter.writeLongField("difference", this.difference); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeltaTypeResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeltaTypeResponse if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DeltaTypeResponse. - */ - @Generated - public static DeltaTypeResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GlobalAssetType kind = null; - long removed = 0L; - long added = 0L; - long difference = 0L; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kind".equals(fieldName)) { - kind = GlobalAssetType.fromString(reader.getString()); - } else if ("removed".equals(fieldName)) { - removed = reader.getLong(); - } else if ("added".equals(fieldName)) { - added = reader.getLong(); - } else if ("difference".equals(fieldName)) { - difference = reader.getLong(); - } else { - reader.skipChildren(); - } - } - return new DeltaTypeResponse(kind, removed, added, difference); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupSummaryResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupSummaryResult.java deleted file mode 100644 index e8b4986b973b..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupSummaryResult.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A list of disco group summaries. - */ -@Immutable -public final class DiscoGroupSummaryResult implements JsonSerializable { - /* - * The system generated unique id for the resource. - */ - @Generated - private final String id; - - /* - * The caller provided unique name for the resource. - */ - @Generated - private final String name; - - /* - * The name that can be used for display purposes. - */ - @Generated - private final String displayName; - - /** - * Creates an instance of DiscoGroupSummaryResult class. - * - * @param id the id value to set. - * @param name the name value to set. - * @param displayName the displayName value to set. - */ - @Generated - private DiscoGroupSummaryResult(String id, String name, String displayName) { - this.id = id; - this.name = name; - this.displayName = displayName; - } - - /** - * Get the id property: The system generated unique id for the resource. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the name property: The caller provided unique name for the resource. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the displayName property: The name that can be used for display purposes. - * - * @return the displayName value. - */ - @Generated - public String getDisplayName() { - return this.displayName; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("displayName", this.displayName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoGroupSummaryResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoGroupSummaryResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoGroupSummaryResult. - */ - @Generated - public static DiscoGroupSummaryResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - String name = null; - String displayName = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - displayName = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new DiscoGroupSummaryResult(id, name, displayName); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunPageResult.java deleted file mode 100644 index a4462acaaf7d..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunPageResult.java +++ /dev/null @@ -1,69 +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.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The DiscoRunPageResult model. */ -@Immutable -public final class DiscoRunPageResult { - /* - * The total number of items available in the full result set. - */ - @Generated - @JsonProperty(value = "totalElements") - private Long totalElements; - - /* - * The link to access the next page of results. Not set if at the end of the result set. - */ - @Generated - @JsonProperty(value = "nextLink") - private String nextLink; - - /* - * The items in the current page of results. - */ - @Generated - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of DiscoRunPageResult class. */ - @Generated - private DiscoRunPageResult() {} - - /** - * Get the totalElements property: The total number of items available in the full result set. - * - * @return the totalElements value. - */ - @Generated - public Long getTotalElements() { - return this.totalElements; - } - - /** - * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result set. - * - * @return the nextLink value. - */ - @Generated - public String getNextLink() { - return this.nextLink; - } - - /** - * Get the value property: The items in the current page of results. - * - * @return the value value. - */ - @Generated - public List getValue() { - return this.value; - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAssetResource.java index 2891f5778d22..2f5bbac37775 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAssetResource.java @@ -21,36 +21,16 @@ public final class DomainAssetResource extends AssetResource { /* - * asset - */ - @Generated - private final DomainAsset asset; - - /** - * Creates an instance of DomainAssetResource class. - * - * @param asset the asset value to set. - */ - @Generated - private DomainAssetResource(DomainAsset asset) { - this.asset = asset; - } - - /** - * Get the asset property: asset. - * - * @return the asset value. + * Discriminator property for AssetResource. */ @Generated - public DomainAsset getAsset() { - return this.asset; - } + private String kind = "domain"; /* - * Discriminator property for AssetResource. + * asset */ @Generated - private String kind = "domain"; + private final DomainAsset asset; /* * The caller provided unique name for the resource. @@ -124,6 +104,16 @@ public DomainAsset getAsset() { @Generated private String reason; + /** + * Creates an instance of DomainAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + private DomainAssetResource(DomainAsset asset) { + this.asset = asset; + } + /** * Get the kind property: Discriminator property for AssetResource. * @@ -135,6 +125,16 @@ public String getKind() { return this.kind; } + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public DomainAsset getAsset() { + return this.asset; + } + /** * Get the name property: The caller provided unique name for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorResponse.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorResponse.java deleted file mode 100644 index 6b30828eaace..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorResponse.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.models.ResponseError; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A response containing error details. - */ -@Immutable -public final class ErrorResponse implements JsonSerializable { - /* - * The error object. - */ - @Generated - private final ResponseError error; - - /** - * Creates an instance of ErrorResponse class. - * - * @param error the error value to set. - */ - @Generated - private ErrorResponse(ResponseError error) { - this.error = error; - } - - /** - * Get the error property: The error object. - * - * @return the error value. - */ - @Generated - public ResponseError getError() { - return this.error; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ErrorResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ErrorResponse if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ErrorResponse. - */ - @Generated - public static ErrorResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResponseError error = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("error".equals(fieldName)) { - error = ResponseError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - return new ErrorResponse(error); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalAssetType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalAssetType.java deleted file mode 100644 index 6757410ae238..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalAssetType.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * A list of global asset type. - */ -public final class GlobalAssetType extends ExpandableStringEnum { - /** - * page. - */ - @Generated - public static final GlobalAssetType PAGE = fromString("page"); - - /** - * resource. - */ - @Generated - public static final GlobalAssetType RESOURCE = fromString("resource"); - - /** - * mail server. - */ - @Generated - public static final GlobalAssetType MAIL_SERVER = fromString("mailServer"); - - /** - * name server. - */ - @Generated - public static final GlobalAssetType NAME_SERVER = fromString("nameServer"); - - /** - * host. - */ - @Generated - public static final GlobalAssetType HOST = fromString("host"); - - /** - * domain. - */ - @Generated - public static final GlobalAssetType DOMAIN = fromString("domain"); - - /** - * ip address. - */ - @Generated - public static final GlobalAssetType IP_ADDRESS = fromString("ipAddress"); - - /** - * ip block. - */ - @Generated - public static final GlobalAssetType IP_BLOCK = fromString("ipBlock"); - - /** - * autonomous system number. - */ - @Generated - public static final GlobalAssetType AS = fromString("as"); - - /** - * contact. - */ - @Generated - public static final GlobalAssetType CONTACT = fromString("contact"); - - /** - * ssl certificate. - */ - @Generated - public static final GlobalAssetType SSL_CERT = fromString("sslCert"); - - /** - * Creates a new instance of GlobalAssetType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public GlobalAssetType() { - } - - /** - * Creates or finds a GlobalAssetType from its string representation. - * - * @param name a name to look for. - * @return the corresponding GlobalAssetType. - */ - @Generated - public static GlobalAssetType fromString(String name) { - return fromString(name, GlobalAssetType.class); - } - - /** - * Gets known GlobalAssetType values. - * - * @return known GlobalAssetType values. - */ - @Generated - public static Collection values() { - return values(GlobalAssetType.class); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalInventoryState.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalInventoryState.java deleted file mode 100644 index 0ecfcdf46d6a..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GlobalInventoryState.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * A list of global inventory states. - */ -public final class GlobalInventoryState extends ExpandableStringEnum { - /** - * candidate. - */ - @Generated - public static final GlobalInventoryState CANDIDATE = fromString("candidate"); - - /** - * candidate investigate. - */ - @Generated - public static final GlobalInventoryState CANDIDATE_INVESTIGATE = fromString("candidateInvestigate"); - - /** - * confirmed. - */ - @Generated - public static final GlobalInventoryState CONFIRMED = fromString("confirmed"); - - /** - * associated. - */ - @Generated - public static final GlobalInventoryState ASSOCIATED = fromString("associated"); - - /** - * associated partner. - */ - @Generated - public static final GlobalInventoryState ASSOCIATED_PARTNER = fromString("associatedPartner"); - - /** - * associated third party. - */ - @Generated - public static final GlobalInventoryState ASSOCIATED_THIRD_PARTY = fromString("associatedThirdParty"); - - /** - * archived. - */ - @Generated - public static final GlobalInventoryState ARCHIVED = fromString("archived"); - - /** - * dismissed. - */ - @Generated - public static final GlobalInventoryState DISMISSED = fromString("dismissed"); - - /** - * auto confirmed. - */ - @Generated - public static final GlobalInventoryState AUTOCONFIRMED = fromString("autoconfirmed"); - - /** - * Creates a new instance of GlobalInventoryState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public GlobalInventoryState() { - } - - /** - * Creates or finds a GlobalInventoryState from its string representation. - * - * @param name a name to look for. - * @return the corresponding GlobalInventoryState. - */ - @Generated - public static GlobalInventoryState fromString(String name) { - return fromString(name, GlobalInventoryState.class); - } - - /** - * Gets known GlobalInventoryState values. - * - * @return known GlobalInventoryState values. - */ - @Generated - public static Collection values() { - return values(GlobalInventoryState.class); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAssetResource.java index 4a6337895b4b..4fab520c2f17 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAssetResource.java @@ -21,36 +21,16 @@ public final class HostAssetResource extends AssetResource { /* - * asset - */ - @Generated - private final HostAsset asset; - - /** - * Creates an instance of HostAssetResource class. - * - * @param asset the asset value to set. - */ - @Generated - private HostAssetResource(HostAsset asset) { - this.asset = asset; - } - - /** - * Get the asset property: asset. - * - * @return the asset value. + * Discriminator property for AssetResource. */ @Generated - public HostAsset getAsset() { - return this.asset; - } + private String kind = "host"; /* - * Discriminator property for AssetResource. + * asset */ @Generated - private String kind = "host"; + private final HostAsset asset; /* * The caller provided unique name for the resource. @@ -124,6 +104,16 @@ public HostAsset getAsset() { @Generated private String reason; + /** + * Creates an instance of HostAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + private HostAssetResource(HostAsset asset) { + this.asset = asset; + } + /** * Get the kind property: Discriminator property for AssetResource. * @@ -135,6 +125,16 @@ public String getKind() { return this.kind; } + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public HostAsset getAsset() { + return this.asset; + } + /** * Get the name property: The caller provided unique name for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAssetResource.java index 2125a18a80c0..491165d8afc8 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAssetResource.java @@ -21,36 +21,16 @@ public final class IpAddressAssetResource extends AssetResource { /* - * asset - */ - @Generated - private final IpAddressAsset asset; - - /** - * Creates an instance of IpAddressAssetResource class. - * - * @param asset the asset value to set. - */ - @Generated - private IpAddressAssetResource(IpAddressAsset asset) { - this.asset = asset; - } - - /** - * Get the asset property: asset. - * - * @return the asset value. + * Discriminator property for AssetResource. */ @Generated - public IpAddressAsset getAsset() { - return this.asset; - } + private String kind = "ipAddress"; /* - * Discriminator property for AssetResource. + * asset */ @Generated - private String kind = "ipAddress"; + private final IpAddressAsset asset; /* * The caller provided unique name for the resource. @@ -124,6 +104,16 @@ public IpAddressAsset getAsset() { @Generated private String reason; + /** + * Creates an instance of IpAddressAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + private IpAddressAssetResource(IpAddressAsset asset) { + this.asset = asset; + } + /** * Get the kind property: Discriminator property for AssetResource. * @@ -135,6 +125,16 @@ public String getKind() { return this.kind; } + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public IpAddressAsset getAsset() { + return this.asset; + } + /** * Get the name property: The caller provided unique name for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAssetResource.java index 3ac251454dab..2d7b9c03ef9b 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAssetResource.java @@ -21,36 +21,16 @@ public final class IpBlockAssetResource extends AssetResource { /* - * asset - */ - @Generated - private final IpBlockAsset asset; - - /** - * Creates an instance of IpBlockAssetResource class. - * - * @param asset the asset value to set. - */ - @Generated - private IpBlockAssetResource(IpBlockAsset asset) { - this.asset = asset; - } - - /** - * Get the asset property: asset. - * - * @return the asset value. + * Discriminator property for AssetResource. */ @Generated - public IpBlockAsset getAsset() { - return this.asset; - } + private String kind = "ipBlock"; /* - * Discriminator property for AssetResource. + * asset */ @Generated - private String kind = "ipBlock"; + private final IpBlockAsset asset; /* * The caller provided unique name for the resource. @@ -124,6 +104,16 @@ public IpBlockAsset getAsset() { @Generated private String reason; + /** + * Creates an instance of IpBlockAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + private IpBlockAssetResource(IpBlockAsset asset) { + this.asset = asset; + } + /** * Get the kind property: Discriminator property for AssetResource. * @@ -135,6 +125,16 @@ public String getKind() { return this.kind; } + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public IpBlockAsset getAsset() { + return this.asset; + } + /** * Get the name property: The caller provided unique name for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnection.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnection.java index bc663b717558..5d664a843f27 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnection.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnection.java @@ -19,36 +19,16 @@ public final class LogAnalyticsDataConnection extends DataConnection { /* - * properties - */ - @Generated - private final LogAnalyticsDataConnectionProperties properties; - - /** - * Creates an instance of LogAnalyticsDataConnection class. - * - * @param properties the properties value to set. - */ - @Generated - private LogAnalyticsDataConnection(LogAnalyticsDataConnectionProperties properties) { - this.properties = properties; - } - - /** - * Get the properties property: properties. - * - * @return the properties value. + * Discriminator property for DataConnection. */ @Generated - public LogAnalyticsDataConnectionProperties getProperties() { - return this.properties; - } + private String kind = "logAnalytics"; /* - * Discriminator property for DataConnection. + * properties */ @Generated - private String kind = "logAnalytics"; + private final LogAnalyticsDataConnectionProperties properties; /* * The system generated unique id for the resource. @@ -110,6 +90,16 @@ public LogAnalyticsDataConnectionProperties getProperties() { @Generated private String inactiveMessage; + /** + * Creates an instance of LogAnalyticsDataConnection class. + * + * @param properties the properties value to set. + */ + @Generated + private LogAnalyticsDataConnection(LogAnalyticsDataConnectionProperties properties) { + this.properties = properties; + } + /** * Get the kind property: Discriminator property for DataConnection. * @@ -121,6 +111,16 @@ public String getKind() { return this.kind; } + /** + * Get the properties property: properties. + * + * @return the properties value. + */ + @Generated + public LogAnalyticsDataConnectionProperties getProperties() { + return this.properties; + } + /** * Get the id property: The system generated unique id for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionData.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionData.java index e56aefcb231a..63354816b6fd 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionData.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionData.java @@ -16,6 +16,12 @@ @Fluent public final class LogAnalyticsDataConnectionData extends DataConnectionData { + /* + * Discriminator property for DataConnectionData. + */ + @Generated + private String kind = "logAnalytics"; + /* * properties */ @@ -32,6 +38,17 @@ public LogAnalyticsDataConnectionData(LogAnalyticsDataConnectionProperties prope this.properties = properties; } + /** + * Get the kind property: Discriminator property for DataConnectionData. + * + * @return the kind value. + */ + @Generated + @Override + public String getKind() { + return this.kind; + } + /** * Get the properties property: properties. * @@ -82,23 +99,6 @@ public LogAnalyticsDataConnectionData setFrequencyOffset(Integer frequencyOffset return this; } - /* - * Discriminator property for DataConnectionData. - */ - @Generated - private String kind = "logAnalytics"; - - /** - * Get the kind property: Discriminator property for DataConnectionData. - * - * @return the kind value. - */ - @Generated - @Override - public String getKind() { - return this.kind; - } - /** * {@inheritDoc} */ diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPageResult.java deleted file mode 100644 index 31c61455ba10..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPageResult.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The page result response for the observation. - */ -@Immutable -public final class ObservationPageResult implements JsonSerializable { - /* - * The total number of elements. - */ - @Generated - private final long totalElements; - - /* - * The summary of observation counts by priority. - */ - @Generated - private final Map prioritySummary; - - /* - * The list of observation results. - */ - @Generated - private final List value; - - /** - * Creates an instance of ObservationPageResult class. - * - * @param totalElements the totalElements value to set. - * @param prioritySummary the prioritySummary value to set. - * @param value the value value to set. - */ - @Generated - private ObservationPageResult(long totalElements, Map prioritySummary, - List value) { - this.totalElements = totalElements; - this.prioritySummary = prioritySummary; - this.value = value; - } - - /** - * Get the totalElements property: The total number of elements. - * - * @return the totalElements value. - */ - @Generated - public long getTotalElements() { - return this.totalElements; - } - - /** - * Get the prioritySummary property: The summary of observation counts by priority. - * - * @return the prioritySummary value. - */ - @Generated - public Map getPrioritySummary() { - return this.prioritySummary; - } - - /** - * Get the value property: The list of observation results. - * - * @return the value value. - */ - @Generated - public List getValue() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("totalElements", this.totalElements); - jsonWriter.writeMapField("prioritySummary", this.prioritySummary, - (writer, element) -> writer.writeInt(element)); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ObservationPageResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ObservationPageResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ObservationPageResult. - */ - @Generated - public static ObservationPageResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - long totalElements = 0L; - Map prioritySummary = null; - List value = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("totalElements".equals(fieldName)) { - totalElements = reader.getLong(); - } else if ("prioritySummary".equals(fieldName)) { - prioritySummary = reader.readMap(reader1 -> reader1.getInt()); - } else if ("value".equals(fieldName)) { - value = reader.readArray(reader1 -> ObservationResult.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - return new ObservationPageResult(totalElements, prioritySummary, value); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPriority.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPriority.java deleted file mode 100644 index 5cdc0a716fc0..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationPriority.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * A list of observation priorities. - */ -public final class ObservationPriority extends ExpandableStringEnum { - /** - * high. - */ - @Generated - public static final ObservationPriority HIGH = fromString("high"); - - /** - * medium. - */ - @Generated - public static final ObservationPriority MEDIUM = fromString("medium"); - - /** - * low. - */ - @Generated - public static final ObservationPriority LOW = fromString("low"); - - /** - * none. - */ - @Generated - public static final ObservationPriority NONE = fromString("none"); - - /** - * Creates a new instance of ObservationPriority value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ObservationPriority() { - } - - /** - * Creates or finds a ObservationPriority from its string representation. - * - * @param name a name to look for. - * @return the corresponding ObservationPriority. - */ - @Generated - public static ObservationPriority fromString(String name) { - return fromString(name, ObservationPriority.class); - } - - /** - * Gets known ObservationPriority values. - * - * @return known ObservationPriority values. - */ - @Generated - public static Collection values() { - return values(ObservationPriority.class); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationResult.java deleted file mode 100644 index 471459abc68e..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationResult.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The result response for the observation. - */ -@Immutable -public final class ObservationResult implements JsonSerializable { - /* - * The name of the observation. - */ - @Generated - private final String name; - - /* - * The list of applicable types. - */ - @Generated - private final List types; - - /* - * The priority of the observation. - */ - @Generated - private final ObservationPriority priority; - - /* - * The CVSS v2 score. - */ - @Generated - private final double cvssScoreV2; - - /* - * The CVSS v3 score. - */ - @Generated - private final double cvssScoreV3; - - /** - * Creates an instance of ObservationResult class. - * - * @param name the name value to set. - * @param types the types value to set. - * @param priority the priority value to set. - * @param cvssScoreV2 the cvssScoreV2 value to set. - * @param cvssScoreV3 the cvssScoreV3 value to set. - */ - @Generated - private ObservationResult(String name, List types, ObservationPriority priority, - double cvssScoreV2, double cvssScoreV3) { - this.name = name; - this.types = types; - this.priority = priority; - this.cvssScoreV2 = cvssScoreV2; - this.cvssScoreV3 = cvssScoreV3; - } - - /** - * Get the name property: The name of the observation. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the types property: The list of applicable types. - * - * @return the types value. - */ - @Generated - public List getTypes() { - return this.types; - } - - /** - * Get the priority property: The priority of the observation. - * - * @return the priority value. - */ - @Generated - public ObservationPriority getPriority() { - return this.priority; - } - - /** - * Get the cvssScoreV2 property: The CVSS v2 score. - * - * @return the cvssScoreV2 value. - */ - @Generated - public double getCvssScoreV2() { - return this.cvssScoreV2; - } - - /** - * Get the cvssScoreV3 property: The CVSS v3 score. - * - * @return the cvssScoreV3 value. - */ - @Generated - public double getCvssScoreV3() { - return this.cvssScoreV3; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeArrayField("types", this.types, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeStringField("priority", this.priority == null ? null : this.priority.toString()); - jsonWriter.writeDoubleField("cvssScoreV2", this.cvssScoreV2); - jsonWriter.writeDoubleField("cvssScoreV3", this.cvssScoreV3); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ObservationResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ObservationResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ObservationResult. - */ - @Generated - public static ObservationResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String name = null; - List types = null; - ObservationPriority priority = null; - double cvssScoreV2 = 0.0; - double cvssScoreV3 = 0.0; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("types".equals(fieldName)) { - types = reader.readArray(reader1 -> ObservationType.fromString(reader1.getString())); - } else if ("priority".equals(fieldName)) { - priority = ObservationPriority.fromString(reader.getString()); - } else if ("cvssScoreV2".equals(fieldName)) { - cvssScoreV2 = reader.getDouble(); - } else if ("cvssScoreV3".equals(fieldName)) { - cvssScoreV3 = reader.getDouble(); - } else { - reader.skipChildren(); - } - } - return new ObservationResult(name, types, priority, cvssScoreV2, cvssScoreV3); - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationType.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationType.java deleted file mode 100644 index 309086621717..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservationType.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * A list of observation types. - */ -public final class ObservationType extends ExpandableStringEnum { - /** - * common vulnerabilities and exposures. - */ - @Generated - public static final ObservationType CVE = fromString("cve"); - - /** - * insight. - */ - @Generated - public static final ObservationType INSIGHT = fromString("insight"); - - /** - * Creates a new instance of ObservationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ObservationType() { - } - - /** - * Creates or finds a ObservationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ObservationType. - */ - @Generated - public static ObservationType fromString(String name) { - return fromString(name, ObservationType.class); - } - - /** - * Gets known ObservationType values. - * - * @return known ObservationType values. - */ - @Generated - public static Collection values() { - return values(ObservationType.class); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedBoolean.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedBoolean.java index 107d2d3a5a4c..7a02d9ef357b 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedBoolean.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedBoolean.java @@ -32,6 +32,30 @@ public final class ObservedBoolean extends ObservedValue { @Generated private List sources; + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + /** * Creates an instance of ObservedBoolean class. */ @@ -59,30 +83,6 @@ public List getSources() { return this.sources; } - /* - * The firstSeen property. - */ - @Generated - private OffsetDateTime firstSeen; - - /* - * The lastSeen property. - */ - @Generated - private OffsetDateTime lastSeen; - - /* - * The count property. - */ - @Generated - private Long count; - - /* - * The recent property. - */ - @Generated - private Boolean recent; - /** * Get the firstSeen property: The firstSeen property. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedHeader.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedHeader.java index 1be89b758f68..29ae99f7119d 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedHeader.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedHeader.java @@ -31,6 +31,30 @@ public final class ObservedHeader extends ObservedValue { @Generated private String headerValue; + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + /** * Creates an instance of ObservedHeader class. */ @@ -58,30 +82,6 @@ public String getHeaderValue() { return this.headerValue; } - /* - * The firstSeen property. - */ - @Generated - private OffsetDateTime firstSeen; - - /* - * The lastSeen property. - */ - @Generated - private OffsetDateTime lastSeen; - - /* - * The count property. - */ - @Generated - private Long count; - - /* - * The recent property. - */ - @Generated - private Boolean recent; - /** * Get the firstSeen property: The firstSeen property. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedInteger.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedInteger.java index 90741ad38e7b..226764ff08f3 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedInteger.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedInteger.java @@ -32,6 +32,30 @@ public final class ObservedInteger extends ObservedValue { @Generated private List sources; + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + /** * Creates an instance of ObservedInteger class. */ @@ -59,30 +83,6 @@ public List getSources() { return this.sources; } - /* - * The firstSeen property. - */ - @Generated - private OffsetDateTime firstSeen; - - /* - * The lastSeen property. - */ - @Generated - private OffsetDateTime lastSeen; - - /* - * The count property. - */ - @Generated - private Long count; - - /* - * The recent property. - */ - @Generated - private Boolean recent; - /** * Get the firstSeen property: The firstSeen property. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedIntegers.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedIntegers.java index 7ec8cc04d3d7..5744209ce382 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedIntegers.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedIntegers.java @@ -32,6 +32,30 @@ public final class ObservedIntegers extends ObservedValue { @Generated private List sources; + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + /** * Creates an instance of ObservedIntegers class. */ @@ -59,30 +83,6 @@ public List getSources() { return this.sources; } - /* - * The firstSeen property. - */ - @Generated - private OffsetDateTime firstSeen; - - /* - * The lastSeen property. - */ - @Generated - private OffsetDateTime lastSeen; - - /* - * The count property. - */ - @Generated - private Long count; - - /* - * The recent property. - */ - @Generated - private Boolean recent; - /** * Get the firstSeen property: The firstSeen property. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLocation.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLocation.java index 4bd0886118d0..f0c311ddd3ae 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLocation.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLocation.java @@ -32,6 +32,30 @@ public final class ObservedLocation extends ObservedValue { @Generated private List sources; + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + /** * Creates an instance of ObservedLocation class. */ @@ -59,30 +83,6 @@ public List getSources() { return this.sources; } - /* - * The firstSeen property. - */ - @Generated - private OffsetDateTime firstSeen; - - /* - * The lastSeen property. - */ - @Generated - private OffsetDateTime lastSeen; - - /* - * The count property. - */ - @Generated - private Long count; - - /* - * The recent property. - */ - @Generated - private Boolean recent; - /** * Get the firstSeen property: The firstSeen property. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLong.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLong.java index 555af2915938..47c8ce78e314 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLong.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLong.java @@ -32,6 +32,30 @@ public final class ObservedLong extends ObservedValue { @Generated private List sources; + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + /** * Creates an instance of ObservedLong class. */ @@ -59,30 +83,6 @@ public List getSources() { return this.sources; } - /* - * The firstSeen property. - */ - @Generated - private OffsetDateTime firstSeen; - - /* - * The lastSeen property. - */ - @Generated - private OffsetDateTime lastSeen; - - /* - * The count property. - */ - @Generated - private Long count; - - /* - * The recent property. - */ - @Generated - private Boolean recent; - /** * Get the firstSeen property: The firstSeen property. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortState.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortState.java index 579cb21edb23..c9f6e55c6366 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortState.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortState.java @@ -31,6 +31,30 @@ public final class ObservedPortState extends ObservedValue { @Generated private Integer port; + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + /** * Creates an instance of ObservedPortState class. */ @@ -58,30 +82,6 @@ public Integer getPort() { return this.port; } - /* - * The firstSeen property. - */ - @Generated - private OffsetDateTime firstSeen; - - /* - * The lastSeen property. - */ - @Generated - private OffsetDateTime lastSeen; - - /* - * The count property. - */ - @Generated - private Long count; - - /* - * The recent property. - */ - @Generated - private Boolean recent; - /** * Get the firstSeen property: The firstSeen property. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedString.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedString.java index 0dbc65708a36..7a309c1f59a8 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedString.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedString.java @@ -32,6 +32,30 @@ public final class ObservedString extends ObservedValue { @Generated private List sources; + /* + * The firstSeen property. + */ + @Generated + private OffsetDateTime firstSeen; + + /* + * The lastSeen property. + */ + @Generated + private OffsetDateTime lastSeen; + + /* + * The count property. + */ + @Generated + private Long count; + + /* + * The recent property. + */ + @Generated + private Boolean recent; + /** * Creates an instance of ObservedString class. */ @@ -59,30 +83,6 @@ public List getSources() { return this.sources; } - /* - * The firstSeen property. - */ - @Generated - private OffsetDateTime firstSeen; - - /* - * The lastSeen property. - */ - @Generated - private OffsetDateTime lastSeen; - - /* - * The count property. - */ - @Generated - private Long count; - - /* - * The recent property. - */ - @Generated - private Boolean recent; - /** * Get the firstSeen property: The firstSeen property. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedValue.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedValue.java index d0fb37f99b33..f14f99ccfd4b 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedValue.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedValue.java @@ -62,57 +62,47 @@ public OffsetDateTime getFirstSeen() { } /** - * Get the lastSeen property: The lastSeen property. - * - * @return the lastSeen value. - */ - @Generated - public OffsetDateTime getLastSeen() { - return this.lastSeen; - } - - /** - * Get the count property: The count property. + * Set the firstSeen property: The firstSeen property. * - * @return the count value. + * @param firstSeen the firstSeen value to set. + * @return the ObservedValue object itself. */ @Generated - public Long getCount() { - return this.count; + ObservedValue setFirstSeen(OffsetDateTime firstSeen) { + this.firstSeen = firstSeen; + return this; } /** - * Get the recent property: The recent property. + * Get the lastSeen property: The lastSeen property. * - * @return the recent value. + * @return the lastSeen value. */ @Generated - public Boolean isRecent() { - return this.recent; + public OffsetDateTime getLastSeen() { + return this.lastSeen; } /** - * Set the firstSeen property: The firstSeen property. + * Set the lastSeen property: The lastSeen property. * - * @param firstSeen the firstSeen value to set. + * @param lastSeen the lastSeen value to set. * @return the ObservedValue object itself. */ @Generated - ObservedValue setFirstSeen(OffsetDateTime firstSeen) { - this.firstSeen = firstSeen; + ObservedValue setLastSeen(OffsetDateTime lastSeen) { + this.lastSeen = lastSeen; return this; } /** - * Set the lastSeen property: The lastSeen property. + * Get the count property: The count property. * - * @param lastSeen the lastSeen value to set. - * @return the ObservedValue object itself. + * @return the count value. */ @Generated - ObservedValue setLastSeen(OffsetDateTime lastSeen) { - this.lastSeen = lastSeen; - return this; + public Long getCount() { + return this.count; } /** @@ -127,6 +117,16 @@ ObservedValue setCount(Long count) { return this; } + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } + /** * Set the recent property: The recent property. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetResource.java index 1fb0ddbfc83c..f4fc9f68f3a4 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetResource.java @@ -21,36 +21,16 @@ public final class PageAssetResource extends AssetResource { /* - * asset - */ - @Generated - private final PageAsset asset; - - /** - * Creates an instance of PageAssetResource class. - * - * @param asset the asset value to set. - */ - @Generated - private PageAssetResource(PageAsset asset) { - this.asset = asset; - } - - /** - * Get the asset property: asset. - * - * @return the asset value. + * Discriminator property for AssetResource. */ @Generated - public PageAsset getAsset() { - return this.asset; - } + private String kind = "page"; /* - * Discriminator property for AssetResource. + * asset */ @Generated - private String kind = "page"; + private final PageAsset asset; /* * The caller provided unique name for the resource. @@ -124,6 +104,16 @@ public PageAsset getAsset() { @Generated private String reason; + /** + * Creates an instance of PageAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + private PageAssetResource(PageAsset asset) { + this.asset = asset; + } + /** * Get the kind property: Discriminator property for AssetResource. * @@ -135,6 +125,16 @@ public String getKind() { return this.kind; } + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public PageAsset getAsset() { + return this.asset; + } + /** * Get the name property: The caller provided unique name for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotExportRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotExportRequest.java deleted file mode 100644 index b8c243380bb1..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotExportRequest.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A request body used for an asset report snapshot export. - */ -@Fluent -public final class ReportAssetSnapshotExportRequest implements JsonSerializable { - /* - * The metric to retrieve a snapshot for. - */ - @Generated - private String metric; - - /* - * The filename of the exported file. - */ - @Generated - private String fileName; - - /* - * The columns to include in the export - */ - @Generated - private List columns; - - /** - * Creates an instance of ReportAssetSnapshotExportRequest class. - */ - @Generated - public ReportAssetSnapshotExportRequest() { - } - - /** - * Get the metric property: The metric to retrieve a snapshot for. - * - * @return the metric value. - */ - @Generated - public String getMetric() { - return this.metric; - } - - /** - * Set the metric property: The metric to retrieve a snapshot for. - * - * @param metric the metric value to set. - * @return the ReportAssetSnapshotExportRequest object itself. - */ - @Generated - public ReportAssetSnapshotExportRequest setMetric(String metric) { - this.metric = metric; - return this; - } - - /** - * Get the fileName property: The filename of the exported file. - * - * @return the fileName value. - */ - @Generated - public String getFileName() { - return this.fileName; - } - - /** - * Set the fileName property: The filename of the exported file. - * - * @param fileName the fileName value to set. - * @return the ReportAssetSnapshotExportRequest object itself. - */ - @Generated - public ReportAssetSnapshotExportRequest setFileName(String fileName) { - this.fileName = fileName; - return this; - } - - /** - * Get the columns property: The columns to include in the export. - * - * @return the columns value. - */ - @Generated - public List getColumns() { - return this.columns; - } - - /** - * Set the columns property: The columns to include in the export. - * - * @param columns the columns value to set. - * @return the ReportAssetSnapshotExportRequest object itself. - */ - @Generated - public ReportAssetSnapshotExportRequest setColumns(List columns) { - this.columns = columns; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("metric", this.metric); - jsonWriter.writeStringField("fileName", this.fileName); - jsonWriter.writeArrayField("columns", this.columns, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ReportAssetSnapshotExportRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ReportAssetSnapshotExportRequest if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ReportAssetSnapshotExportRequest. - */ - @Generated - public static ReportAssetSnapshotExportRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ReportAssetSnapshotExportRequest deserializedReportAssetSnapshotExportRequest - = new ReportAssetSnapshotExportRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("metric".equals(fieldName)) { - deserializedReportAssetSnapshotExportRequest.metric = reader.getString(); - } else if ("fileName".equals(fieldName)) { - deserializedReportAssetSnapshotExportRequest.fileName = reader.getString(); - } else if ("columns".equals(fieldName)) { - List columns = reader.readArray(reader1 -> reader1.getString()); - deserializedReportAssetSnapshotExportRequest.columns = columns; - } else { - reader.skipChildren(); - } - } - - return deserializedReportAssetSnapshotExportRequest; - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetResource.java index 9829d6e48bf2..adb84552d0c9 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetResource.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetResource.java @@ -21,36 +21,16 @@ public final class SslCertAssetResource extends AssetResource { /* - * asset - */ - @Generated - private final SslCertAsset asset; - - /** - * Creates an instance of SslCertAssetResource class. - * - * @param asset the asset value to set. - */ - @Generated - private SslCertAssetResource(SslCertAsset asset) { - this.asset = asset; - } - - /** - * Get the asset property: asset. - * - * @return the asset value. + * Discriminator property for AssetResource. */ @Generated - public SslCertAsset getAsset() { - return this.asset; - } + private String kind = "sslCert"; /* - * Discriminator property for AssetResource. + * asset */ @Generated - private String kind = "sslCert"; + private final SslCertAsset asset; /* * The caller provided unique name for the resource. @@ -124,6 +104,16 @@ public SslCertAsset getAsset() { @Generated private String reason; + /** + * Creates an instance of SslCertAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + private SslCertAssetResource(SslCertAsset asset) { + this.asset = asset; + } + /** * Get the kind property: Discriminator property for AssetResource. * @@ -135,6 +125,16 @@ public String getKind() { return this.kind; } + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public SslCertAsset getAsset() { + return this.asset; + } + /** * Get the name property: The caller provided unique name for the resource. * diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/package-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/package-info.java index 792af307c557..a7de8b1a0cd1 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/package-info.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/package-info.java @@ -2,9 +2,12 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for Easm. Defender EASM discovers and maps your digital attack surface to provide - * an "outside-in" perspective using probes to discover assets. The assets are provided with detailed metadata - * associated, including vulnerabilities, configurations and web components, allowing customers to view and prioritize - * external risk. The EASM REST API enables you to develop clients that integrate with your application. + * + * Package containing the data models for Easm. + * Defender EASM discovers and maps your digital attack surface to provide an "outside-in" perspective using probes to + * discover assets. The assets are provided with detailed metadata associated, including vulnerabilities, configurations + * and web components, allowing customers to view and prioritize external risk. The EASM REST API enables you to develop + * clients that integrate with your application. + * */ package com.azure.analytics.defender.easm.models; diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/package-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/package-info.java index 442a1cfd2254..8d900f02a30a 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/package-info.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/package-info.java @@ -2,9 +2,12 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for Easm. Defender EASM discovers and maps your digital attack surface to provide an - * "outside-in" perspective using probes to discover assets. The assets are provided with detailed metadata associated, - * including vulnerabilities, configurations and web components, allowing customers to view and prioritize external - * risk. The EASM REST API enables you to develop clients that integrate with your application. + * + * Package containing the classes for Easm. + * Defender EASM discovers and maps your digital attack surface to provide an "outside-in" perspective using probes to + * discover assets. The assets are provided with detailed metadata associated, including vulnerabilities, configurations + * and web components, allowing customers to view and prioritize external risk. The EASM REST API enables you to develop + * clients that integrate with your application. + * */ package com.azure.analytics.defender.easm; diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json b/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json index d485bdeb600a..23557c6d518e 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json +++ b/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json @@ -12,41 +12,21 @@ "com.azure.analytics.defender.easm.EasmAsyncClient.createOrReplaceSavedFilterWithResponse": "Customizations.EasmClient.createOrReplaceSavedFilter", "com.azure.analytics.defender.easm.EasmAsyncClient.deleteDataConnection": "Customizations.EasmClient.deleteDataConnection", "com.azure.analytics.defender.easm.EasmAsyncClient.deleteDataConnectionWithResponse": "Customizations.EasmClient.deleteDataConnection", - "com.azure.analytics.defender.easm.EasmAsyncClient.deleteDiscoGroup": "Customizations.EasmClient.deleteDiscoGroup", - "com.azure.analytics.defender.easm.EasmAsyncClient.deleteDiscoGroupWithResponse": "Customizations.EasmClient.deleteDiscoGroup", "com.azure.analytics.defender.easm.EasmAsyncClient.deleteSavedFilter": "Customizations.EasmClient.deleteSavedFilter", "com.azure.analytics.defender.easm.EasmAsyncClient.deleteSavedFilterWithResponse": "Customizations.EasmClient.deleteSavedFilter", - "com.azure.analytics.defender.easm.EasmAsyncClient.dismissAssetChain": "Customizations.EasmClient.dismissAssetChain", - "com.azure.analytics.defender.easm.EasmAsyncClient.dismissAssetChainWithResponse": "Customizations.EasmClient.dismissAssetChain", - "com.azure.analytics.defender.easm.EasmAsyncClient.downloadTask": "Customizations.EasmClient.downloadTask", - "com.azure.analytics.defender.easm.EasmAsyncClient.downloadTaskWithResponse": "Customizations.EasmClient.downloadTask", - "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetChainSummary": "Customizations.EasmClient.getAssetChainSummary", - "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetChainSummaryWithResponse": "Customizations.EasmClient.getAssetChainSummary", "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetResource": "Customizations.EasmClient.getAssetResource", "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetResourceWithResponse": "Customizations.EasmClient.getAssetResource", - "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetsExport": "Customizations.EasmClient.getAssetsExport", - "com.azure.analytics.defender.easm.EasmAsyncClient.getAssetsExportWithResponse": "Customizations.EasmClient.getAssetsExport", "com.azure.analytics.defender.easm.EasmAsyncClient.getBillable": "Customizations.EasmClient.getBillable", "com.azure.analytics.defender.easm.EasmAsyncClient.getBillableWithResponse": "Customizations.EasmClient.getBillable", - "com.azure.analytics.defender.easm.EasmAsyncClient.getCisaCve": "Customizations.EasmClient.getCisaCve", - "com.azure.analytics.defender.easm.EasmAsyncClient.getCisaCveWithResponse": "Customizations.EasmClient.getCisaCve", - "com.azure.analytics.defender.easm.EasmAsyncClient.getCisaCves": "Customizations.EasmClient.getCisaCves", "com.azure.analytics.defender.easm.EasmAsyncClient.getDataConnection": "Customizations.EasmClient.getDataConnection", "com.azure.analytics.defender.easm.EasmAsyncClient.getDataConnectionWithResponse": "Customizations.EasmClient.getDataConnection", - "com.azure.analytics.defender.easm.EasmAsyncClient.getDeltaDetails": "Customizations.EasmClient.getDeltaDetails", - "com.azure.analytics.defender.easm.EasmAsyncClient.getDeltaSummary": "Customizations.EasmClient.getDeltaSummary", - "com.azure.analytics.defender.easm.EasmAsyncClient.getDeltaSummaryWithResponse": "Customizations.EasmClient.getDeltaSummary", "com.azure.analytics.defender.easm.EasmAsyncClient.getDiscoGroup": "Customizations.EasmClient.getDiscoGroup", "com.azure.analytics.defender.easm.EasmAsyncClient.getDiscoGroupWithResponse": "Customizations.EasmClient.getDiscoGroup", "com.azure.analytics.defender.easm.EasmAsyncClient.getDiscoTemplate": "Customizations.EasmClient.getDiscoTemplate", "com.azure.analytics.defender.easm.EasmAsyncClient.getDiscoTemplateWithResponse": "Customizations.EasmClient.getDiscoTemplate", - "com.azure.analytics.defender.easm.EasmAsyncClient.getObservations": "Customizations.EasmClient.getObservations", - "com.azure.analytics.defender.easm.EasmAsyncClient.getObservationsWithResponse": "Customizations.EasmClient.getObservations", "com.azure.analytics.defender.easm.EasmAsyncClient.getSavedFilter": "Customizations.EasmClient.getSavedFilter", "com.azure.analytics.defender.easm.EasmAsyncClient.getSavedFilterWithResponse": "Customizations.EasmClient.getSavedFilter", "com.azure.analytics.defender.easm.EasmAsyncClient.getSnapshot": "Customizations.EasmClient.getSnapshot", - "com.azure.analytics.defender.easm.EasmAsyncClient.getSnapshotExport": "Customizations.EasmClient.getSnapshotExport", - "com.azure.analytics.defender.easm.EasmAsyncClient.getSnapshotExportWithResponse": "Customizations.EasmClient.getSnapshotExport", "com.azure.analytics.defender.easm.EasmAsyncClient.getSnapshotWithResponse": "Customizations.EasmClient.getSnapshot", "com.azure.analytics.defender.easm.EasmAsyncClient.getSummary": "Customizations.EasmClient.getSummary", "com.azure.analytics.defender.easm.EasmAsyncClient.getSummaryWithResponse": "Customizations.EasmClient.getSummary", @@ -61,8 +41,6 @@ "com.azure.analytics.defender.easm.EasmAsyncClient.listTask": "Customizations.EasmClient.listTask", "com.azure.analytics.defender.easm.EasmAsyncClient.runDiscoGroup": "Customizations.EasmClient.runDiscoGroup", "com.azure.analytics.defender.easm.EasmAsyncClient.runDiscoGroupWithResponse": "Customizations.EasmClient.runDiscoGroup", - "com.azure.analytics.defender.easm.EasmAsyncClient.runTask": "Customizations.EasmClient.runTask", - "com.azure.analytics.defender.easm.EasmAsyncClient.runTaskWithResponse": "Customizations.EasmClient.runTask", "com.azure.analytics.defender.easm.EasmAsyncClient.updateAssets": "Customizations.EasmClient.updateAssets", "com.azure.analytics.defender.easm.EasmAsyncClient.updateAssetsWithResponse": "Customizations.EasmClient.updateAssets", "com.azure.analytics.defender.easm.EasmAsyncClient.validateDataConnection": "Customizations.EasmClient.validateDataConnection", @@ -80,41 +58,21 @@ "com.azure.analytics.defender.easm.EasmClient.createOrReplaceSavedFilterWithResponse": "Customizations.EasmClient.createOrReplaceSavedFilter", "com.azure.analytics.defender.easm.EasmClient.deleteDataConnection": "Customizations.EasmClient.deleteDataConnection", "com.azure.analytics.defender.easm.EasmClient.deleteDataConnectionWithResponse": "Customizations.EasmClient.deleteDataConnection", - "com.azure.analytics.defender.easm.EasmClient.deleteDiscoGroup": "Customizations.EasmClient.deleteDiscoGroup", - "com.azure.analytics.defender.easm.EasmClient.deleteDiscoGroupWithResponse": "Customizations.EasmClient.deleteDiscoGroup", "com.azure.analytics.defender.easm.EasmClient.deleteSavedFilter": "Customizations.EasmClient.deleteSavedFilter", "com.azure.analytics.defender.easm.EasmClient.deleteSavedFilterWithResponse": "Customizations.EasmClient.deleteSavedFilter", - "com.azure.analytics.defender.easm.EasmClient.dismissAssetChain": "Customizations.EasmClient.dismissAssetChain", - "com.azure.analytics.defender.easm.EasmClient.dismissAssetChainWithResponse": "Customizations.EasmClient.dismissAssetChain", - "com.azure.analytics.defender.easm.EasmClient.downloadTask": "Customizations.EasmClient.downloadTask", - "com.azure.analytics.defender.easm.EasmClient.downloadTaskWithResponse": "Customizations.EasmClient.downloadTask", - "com.azure.analytics.defender.easm.EasmClient.getAssetChainSummary": "Customizations.EasmClient.getAssetChainSummary", - "com.azure.analytics.defender.easm.EasmClient.getAssetChainSummaryWithResponse": "Customizations.EasmClient.getAssetChainSummary", "com.azure.analytics.defender.easm.EasmClient.getAssetResource": "Customizations.EasmClient.getAssetResource", "com.azure.analytics.defender.easm.EasmClient.getAssetResourceWithResponse": "Customizations.EasmClient.getAssetResource", - "com.azure.analytics.defender.easm.EasmClient.getAssetsExport": "Customizations.EasmClient.getAssetsExport", - "com.azure.analytics.defender.easm.EasmClient.getAssetsExportWithResponse": "Customizations.EasmClient.getAssetsExport", "com.azure.analytics.defender.easm.EasmClient.getBillable": "Customizations.EasmClient.getBillable", "com.azure.analytics.defender.easm.EasmClient.getBillableWithResponse": "Customizations.EasmClient.getBillable", - "com.azure.analytics.defender.easm.EasmClient.getCisaCve": "Customizations.EasmClient.getCisaCve", - "com.azure.analytics.defender.easm.EasmClient.getCisaCveWithResponse": "Customizations.EasmClient.getCisaCve", - "com.azure.analytics.defender.easm.EasmClient.getCisaCves": "Customizations.EasmClient.getCisaCves", "com.azure.analytics.defender.easm.EasmClient.getDataConnection": "Customizations.EasmClient.getDataConnection", "com.azure.analytics.defender.easm.EasmClient.getDataConnectionWithResponse": "Customizations.EasmClient.getDataConnection", - "com.azure.analytics.defender.easm.EasmClient.getDeltaDetails": "Customizations.EasmClient.getDeltaDetails", - "com.azure.analytics.defender.easm.EasmClient.getDeltaSummary": "Customizations.EasmClient.getDeltaSummary", - "com.azure.analytics.defender.easm.EasmClient.getDeltaSummaryWithResponse": "Customizations.EasmClient.getDeltaSummary", "com.azure.analytics.defender.easm.EasmClient.getDiscoGroup": "Customizations.EasmClient.getDiscoGroup", "com.azure.analytics.defender.easm.EasmClient.getDiscoGroupWithResponse": "Customizations.EasmClient.getDiscoGroup", "com.azure.analytics.defender.easm.EasmClient.getDiscoTemplate": "Customizations.EasmClient.getDiscoTemplate", "com.azure.analytics.defender.easm.EasmClient.getDiscoTemplateWithResponse": "Customizations.EasmClient.getDiscoTemplate", - "com.azure.analytics.defender.easm.EasmClient.getObservations": "Customizations.EasmClient.getObservations", - "com.azure.analytics.defender.easm.EasmClient.getObservationsWithResponse": "Customizations.EasmClient.getObservations", "com.azure.analytics.defender.easm.EasmClient.getSavedFilter": "Customizations.EasmClient.getSavedFilter", "com.azure.analytics.defender.easm.EasmClient.getSavedFilterWithResponse": "Customizations.EasmClient.getSavedFilter", "com.azure.analytics.defender.easm.EasmClient.getSnapshot": "Customizations.EasmClient.getSnapshot", - "com.azure.analytics.defender.easm.EasmClient.getSnapshotExport": "Customizations.EasmClient.getSnapshotExport", - "com.azure.analytics.defender.easm.EasmClient.getSnapshotExportWithResponse": "Customizations.EasmClient.getSnapshotExport", "com.azure.analytics.defender.easm.EasmClient.getSnapshotWithResponse": "Customizations.EasmClient.getSnapshot", "com.azure.analytics.defender.easm.EasmClient.getSummary": "Customizations.EasmClient.getSummary", "com.azure.analytics.defender.easm.EasmClient.getSummaryWithResponse": "Customizations.EasmClient.getSummary", @@ -129,8 +87,6 @@ "com.azure.analytics.defender.easm.EasmClient.listTask": "Customizations.EasmClient.listTask", "com.azure.analytics.defender.easm.EasmClient.runDiscoGroup": "Customizations.EasmClient.runDiscoGroup", "com.azure.analytics.defender.easm.EasmClient.runDiscoGroupWithResponse": "Customizations.EasmClient.runDiscoGroup", - "com.azure.analytics.defender.easm.EasmClient.runTask": "Customizations.EasmClient.runTask", - "com.azure.analytics.defender.easm.EasmClient.runTaskWithResponse": "Customizations.EasmClient.runTask", "com.azure.analytics.defender.easm.EasmClient.updateAssets": "Customizations.EasmClient.updateAssets", "com.azure.analytics.defender.easm.EasmClient.updateAssetsWithResponse": "Customizations.EasmClient.updateAssets", "com.azure.analytics.defender.easm.EasmClient.validateDataConnection": "Customizations.EasmClient.validateDataConnection", @@ -142,21 +98,14 @@ "com.azure.analytics.defender.easm.models.AlexaDetails": "Easm.AlexaInfo", "com.azure.analytics.defender.easm.models.AsAsset": "Easm.AsAsset", "com.azure.analytics.defender.easm.models.AsAssetResource": "Easm.AsAssetResource", - "com.azure.analytics.defender.easm.models.AssetChainKindSummaryResult": "Easm.AssetChainKindSummaryResult", - "com.azure.analytics.defender.easm.models.AssetChainRequest": "Easm.AssetChainRequest", - "com.azure.analytics.defender.easm.models.AssetChainSource": "Easm.AssetChainSource", - "com.azure.analytics.defender.easm.models.AssetChainSummaryResult": "Easm.AssetChainSummaryResult", - "com.azure.analytics.defender.easm.models.AssetKind": "Easm.AssetKind", "com.azure.analytics.defender.easm.models.AssetPageResult": "Easm.AssetPageResult", "com.azure.analytics.defender.easm.models.AssetResource": "Easm.AssetResource", - "com.azure.analytics.defender.easm.models.AssetResponseType": "Easm.AssetResponseType", "com.azure.analytics.defender.easm.models.AssetSecurityPolicy": "Easm.AssetSecurityPolicy", "com.azure.analytics.defender.easm.models.AssetState": "Easm.AssetState", "com.azure.analytics.defender.easm.models.AssetSummaryResult": "Easm.AssetSummaryResult", "com.azure.analytics.defender.easm.models.AssetUpdateData": "Easm.AssetUpdateData", "com.azure.analytics.defender.easm.models.AssetUpdateState": "Easm.AssetUpdateState", "com.azure.analytics.defender.easm.models.AssetUpdateTransfers": "Easm.AssetUpdateTransfers", - "com.azure.analytics.defender.easm.models.AssetsExportRequest": "Easm.AssetsExportRequest", "com.azure.analytics.defender.easm.models.Attribute": "Easm.Attribute", "com.azure.analytics.defender.easm.models.AuditTrailItem": "Easm.AuditTrailItem", "com.azure.analytics.defender.easm.models.AuditTrailItemKind": "Easm.AuditTrailItemKind", @@ -164,31 +113,20 @@ "com.azure.analytics.defender.easm.models.AzureDataExplorerDataConnectionData": "Easm.AzureDataExplorerDataConnectionData", "com.azure.analytics.defender.easm.models.AzureDataExplorerDataConnectionProperties": "Easm.AzureDataExplorerDataConnectionProperties", "com.azure.analytics.defender.easm.models.Banner": "Easm.Banner", - "com.azure.analytics.defender.easm.models.CisaCveResult": "Easm.CisaCveResult", "com.azure.analytics.defender.easm.models.ContactAsset": "Easm.ContactAsset", "com.azure.analytics.defender.easm.models.ContactAssetResource": "Easm.ContactAssetResource", "com.azure.analytics.defender.easm.models.Cookie": "Easm.Cookie", "com.azure.analytics.defender.easm.models.CreateOrReplaceDiscoGroupOptions": "null", "com.azure.analytics.defender.easm.models.Cve": "Easm.Cve", "com.azure.analytics.defender.easm.models.Cvss3Summary": "Easm.Cvss3Summary", - "com.azure.analytics.defender.easm.models.DailyDeltaTypeResponse": "Easm.DailyDeltaTypeResponse", "com.azure.analytics.defender.easm.models.DataConnection": "Easm.DataConnection", "com.azure.analytics.defender.easm.models.DataConnectionContent": "Easm.DataConnectionContent", "com.azure.analytics.defender.easm.models.DataConnectionData": "Easm.DataConnectionData", "com.azure.analytics.defender.easm.models.DataConnectionFrequency": "Easm.DataConnectionFrequency", "com.azure.analytics.defender.easm.models.DataConnectionProperties": "Easm.DataConnectionProperties", - "com.azure.analytics.defender.easm.models.DeltaDateResult": "Easm.DeltaDateResult", - "com.azure.analytics.defender.easm.models.DeltaDetailType": "Easm.DeltaDetailType", - "com.azure.analytics.defender.easm.models.DeltaDetailsRequest": "Easm.DeltaDetailsRequest", - "com.azure.analytics.defender.easm.models.DeltaRangeResult": "Easm.DeltaRangeResult", - "com.azure.analytics.defender.easm.models.DeltaResult": "Easm.DeltaResult", - "com.azure.analytics.defender.easm.models.DeltaSummaryRequest": "Easm.DeltaSummaryRequest", - "com.azure.analytics.defender.easm.models.DeltaSummaryResult": "Easm.DeltaSummaryResult", - "com.azure.analytics.defender.easm.models.DeltaTypeResponse": "Easm.DeltaTypeResponse", "com.azure.analytics.defender.easm.models.DependentResource": "Easm.DependentResource", "com.azure.analytics.defender.easm.models.DiscoGroup": "Easm.DiscoGroup", "com.azure.analytics.defender.easm.models.DiscoGroupData": "Easm.DiscoGroupData", - "com.azure.analytics.defender.easm.models.DiscoGroupSummaryResult": "Easm.DiscoGroupSummaryResult", "com.azure.analytics.defender.easm.models.DiscoRunResult": "Easm.DiscoRunResult", "com.azure.analytics.defender.easm.models.DiscoRunState": "Easm.DiscoRunState", "com.azure.analytics.defender.easm.models.DiscoSource": "Easm.DiscoSource", @@ -197,9 +135,6 @@ "com.azure.analytics.defender.easm.models.DomainAsset": "Easm.DomainAsset", "com.azure.analytics.defender.easm.models.DomainAssetResource": "Easm.DomainAssetResource", "com.azure.analytics.defender.easm.models.ErrorDetail": "Easm.ErrorDetail", - "com.azure.analytics.defender.easm.models.ErrorResponse": "Azure.Core.Foundations.ErrorResponse", - "com.azure.analytics.defender.easm.models.GlobalAssetType": "Easm.GlobalAssetType", - "com.azure.analytics.defender.easm.models.GlobalInventoryState": "Easm.GlobalInventoryState", "com.azure.analytics.defender.easm.models.GuidPair": "Easm.GuidPair", "com.azure.analytics.defender.easm.models.HostAsset": "Easm.HostAsset", "com.azure.analytics.defender.easm.models.HostAssetResource": "Easm.HostAssetResource", @@ -215,10 +150,6 @@ "com.azure.analytics.defender.easm.models.LogAnalyticsDataConnection": "Easm.LogAnalyticsDataConnection", "com.azure.analytics.defender.easm.models.LogAnalyticsDataConnectionData": "Easm.LogAnalyticsDataConnectionData", "com.azure.analytics.defender.easm.models.LogAnalyticsDataConnectionProperties": "Easm.LogAnalyticsDataConnectionProperties", - "com.azure.analytics.defender.easm.models.ObservationPageResult": "Easm.ObservationPageResult", - "com.azure.analytics.defender.easm.models.ObservationPriority": "Easm.ObservationPriority", - "com.azure.analytics.defender.easm.models.ObservationResult": "Easm.ObservationResult", - "com.azure.analytics.defender.easm.models.ObservationType": "Easm.ObservationType", "com.azure.analytics.defender.easm.models.ObservedBoolean": "Easm.ObservedBoolean", "com.azure.analytics.defender.easm.models.ObservedHeader": "Easm.ObservedHeader", "com.azure.analytics.defender.easm.models.ObservedInteger": "Easm.ObservedInteger", @@ -234,7 +165,6 @@ "com.azure.analytics.defender.easm.models.PageAssetResource": "Easm.PageAssetResource", "com.azure.analytics.defender.easm.models.PageCause": "Easm.PageCause", "com.azure.analytics.defender.easm.models.Port": "Easm.Port", - "com.azure.analytics.defender.easm.models.ReportAssetSnapshotExportRequest": "Easm.ReportAssetSnapshotExportRequest", "com.azure.analytics.defender.easm.models.ReportAssetSnapshotRequest": "Easm.ReportAssetSnapshotRequest", "com.azure.analytics.defender.easm.models.ReportAssetSnapshotResult": "Easm.ReportAssetSnapshotResult", "com.azure.analytics.defender.easm.models.ReportAssetSummaryRequest": "Easm.ReportAssetSummaryRequest", From f411a1fd6fcdaa0ae4660e2276763d9db7599fdf Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 16 Jul 2024 12:29:19 +0800 Subject: [PATCH 04/11] regen --- .../azure-analytics-defender-easm/README.md | 6 -- .../defender/easm/EasmAsyncClient.java | 67 ++++++++----------- .../analytics/defender/easm/EasmClient.java | 66 +++++++----------- .../easm/implementation/EasmClientImpl.java | 29 ++++---- ...tics-defender-easm_apiview_properties.json | 2 - .../tsp-location.yaml | 2 +- 6 files changed, 67 insertions(+), 105 deletions(-) diff --git a/sdk/easm/azure-analytics-defender-easm/README.md b/sdk/easm/azure-analytics-defender-easm/README.md index f33ccf5b43fd..4a4e3050a0e5 100644 --- a/sdk/easm/azure-analytics-defender-easm/README.md +++ b/sdk/easm/azure-analytics-defender-easm/README.md @@ -57,16 +57,10 @@ Custom discoveries are organized into Discovery Groups. They are independent see ## Examples ```java readme-sample-createDefenderEasmClient -String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); -String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); -String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); String endpoint = Configuration.getGlobalConfiguration().get("ENDPOINT"); EasmClient easmClient = new EasmClientBuilder() .endpoint(endpoint) - .subscriptionId(subscriptionId) - .workspaceName(workspaceName) - .resourceGroupName(resourceGroupName) .credential(new DefaultAzureCredentialBuilder().build()) .buildClient(); ``` diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java index 829bc4c87050..5caa97cedb8a 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java @@ -4,10 +4,8 @@ package com.azure.analytics.defender.easm; import com.azure.analytics.defender.easm.implementation.EasmClientImpl; -import com.azure.analytics.defender.easm.implementation.models.CreateOrReplaceDiscoGroupRequest; import com.azure.analytics.defender.easm.models.AssetResource; import com.azure.analytics.defender.easm.models.AssetUpdateData; -import com.azure.analytics.defender.easm.models.CreateOrReplaceDiscoGroupOptions; import com.azure.analytics.defender.easm.models.DataConnection; import com.azure.analytics.defender.easm.models.DataConnectionData; import com.azure.analytics.defender.easm.models.DiscoGroup; @@ -670,7 +668,7 @@ public Mono> getDiscoGroupWithResponse(String groupName, Re * }
* * @param groupName The caller provided unique name for the resource. - * @param createOrReplaceDiscoGroupRequest The createOrReplaceDiscoGroupRequest parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -680,10 +678,9 @@ public Mono> getDiscoGroupWithResponse(String groupName, Re */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrReplaceDiscoGroupWithResponse(String groupName, - BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceDiscoGroupWithResponseAsync(groupName, - createOrReplaceDiscoGroupRequest, requestOptions); + public Mono> createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDiscoGroupWithResponseAsync(groupName, body, requestOptions); } /** @@ -1620,39 +1617,6 @@ public Mono getDiscoGroup(String groupName) { .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class)); } - /** - * Create a discovery group with a given groupName. - * - * @param options Options for createOrReplaceDiscoGroup API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrReplaceDiscoGroup(CreateOrReplaceDiscoGroupOptions options) { - // Generated convenience method for createOrReplaceDiscoGroupWithResponse - RequestOptions requestOptions = new RequestOptions(); - String groupName = options.getGroupName(); - CreateOrReplaceDiscoGroupRequest createOrReplaceDiscoGroupRequestObj - = new CreateOrReplaceDiscoGroupRequest().setName(options.getName()) - .setDescription(options.getDescription()) - .setTier(options.getTier()) - .setFrequencyMilliseconds(options.getFrequencyMilliseconds()) - .setSeeds(options.getSeeds()) - .setNames(options.getNames()) - .setExcludes(options.getExcludes()) - .setTemplateId(options.getTemplateId()); - BinaryData createOrReplaceDiscoGroupRequest = BinaryData.fromObject(createOrReplaceDiscoGroupRequestObj); - return createOrReplaceDiscoGroupWithResponse(groupName, createOrReplaceDiscoGroupRequest, requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class)); - } - /** * Run a discovery group with a given groupName. * @@ -2144,4 +2108,27 @@ public Mono cancelTask(String taskId) { return cancelTaskWithResponse(taskId, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); } + + /** + * Create a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrReplaceDiscoGroup(String groupName, DiscoGroupData body) { + // Generated convenience method for createOrReplaceDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(body), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class)); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java index 22cc64591411..42efe3cc6971 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java @@ -4,10 +4,8 @@ package com.azure.analytics.defender.easm; import com.azure.analytics.defender.easm.implementation.EasmClientImpl; -import com.azure.analytics.defender.easm.implementation.models.CreateOrReplaceDiscoGroupRequest; import com.azure.analytics.defender.easm.models.AssetResource; import com.azure.analytics.defender.easm.models.AssetUpdateData; -import com.azure.analytics.defender.easm.models.CreateOrReplaceDiscoGroupOptions; import com.azure.analytics.defender.easm.models.DataConnection; import com.azure.analytics.defender.easm.models.DataConnectionData; import com.azure.analytics.defender.easm.models.DiscoGroup; @@ -658,7 +656,7 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO * }
* * @param groupName The caller provided unique name for the resource. - * @param createOrReplaceDiscoGroupRequest The createOrReplaceDiscoGroupRequest parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -668,10 +666,9 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceDiscoGroupWithResponse(String groupName, - BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceDiscoGroupWithResponse(groupName, createOrReplaceDiscoGroupRequest, - requestOptions); + public Response createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDiscoGroupWithResponse(groupName, body, requestOptions); } /** @@ -1534,39 +1531,6 @@ public DiscoGroup getDiscoGroup(String groupName) { return getDiscoGroupWithResponse(groupName, requestOptions).getValue().toObject(DiscoGroup.class); } - /** - * Create a discovery group with a given groupName. - * - * @param options Options for createOrReplaceDiscoGroup API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoGroup createOrReplaceDiscoGroup(CreateOrReplaceDiscoGroupOptions options) { - // Generated convenience method for createOrReplaceDiscoGroupWithResponse - RequestOptions requestOptions = new RequestOptions(); - String groupName = options.getGroupName(); - CreateOrReplaceDiscoGroupRequest createOrReplaceDiscoGroupRequestObj - = new CreateOrReplaceDiscoGroupRequest().setName(options.getName()) - .setDescription(options.getDescription()) - .setTier(options.getTier()) - .setFrequencyMilliseconds(options.getFrequencyMilliseconds()) - .setSeeds(options.getSeeds()) - .setNames(options.getNames()) - .setExcludes(options.getExcludes()) - .setTemplateId(options.getTemplateId()); - BinaryData createOrReplaceDiscoGroupRequest = BinaryData.fromObject(createOrReplaceDiscoGroupRequestObj); - return createOrReplaceDiscoGroupWithResponse(groupName, createOrReplaceDiscoGroupRequest, requestOptions) - .getValue() - .toObject(DiscoGroup.class); - } - /** * Run a discovery group with a given groupName. * @@ -1960,4 +1924,26 @@ public Task cancelTask(String taskId) { RequestOptions requestOptions = new RequestOptions(); return cancelTaskWithResponse(taskId, requestOptions).getValue().toObject(Task.class); } + + /** + * Create a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DiscoGroup createOrReplaceDiscoGroup(String groupName, DiscoGroupData body) { + // Generated convenience method for createOrReplaceDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(body), requestOptions).getValue() + .toObject(DiscoGroup.class); + } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java index 44dde899f121..f37991d698d7 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java @@ -393,9 +393,8 @@ Response getDiscoGroupSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrReplaceDiscoGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/discoGroups/{groupName}") @ExpectedResponses({ 200 }) @@ -405,9 +404,8 @@ Mono> createOrReplaceDiscoGroup(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrReplaceDiscoGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Post("/discoGroups/{groupName}:run") @ExpectedResponses({ 204 }) @@ -2489,7 +2487,7 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO * }
* * @param groupName The caller provided unique name for the resource. - * @param createOrReplaceDiscoGroupRequest The createOrReplaceDiscoGroupRequest parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2498,12 +2496,11 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrReplaceDiscoGroupWithResponseAsync(String groupName, - BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions) { + public Mono> createOrReplaceDiscoGroupWithResponseAsync(String groupName, BinaryData body, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createOrReplaceDiscoGroup(this.getEndpoint(), this.getServiceVersion().getVersion(), - groupName, accept, createOrReplaceDiscoGroupRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.createOrReplaceDiscoGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), groupName, accept, body, requestOptions, context)); } /** @@ -2577,7 +2574,7 @@ public Mono> createOrReplaceDiscoGroupWithResponseAsync(Str * }
* * @param groupName The caller provided unique name for the resource. - * @param createOrReplaceDiscoGroupRequest The createOrReplaceDiscoGroupRequest parameter. + * @param body Body parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2586,11 +2583,11 @@ public Mono> createOrReplaceDiscoGroupWithResponseAsync(Str * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceDiscoGroupWithResponse(String groupName, - BinaryData createOrReplaceDiscoGroupRequest, RequestOptions requestOptions) { + public Response createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData body, + RequestOptions requestOptions) { final String accept = "application/json"; return service.createOrReplaceDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - groupName, accept, createOrReplaceDiscoGroupRequest, requestOptions, Context.NONE); + groupName, accept, body, requestOptions, Context.NONE); } /** diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json b/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json index 23557c6d518e..9c915ec53fa1 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json +++ b/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json @@ -94,7 +94,6 @@ "com.azure.analytics.defender.easm.EasmClient.validateDiscoGroup": "Customizations.EasmClient.validateDiscoGroup", "com.azure.analytics.defender.easm.EasmClient.validateDiscoGroupWithResponse": "Customizations.EasmClient.validateDiscoGroup", "com.azure.analytics.defender.easm.EasmClientBuilder": "Easm.EasmClient", - "com.azure.analytics.defender.easm.implementation.models.CreateOrReplaceDiscoGroupRequest": "createOrReplaceDiscoGroup.Request.anonymous", "com.azure.analytics.defender.easm.models.AlexaDetails": "Easm.AlexaInfo", "com.azure.analytics.defender.easm.models.AsAsset": "Easm.AsAsset", "com.azure.analytics.defender.easm.models.AsAssetResource": "Easm.AsAssetResource", @@ -116,7 +115,6 @@ "com.azure.analytics.defender.easm.models.ContactAsset": "Easm.ContactAsset", "com.azure.analytics.defender.easm.models.ContactAssetResource": "Easm.ContactAssetResource", "com.azure.analytics.defender.easm.models.Cookie": "Easm.Cookie", - "com.azure.analytics.defender.easm.models.CreateOrReplaceDiscoGroupOptions": "null", "com.azure.analytics.defender.easm.models.Cve": "Easm.Cve", "com.azure.analytics.defender.easm.models.Cvss3Summary": "Easm.Cvss3Summary", "com.azure.analytics.defender.easm.models.DataConnection": "Easm.DataConnection", diff --git a/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml b/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml index e2abe3bc972c..bf95dea1b3ef 100644 --- a/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml +++ b/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/riskiq/Easm -commit: df3cd3e3d50eec1d1da593750e1ea3a4db3f541d +commit: 265931d2920d07faba0239f8bbb5eeeff8b39c93 repo: Azure/azure-rest-api-specs From 505a4cdf6dc1fd0c03b8fae1f0c033c4e12ed385 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 16 Jul 2024 12:54:05 +0800 Subject: [PATCH 05/11] commit on main branch --- sdk/easm/azure-analytics-defender-easm/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml b/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml index bf95dea1b3ef..0a483027671d 100644 --- a/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml +++ b/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/riskiq/Easm -commit: 265931d2920d07faba0239f8bbb5eeeff8b39c93 +commit: f0d6fb9228518f963d2407e49cad2dd403db6f18 repo: Azure/azure-rest-api-specs From 7b93ab399e74236e78b7c2ec8594e3d3b78ec5fe Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 5 Aug 2024 09:44:51 +0800 Subject: [PATCH 06/11] regen --- .../defender/easm/EasmAsyncClient.java | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java index 5caa97cedb8a..baf9a4db92c8 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java @@ -1269,10 +1269,10 @@ public PagedFlux listAssetResource(String filter, String orderBy, requestOptions.addQueryParam("mark", mark, false); } PagedFlux pagedFluxResponse = listAssetResource(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1299,10 +1299,10 @@ public PagedFlux listAssetResource() { // Generated convenience method for listAssetResource RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listAssetResource(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1377,10 +1377,10 @@ public PagedFlux listDataConnection(Integer skip) { requestOptions.addQueryParam("skip", String.valueOf(skip), false); } PagedFlux pagedFluxResponse = listDataConnection(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1407,10 +1407,10 @@ public PagedFlux listDataConnection() { // Generated convenience method for listDataConnection RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listDataConnection(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1531,10 +1531,10 @@ public PagedFlux listDiscoGroup(String filter, Integer skip) { requestOptions.addQueryParam("skip", String.valueOf(skip), false); } PagedFlux pagedFluxResponse = listDiscoGroup(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1561,10 +1561,10 @@ public PagedFlux listDiscoGroup() { // Generated convenience method for listDiscoGroup RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listDiscoGroup(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1663,10 +1663,10 @@ public PagedFlux listRuns(String groupName, String filter, Integ requestOptions.addQueryParam("skip", String.valueOf(skip), false); } PagedFlux pagedFluxResponse = listRuns(groupName, requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1695,10 +1695,10 @@ public PagedFlux listRuns(String groupName) { // Generated convenience method for listRuns RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listRuns(groupName, requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1734,10 +1734,10 @@ public PagedFlux listDiscoTemplate(String filter, Integer skip) { requestOptions.addQueryParam("skip", String.valueOf(skip), false); } PagedFlux pagedFluxResponse = listDiscoTemplate(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1764,10 +1764,10 @@ public PagedFlux listDiscoTemplate() { // Generated convenience method for listDiscoTemplate RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listDiscoTemplate(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1886,10 +1886,10 @@ public PagedFlux listSavedFilter(String filter, Integer skip) { requestOptions.addQueryParam("skip", String.valueOf(skip), false); } PagedFlux pagedFluxResponse = listSavedFilter(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -1916,10 +1916,10 @@ public PagedFlux listSavedFilter() { // Generated convenience method for listSavedFilter RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listSavedFilter(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -2023,10 +2023,10 @@ public PagedFlux listTask(String filter, String orderBy, Integer skip) { requestOptions.addQueryParam("skip", String.valueOf(skip), false); } PagedFlux pagedFluxResponse = listTask(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() @@ -2053,10 +2053,10 @@ public PagedFlux listTask() { // Generated convenience method for listTask RequestOptions requestOptions = new RequestOptions(); PagedFlux pagedFluxResponse = listTask(requestOptions); - return PagedFlux.create(() -> (continuationToken, pageSize) -> { - Flux> flux = (continuationToken == null) + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationToken).take(1); + : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() From 7b812b954a6a33fed0dfd77130c1b31b482c81db Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 5 Aug 2024 10:11:24 +0800 Subject: [PATCH 07/11] modify record --- sdk/easm/azure-analytics-defender-easm/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/easm/azure-analytics-defender-easm/assets.json b/sdk/easm/azure-analytics-defender-easm/assets.json index 709869328e8d..286fa55d532b 100644 --- a/sdk/easm/azure-analytics-defender-easm/assets.json +++ b/sdk/easm/azure-analytics-defender-easm/assets.json @@ -2,5 +2,5 @@ "AssetsRepo" : "Azure/azure-sdk-assets", "AssetsRepoPrefixPath" : "java", "TagPrefix" : "java/easm/azure-analytics-defender-easm", - "Tag" : "java/easm/azure-analytics-defender-easm_89ef9d7fb3" + "Tag" : "java/easm/azure-analytics-defender-easm_fb73beaf08" } From 6e18babbb9a2a71c20be9d1a7585e1a86cbe4752 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 5 Aug 2024 10:14:51 +0800 Subject: [PATCH 08/11] regen --- .../defender/easm/EasmAsyncClient.java | 46 +-- .../analytics/defender/easm/EasmClient.java | 44 +-- .../CreateOrReplaceDiscoGroupRequest.java | 320 ------------------ .../implementation/models/package-info.java | 13 - .../CreateOrReplaceDiscoGroupOptions.java | 271 --------------- .../src/main/java/module-info.java | 1 - 6 files changed, 45 insertions(+), 650 deletions(-) delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java index baf9a4db92c8..451c74c43540 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java @@ -1617,6 +1617,29 @@ public Mono getDiscoGroup(String groupName) { .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class)); } + /** + * Create a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrReplaceDiscoGroup(String groupName, DiscoGroupData body) { + // Generated convenience method for createOrReplaceDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(body), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class)); + } + /** * Run a discovery group with a given groupName. * @@ -2108,27 +2131,4 @@ public Mono cancelTask(String taskId) { return cancelTaskWithResponse(taskId, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(Task.class)); } - - /** - * Create a discovery group with a given groupName. - * - * @param groupName The caller provided unique name for the resource. - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrReplaceDiscoGroup(String groupName, DiscoGroupData body) { - // Generated convenience method for createOrReplaceDiscoGroupWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(body), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(DiscoGroup.class)); - } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java index 42efe3cc6971..55dc03164bae 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java @@ -1531,6 +1531,28 @@ public DiscoGroup getDiscoGroup(String groupName) { return getDiscoGroupWithResponse(groupName, requestOptions).getValue().toObject(DiscoGroup.class); } + /** + * Create a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param body Body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DiscoGroup createOrReplaceDiscoGroup(String groupName, DiscoGroupData body) { + // Generated convenience method for createOrReplaceDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(body), requestOptions).getValue() + .toObject(DiscoGroup.class); + } + /** * Run a discovery group with a given groupName. * @@ -1924,26 +1946,4 @@ public Task cancelTask(String taskId) { RequestOptions requestOptions = new RequestOptions(); return cancelTaskWithResponse(taskId, requestOptions).getValue().toObject(Task.class); } - - /** - * Create a discovery group with a given groupName. - * - * @param groupName The caller provided unique name for the resource. - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoGroup createOrReplaceDiscoGroup(String groupName, DiscoGroupData body) { - // Generated convenience method for createOrReplaceDiscoGroupWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(body), requestOptions).getValue() - .toObject(DiscoGroup.class); - } } diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java deleted file mode 100644 index 0059ef20b2f6..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/CreateOrReplaceDiscoGroupRequest.java +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.analytics.defender.easm.implementation.models; - -import com.azure.analytics.defender.easm.models.DiscoSource; -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The CreateOrReplaceDiscoGroupRequest model. - */ -@Fluent -public final class CreateOrReplaceDiscoGroupRequest implements JsonSerializable { - - /* - * The name for a disco group. - */ - @Generated - private String name; - - /* - * The description for a disco group. - */ - @Generated - private String description; - - /* - * The tier for the disco group which will affect the algorithm used for the disco runs in this group. - */ - @Generated - private String tier; - - /* - * The frequency at which the disco group is supposed to be rerun in milliseconds. - */ - @Generated - private Long frequencyMilliseconds; - - /* - * The list of seeds used for the disco group runs. - */ - @Generated - private List seeds; - - /* - * The list of names used for the disco group runs. - */ - @Generated - private List names; - - /* - * The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. - */ - @Generated - private List excludes; - - /* - * The unique identifier for the disco template used for the disco group creation. - */ - @Generated - private String templateId; - - /** - * Creates an instance of CreateOrReplaceDiscoGroupRequest class. - */ - @Generated - public CreateOrReplaceDiscoGroupRequest() { - } - - /** - * Get the name property: The name for a disco group. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Set the name property: The name for a disco group. - * - * @param name the name value to set. - * @return the CreateOrReplaceDiscoGroupRequest object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupRequest setName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: The description for a disco group. - * - * @return the description value. - */ - @Generated - public String getDescription() { - return this.description; - } - - /** - * Set the description property: The description for a disco group. - * - * @param description the description value to set. - * @return the CreateOrReplaceDiscoGroupRequest object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupRequest setDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in - * this group. - * - * @return the tier value. - */ - @Generated - public String getTier() { - return this.tier; - } - - /** - * Set the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in - * this group. - * - * @param tier the tier value to set. - * @return the CreateOrReplaceDiscoGroupRequest object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupRequest setTier(String tier) { - this.tier = tier; - return this; - } - - /** - * Get the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in - * milliseconds. - * - * @return the frequencyMilliseconds value. - */ - @Generated - public Long getFrequencyMilliseconds() { - return this.frequencyMilliseconds; - } - - /** - * Set the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in - * milliseconds. - * - * @param frequencyMilliseconds the frequencyMilliseconds value to set. - * @return the CreateOrReplaceDiscoGroupRequest object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupRequest setFrequencyMilliseconds(Long frequencyMilliseconds) { - this.frequencyMilliseconds = frequencyMilliseconds; - return this; - } - - /** - * Get the seeds property: The list of seeds used for the disco group runs. - * - * @return the seeds value. - */ - @Generated - public List getSeeds() { - return this.seeds; - } - - /** - * Set the seeds property: The list of seeds used for the disco group runs. - * - * @param seeds the seeds value to set. - * @return the CreateOrReplaceDiscoGroupRequest object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupRequest setSeeds(List seeds) { - this.seeds = seeds; - return this; - } - - /** - * Get the names property: The list of names used for the disco group runs. - * - * @return the names value. - */ - @Generated - public List getNames() { - return this.names; - } - - /** - * Set the names property: The list of names used for the disco group runs. - * - * @param names the names value to set. - * @return the CreateOrReplaceDiscoGroupRequest object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupRequest setNames(List names) { - this.names = names; - return this; - } - - /** - * Get the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the - * discovery algorithm. - * - * @return the excludes value. - */ - @Generated - public List getExcludes() { - return this.excludes; - } - - /** - * Set the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the - * discovery algorithm. - * - * @param excludes the excludes value to set. - * @return the CreateOrReplaceDiscoGroupRequest object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupRequest setExcludes(List excludes) { - this.excludes = excludes; - return this; - } - - /** - * Get the templateId property: The unique identifier for the disco template used for the disco group creation. - * - * @return the templateId value. - */ - @Generated - public String getTemplateId() { - return this.templateId; - } - - /** - * Set the templateId property: The unique identifier for the disco template used for the disco group creation. - * - * @param templateId the templateId value to set. - * @return the CreateOrReplaceDiscoGroupRequest object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupRequest setTemplateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("tier", this.tier); - jsonWriter.writeNumberField("frequencyMilliseconds", this.frequencyMilliseconds); - jsonWriter.writeArrayField("seeds", this.seeds, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("names", this.names, (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("excludes", this.excludes, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("templateId", this.templateId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CreateOrReplaceDiscoGroupRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CreateOrReplaceDiscoGroupRequest if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the CreateOrReplaceDiscoGroupRequest. - */ - @Generated - public static CreateOrReplaceDiscoGroupRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CreateOrReplaceDiscoGroupRequest deserializedCreateOrReplaceDiscoGroupRequest - = new CreateOrReplaceDiscoGroupRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("name".equals(fieldName)) { - deserializedCreateOrReplaceDiscoGroupRequest.name = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedCreateOrReplaceDiscoGroupRequest.description = reader.getString(); - } else if ("tier".equals(fieldName)) { - deserializedCreateOrReplaceDiscoGroupRequest.tier = reader.getString(); - } else if ("frequencyMilliseconds".equals(fieldName)) { - deserializedCreateOrReplaceDiscoGroupRequest.frequencyMilliseconds - = reader.getNullable(JsonReader::getLong); - } else if ("seeds".equals(fieldName)) { - List seeds = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); - deserializedCreateOrReplaceDiscoGroupRequest.seeds = seeds; - } else if ("names".equals(fieldName)) { - List names = reader.readArray(reader1 -> reader1.getString()); - deserializedCreateOrReplaceDiscoGroupRequest.names = names; - } else if ("excludes".equals(fieldName)) { - List excludes = reader.readArray(reader1 -> DiscoSource.fromJson(reader1)); - deserializedCreateOrReplaceDiscoGroupRequest.excludes = excludes; - } else if ("templateId".equals(fieldName)) { - deserializedCreateOrReplaceDiscoGroupRequest.templateId = reader.getString(); - } else { - reader.skipChildren(); - } - } - return deserializedCreateOrReplaceDiscoGroupRequest; - }); - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java deleted file mode 100644 index 18557bc0a362..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/models/package-info.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -/** - * - * Package containing the data models for Easm. - * Defender EASM discovers and maps your digital attack surface to provide an "outside-in" perspective using probes to - * discover assets. The assets are provided with detailed metadata associated, including vulnerabilities, configurations - * and web components, allowing customers to view and prioritize external risk. The EASM REST API enables you to develop - * clients that integrate with your application. - * - */ -package com.azure.analytics.defender.easm.implementation.models; diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java deleted file mode 100644 index c61c8a688a02..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CreateOrReplaceDiscoGroupOptions.java +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import java.util.List; - -/** - * Options for createOrReplaceDiscoGroup API. - */ -@Fluent -public final class CreateOrReplaceDiscoGroupOptions { - - /* - * The caller provided unique name for the resource. - */ - @Generated - private final String groupName; - - /* - * The name for a disco group. - */ - @Generated - private String name; - - /* - * The description for a disco group. - */ - @Generated - private String description; - - /* - * The tier for the disco group which will affect the algorithm used for the disco runs in this group. - */ - @Generated - private String tier; - - /* - * The frequency at which the disco group is supposed to be rerun in milliseconds. - */ - @Generated - private Long frequencyMilliseconds; - - /* - * The list of seeds used for the disco group runs. - */ - @Generated - private List seeds; - - /* - * The list of names used for the disco group runs. - */ - @Generated - private List names; - - /* - * The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. - */ - @Generated - private List excludes; - - /* - * The unique identifier for the disco template used for the disco group creation. - */ - @Generated - private String templateId; - - /** - * Creates an instance of CreateOrReplaceDiscoGroupOptions class. - * - * @param groupName the groupName value to set. - */ - @Generated - public CreateOrReplaceDiscoGroupOptions(String groupName) { - this.groupName = groupName; - } - - /** - * Get the groupName property: The caller provided unique name for the resource. - * - * @return the groupName value. - */ - @Generated - public String getGroupName() { - return this.groupName; - } - - /** - * Get the name property: The name for a disco group. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Set the name property: The name for a disco group. - * - * @param name the name value to set. - * @return the CreateOrReplaceDiscoGroupOptions object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupOptions setName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: The description for a disco group. - * - * @return the description value. - */ - @Generated - public String getDescription() { - return this.description; - } - - /** - * Set the description property: The description for a disco group. - * - * @param description the description value to set. - * @return the CreateOrReplaceDiscoGroupOptions object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupOptions setDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in - * this group. - * - * @return the tier value. - */ - @Generated - public String getTier() { - return this.tier; - } - - /** - * Set the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in - * this group. - * - * @param tier the tier value to set. - * @return the CreateOrReplaceDiscoGroupOptions object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupOptions setTier(String tier) { - this.tier = tier; - return this; - } - - /** - * Get the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in - * milliseconds. - * - * @return the frequencyMilliseconds value. - */ - @Generated - public Long getFrequencyMilliseconds() { - return this.frequencyMilliseconds; - } - - /** - * Set the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in - * milliseconds. - * - * @param frequencyMilliseconds the frequencyMilliseconds value to set. - * @return the CreateOrReplaceDiscoGroupOptions object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupOptions setFrequencyMilliseconds(Long frequencyMilliseconds) { - this.frequencyMilliseconds = frequencyMilliseconds; - return this; - } - - /** - * Get the seeds property: The list of seeds used for the disco group runs. - * - * @return the seeds value. - */ - @Generated - public List getSeeds() { - return this.seeds; - } - - /** - * Set the seeds property: The list of seeds used for the disco group runs. - * - * @param seeds the seeds value to set. - * @return the CreateOrReplaceDiscoGroupOptions object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupOptions setSeeds(List seeds) { - this.seeds = seeds; - return this; - } - - /** - * Get the names property: The list of names used for the disco group runs. - * - * @return the names value. - */ - @Generated - public List getNames() { - return this.names; - } - - /** - * Set the names property: The list of names used for the disco group runs. - * - * @param names the names value to set. - * @return the CreateOrReplaceDiscoGroupOptions object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupOptions setNames(List names) { - this.names = names; - return this; - } - - /** - * Get the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the - * discovery algorithm. - * - * @return the excludes value. - */ - @Generated - public List getExcludes() { - return this.excludes; - } - - /** - * Set the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the - * discovery algorithm. - * - * @param excludes the excludes value to set. - * @return the CreateOrReplaceDiscoGroupOptions object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupOptions setExcludes(List excludes) { - this.excludes = excludes; - return this; - } - - /** - * Get the templateId property: The unique identifier for the disco template used for the disco group creation. - * - * @return the templateId value. - */ - @Generated - public String getTemplateId() { - return this.templateId; - } - - /** - * Set the templateId property: The unique identifier for the disco template used for the disco group creation. - * - * @param templateId the templateId value to set. - * @return the CreateOrReplaceDiscoGroupOptions object itself. - */ - @Generated - public CreateOrReplaceDiscoGroupOptions setTemplateId(String templateId) { - this.templateId = templateId; - return this; - } -} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/module-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/module-info.java index 6f8c05d19d31..34fe629c7523 100644 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/module-info.java +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/module-info.java @@ -7,5 +7,4 @@ exports com.azure.analytics.defender.easm; exports com.azure.analytics.defender.easm.models; opens com.azure.analytics.defender.easm.models to com.azure.core; - opens com.azure.analytics.defender.easm.implementation.models to com.azure.core; } From e973449facc926c3ee78e619afae4a209cc8c505 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 5 Aug 2024 14:05:08 +0800 Subject: [PATCH 09/11] lower linecoverage --- sdk/easm/azure-analytics-defender-easm/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/easm/azure-analytics-defender-easm/pom.xml b/sdk/easm/azure-analytics-defender-easm/pom.xml index f24388d0b2b4..eec6c051738f 100644 --- a/sdk/easm/azure-analytics-defender-easm/pom.xml +++ b/sdk/easm/azure-analytics-defender-easm/pom.xml @@ -43,6 +43,7 @@ UTF-8 + 0.30 From ad3b1dc0651ff92c92a43ad696770ccd18faf8af Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 5 Aug 2024 14:14:53 +0800 Subject: [PATCH 10/11] changelog --- sdk/easm/azure-analytics-defender-easm/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md b/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md index f4ab4f2333af..bc5a0f77b90d 100644 --- a/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md +++ b/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md @@ -6,6 +6,9 @@ ### Breaking Changes +- Removed `subscriptionId`, `resourceGroupName`, `workspaceName` API from `EasmClientBuilder` client builder. + Please set all of these values into `endpoint` API, e.g. `builder.endpoint("https:///subscriptions//resourceGroups//workspaces//")`. + ### Bugs Fixed ### Other Changes From 480496817276181f896106bb440aca8c252b9ea9 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 6 Aug 2024 11:27:24 +0800 Subject: [PATCH 11/11] Update CHANGELOG.md --- sdk/easm/azure-analytics-defender-easm/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md b/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md index bc5a0f77b90d..5a1577e40513 100644 --- a/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md +++ b/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md @@ -8,6 +8,7 @@ - Removed `subscriptionId`, `resourceGroupName`, `workspaceName` API from `EasmClientBuilder` client builder. Please set all of these values into `endpoint` API, e.g. `builder.endpoint("https:///subscriptions//resourceGroups//workspaces//")`. +- Removed Jackson annotations from models and removed custom serializer for raw JSON fields. ### Bugs Fixed