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..535bc3f5a596 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 @@ -150,20 +150,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 +177,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 +196,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 +206,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 +319,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 +365,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 +419,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 +451,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 +462,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 +577,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 +615,9 @@ public PagedFlux listDiscoGroup(RequestOptions requestOptions) {
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -623,26 +635,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 +712,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 +735,9 @@ public Mono> getDiscoGroupWithResponse(String groupName, Re
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -771,7 +781,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 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. @@ -781,9 +791,9 @@ public Mono> getDiscoGroupWithResponse(String groupName, Re */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData discoGroupData, + public Mono> createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceDiscoGroupWithResponseAsync(groupName, discoGroupData, requestOptions); + return this.serviceClient.createOrReplaceDiscoGroupWithResponseAsync(groupName, body, requestOptions); } /** @@ -875,20 +885,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 +941,8 @@ public Mono> getDiscoTemplateWithResponse(String templateId
 
     /**
      * Get billable assets summary for the workspace.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -964,9 +976,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 +986,9 @@ public Mono> getBillableWithResponse(RequestOptions request
      *     page: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     displayName: String (Optional)
@@ -991,6 +1002,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 +1032,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 +1043,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 +1067,9 @@ public Mono> getSnapshotWithResponse(BinaryData reportAsset
      *     labelName: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -1081,8 +1091,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 +1102,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 +1166,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 +1209,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 +1231,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 +1241,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 +1334,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 +1382,8 @@ public Mono> getTaskWithResponse(String taskId, RequestOpti
 
     /**
      * Cancel a task by taskId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -1437,11 +1448,13 @@ public PagedFlux listAssetResource(String filter, String orderBy,
         }
         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));
@@ -1465,11 +1478,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 +1509,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 +1554,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 +1583,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 +1706,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 +1735,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 +1850,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 +1888,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 +1917,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 +2038,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 +2068,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 +2173,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 +2203,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 +2334,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,11 +2374,13 @@ 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));
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..c4b121d2733a 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
@@ -147,9 +147,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 +159,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 +178,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 +188,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 +303,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 +334,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 +386,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 +418,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 +428,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 +452,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 +475,9 @@ public Response deleteDataConnectionWithResponse(String dataConnectionName
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -498,26 +495,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 +571,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 +594,9 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -646,7 +640,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 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. @@ -656,9 +650,9 @@ public Response getDiscoGroupWithResponse(String groupName, RequestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData discoGroupData, + public Response createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrReplaceDiscoGroupWithResponse(groupName, discoGroupData, requestOptions); + return this.serviceClient.createOrReplaceDiscoGroupWithResponse(groupName, body, requestOptions); } /** @@ -828,9 +822,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 +862,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 +896,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 +906,9 @@ public Response getBillableWithResponse(RequestOptions requestOption
      *     page: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     displayName: String (Optional)
@@ -931,6 +922,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 +952,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 +962,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 +986,9 @@ public Response getSnapshotWithResponse(BinaryData reportAssetSnapsh
      *     labelName: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -1020,8 +1010,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 +1020,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 +1087,8 @@ public PagedIterable listSavedFilter(RequestOptions requestOptions) /** * Retrieve a saved filter by filterName. - *

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -1128,18 +1115,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 +1137,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 +1147,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 +1243,8 @@ public PagedIterable listTask(RequestOptions requestOptions) { /** * Retrieve a task by taskId. - *

- * Response Body Schema - *

+ *

Response Body Schema

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

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
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/implementation/EasmClientImpl.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java
index 083ff7efe91c..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
@@ -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,8 +220,6 @@ 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);
 
@@ -298,8 +230,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 +240,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 +250,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 +260,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 +270,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 +280,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 +290,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 +301,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 +312,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 +322,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 +332,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 +342,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 +352,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 +362,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 +372,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 +382,6 @@ 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);
 
@@ -494,10 +392,8 @@ 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,
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
             RequestOptions requestOptions, Context context);
 
         @Put("/discoGroups/{groupName}")
@@ -507,10 +403,8 @@ 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,
+            @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body,
             RequestOptions requestOptions, Context context);
 
         @Post("/discoGroups/{groupName}:run")
@@ -520,8 +414,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 +424,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 +434,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,8 +444,6 @@ 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);
 
@@ -568,8 +454,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 +464,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 +474,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 +484,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 +494,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 +504,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 +514,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 +524,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 +534,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 +544,8 @@ 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);
 
         @Get("/savedFilters")
         @ExpectedResponses({ 200 })
@@ -692,8 +554,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 +564,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 +574,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 +584,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 +594,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 +605,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 +616,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 +626,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 +636,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 +646,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 +656,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 +666,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 +676,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,8 +686,6 @@ 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);
 
@@ -862,9 +696,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 +706,8 @@ 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 })
@@ -885,8 +717,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 +726,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 +736,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 +746,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 +756,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 +766,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 +776,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 +786,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 +796,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 +806,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 +816,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 +826,30 @@ 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);
     }
 
     /**
      * 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)
@@ -1100,64 +888,32 @@ 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.
* 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 +978,24 @@ 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.
* 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 +1032,32 @@ 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.
* 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 +1122,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 +1134,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 +1153,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 +1162,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 +1183,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 +1202,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 +1211,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 +1263,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)
@@ -1623,43 +1311,25 @@ public Mono> getAssetResourceWithResponseAsync(String asset
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getAssetResourceWithResponse(String assetId, 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.getAssetResourceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), assetId, accept,
+            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 +1356,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 +1429,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 +1466,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 +1539,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 +1570,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 +1620,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 +1668,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 +1705,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 +1743,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 +1753,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 +1793,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 +1802,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 +1825,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 +1842,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 +1913,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 +2012,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 +2075,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 +2174,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 +2197,9 @@ public PagedIterable listDiscoGroup(RequestOptions requestOptions) {
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -2702,28 +2217,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 +2259,9 @@ public Mono> validateDiscoGroupWithResponseAsync(BinaryData
      *     templateId: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     error (Optional): {
@@ -2765,28 +2279,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 +2351,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 +2412,14 @@ 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);
     }
 
     /**
      * Create a discovery group with a given groupName.
-     * 

- * Request Body Schema - *

+ *

Request Body Schema

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

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -2980,7 +2487,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 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. @@ -2989,19 +2496,17 @@ 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 discoGroupData, 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.getSubscriptionId(), this.getResourceGroupName(), this.getWorkspaceName(), - this.getServiceVersion().getVersion(), groupName, accept, discoGroupData, requestOptions, context)); + this.getServiceVersion().getVersion(), groupName, accept, body, requestOptions, context)); } /** * Create a discovery group with a given groupName. - *

- * Request Body Schema - *

+ *

Request Body Schema

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

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -3069,7 +2574,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 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. @@ -3078,12 +2583,11 @@ public Mono> createOrReplaceDiscoGroupWithResponseAsync(Str * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData discoGroupData, + public Response createOrReplaceDiscoGroupWithResponse(String groupName, BinaryData body, 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, body, requestOptions, Context.NONE); } /** @@ -3100,9 +2604,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 +2622,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 +2674,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 +2755,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 +2800,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)
@@ -3473,40 +2881,17 @@ public PagedIterable listRuns(String groupName, RequestOptions reque
 
     /**
      * 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 +2926,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 +3005,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 +3048,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 +3127,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 +3164,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 +3205,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 +3241,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 +3276,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 +3292,9 @@ public Response getBillableWithResponse(RequestOptions requestOption
      *     page: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     displayName: String (Optional)
@@ -4002,6 +3308,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 +3338,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 +3348,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 +3366,9 @@ public Mono> getSnapshotWithResponseAsync(BinaryData report
      *     page: Integer (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     displayName: String (Optional)
@@ -4078,6 +3382,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 +3412,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 +3421,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 +3447,9 @@ public Response getSnapshotWithResponse(BinaryData reportAssetSnapsh
      *     labelName: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -4169,8 +3471,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 +3481,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 +3507,9 @@ public Mono> getSummaryWithResponseAsync(BinaryData reportA
      *     labelName: String (Optional)
      * }
      * }
- *

- * Response Body Schema - *

+ * + *

Response Body Schema

+ * *
{@code
      * {
      *     assetSummaries (Optional): [
@@ -4233,8 +3531,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 +3540,25 @@ 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, - RequestOptions requestOptions) { + public Response getSummaryWithResponse(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 service.getSummarySync(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 +3581,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 +3648,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 +3679,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 +3746,8 @@ public PagedIterable listSavedFilter(RequestOptions requestOptions)
 
     /**
      * Retrieve a saved filter by filterName.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Optional)
@@ -4570,16 +3770,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 +3799,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 +3827,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 +3836,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 +3867,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 +3876,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 +3897,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 +3915,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 +3960,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 +4034,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 +4072,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 +4146,8 @@ public PagedIterable listTask(RequestOptions requestOptions) {
 
     /**
      * Retrieve a task by taskId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5094,16 +4174,14 @@ public PagedIterable listTask(RequestOptions requestOptions) {
     @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.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), taskId, accept,
-            requestOptions, context));
+        return FluxUtil.withContext(context -> service.getTask(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context));
     }
 
     /**
      * Retrieve a task by taskId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5130,16 +4208,14 @@ public Mono> getTaskWithResponseAsync(String taskId, Reques
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getTaskWithResponse(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.getTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, accept,
+            requestOptions, Context.NONE);
     }
 
     /**
      * Cancel a task by taskId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5166,16 +4242,14 @@ public Response getTaskWithResponse(String taskId, RequestOptions re
     @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.getSubscriptionId(),
-            this.getResourceGroupName(), this.getWorkspaceName(), this.getServiceVersion().getVersion(), taskId, accept,
-            requestOptions, context));
+        return FluxUtil.withContext(context -> service.cancelTask(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), taskId, accept, requestOptions, context));
     }
 
     /**
      * Cancel a task by taskId.
-     * 

- * Response Body Schema - *

+ *

Response Body Schema

+ * *
{@code
      * {
      *     id: String (Required)
@@ -5202,18 +4276,17 @@ public Mono> cancelTaskWithResponseAsync(String taskId, Req
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response cancelTaskWithResponse(String taskId, 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.cancelTaskSync(this.getEndpoint(), this.getServiceVersion().getVersion(), taskId, 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 +4313,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 +4328,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 +4366,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 +4378,18 @@ 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 - *

+ *

Response Body Schema

+ * *
{@code
      * {
+     *     kind: String (Required)
      *     id: String (Optional)
      *     name: String (Required)
      *     displayName: String (Optional)
@@ -5337,9 +4404,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 +4417,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 +4444,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 +4456,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 +4507,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 +4521,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 +4573,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 +4585,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 +4617,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 +4630,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 +4662,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 +4673,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 +4705,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 +4720,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 +4751,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 +4763,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 +4782,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 +4796,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 +4816,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 +4828,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 +4852,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 +4865,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 +4889,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 +4900,8 @@ 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); } 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/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/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/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/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/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/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/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/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/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/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/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..672489094d06 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; opens com.azure.analytics.defender.easm.models to com.azure.core, com.fasterxml.jackson.databind; } 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..9c915ec53fa1 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/resources/META-INF/azure-analytics-defender-easm_apiview_properties.json @@ -0,0 +1,193 @@ +{ + "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.deleteSavedFilter": "Customizations.EasmClient.deleteSavedFilter", + "com.azure.analytics.defender.easm.EasmAsyncClient.deleteSavedFilterWithResponse": "Customizations.EasmClient.deleteSavedFilter", + "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.getBillable": "Customizations.EasmClient.getBillable", + "com.azure.analytics.defender.easm.EasmAsyncClient.getBillableWithResponse": "Customizations.EasmClient.getBillable", + "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.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.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.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.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.deleteSavedFilter": "Customizations.EasmClient.deleteSavedFilter", + "com.azure.analytics.defender.easm.EasmClient.deleteSavedFilterWithResponse": "Customizations.EasmClient.deleteSavedFilter", + "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.getBillable": "Customizations.EasmClient.getBillable", + "com.azure.analytics.defender.easm.EasmClient.getBillableWithResponse": "Customizations.EasmClient.getBillable", + "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.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.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.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.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.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.AssetPageResult": "Easm.AssetPageResult", + "com.azure.analytics.defender.easm.models.AssetResource": "Easm.AssetResource", + "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.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.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.Cve": "Easm.Cve", + "com.azure.analytics.defender.easm.models.Cvss3Summary": "Easm.Cvss3Summary", + "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.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.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.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.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.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..3b2a8b460465 100644 --- a/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml +++ b/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/riskiq/Easm -commit: 11dd0dbfb9bec989f3a9a3536ae526407ff17c78 +commit: 2719e083170c95d7763c1e07e48588c36a6bde0c repo: Azure/azure-rest-api-specs +additionalDirectories: