diff --git a/.vscode/cspell.json b/.vscode/cspell.json index ac5fbe96a20c..0ad251bca538 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -481,6 +481,16 @@ "Decibles" ] }, + { + "filename": "sdk/easm/*", + "words": [ + "easm", + "asns", + "nxdomain", + "cnames", + "riskiq" + ] + }, { "filename": "**/pom.xml", "patterns": [ diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index e94a2bc2073a..44200c08925a 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -596,4 +596,6 @@ the main ServiceBusClientBuilder. --> + + diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 0e4e14190c3d..303d64d772c9 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -48,6 +48,7 @@ com.azure:azure-ai-personalizer;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-ai-textanalytics;5.4.0;5.5.0-beta.1 com.azure:azure-ai-textanalytics-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-translation-text;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-analytics-defender-easm;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-analytics-purview-catalog;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-analytics-purview-scanning;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-analytics-purview-sharing;1.0.0-beta.2;1.0.0-beta.3 diff --git a/pom.xml b/pom.xml index 5623ede6090d..c4535f0b1718 100644 --- a/pom.xml +++ b/pom.xml @@ -77,6 +77,7 @@ sdk/digitaltwins sdk/dnsresolver sdk/dynatrace + sdk/easm sdk/edgeorder sdk/education sdk/elastic diff --git a/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md b/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md new file mode 100644 index 000000000000..30e10281d696 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure EASM client library for Java. This package contains Microsoft Azure EASM client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/easm/azure-analytics-defender-easm/README.md b/sdk/easm/azure-analytics-defender-easm/README.md new file mode 100644 index 000000000000..38dbf1141e9e --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/README.md @@ -0,0 +1,116 @@ +# Azure EASM client library for Java + +*Microsoft Defender External Attack Surface Management (Defender EASM)* continuously discovers and maps your digital attack surface to provide an external view of your online infrastructure. This visibility enables security and IT teams to identify unknowns, prioritize risk, eliminate threats, and extend vulnerability and exposure control beyond the firewall. Defender EASM leverages Microsoft’s crawling technology to discover assets that are related to your known online infrastructure, and actively scans these assets to discover new connections over time. Attack Surface Insights are generated by leveraging vulnerability and infrastructure data to showcase the key areas of concern for your organization. + +This package contains Microsoft Azure EASM Defender client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-analytics-defender-easm;current}) +```xml + + com.azure + azure-analytics-defender-easm + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts +### [Assets][assets_documentation] +Defender EASM includes the discovery of the following kinds of assets: +- Domains +- Hosts +- Pages +- IP Blocks +- IP Addresses +- Autonomous System Numbers (ASNs) +- SSL Certificates +- WHOIS Contacts + +These asset types comprise your attack surface inventory in Defender EASM. This solution discovers externally facing assets that are exposed to the open internet outside of traditional firewall protection; they need to be monitored and maintained to minimize risk and improve an organization’s security posture. Microsoft Defender External Attack Surface Management (Defender EASM) actively discovers and monitors these assets, then surfacing key insights that help customers efficiently address any vulnerabilities in their organization. + +### [Discovery][discovery_documentation] +Microsoft Defender External Attack Surface Management (Defender EASM) relies on our proprietary discovery technology to continuously define your organization’s unique Internet-exposed attack surface. Discovery scans known assets owned by your organization to uncover previously unknown and unmonitored properties. Discovered assets are indexed in a customer’s inventory, providing a dynamic system of record of web applications, third party dependencies, and web infrastructure under the organization’s management through a single pane of glass. + +#### [Discovery Groups][discovery_groups_documentation] +Custom discoveries are organized into Discovery Groups. They are independent seed clusters that comprise a single discovery run and operate on their own recurrence schedules. Users can elect to organize their Discovery Groups to delineate assets in whatever way best benefits their company and workflows. Common options include organizing by responsible team/business unit, brands or subsidiaries. + +## Examples + +```java readme-sample-createDefenderEasmClient +String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); +String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); +String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); +String endpoint = Configuration.getGlobalConfiguration().get("ENDPOINT"); + +EasmClient easmClient = new EasmClientBuilder() + .endpoint(endpoint) + .subscriptionId(subscriptionId) + .workspaceName(workspaceName) + .resourceGroupName(resourceGroupName) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildClient(); +``` +| **File Name** | **Description** | +|----------------------------------------------------------------|--------------------------------------------------------| +| [DiscoveryRunsSample.java][discovery_runs_sample] | Create and manage a discovery group | +| [DiscoTemplateSample.java][disco_template_sample] | Create discovery groups using a template | +| [SavedFilterSample.java][saved_filter_sample] | Use saved filters to synchronize queries across scripts | +| [ManagingExternalIdsSample.java][external_ids_sample] | Tag assets automatically with external ids | + +## Troubleshooting +### Enabling Logging + +Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite +their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help +locate the root issue. View the [logging][logging] wiki for guidance about enabling logging. +## Next steps +These code samples show common scenario operations with the Azure Anomaly Detector library. More samples can be found under the [samples][samples] directory. + +For more extensive documentation on Microsoft Defender External Attack Surface Management, see the [Defender EASM][product_documentation]: https://azure.microsoft.com/services/ +on docs.microsoft.com. +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://learn.microsoft.com/azure/external-attack-surface-management/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[discovery_runs_sample]: https://github.com/thang-bit/azure-sdk-for-java/blob/easm-java-sdk/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java +[disco_template_sample]: https://github.com/thang-bit/azure-sdk-for-java/blob/easm-java-sdk/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java +[saved_filter_sample]: https://github.com/thang-bit/azure-sdk-for-java/blob/easm-java-sdk/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java +[external_ids_sample]: https://github.com/thang-bit/azure-sdk-for-java/blob/easm-java-sdk/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ManagingExternalIdsSample.java +[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK +[samples]: https://github.com/thang-bit/azure-sdk-for-java/tree/easm-java-sdk/samples +[assets_documentation]: https://learn.microsoft.com/azure/external-attack-surface-management/understanding-inventory-assets +[discovery_documentation]: https://learn.microsoft.com/azure/external-attack-surface-management/what-is-discovery +[discovery_groups_documentation]: https://learn.microsoft.com/azure/external-attack-surface-management/using-and-managing-discovery#discovery-groups +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Feasm%2Fazure-analytics-defender-easm%2FREADME.png) diff --git a/sdk/easm/azure-analytics-defender-easm/assets.json b/sdk/easm/azure-analytics-defender-easm/assets.json new file mode 100644 index 000000000000..709869328e8d --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo" : "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath" : "java", + "TagPrefix" : "java/easm/azure-analytics-defender-easm", + "Tag" : "java/easm/azure-analytics-defender-easm_89ef9d7fb3" +} diff --git a/sdk/easm/azure-analytics-defender-easm/pom.xml b/sdk/easm/azure-analytics-defender-easm/pom.xml new file mode 100644 index 000000000000..e44d72bcc641 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/pom.xml @@ -0,0 +1,95 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-analytics-defender-easm + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Easm + This package contains Microsoft Azure Easm client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + com.azure + azure-core + 1.44.1 + + + com.azure + azure-core-http-netty + 1.13.9 + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.3 + test + + + org.mockito + mockito-core + 4.11.0 + test + + + com.azure + azure-core-test + 1.21.1 + test + + + com.azure + azure-identity + 1.10.4 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + + + 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 new file mode 100644 index 000000000000..ae269a8b779f --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmAsyncClient.java @@ -0,0 +1,2433 @@ +// 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; + +import com.azure.analytics.defender.easm.implementation.EasmClientImpl; +import com.azure.analytics.defender.easm.models.AssetResource; +import com.azure.analytics.defender.easm.models.AssetUpdateData; +import com.azure.analytics.defender.easm.models.DataConnection; +import com.azure.analytics.defender.easm.models.DataConnectionData; +import com.azure.analytics.defender.easm.models.DiscoGroup; +import com.azure.analytics.defender.easm.models.DiscoGroupData; +import com.azure.analytics.defender.easm.models.DiscoRunResult; +import com.azure.analytics.defender.easm.models.DiscoTemplate; +import com.azure.analytics.defender.easm.models.ReportAssetSnapshotRequest; +import com.azure.analytics.defender.easm.models.ReportAssetSnapshotResult; +import com.azure.analytics.defender.easm.models.ReportAssetSummaryRequest; +import com.azure.analytics.defender.easm.models.ReportAssetSummaryResult; +import com.azure.analytics.defender.easm.models.ReportBillableAssetSummaryResult; +import com.azure.analytics.defender.easm.models.SavedFilter; +import com.azure.analytics.defender.easm.models.SavedFilterData; +import com.azure.analytics.defender.easm.models.Task; +import com.azure.analytics.defender.easm.models.ValidateResult; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous EasmClient type. */ +@ServiceClient(builder = EasmClientBuilder.class, isAsync = true) +public final class EasmAsyncClient { + + @Generated private final EasmClientImpl serviceClient; + + /** + * Initializes an instance of EasmAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + EasmAsyncClient(EasmClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Retrieve a list of assets for the provided search parameters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
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 + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of AssetResource items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAssetResource(RequestOptions requestOptions) { + PagedFlux pagedFluxResponse = this.serviceClient.listAssetResourceAsync(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Update labels on assets matching the provided filter. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): {
+     *         String: boolean (Optional)
+     *     }
+     *     transfers: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param assetId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the items in the current page of results along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAssetResourceWithResponse(String assetId, RequestOptions requestOptions) { + return this.serviceClient.getAssetResourceWithResponseAsync(assetId, requestOptions); + } + + /** + * Retrieve a list of data connections. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DataConnection items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDataConnection(RequestOptions requestOptions) { + PagedFlux pagedFluxResponse = this.serviceClient.listDataConnectionAsync(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Validate a data connection with a given dataConnectionName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             value: Object (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param dataConnectionData The dataConnectionData parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> validateDataConnectionWithResponse( + BinaryData dataConnectionData, RequestOptions requestOptions) { + return this.serviceClient.validateDataConnectionWithResponseAsync(dataConnectionData, requestOptions); + } + + /** + * Retrieve a data connection with a given dataConnectionName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param dataConnectionName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataConnectionWithResponse( + String dataConnectionName, RequestOptions requestOptions) { + return this.serviceClient.getDataConnectionWithResponseAsync(dataConnectionName, requestOptions); + } + + /** + * Create or replace a data connection with a given dataConnectionName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param dataConnectionName The caller provided unique name for the resource. + * @param dataConnectionData The dataConnectionData parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrReplaceDataConnectionWithResponse( + String dataConnectionName, BinaryData dataConnectionData, RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDataConnectionWithResponseAsync( + dataConnectionName, dataConnectionData, requestOptions); + } + + /** + * Delete a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDataConnectionWithResponse( + String dataConnectionName, RequestOptions requestOptions) { + return this.serviceClient.deleteDataConnectionWithResponseAsync(dataConnectionName, requestOptions); + } + + /** + * Retrieve a list of discovery group for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDiscoGroup(RequestOptions requestOptions) { + PagedFlux pagedFluxResponse = this.serviceClient.listDiscoGroupAsync(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Validate a discovery group with a given groupName. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             value: Object (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param discoGroupData A request body used to create a discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body 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); + } + + /** + * Retrieve a discovery group with a given groupName. + * + *

Response Body Schema + * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param groupName The caller provided unique name for the resource. + * @param discoGroupData A request body used to create a discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrReplaceDiscoGroupWithResponse( + String groupName, BinaryData discoGroupData, RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDiscoGroupWithResponseAsync(groupName, discoGroupData, requestOptions); + } + + /** + * Run a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> runDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { + return this.serviceClient.runDiscoGroupWithResponseAsync(groupName, requestOptions); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoTemplate items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDiscoTemplate(RequestOptions requestOptions) { + PagedFlux pagedFluxResponse = this.serviceClient.listDiscoTemplateAsync(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a disco template with a given templateId. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param templateId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the items in the current page of results along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDiscoTemplateWithResponse(String templateId, RequestOptions requestOptions) { + return this.serviceClient.getDiscoTemplateWithResponseAsync(templateId, requestOptions); + } + + /** + * Get billable assets summary for the workspace. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     assetSummaries (Optional): [
+     *          (Optional){
+     *             date: LocalDate (Optional)
+     *             total: Long (Optional)
+     *             assetBreakdown (Optional): [
+     *                  (Optional){
+     *                     kind: String(domain/host/ipAddress) (Optional)
+     *                     count: Long (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return billable assets summary for the workspace along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getBillableWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getBillableWithResponseAsync(requestOptions); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     metric: String (Optional)
+     *     labelName: String (Optional)
+     *     size: Integer (Optional)
+     *     page: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     displayName: String (Optional)
+     *     metric: String (Optional)
+     *     labelName: String (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     description: String (Optional)
+     *     assets (Optional): {
+     *         totalElements: Long (Optional)
+     *         mark: String (Optional)
+     *         nextLink: String (Optional)
+     *         value (Optional): [
+     *              (Optional){
+     *                 id: String (Required)
+     *                 name: String (Optional)
+     *                 displayName: String (Optional)
+     *                 uuid: String (Optional)
+     *                 createdDate: OffsetDateTime (Optional)
+     *                 updatedDate: OffsetDateTime (Optional)
+     *                 state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *                 externalId: String (Optional)
+     *                 labels (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 wildcard: Boolean (Optional)
+     *                 discoGroupName: String (Optional)
+     *                 auditTrail (Optional): [
+     *                      (Optional){
+     *                         id: String (Optional)
+     *                         name: String (Optional)
+     *                         displayName: String (Optional)
+     *                         kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *                         reason: String (Optional)
+     *                     }
+     *                 ]
+     *                 reason: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the most recent snapshot of asset summary values for the snapshot request along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSnapshotWithResponse( + BinaryData reportAssetSnapshotRequest, RequestOptions requestOptions) { + return this.serviceClient.getSnapshotWithResponseAsync(reportAssetSnapshotRequest, requestOptions); + } + + /** + * Get asset summary details for the summary request. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     metricCategories (Optional): [
+     *         String (Optional)
+     *     ]
+     *     metrics (Optional): [
+     *         String (Optional)
+     *     ]
+     *     filters (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupBy: String (Optional)
+     *     segmentBy: String (Optional)
+     *     labelName: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     assetSummaries (Optional): [
+     *          (Optional){
+     *             displayName: String (Optional)
+     *             description: String (Optional)
+     *             updatedAt: OffsetDateTime (Optional)
+     *             metricCategory: String (Optional)
+     *             metric: String (Optional)
+     *             filter: String (Optional)
+     *             labelName: String (Optional)
+     *             count: Long (Optional)
+     *             link: String (Optional)
+     *             children (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 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 asset summary details for the summary request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSummaryWithResponse( + BinaryData reportAssetSummaryRequest, RequestOptions requestOptions) { + return this.serviceClient.getSummaryWithResponseAsync(reportAssetSummaryRequest, requestOptions); + } + + /** + * Retrieve a list of saved filters for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of SavedFilter items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSavedFilter(RequestOptions requestOptions) { + PagedFlux pagedFluxResponse = this.serviceClient.listSavedFilterAsync(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a saved filter by filterName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param filterName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSavedFilterWithResponse(String filterName, RequestOptions requestOptions) { + return this.serviceClient.getSavedFilterWithResponseAsync(filterName, requestOptions); + } + + /** + * Create or replace a saved filter with a given filterName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param filterName The caller provided unique name for the resource. + * @param savedFilterData A request body used to create a saved filter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrReplaceSavedFilterWithResponse( + String filterName, BinaryData savedFilterData, RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceSavedFilterWithResponseAsync( + filterName, savedFilterData, requestOptions); + } + + /** + * Delete a saved filter with a given filterName. + * + * @param filterName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteSavedFilterWithResponse(String filterName, RequestOptions requestOptions) { + return this.serviceClient.deleteSavedFilterWithResponseAsync(filterName, requestOptions); + } + + /** + * Retrieve a list of tasks for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Task items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTask(RequestOptions requestOptions) { + PagedFlux pagedFluxResponse = this.serviceClient.listTaskAsync(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a task by taskId. + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelTaskWithResponse(String taskId, RequestOptions requestOptions) { + return this.serviceClient.cancelTaskWithResponseAsync(taskId, requestOptions); + } + + /** + * Retrieve a list of assets for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @param skip The number of result items to skip. + * @param mark Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and + * subsequent values are returned in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of AssetResource items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAssetResource(String filter, String orderBy, Integer skip, String mark) { + // Generated convenience method for listAssetResource + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (mark != null) { + requestOptions.addQueryParam("mark", mark, false); + } + PagedFlux pagedFluxResponse = listAssetResource(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map( + protocolMethodData -> + protocolMethodData.toObject( + AssetResource.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a list of assets for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of AssetResource items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAssetResource() { + // Generated convenience method for listAssetResource + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listAssetResource(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map( + protocolMethodData -> + protocolMethodData.toObject( + AssetResource.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Update labels on assets matching the provided filter. + * + * @param filter An expression on the resource type that selects the resources to be returned. + * @param assetUpdateData A request body used to update an asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)); + } + + /** + * Retrieve an asset by assetId. + * + * @param assetId The system generated unique id for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the items in the current page of results on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAssetResource(String assetId) { + // Generated convenience method for getAssetResourceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAssetResourceWithResponse(assetId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(AssetResource.class)); + } + + /** + * Retrieve a list of data connections. + * + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DataConnection items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDataConnection(Integer skip) { + // Generated convenience method for listDataConnection + RequestOptions requestOptions = new RequestOptions(); + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listDataConnection(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map( + protocolMethodData -> + protocolMethodData.toObject( + DataConnection.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a list of data connections. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DataConnection items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDataConnection() { + // Generated convenience method for listDataConnection + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listDataConnection(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? 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( + DataConnection.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Validate a data connection with a given dataConnectionName. + * + * @param dataConnectionData The dataConnectionData parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono validateDataConnection(DataConnectionData dataConnectionData) { + // Generated convenience method for validateDataConnectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return validateDataConnectionWithResponse(BinaryData.fromObject(dataConnectionData), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(ValidateResult.class)); + } + + /** + * Retrieve a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDataConnection(String dataConnectionName) { + // Generated convenience method for getDataConnectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDataConnectionWithResponse(dataConnectionName, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DataConnection.class)); + } + + /** + * Create or replace a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @param dataConnectionData The dataConnectionData parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrReplaceDataConnection( + String dataConnectionName, DataConnectionData dataConnectionData) { + // Generated convenience method for createOrReplaceDataConnectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOrReplaceDataConnectionWithResponse( + dataConnectionName, BinaryData.fromObject(dataConnectionData), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DataConnection.class)); + } + + /** + * Delete a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteDataConnection(String dataConnectionName) { + // Generated convenience method for deleteDataConnectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteDataConnectionWithResponse(dataConnectionName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve a list of discovery group for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDiscoGroup(String filter, Integer skip) { + // Generated convenience method for listDiscoGroup + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listDiscoGroup(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map( + protocolMethodData -> + protocolMethodData.toObject( + DiscoGroup.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a list of discovery group for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDiscoGroup() { + // Generated convenience method for listDiscoGroup + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listDiscoGroup(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? 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( + DiscoGroup.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Validate a discovery group with a given groupName. + * + * @param discoGroupData A request body used to create a discovery group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono validateDiscoGroup(DiscoGroupData discoGroupData) { + // Generated convenience method for validateDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return validateDiscoGroupWithResponse(BinaryData.fromObject(discoGroupData), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(ValidateResult.class)); + } + + /** + * Retrieve a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDiscoGroup(String groupName) { + // Generated convenience method for getDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDiscoGroupWithResponse(groupName, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DiscoGroup.class)); + } + + /** + * Create a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param discoGroupData A request body used to create a discovery group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrReplaceDiscoGroup(String groupName, DiscoGroupData discoGroupData) { + // Generated convenience method for createOrReplaceDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(discoGroupData), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DiscoGroup.class)); + } + + /** + * Run a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono runDiscoGroup(String groupName) { + // Generated convenience method for runDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return runDiscoGroupWithResponse(groupName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + * @param groupName The unique identifier for the discovery group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRuns(String groupName) { + // Generated convenience method for listRuns + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listRuns(groupName, requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map( + protocolMethodData -> + protocolMethodData.toObject( + DiscoRunResult.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoTemplate items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDiscoTemplate(String filter, Integer skip) { + // Generated convenience method for listDiscoTemplate + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listDiscoTemplate(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map( + protocolMethodData -> + protocolMethodData.toObject( + DiscoTemplate.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoTemplate items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDiscoTemplate() { + // Generated convenience method for listDiscoTemplate + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listDiscoTemplate(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? 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( + DiscoTemplate.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a disco template with a given templateId. + * + * @param templateId The system generated unique id for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the items in the current page of results on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDiscoTemplate(String templateId) { + // Generated convenience method for getDiscoTemplateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDiscoTemplateWithResponse(templateId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DiscoTemplate.class)); + } + + /** + * Get billable assets summary for the workspace. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return billable assets summary for the workspace on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getBillable() { + // Generated convenience method for getBillableWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getBillableWithResponse(requestOptions) + .flatMap(FluxUtil::toMono) + .map( + protocolMethodData -> + cleanUp(protocolMethodData).toObject(ReportBillableAssetSummaryResult.class)); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request. + * + * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the most recent snapshot of asset summary values for the snapshot request on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSnapshot(ReportAssetSnapshotRequest reportAssetSnapshotRequest) { + // Generated convenience method for getSnapshotWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSnapshotWithResponse(BinaryData.fromObject(reportAssetSnapshotRequest), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(ReportAssetSnapshotResult.class)); + } + + /** + * Get asset summary details for the summary request. + * + * @param reportAssetSummaryRequest A request body used to retrieve summary asset information. One and only one + * collection of summary identifiers must be provided: filters, metrics, or metricCategories. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return asset summary details for the summary request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSummary(ReportAssetSummaryRequest reportAssetSummaryRequest) { + // Generated convenience method for getSummaryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSummaryWithResponse(BinaryData.fromObject(reportAssetSummaryRequest), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(ReportAssetSummaryResult.class)); + } + + /** + * Retrieve a list of saved filters for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of SavedFilter items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSavedFilter(String filter, Integer skip) { + // Generated convenience method for listSavedFilter + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listSavedFilter(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map( + protocolMethodData -> + protocolMethodData.toObject( + SavedFilter.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a list of saved filters for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of SavedFilter items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSavedFilter() { + // Generated convenience method for listSavedFilter + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listSavedFilter(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? 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( + SavedFilter.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a saved filter by filterName. + * + * @param filterName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSavedFilter(String filterName) { + // Generated convenience method for getSavedFilterWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSavedFilterWithResponse(filterName, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(SavedFilter.class)); + } + + /** + * Create or replace a saved filter with a given filterName. + * + * @param filterName The caller provided unique name for the resource. + * @param savedFilterData A request body used to create a saved filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrReplaceSavedFilter(String filterName, SavedFilterData savedFilterData) { + // Generated convenience method for createOrReplaceSavedFilterWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOrReplaceSavedFilterWithResponse( + filterName, BinaryData.fromObject(savedFilterData), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(SavedFilter.class)); + } + + /** + * Delete a saved filter with a given filterName. + * + * @param filterName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteSavedFilter(String filterName) { + // Generated convenience method for deleteSavedFilterWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteSavedFilterWithResponse(filterName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve a list of tasks for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Task items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTask(String filter, String orderBy, Integer skip) { + // Generated convenience method for listTask + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listTask(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map( + protocolMethodData -> + protocolMethodData.toObject(Task.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a list of tasks for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Task items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTask() { + // Generated convenience method for listTask + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTask(requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? 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.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a task by taskId. + * + * @param taskId The unique identifier of the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTask(String taskId) { + // Generated convenience method for getTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTaskWithResponse(taskId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(Task.class)); + } + + /** + * Cancel a task by taskId. + * + * @param taskId The unique identifier of the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelTask(String taskId) { + // Generated convenience method for cancelTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelTaskWithResponse(taskId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> cleanUp(protocolMethodData).toObject(Task.class)); + } + + private BinaryData cleanUp(BinaryData input) { + return BinaryData.fromString(input.toString().replaceAll("\\+0000", "+00:00")); + } + + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     submittedDate: OffsetDateTime (Optional)
+     *     startedDate: OffsetDateTime (Optional)
+     *     completedDate: OffsetDateTime (Optional)
+     *     tier: String (Optional)
+     *     state: String(pending/running/completed/failed) (Optional)
+     *     totalAssetsFoundCount: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param groupName The unique identifier for the discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRuns(String groupName, RequestOptions requestOptions) { + PagedFlux pagedFluxResponse = this.serviceClient.listRunsAsync(groupName, requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map(protocolMethodData -> cleanUp(protocolMethodData)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } + + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + * @param groupName The unique identifier for the discovery group. + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRuns(String groupName, String filter, Integer skip) { + // Generated convenience method for listRuns + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listRuns(groupName, requestOptions); + return PagedFlux.create( + () -> + (continuationToken, pageSize) -> { + Flux> flux = + (continuationToken == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationToken).take(1); + return flux.map( + pagedResponse -> + new PagedResponseBase( + pagedResponse.getRequest(), + pagedResponse.getStatusCode(), + pagedResponse.getHeaders(), + pagedResponse.getValue().stream() + .map( + protocolMethodData -> + protocolMethodData.toObject( + DiscoRunResult.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), + null)); + }); + } +} 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 new file mode 100644 index 000000000000..6173fee32f64 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClient.java @@ -0,0 +1,1988 @@ +// 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; + +import com.azure.analytics.defender.easm.implementation.EasmClientImpl; +import com.azure.analytics.defender.easm.models.AssetResource; +import com.azure.analytics.defender.easm.models.AssetUpdateData; +import com.azure.analytics.defender.easm.models.DataConnection; +import com.azure.analytics.defender.easm.models.DataConnectionData; +import com.azure.analytics.defender.easm.models.DiscoGroup; +import com.azure.analytics.defender.easm.models.DiscoGroupData; +import com.azure.analytics.defender.easm.models.DiscoRunResult; +import com.azure.analytics.defender.easm.models.DiscoTemplate; +import com.azure.analytics.defender.easm.models.ReportAssetSnapshotRequest; +import com.azure.analytics.defender.easm.models.ReportAssetSnapshotResult; +import com.azure.analytics.defender.easm.models.ReportAssetSummaryRequest; +import com.azure.analytics.defender.easm.models.ReportAssetSummaryResult; +import com.azure.analytics.defender.easm.models.ReportBillableAssetSummaryResult; +import com.azure.analytics.defender.easm.models.SavedFilter; +import com.azure.analytics.defender.easm.models.SavedFilterData; +import com.azure.analytics.defender.easm.models.Task; +import com.azure.analytics.defender.easm.models.ValidateResult; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** Initializes a new instance of the synchronous EasmClient type. */ +@ServiceClient(builder = EasmClientBuilder.class) +public final class EasmClient { + + @Generated private final EasmClientImpl serviceClient; + + /** + * Initializes an instance of EasmClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + EasmClient(EasmClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Retrieve a list of assets for the provided search parameters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
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 + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of AssetResource items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssetResource(RequestOptions requestOptions) { + return this.serviceClient.listAssetResource(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue)); + } + + /** + * Update labels on assets matching the provided filter. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): {
+     *         String: boolean (Optional)
+     *     }
+     *     transfers: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param assetId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the items in the current page of results along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssetResourceWithResponse(String assetId, RequestOptions requestOptions) { + return this.serviceClient.getAssetResourceWithResponse(assetId, requestOptions); + } + + /** + * Retrieve a list of data connections. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DataConnection items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDataConnection(RequestOptions requestOptions) { + return this.serviceClient.listDataConnection(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue)); + } + + /** + * Validate a data connection with a given dataConnectionName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             value: Object (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param dataConnectionData The dataConnectionData parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateDataConnectionWithResponse( + BinaryData dataConnectionData, RequestOptions requestOptions) { + return this.serviceClient.validateDataConnectionWithResponse(dataConnectionData, requestOptions); + } + + /** + * Retrieve a data connection with a given dataConnectionName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param dataConnectionName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDataConnectionWithResponse( + String dataConnectionName, RequestOptions requestOptions) { + return this.serviceClient.getDataConnectionWithResponse(dataConnectionName, requestOptions); + } + + /** + * Create or replace a data connection with a given dataConnectionName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param dataConnectionName The caller provided unique name for the resource. + * @param dataConnectionData The dataConnectionData parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrReplaceDataConnectionWithResponse( + String dataConnectionName, BinaryData dataConnectionData, RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDataConnectionWithResponse( + dataConnectionName, dataConnectionData, requestOptions); + } + + /** + * Delete a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDataConnectionWithResponse(String dataConnectionName, RequestOptions requestOptions) { + return this.serviceClient.deleteDataConnectionWithResponse(dataConnectionName, requestOptions); + } + + /** + * Validate a discovery group with a given groupName. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             value: Object (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param discoGroupData A request body used to create a discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateDiscoGroupWithResponse( + BinaryData discoGroupData, RequestOptions requestOptions) { + return this.serviceClient.validateDiscoGroupWithResponse(discoGroupData, requestOptions); + } + + /** + * Retrieve a discovery group with a given groupName. + * + *

Response Body Schema + * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param groupName The caller provided unique name for the resource. + * @param discoGroupData A request body used to create a discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrReplaceDiscoGroupWithResponse( + String groupName, BinaryData discoGroupData, RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceDiscoGroupWithResponse(groupName, discoGroupData, requestOptions); + } + + /** + * Run a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response runDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { + return this.serviceClient.runDiscoGroupWithResponse(groupName, requestOptions); + } + + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     submittedDate: OffsetDateTime (Optional)
+     *     startedDate: OffsetDateTime (Optional)
+     *     completedDate: OffsetDateTime (Optional)
+     *     tier: String (Optional)
+     *     state: String(pending/running/completed/failed) (Optional)
+     *     totalAssetsFoundCount: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param groupName The unique identifier for the discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRuns(String groupName, RequestOptions requestOptions) { + return this.serviceClient.listRuns(groupName, requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue)); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoTemplate items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoTemplate(RequestOptions requestOptions) { + return this.serviceClient.listDiscoTemplate(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue)); + } + + /** + * Retrieve a disco template with a given templateId. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param templateId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the items in the current page of results along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDiscoTemplateWithResponse(String templateId, RequestOptions requestOptions) { + return this.serviceClient.getDiscoTemplateWithResponse(templateId, requestOptions); + } + + /** + * Get billable assets summary for the workspace. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     assetSummaries (Optional): [
+     *          (Optional){
+     *             date: LocalDate (Optional)
+     *             total: Long (Optional)
+     *             assetBreakdown (Optional): [
+     *                  (Optional){
+     *                     kind: String(domain/host/ipAddress) (Optional)
+     *                     count: Long (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return billable assets summary for the workspace along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBillableWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getBillableWithResponse(requestOptions); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     metric: String (Optional)
+     *     labelName: String (Optional)
+     *     size: Integer (Optional)
+     *     page: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     displayName: String (Optional)
+     *     metric: String (Optional)
+     *     labelName: String (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     description: String (Optional)
+     *     assets (Optional): {
+     *         totalElements: Long (Optional)
+     *         mark: String (Optional)
+     *         nextLink: String (Optional)
+     *         value (Optional): [
+     *              (Optional){
+     *                 id: String (Required)
+     *                 name: String (Optional)
+     *                 displayName: String (Optional)
+     *                 uuid: String (Optional)
+     *                 createdDate: OffsetDateTime (Optional)
+     *                 updatedDate: OffsetDateTime (Optional)
+     *                 state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *                 externalId: String (Optional)
+     *                 labels (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 wildcard: Boolean (Optional)
+     *                 discoGroupName: String (Optional)
+     *                 auditTrail (Optional): [
+     *                      (Optional){
+     *                         id: String (Optional)
+     *                         name: String (Optional)
+     *                         displayName: String (Optional)
+     *                         kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *                         reason: String (Optional)
+     *                     }
+     *                 ]
+     *                 reason: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the most recent snapshot of asset summary values for the snapshot request along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSnapshotWithResponse( + BinaryData reportAssetSnapshotRequest, RequestOptions requestOptions) { + return this.serviceClient.getSnapshotWithResponse(reportAssetSnapshotRequest, requestOptions); + } + + /** + * Get asset summary details for the summary request. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     metricCategories (Optional): [
+     *         String (Optional)
+     *     ]
+     *     metrics (Optional): [
+     *         String (Optional)
+     *     ]
+     *     filters (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupBy: String (Optional)
+     *     segmentBy: String (Optional)
+     *     labelName: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     assetSummaries (Optional): [
+     *          (Optional){
+     *             displayName: String (Optional)
+     *             description: String (Optional)
+     *             updatedAt: OffsetDateTime (Optional)
+     *             metricCategory: String (Optional)
+     *             metric: String (Optional)
+     *             filter: String (Optional)
+     *             labelName: String (Optional)
+     *             count: Long (Optional)
+     *             link: String (Optional)
+     *             children (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 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 asset summary details for the summary request along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSummaryWithResponse( + BinaryData reportAssetSummaryRequest, RequestOptions requestOptions) { + return this.serviceClient.getSummaryWithResponse(reportAssetSummaryRequest, requestOptions); + } + + /** + * Retrieve a list of saved filters for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of SavedFilter items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSavedFilter(RequestOptions requestOptions) { + return this.serviceClient.listSavedFilter(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue)); + } + + /** + * Retrieve a saved filter by filterName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param filterName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSavedFilterWithResponse(String filterName, RequestOptions requestOptions) { + return this.serviceClient.getSavedFilterWithResponse(filterName, requestOptions); + } + + /** + * Create or replace a saved filter with a given filterName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param filterName The caller provided unique name for the resource. + * @param savedFilterData A request body used to create a saved filter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrReplaceSavedFilterWithResponse( + String filterName, BinaryData savedFilterData, RequestOptions requestOptions) { + return this.serviceClient.createOrReplaceSavedFilterWithResponse(filterName, savedFilterData, requestOptions); + } + + /** + * Delete a saved filter with a given filterName. + * + * @param filterName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteSavedFilterWithResponse(String filterName, RequestOptions requestOptions) { + return this.serviceClient.deleteSavedFilterWithResponse(filterName, requestOptions); + } + + /** + * Retrieve a list of tasks for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Task items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTask(RequestOptions requestOptions) { + return this.serviceClient.listTask(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue)); + } + + /** + * Retrieve a task by taskId. + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @param taskId The unique identifier of the task. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelTaskWithResponse(String taskId, RequestOptions requestOptions) { + return this.serviceClient.cancelTaskWithResponse(taskId, requestOptions); + } + + /** + * Retrieve a list of assets for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of AssetResource items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssetResource() { + // Generated convenience method for listAssetResource + RequestOptions requestOptions = new RequestOptions(); + return serviceClient + .listAssetResource(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(AssetResource.class)); + } + + /** + * Update labels on assets matching the provided filter. + * + * @param filter An expression on the resource type that selects the resources to be returned. + * @param assetUpdateData A request body used to update an asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Task updateAssets(String filter, AssetUpdateData assetUpdateData) { + // Generated convenience method for updateAssetsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp( + updateAssetsWithResponse(filter, BinaryData.fromObject(assetUpdateData), requestOptions) + .getValue()) + .toObject(Task.class); + } + + /** + * Retrieve an asset by assetId. + * + * @param assetId The system generated unique id for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the items in the current page of results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssetResource getAssetResource(String assetId) { + // Generated convenience method for getAssetResourceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp(getAssetResourceWithResponse(assetId, requestOptions).getValue()).toObject(AssetResource.class); + } + + /** + * Retrieve a list of data connections. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DataConnection items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDataConnection() { + // Generated convenience method for listDataConnection + RequestOptions requestOptions = new RequestOptions(); + return serviceClient + .listDataConnection(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DataConnection.class)); + } + + /** + * Validate a data connection with a given dataConnectionName. + * + * @param dataConnectionData The dataConnectionData parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateResult validateDataConnection(DataConnectionData dataConnectionData) { + // Generated convenience method for validateDataConnectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp( + validateDataConnectionWithResponse(BinaryData.fromObject(dataConnectionData), requestOptions) + .getValue()) + .toObject(ValidateResult.class); + } + + /** + * Retrieve a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnection getDataConnection(String dataConnectionName) { + // Generated convenience method for getDataConnectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp(getDataConnectionWithResponse(dataConnectionName, requestOptions).getValue()) + .toObject(DataConnection.class); + } + + /** + * Create or update a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @param dataConnectionData The dataConnectionData parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnection createOrReplaceDataConnection( + String dataConnectionName, DataConnectionData dataConnectionData) { + // Generated convenience method for createOrReplaceDataConnectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp( + createOrReplaceDataConnectionWithResponse( + dataConnectionName, BinaryData.fromObject(dataConnectionData), requestOptions) + .getValue()) + .toObject(DataConnection.class); + } + + /** + * Delete a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDataConnection(String dataConnectionName) { + // Generated convenience method for deleteDataConnectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteDataConnectionWithResponse(dataConnectionName, requestOptions).getValue(); + } + + /** + * Retrieve a list of discovery group for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoGroup() { + // Generated convenience method for listDiscoGroup + RequestOptions requestOptions = new RequestOptions(); + return serviceClient + .listDiscoGroup(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoGroup.class)); + } + + /** + * Validate a discovery group with a given groupName. + * + * @param discoGroupData A request body used to create a discovery group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateResult validateDiscoGroup(DiscoGroupData discoGroupData) { + // Generated convenience method for validateDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp(validateDiscoGroupWithResponse(BinaryData.fromObject(discoGroupData), requestOptions).getValue()) + .toObject(ValidateResult.class); + } + + /** + * Retrieve a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiscoGroup getDiscoGroup(String groupName) { + // Generated convenience method for getDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp(getDiscoGroupWithResponse(groupName, requestOptions).getValue()).toObject(DiscoGroup.class); + } + + /** + * Create a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param discoGroupData A request body used to create a discovery group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiscoGroup createOrReplaceDiscoGroup(String groupName, DiscoGroupData discoGroupData) { + // Generated convenience method for createOrReplaceDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp( + createOrReplaceDiscoGroupWithResponse( + groupName, BinaryData.fromObject(discoGroupData), requestOptions) + .getValue()) + .toObject(DiscoGroup.class); + } + + private BinaryData cleanUp(BinaryData input) { + return BinaryData.fromString(input.toString().replaceAll("\\+0000", "+00:00")); + } + + /** + * Run a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void runDiscoGroup(String groupName) { + // Generated convenience method for runDiscoGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + runDiscoGroupWithResponse(groupName, requestOptions).getValue(); + } + + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + * @param groupName The unique identifier for the discovery group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRuns(String groupName) { + // Generated convenience method for listRuns + RequestOptions requestOptions = new RequestOptions(); + return serviceClient + .listRuns(groupName, requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoRunResult.class)); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoTemplate items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoTemplate() { + // Generated convenience method for listDiscoTemplate + RequestOptions requestOptions = new RequestOptions(); + return serviceClient + .listDiscoTemplate(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoTemplate.class)); + } + + /** + * Retrieve a disco template with a given templateId. + * + * @param templateId The system generated unique id for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the items in the current page of results. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DiscoTemplate getDiscoTemplate(String templateId) { + // Generated convenience method for getDiscoTemplateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDiscoTemplateWithResponse(templateId, requestOptions).getValue().toObject(DiscoTemplate.class); + } + + /** + * Get billable assets summary for the workspace. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return billable assets summary for the workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReportBillableAssetSummaryResult getBillable() { + // Generated convenience method for getBillableWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp(getBillableWithResponse(requestOptions).getValue()) + .toObject(ReportBillableAssetSummaryResult.class); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request. + * + * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the most recent snapshot of asset summary values for the snapshot request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReportAssetSnapshotResult getSnapshot(ReportAssetSnapshotRequest reportAssetSnapshotRequest) { + // Generated convenience method for getSnapshotWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp( + getSnapshotWithResponse(BinaryData.fromObject(reportAssetSnapshotRequest), requestOptions) + .getValue()) + .toObject(ReportAssetSnapshotResult.class); + } + + /** + * Get asset summary details for the summary request. + * + * @param reportAssetSummaryRequest A request body used to retrieve summary asset information. One and only one + * collection of summary identifiers must be provided: filters, metrics, or metricCategories. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return asset summary details for the summary request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReportAssetSummaryResult getSummary(ReportAssetSummaryRequest reportAssetSummaryRequest) { + // Generated convenience method for getSummaryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp( + getSummaryWithResponse(BinaryData.fromObject(reportAssetSummaryRequest), requestOptions) + .getValue()) + .toObject(ReportAssetSummaryResult.class); + } + + /** + * Retrieve a list of saved filters for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of SavedFilter items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSavedFilter() { + // Generated convenience method for listSavedFilter + RequestOptions requestOptions = new RequestOptions(); + return serviceClient + .listSavedFilter(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(SavedFilter.class)); + } + + /** + * Retrieve a saved filter by filterName. + * + * @param filterName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SavedFilter getSavedFilter(String filterName) { + // Generated convenience method for getSavedFilterWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp(getSavedFilterWithResponse(filterName, requestOptions).getValue()).toObject(SavedFilter.class); + } + + /** + * Create or update a saved filter with a given filterName. + * + * @param filterName The caller provided unique name for the resource. + * @param savedFilterData A request body used to create a saved filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SavedFilter createOrReplaceSavedFilter(String filterName, SavedFilterData savedFilterData) { + // Generated convenience method for createOrReplaceSavedFilterWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp( + createOrReplaceSavedFilterWithResponse( + filterName, BinaryData.fromObject(savedFilterData), requestOptions) + .getValue()) + .toObject(SavedFilter.class); + } + + /** + * Delete a saved filter with a given filterName. + * + * @param filterName The caller provided unique name for the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteSavedFilter(String filterName) { + // Generated convenience method for deleteSavedFilterWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteSavedFilterWithResponse(filterName, requestOptions).getValue(); + } + + /** + * Retrieve a list of tasks for the provided search parameters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Task items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTask() { + // Generated convenience method for listTask + RequestOptions requestOptions = new RequestOptions(); + return serviceClient + .listTask(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(Task.class)); + } + + /** + * Retrieve a task by taskId. + * + * @param taskId The unique identifier of the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Task getTask(String taskId) { + // Generated convenience method for getTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp(getTaskWithResponse(taskId, requestOptions).getValue()).toObject(Task.class); + } + + /** + * Cancel a task by taskId. + * + * @param taskId The unique identifier of the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Task cancelTask(String taskId) { + // Generated convenience method for cancelTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cleanUp(cancelTaskWithResponse(taskId, requestOptions).getValue()).toObject(Task.class); + } + + /** + * Retrieve a list of discovery group for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoGroup(RequestOptions requestOptions) { + return this.serviceClient.listDiscoGroup(requestOptions).mapPage(bodyItemValue -> cleanUp(bodyItemValue)); + } + + /** + * Retrieve a list of assets for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @param skip The number of result items to skip. + * @param mark Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and + * subsequent values are returned in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of AssetResource items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssetResource(String filter, String orderBy, Integer skip, String mark) { + // Generated convenience method for listAssetResource + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (mark != null) { + requestOptions.addQueryParam("mark", mark, false); + } + return serviceClient + .listAssetResource(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(AssetResource.class)); + } + + /** + * Retrieve a list of data connections. + * + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DataConnection items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDataConnection(Integer skip) { + // Generated convenience method for listDataConnection + RequestOptions requestOptions = new RequestOptions(); + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient + .listDataConnection(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DataConnection.class)); + } + + /** + * Retrieve a list of discovery group for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoGroup(String filter, Integer skip) { + // Generated convenience method for listDiscoGroup + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient + .listDiscoGroup(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoGroup.class)); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of DiscoTemplate items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoTemplate(String filter, Integer skip) { + // Generated convenience method for listDiscoTemplate + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient + .listDiscoTemplate(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoTemplate.class)); + } + + /** + * Retrieve a list of saved filters for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of SavedFilter items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSavedFilter(String filter, Integer skip) { + // Generated convenience method for listSavedFilter + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient + .listSavedFilter(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(SavedFilter.class)); + } + + /** + * Retrieve a list of tasks for the provided search parameters. + * + * @param filter Filter the result list using the given expression. + * @param orderBy A list of expressions that specify the order of the returned resources. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Task items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTask(String filter, String orderBy, Integer skip) { + // Generated convenience method for listTask + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient + .listTask(requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(Task.class)); + } + + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + * @param groupName The unique identifier for the discovery group. + * @param filter Filter the result list using the given expression. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRuns(String groupName, String filter, Integer skip) { + // Generated convenience method for listRuns + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient + .listRuns(groupName, requestOptions) + .mapPage(bodyItemValue -> cleanUp(bodyItemValue).toObject(DiscoRunResult.class)); + } +} 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 new file mode 100644 index 000000000000..3de38765d772 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmClientBuilder.java @@ -0,0 +1,357 @@ +// 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; + +import com.azure.analytics.defender.easm.implementation.EasmClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +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; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.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.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A builder for creating a new instance of the EasmClient type. */ +@ServiceClientBuilder(serviceClients = {EasmClient.class, EasmAsyncClient.class}) +public final class EasmClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { + + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] {"https://easm.defender.microsoft.com/.default"}; + + @Generated + private static final Map PROPERTIES = + CoreUtils.getProperties("azure-analytics-defender-easm.properties"); + + @Generated private final List pipelinePolicies; + + /** Create an instance of the EasmClientBuilder. */ + @Generated + public EasmClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated private HttpPipeline pipeline; + + /** {@inheritDoc}. */ + @Generated + @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."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** {@inheritDoc}. */ + @Generated + @Override + public EasmClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public EasmClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated private ClientOptions clientOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public EasmClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated private RetryOptions retryOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public EasmClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public EasmClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated private Configuration configuration; + + /** {@inheritDoc}. */ + @Generated + @Override + public EasmClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public EasmClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public EasmClientBuilder endpoint(String endpoint) { + this.endpoint = 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 + */ + @Generated private EasmServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the EasmClientBuilder. + */ + @Generated + public EasmClientBuilder serviceVersion(EasmServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the EasmClientBuilder. + */ + @Generated + public EasmClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of EasmClientImpl with the provided parameters. + * + * @return an instance of EasmClientImpl. + */ + @Generated + private EasmClientImpl buildInnerClient() { + 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); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + 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) { + policies.add(new AddHeadersPolicy(headers)); + } + 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())); + policies.add(new AddDatePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of EasmAsyncClient class. + * + * @return an instance of EasmAsyncClient. + */ + @Generated + public EasmAsyncClient buildAsyncClient() { + return new EasmAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of EasmClient class. + * + * @return an instance of EasmClient. + */ + @Generated + public EasmClient buildClient() { + return new EasmClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(EasmClientBuilder.class); +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java new file mode 100644 index 000000000000..249b7de982ed --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/EasmServiceVersion.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm; + +import com.azure.core.util.ServiceVersion; + +/** Service version of EasmClient. */ +public enum EasmServiceVersion implements ServiceVersion { + /** Enum value 2023-03-01-preview. */ + V2023_03_01_PREVIEW("2023-03-01-preview"); + + private final String version; + + EasmServiceVersion(String version) { + this.version = version; + } + + /** {@inheritDoc} */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link EasmServiceVersion}. + */ + public static EasmServiceVersion getLatest() { + return V2023_03_01_PREVIEW; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java new file mode 100644 index 000000000000..3d1cf89353f1 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java @@ -0,0 +1,6790 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.analytics.defender.easm.implementation; + +import com.azure.analytics.defender.easm.EasmServiceVersion; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.UrlBuilder; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the EasmClient type. */ +public final class EasmClientImpl { + /** The proxy service used to perform REST calls. */ + private final EasmClientService service; + + /** The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com. */ + private final String endpoint; + + /** + * Gets The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com. + * + * @return the endpoint value. + */ + 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. */ + private final EasmServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public EasmServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * 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. + * @param serviceVersion Service version. + */ + public EasmClientImpl( + String endpoint, + String subscriptionId, + String resourceGroupName, + String workspaceName, + EasmServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), + endpoint, + subscriptionId, + resourceGroupName, + workspaceName, + serviceVersion); + } + + /** + * Initializes an instance of EasmClient client. + * + * @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. + * @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); + } + + /** + * Initializes an instance of EasmClient client. + * + * @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. + * @param serviceVersion Service version. + */ + public EasmClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String endpoint, + String subscriptionId, + String resourceGroupName, + String workspaceName, + 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()); + } + + /** 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}") + @ServiceInterface(name = "EasmClient") + public interface EasmClientService { + @Get("/assets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/assets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/assets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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, + RequestOptions requestOptions, + Context context); + + @Post("/assets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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, + RequestOptions requestOptions, + Context context); + + @Get("/assets/{assetId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/assets/{assetId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/dataConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/dataConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/dataConnections:validate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/dataConnections:validate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/dataConnections/{dataConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/dataConnections/{dataConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Put("/dataConnections/{dataConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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, + RequestOptions requestOptions, + Context context); + + @Put("/dataConnections/{dataConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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, + RequestOptions requestOptions, + Context context); + + @Delete("/dataConnections/{dataConnectionName}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Delete("/dataConnections/{dataConnectionName}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/discoGroups:validate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/discoGroups:validate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoGroups/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoGroups/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Put("/discoGroups/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrReplaceDiscoGroup( + @HostParam("endpoint") String endpoint, + @HostParam("subscriptionId") String subscriptionId, + @HostParam("resourceGroupName") String resourceGroupName, + @HostParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("groupName") String groupName, + @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData discoGroupData, + RequestOptions requestOptions, + Context context); + + @Put("/discoGroups/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createOrReplaceDiscoGroupSync( + @HostParam("endpoint") String endpoint, + @HostParam("subscriptionId") String subscriptionId, + @HostParam("resourceGroupName") String resourceGroupName, + @HostParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("groupName") String groupName, + @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData discoGroupData, + RequestOptions requestOptions, + Context context); + + @Post("/discoGroups/{groupName}:run") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/discoGroups/{groupName}:run") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoGroups/{groupName}/runs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoGroups/{groupName}/runs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoTemplates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoTemplates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoTemplates/{templateId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/discoTemplates/{templateId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/reports/assets:getBillable") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/reports/assets:getBillable") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/reports/assets:getSnapshot") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/reports/assets:getSnapshot") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/reports/assets:getSummary") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/reports/assets:getSummary") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/savedFilters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/savedFilters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/savedFilters/{filterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/savedFilters/{filterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Put("/savedFilters/{filterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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, + RequestOptions requestOptions, + Context context); + + @Put("/savedFilters/{filterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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, + RequestOptions requestOptions, + Context context); + + @Delete("/savedFilters/{filterName}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Delete("/savedFilters/{filterName}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/tasks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/tasks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/tasks/{taskId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("/tasks/{taskId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/tasks/{taskId}:cancel") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Post("/tasks/{taskId}:cancel") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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); + } + + /** + * Retrieve a list of assets for the provided search parameters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
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 + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of AssetResource items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)) + .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
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 + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of AssetResource items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAssetResourceAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listAssetResourceSinglePageAsync(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listAssetResourceNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a list of assets for the provided search parameters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
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 + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of AssetResource items along with {@link PagedResponse}. + */ + @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); + 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
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 + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of AssetResource items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssetResource(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedIterable<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listAssetResourceSinglePage(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listAssetResourceNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Update labels on assets matching the provided filter. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): {
+     *         String: boolean (Optional)
+     *     }
+     *     transfers: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateAssetsWithResponseAsync( + String filter, BinaryData assetUpdateData, 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)); + } + + /** + * Update labels on assets matching the provided filter. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): {
+     *         String: boolean (Optional)
+     *     }
+     *     transfers: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param assetId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the items in the current page of results along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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)); + } + + /** + * Retrieve an asset by assetId. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param assetId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the items in the current page of results along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssetResourceWithResponse(String assetId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getAssetResourceSync( + this.getEndpoint(), + this.getSubscriptionId(), + this.getResourceGroupName(), + this.getWorkspaceName(), + this.getServiceVersion().getVersion(), + assetId, + accept, + requestOptions, + Context.NONE); + } + + /** + * Retrieve a list of data connections. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DataConnection items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)) + .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
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DataConnection items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDataConnectionAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDataConnectionSinglePageAsync(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDataConnectionNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a list of data connections. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DataConnection items along with {@link PagedResponse}. + */ + @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); + 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
NameTypeRequiredDescription
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DataConnection items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDataConnection(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedIterable<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDataConnectionSinglePage(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDataConnectionNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Validate a data connection with a given dataConnectionName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             value: Object (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param dataConnectionData The dataConnectionData parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> validateDataConnectionWithResponseAsync( + BinaryData dataConnectionData, 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)); + } + + /** + * Validate a data connection with a given dataConnectionName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             value: Object (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param dataConnectionData The dataConnectionData parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateDataConnectionWithResponse( + BinaryData dataConnectionData, 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); + } + + /** + * Retrieve a data connection with a given dataConnectionName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param dataConnectionName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)); + } + + /** + * Retrieve a data connection with a given dataConnectionName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param dataConnectionName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * Create or replace a data connection with a given dataConnectionName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param dataConnectionName The caller provided unique name for the resource. + * @param dataConnectionData The dataConnectionData parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrReplaceDataConnectionWithResponseAsync( + String dataConnectionName, BinaryData dataConnectionData, 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)); + } + + /** + * Create or replace a data connection with a given dataConnectionName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param dataConnectionName The caller provided unique name for the resource. + * @param dataConnectionData The dataConnectionData parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrReplaceDataConnectionWithResponse( + String dataConnectionName, BinaryData dataConnectionData, 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); + } + + /** + * Delete a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDataConnectionWithResponseAsync( + String dataConnectionName, 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)); + } + + /** + * Delete a data connection with a given dataConnectionName. + * + * @param dataConnectionName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDataConnectionWithResponse(String dataConnectionName, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteDataConnectionSync( + this.getEndpoint(), + this.getSubscriptionId(), + this.getResourceGroupName(), + this.getWorkspaceName(), + this.getServiceVersion().getVersion(), + dataConnectionName, + accept, + requestOptions, + Context.NONE); + } + + /** + * Retrieve a list of discovery group for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoGroup items along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)) + .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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDiscoGroupAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDiscoGroupSinglePageAsync(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDiscoGroupNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a list of discovery group for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoGroup items along with {@link PagedResponse}. + */ + @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); + 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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoGroup items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoGroup(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedIterable<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDiscoGroupSinglePage(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDiscoGroupNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Validate a discovery group with a given groupName. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             value: Object (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param discoGroupData A request body used to create a discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> validateDiscoGroupWithResponseAsync( + BinaryData discoGroupData, 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)); + } + + /** + * Validate a discovery group with a given groupName. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             value: Object (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param discoGroupData A request body used to create a discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateDiscoGroupWithResponse( + BinaryData discoGroupData, 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); + } + + /** + * Retrieve a discovery group with a given groupName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param groupName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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)); + } + + /** + * Retrieve a discovery group with a given groupName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param groupName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @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); + } + + /** + * Create a discovery group with a given groupName. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param groupName The caller provided unique name for the resource. + * @param discoGroupData A request body used to create a discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the 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) { + 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)); + } + + /** + * Create a discovery group with a given groupName. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param groupName The caller provided unique name for the resource. + * @param discoGroupData A request body used to create a discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrReplaceDiscoGroupWithResponse( + String groupName, BinaryData discoGroupData, 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); + } + + /** + * Run a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> 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)); + } + + /** + * Run a discovery group with a given groupName. + * + * @param groupName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response 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); + } + + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     submittedDate: OffsetDateTime (Optional)
+     *     startedDate: OffsetDateTime (Optional)
+     *     completedDate: OffsetDateTime (Optional)
+     *     tier: String (Optional)
+     *     state: String(pending/running/completed/failed) (Optional)
+     *     totalAssetsFoundCount: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param groupName The unique identifier for the discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)) + .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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     submittedDate: OffsetDateTime (Optional)
+     *     startedDate: OffsetDateTime (Optional)
+     *     completedDate: OffsetDateTime (Optional)
+     *     tier: String (Optional)
+     *     state: String(pending/running/completed/failed) (Optional)
+     *     totalAssetsFoundCount: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param groupName The unique identifier for the discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRunsAsync(String groupName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listRunsSinglePageAsync(groupName, requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listRunsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a collection of discovery run results for a discovery group with a given groupName. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     submittedDate: OffsetDateTime (Optional)
+     *     startedDate: OffsetDateTime (Optional)
+     *     completedDate: OffsetDateTime (Optional)
+     *     tier: String (Optional)
+     *     state: String(pending/running/completed/failed) (Optional)
+     *     totalAssetsFoundCount: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param groupName The unique identifier for the discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse}. + */ + @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); + 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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     submittedDate: OffsetDateTime (Optional)
+     *     startedDate: OffsetDateTime (Optional)
+     *     completedDate: OffsetDateTime (Optional)
+     *     tier: String (Optional)
+     *     state: String(pending/running/completed/failed) (Optional)
+     *     totalAssetsFoundCount: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param groupName The unique identifier for the discovery group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRuns(String groupName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedIterable<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listRunsSinglePage(groupName, requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listRunsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoTemplate items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)) + .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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoTemplate items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDiscoTemplateAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDiscoTemplateSinglePageAsync(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDiscoTemplateNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a list of disco templates for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoTemplate items along with {@link PagedResponse}. + */ + @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); + 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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of DiscoTemplate items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDiscoTemplate(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedIterable<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDiscoTemplateSinglePage(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDiscoTemplateNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a disco template with a given templateId. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param templateId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the items in the current page of results along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)); + } + + /** + * Retrieve a disco template with a given templateId. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param templateId The system generated unique id for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the items in the current page of results along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response 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); + } + + /** + * Get billable assets summary for the workspace. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     assetSummaries (Optional): [
+     *          (Optional){
+     *             date: LocalDate (Optional)
+     *             total: Long (Optional)
+     *             assetBreakdown (Optional): [
+     *                  (Optional){
+     *                     kind: String(domain/host/ipAddress) (Optional)
+     *                     count: Long (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return billable assets summary for the workspace along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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)); + } + + /** + * Get billable assets summary for the workspace. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     assetSummaries (Optional): [
+     *          (Optional){
+     *             date: LocalDate (Optional)
+     *             total: Long (Optional)
+     *             assetBreakdown (Optional): [
+     *                  (Optional){
+     *                     kind: String(domain/host/ipAddress) (Optional)
+     *                     count: Long (Optional)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return billable assets summary for the workspace along with {@link Response}. + */ + @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); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     metric: String (Optional)
+     *     labelName: String (Optional)
+     *     size: Integer (Optional)
+     *     page: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     displayName: String (Optional)
+     *     metric: String (Optional)
+     *     labelName: String (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     description: String (Optional)
+     *     assets (Optional): {
+     *         totalElements: Long (Optional)
+     *         mark: String (Optional)
+     *         nextLink: String (Optional)
+     *         value (Optional): [
+     *              (Optional){
+     *                 id: String (Required)
+     *                 name: String (Optional)
+     *                 displayName: String (Optional)
+     *                 uuid: String (Optional)
+     *                 createdDate: OffsetDateTime (Optional)
+     *                 updatedDate: OffsetDateTime (Optional)
+     *                 state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *                 externalId: String (Optional)
+     *                 labels (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 wildcard: Boolean (Optional)
+     *                 discoGroupName: String (Optional)
+     *                 auditTrail (Optional): [
+     *                      (Optional){
+     *                         id: String (Optional)
+     *                         name: String (Optional)
+     *                         displayName: String (Optional)
+     *                         kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *                         reason: String (Optional)
+     *                     }
+     *                 ]
+     *                 reason: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the most recent snapshot of asset summary values for the snapshot request along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSnapshotWithResponseAsync( + BinaryData reportAssetSnapshotRequest, 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)); + } + + /** + * Get the most recent snapshot of asset summary values for the snapshot request. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     metric: String (Optional)
+     *     labelName: String (Optional)
+     *     size: Integer (Optional)
+     *     page: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     displayName: String (Optional)
+     *     metric: String (Optional)
+     *     labelName: String (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     description: String (Optional)
+     *     assets (Optional): {
+     *         totalElements: Long (Optional)
+     *         mark: String (Optional)
+     *         nextLink: String (Optional)
+     *         value (Optional): [
+     *              (Optional){
+     *                 id: String (Required)
+     *                 name: String (Optional)
+     *                 displayName: String (Optional)
+     *                 uuid: String (Optional)
+     *                 createdDate: OffsetDateTime (Optional)
+     *                 updatedDate: OffsetDateTime (Optional)
+     *                 state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *                 externalId: String (Optional)
+     *                 labels (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 wildcard: Boolean (Optional)
+     *                 discoGroupName: String (Optional)
+     *                 auditTrail (Optional): [
+     *                      (Optional){
+     *                         id: String (Optional)
+     *                         name: String (Optional)
+     *                         displayName: String (Optional)
+     *                         kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *                         reason: String (Optional)
+     *                     }
+     *                 ]
+     *                 reason: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param reportAssetSnapshotRequest A request body used to retrieve an asset report snapshot. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the most recent snapshot of asset summary values for the snapshot request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSnapshotWithResponse( + BinaryData reportAssetSnapshotRequest, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSnapshotSync( + this.getEndpoint(), + this.getSubscriptionId(), + this.getResourceGroupName(), + this.getWorkspaceName(), + this.getServiceVersion().getVersion(), + accept, + reportAssetSnapshotRequest, + requestOptions, + Context.NONE); + } + + /** + * Get asset summary details for the summary request. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     metricCategories (Optional): [
+     *         String (Optional)
+     *     ]
+     *     metrics (Optional): [
+     *         String (Optional)
+     *     ]
+     *     filters (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupBy: String (Optional)
+     *     segmentBy: String (Optional)
+     *     labelName: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     assetSummaries (Optional): [
+     *          (Optional){
+     *             displayName: String (Optional)
+     *             description: String (Optional)
+     *             updatedAt: OffsetDateTime (Optional)
+     *             metricCategory: String (Optional)
+     *             metric: String (Optional)
+     *             filter: String (Optional)
+     *             labelName: String (Optional)
+     *             count: Long (Optional)
+     *             link: String (Optional)
+     *             children (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 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 asset summary details for the summary request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSummaryWithResponseAsync( + BinaryData reportAssetSummaryRequest, 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)); + } + + /** + * Get asset summary details for the summary request. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     metricCategories (Optional): [
+     *         String (Optional)
+     *     ]
+     *     metrics (Optional): [
+     *         String (Optional)
+     *     ]
+     *     filters (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupBy: String (Optional)
+     *     segmentBy: String (Optional)
+     *     labelName: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     assetSummaries (Optional): [
+     *          (Optional){
+     *             displayName: String (Optional)
+     *             description: String (Optional)
+     *             updatedAt: OffsetDateTime (Optional)
+     *             metricCategory: String (Optional)
+     *             metric: String (Optional)
+     *             filter: String (Optional)
+     *             labelName: String (Optional)
+     *             count: Long (Optional)
+     *             link: String (Optional)
+     *             children (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 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 asset summary details for the summary request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSummaryWithResponse( + BinaryData reportAssetSummaryRequest, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSummarySync( + this.getEndpoint(), + this.getSubscriptionId(), + this.getResourceGroupName(), + this.getWorkspaceName(), + this.getServiceVersion().getVersion(), + accept, + reportAssetSummaryRequest, + requestOptions, + Context.NONE); + } + + /** + * Retrieve a list of saved filters for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of SavedFilter items along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)) + .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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of SavedFilter items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSavedFilterAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listSavedFilterSinglePageAsync(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listSavedFilterNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a list of saved filters for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of SavedFilter items along with {@link PagedResponse}. + */ + @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); + 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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of SavedFilter items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSavedFilter(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedIterable<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listSavedFilterSinglePage(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listSavedFilterNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a saved filter by filterName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param filterName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)); + } + + /** + * Retrieve a saved filter by filterName. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param filterName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @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); + } + + /** + * Create or replace a saved filter with a given filterName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param filterName The caller provided unique name for the resource. + * @param savedFilterData A request body used to create a saved filter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrReplaceSavedFilterWithResponseAsync( + String filterName, BinaryData savedFilterData, 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)); + } + + /** + * Create or replace a saved filter with a given filterName. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param filterName The caller provided unique name for the resource. + * @param savedFilterData A request body used to create a saved filter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrReplaceSavedFilterWithResponse( + String filterName, BinaryData savedFilterData, 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); + } + + /** + * Delete a saved filter with a given filterName. + * + * @param filterName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> 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)); + } + + /** + * Delete a saved filter with a given filterName. + * + * @param filterName The caller provided unique name for the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response 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); + } + + /** + * Retrieve a list of tasks for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Task items along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)) + .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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Task items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTaskAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + (pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTaskSinglePageAsync(requestOptionsLocal); + }, + (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback( + requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTaskNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Retrieve a list of tasks for the provided search parameters. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Task items along with {@link PagedResponse}. + */ + @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); + 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
NameTypeRequiredDescription
filterStringNoFilter the result list using the given expression.
orderbyStringNoA list of expressions that specify the order of the returned resources.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of AssetResource items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssetResourceNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listAssetResourceNext( + nextLink, + this.getEndpoint(), + this.getSubscriptionId(), + this.getResourceGroupName(), + this.getWorkspaceName(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     uuid: String (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     state: String(candidate/confirmed/dismissed/candidateInvestigate/associatedPartner/associatedThirdparty/archived) (Optional)
+     *     externalId: String (Optional)
+     *     labels (Optional): [
+     *         String (Optional)
+     *     ]
+     *     wildcard: Boolean (Optional)
+     *     discoGroupName: String (Optional)
+     *     auditTrail (Optional): [
+     *          (Optional){
+     *             id: String (Optional)
+     *             name: String (Optional)
+     *             displayName: String (Optional)
+     *             kind: String(as/contact/domain/host/ipAddress/ipBlock/page/sslCert) (Optional)
+     *             reason: String (Optional)
+     *         }
+     *     ]
+     *     reason: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of AssetResource items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + return new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of DataConnection items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     content: String(assets/attackSurfaceInsights) (Optional)
+     *     createdDate: OffsetDateTime (Optional)
+     *     frequency: String(daily/weekly/monthly) (Optional)
+     *     frequencyOffset: Integer (Optional)
+     *     updatedDate: OffsetDateTime (Optional)
+     *     userUpdatedAt: OffsetDateTime (Optional)
+     *     active: Boolean (Optional)
+     *     inactiveMessage: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of DataConnection items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + return new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of DiscoGroup items along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDiscoGroupNextSinglePageAsync( + String nextLink, 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)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     tier: String (Optional)
+     *     frequencyMilliseconds: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     latestRun (Optional): {
+     *         submittedDate: OffsetDateTime (Optional)
+     *         startedDate: OffsetDateTime (Optional)
+     *         completedDate: OffsetDateTime (Optional)
+     *         tier: String (Optional)
+     *         state: String(pending/running/completed/failed) (Optional)
+     *         totalAssetsFoundCount: Long (Optional)
+     *         seeds (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         excludes (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         names (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     createdDate: OffsetDateTime (Optional)
+     *     templateId: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of DiscoGroup items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + return new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     submittedDate: OffsetDateTime (Optional)
+     *     startedDate: OffsetDateTime (Optional)
+     *     completedDate: OffsetDateTime (Optional)
+     *     tier: String (Optional)
+     *     state: String(pending/running/completed/failed) (Optional)
+     *     totalAssetsFoundCount: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRunsNextSinglePageAsync( + String nextLink, 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)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     submittedDate: OffsetDateTime (Optional)
+     *     startedDate: OffsetDateTime (Optional)
+     *     completedDate: OffsetDateTime (Optional)
+     *     tier: String (Optional)
+     *     state: String(pending/running/completed/failed) (Optional)
+     *     totalAssetsFoundCount: Long (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     excludes (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse 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); + return new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of DiscoTemplate items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDiscoTemplateNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDiscoTemplateNext( + nextLink, + this.getEndpoint(), + this.getSubscriptionId(), + this.getResourceGroupName(), + this.getWorkspaceName(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     name: String (Optional)
+     *     displayName: String (Optional)
+     *     industry: String (Optional)
+     *     region: String (Optional)
+     *     countryCode: String (Optional)
+     *     stateCode: String (Optional)
+     *     city: String (Optional)
+     *     seeds (Optional): [
+     *          (Optional){
+     *             kind: String(as/attribute/contact/domain/host/ipBlock) (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     *     names (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of DiscoTemplate items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + return new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of SavedFilter items along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSavedFilterNextSinglePageAsync( + String nextLink, 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)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     displayName: String (Optional)
+     *     filter: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of SavedFilter items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + return new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of Task items along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTaskNextSinglePageAsync( + String nextLink, 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)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     id: String (Required)
+     *     startedAt: OffsetDateTime (Optional)
+     *     completedAt: OffsetDateTime (Optional)
+     *     lastPolledAt: OffsetDateTime (Optional)
+     *     state: String(pending/running/paused/complete/incomplete/failed/warning) (Optional)
+     *     phase: String(running/polling/complete) (Optional)
+     *     reason: String (Optional)
+     *     metadata (Optional): {
+     *         String: Object (Optional)
+     *     }
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink 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 paged collection of Task items along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/package-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/package-info.java new file mode 100644 index 000000000000..cee2f129eda2 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +/** + * Package containing the implementations for Easm. Defender EASM discovers and maps your digital attack surface to + * provide an "outside-in" perspective using probes to discover assets. The assets are provided with detailed metadata + * associated, including vulnerabilities, configurations and web components, allowing customers to view and prioritize + * external risk. The EASM REST API enables you to develop clients that integrate with your application. + */ +package com.azure.analytics.defender.easm.implementation; 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 new file mode 100644 index 000000000000..0a6045aded4b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AlexaDetails.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The AlexaDetails model. */ +@Immutable +public final class AlexaDetails { + + /* + * 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; + + /** Creates an instance of AlexaDetails class. */ + @Generated + private AlexaDetails() {} + + /** + * Get the alexaRank property: The alexaRank property. + * + * @return the alexaRank value. + */ + @Generated + public Long getAlexaRank() { + return this.alexaRank; + } + + /** + * Get the category property: The category property. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } +} 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 new file mode 100644 index 000000000000..1415a6a942f7 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAsset.java @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The AsAsset model. */ +@Immutable +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; + + /** Creates an instance of AsAsset class. */ + @Generated + private AsAsset() {} + + /** + * Get the asn property: The asn property. + * + * @return the asn value. + */ + @Generated + public Long getAsn() { + return this.asn; + } + + /** + * Get the asNames property: The asNames property. + * + * @return the asNames value. + */ + @Generated + public List getAsNames() { + return this.asNames; + } + + /** + * Get the orgNames property: The orgNames property. + * + * @return the orgNames value. + */ + @Generated + public List getOrgNames() { + return this.orgNames; + } + + /** + * Get the orgIds property: The orgIds property. + * + * @return the orgIds value. + */ + @Generated + public List getOrgIds() { + return this.orgIds; + } + + /** + * Get the countries property: The countries property. + * + * @return the countries value. + */ + @Generated + public List getCountries() { + return this.countries; + } + + /** + * Get the registries property: The registries property. + * + * @return the registries value. + */ + @Generated + public List getRegistries() { + return this.registries; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the registrarCreatedAt property: The registrarCreatedAt property. + * + * @return the registrarCreatedAt value. + */ + @Generated + public List getRegistrarCreatedAt() { + return this.registrarCreatedAt; + } + + /** + * Get the registrarUpdatedAt property: The registrarUpdatedAt property. + * + * @return the registrarUpdatedAt value. + */ + @Generated + public List getRegistrarUpdatedAt() { + return this.registrarUpdatedAt; + } + + /** + * Get the registrantContacts property: The registrantContacts property. + * + * @return the registrantContacts value. + */ + @Generated + public List getRegistrantContacts() { + return this.registrantContacts; + } + + /** + * Get the adminContacts property: The adminContacts property. + * + * @return the adminContacts value. + */ + @Generated + public List getAdminContacts() { + return this.adminContacts; + } + + /** + * Get the technicalContacts property: The technicalContacts property. + * + * @return the technicalContacts value. + */ + @Generated + public List getTechnicalContacts() { + return this.technicalContacts; + } + + /** + * Get the registrarNames property: The registrarNames property. + * + * @return the registrarNames value. + */ + @Generated + public List getRegistrarNames() { + return this.registrarNames; + } + + /** + * Get the registrantNames property: The registrantNames property. + * + * @return the registrantNames value. + */ + @Generated + public List getRegistrantNames() { + return this.registrantNames; + } + + /** + * Get the adminNames property: The adminNames property. + * + * @return the adminNames value. + */ + @Generated + public List getAdminNames() { + return this.adminNames; + } + + /** + * Get the technicalNames property: The technicalNames property. + * + * @return the technicalNames value. + */ + @Generated + public List getTechnicalNames() { + return this.technicalNames; + } + + /** + * Get the adminOrgs property: The adminOrgs property. + * + * @return the adminOrgs value. + */ + @Generated + public List getAdminOrgs() { + return this.adminOrgs; + } + + /** + * Get the technicalOrgs property: The technicalOrgs property. + * + * @return the technicalOrgs value. + */ + @Generated + public List getTechnicalOrgs() { + return this.technicalOrgs; + } + + /** + * Get the registrantPhones property: The registrantPhones property. + * + * @return the registrantPhones value. + */ + @Generated + public List getRegistrantPhones() { + return this.registrantPhones; + } + + /** + * Get the adminPhones property: The adminPhones property. + * + * @return the adminPhones value. + */ + @Generated + public List getAdminPhones() { + return this.adminPhones; + } + + /** + * Get the technicalPhones property: The technicalPhones property. + * + * @return the technicalPhones value. + */ + @Generated + public List getTechnicalPhones() { + return this.technicalPhones; + } + + /** + * Get the detailedFromWhoisAt property: The detailedFromWhoisAt property. + * + * @return the detailedFromWhoisAt value. + */ + @Generated + public OffsetDateTime getDetailedFromWhoisAt() { + return this.detailedFromWhoisAt; + } +} 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 new file mode 100644 index 000000000000..716f27808b08 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AsAssetResource.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The AsAssetResource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("as") +@Immutable +public final class AsAssetResource extends AssetResource { + + /* + * asset + */ + @Generated + @JsonProperty(value = "asset") + private AsAsset asset; + + /** + * Creates an instance of AsAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + @JsonCreator + private AsAssetResource(@JsonProperty(value = "asset") AsAsset asset) { + this.asset = asset; + } + + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public AsAsset getAsset() { + return this.asset; + } +} 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 new file mode 100644 index 000000000000..04082fd84c1e --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetPageResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The page of assets that match the provided metric. */ +@Immutable +public final class AssetPageResult { + + /* + * 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; + + /** Creates an instance of AssetPageResult class. */ + @Generated + private AssetPageResult() {} + + /** + * Get the totalElements property: The total number of items available in the full result set. + * + * @return the totalElements value. + */ + @Generated + public Long getTotalElements() { + return this.totalElements; + } + + /** + * Get the mark property: The cursor mark to be used on the next request. Not set if using paging. + * + * @return the mark value. + */ + @Generated + public String getMark() { + return this.mark; + } + + /** + * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result set. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * Get the value property: The items in the current page of results. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java new file mode 100644 index 000000000000..cc18a54d6595 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetResource.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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 java.time.OffsetDateTime; +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 { + + /* + * 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; + + /** Creates an instance of AssetResource class. */ + @Generated + protected AssetResource() {} + + /** + * Get the id property: The system generated unique id for the resource. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the uuid property: Global UUID for the asset. + * + * @return the uuid value. + */ + @Generated + 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 + 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 + public OffsetDateTime getUpdatedDate() { + return this.updatedDate; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + @Generated + public AssetState getState() { + return this.state; + } + + /** + * Get the externalId property: An optional customer provided identifier for this asset. + * + * @return the externalId value. + */ + @Generated + public String getExternalId() { + return this.externalId; + } + + /** + * Get the labels property: Customer labels assigned to this asset. + * + * @return the labels value. + */ + @Generated + 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 + 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 + 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 + public List getAuditTrail() { + return this.auditTrail; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + public String getReason() { + return this.reason; + } +} 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 new file mode 100644 index 000000000000..395e7ab14119 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSecurityPolicy.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The AssetSecurityPolicy model. */ +@Immutable +public final class AssetSecurityPolicy { + + /* + * 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; + + /** Creates an instance of AssetSecurityPolicy class. */ + @Generated + private AssetSecurityPolicy() {} + + /** + * Get the policyName property: The policyName property. + * + * @return the policyName value. + */ + @Generated + public String getPolicyName() { + return this.policyName; + } + + /** + * Get the isAffected property: The isAffected property. + * + * @return the isAffected value. + */ + @Generated + public Boolean isAffected() { + return this.isAffected; + } + + /** + * Get the description property: The description property. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } +} 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 new file mode 100644 index 000000000000..f3bc9e363620 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetState.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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. */ +public final class AssetState extends ExpandableStringEnum { + + /** Static value candidate for AssetState. */ + @Generated public static final AssetState CANDIDATE = fromString("candidate"); + + /** Static value confirmed for AssetState. */ + @Generated public static final AssetState CONFIRMED = fromString("confirmed"); + + /** Static value dismissed for AssetState. */ + @Generated public static final AssetState DISMISSED = fromString("dismissed"); + + /** Static value candidateInvestigate for AssetState. */ + @Generated public static final AssetState CANDIDATE_INVESTIGATE = fromString("candidateInvestigate"); + + /** Static value associatedPartner for AssetState. */ + @Generated public static final AssetState ASSOCIATED_PARTNER = fromString("associatedPartner"); + + /** Static value associatedThirdparty for AssetState. */ + @Generated public static final AssetState ASSOCIATED_THIRDPARTY = fromString("associatedThirdparty"); + + /** Static value archived for AssetState. */ + @Generated public static final AssetState ARCHIVED = fromString("archived"); + + /** + * Creates a new instance of AssetState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AssetState() {} + + /** + * Creates or finds a AssetState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetState. + */ + @Generated + @JsonCreator + public static AssetState fromString(String name) { + return fromString(name, AssetState.class); + } + + /** + * Gets known AssetState values. + * + * @return known AssetState values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..f457be1dfb9d --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetSummaryResult.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The collection of asset summaries. */ +@Immutable +public final class AssetSummaryResult { + + /* + * 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; + + /* + * The last time risk categories or risk metrics were captured. Set to the current time for asset filter requests, + * 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. + */ + @Generated + @JsonProperty(value = "children") + private List children; + + /** Creates an instance of AssetSummaryResult class. */ + @Generated + 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. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the description property: The description of the summary response. Filters don't have a description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the updatedAt property: The last time risk categories or risk metrics were captured. Set to the current time + * for asset filter requests, which always pull the live asset data. + * + * @return the updatedAt value. + */ + @Generated + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Get the metricCategory property: If the request is for a metric category, this will contain the requested unique + * category name. + * + * @return the metricCategory value. + */ + @Generated + public String getMetricCategory() { + return this.metricCategory; + } + + /** + * Get the metric property: If the request is for a metric, this will contain the requested unique metric name. + * + * @return the metric value. + */ + @Generated + public String getMetric() { + return this.metric; + } + + /** + * Get the filter property: If the request is for an asset filter, this will contain the corresponding filter. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Get the labelName property: An optional label used to filter requests results. + * + * @return the labelName value. + */ + @Generated + public String getLabelName() { + return this.labelName; + } + + /** + * Get the count property: The count of assets matching the request parameters. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the link property: The link to the corresponding asset details. + * + * @return the link value. + */ + @Generated + public String getLink() { + return this.link; + } + + /** + * 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. + */ + @Generated + public List getChildren() { + return this.children; + } +} 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 new file mode 100644 index 000000000000..67d129f402de --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateData.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A request body used to update an asset. */ +@Fluent +public final class AssetUpdateData { + + /* + * 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; + + /** Creates an instance of AssetUpdateData class. */ + @Generated + public AssetUpdateData() {} + + /** + * Get the state property: The state to update the asset to. + * + * @return the state value. + */ + @Generated + public AssetUpdateState getState() { + return this.state; + } + + /** + * Set the state property: The state to update the asset to. + * + * @param state the state value to set. + * @return the AssetUpdateData object itself. + */ + @Generated + public AssetUpdateData setState(AssetUpdateState state) { + this.state = state; + return this; + } + + /** + * Get the externalId property: A string which can be used to identify the asset in external systems. + * + * @return the externalId value. + */ + @Generated + public String getExternalId() { + return this.externalId; + } + + /** + * Set the externalId property: A string which can be used to identify the asset in external systems. + * + * @param externalId the externalId value to set. + * @return the AssetUpdateData object itself. + */ + @Generated + public AssetUpdateData setExternalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Get the labels property: Any Labels to update the asset with. + * + * @return the labels value. + */ + @Generated + public Map getLabels() { + return this.labels; + } + + /** + * Set the labels property: Any Labels to update the asset with. + * + * @param labels the labels value to set. + * @return the AssetUpdateData object itself. + */ + @Generated + public AssetUpdateData setLabels(Map labels) { + this.labels = labels; + return this; + } + + /** + * Get the transfers property: A list of asset types to cascade the updates to. + * + * @return the transfers value. + */ + @Generated + public AssetUpdateTransfers getTransfers() { + return this.transfers; + } + + /** + * Set the transfers property: A list of asset types to cascade the updates to. + * + * @param transfers the transfers value to set. + * @return the AssetUpdateData object itself. + */ + @Generated + public AssetUpdateData setTransfers(AssetUpdateTransfers transfers) { + this.transfers = transfers; + return this; + } +} 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 new file mode 100644 index 000000000000..451110a27f3a --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The state to update the asset to. */ +public final class AssetUpdateState extends ExpandableStringEnum { + + /** Static value candidate for AssetUpdateState. */ + @Generated public static final AssetUpdateState CANDIDATE = fromString("candidate"); + + /** Static value confirmed for AssetUpdateState. */ + @Generated public static final AssetUpdateState CONFIRMED = fromString("confirmed"); + + /** Static value dismissed for AssetUpdateState. */ + @Generated public static final AssetUpdateState DISMISSED = fromString("dismissed"); + + /** Static value candidateInvestigate for AssetUpdateState. */ + @Generated public static final AssetUpdateState CANDIDATE_INVESTIGATE = fromString("candidateInvestigate"); + + /** Static value associatedPartner for AssetUpdateState. */ + @Generated public static final AssetUpdateState ASSOCIATED_PARTNER = fromString("associatedPartner"); + + /** Static value associatedThirdparty for AssetUpdateState. */ + @Generated public static final AssetUpdateState ASSOCIATED_THIRDPARTY = fromString("associatedThirdparty"); + + /** + * Creates a new instance of AssetUpdateState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AssetUpdateState() {} + + /** + * Creates or finds a AssetUpdateState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetUpdateState. + */ + @Generated + @JsonCreator + public static AssetUpdateState fromString(String name) { + return fromString(name, AssetUpdateState.class); + } + + /** + * Gets known AssetUpdateState values. + * + * @return known AssetUpdateState values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..d3fe82d66713 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AssetUpdateTransfers.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** A list of asset types to cascade the updates to. */ +public final class AssetUpdateTransfers extends ExpandableStringEnum { + + /** Static value as for AssetUpdateTransfers. */ + @Generated public static final AssetUpdateTransfers AS = fromString("as"); + + /** Static value contact for AssetUpdateTransfers. */ + @Generated public static final AssetUpdateTransfers CONTACT = fromString("contact"); + + /** Static value domain for AssetUpdateTransfers. */ + @Generated public static final AssetUpdateTransfers DOMAIN = fromString("domain"); + + /** Static value host for AssetUpdateTransfers. */ + @Generated public static final AssetUpdateTransfers HOST = fromString("host"); + + /** Static value ipAddress for AssetUpdateTransfers. */ + @Generated public static final AssetUpdateTransfers IP_ADDRESS = fromString("ipAddress"); + + /** Static value ipBlock for AssetUpdateTransfers. */ + @Generated public static final AssetUpdateTransfers IP_BLOCK = fromString("ipBlock"); + + /** Static value page for AssetUpdateTransfers. */ + @Generated public static final AssetUpdateTransfers PAGE = fromString("page"); + + /** Static value sslCert for AssetUpdateTransfers. */ + @Generated public static final AssetUpdateTransfers SSL_CERT = fromString("sslCert"); + + /** + * Creates a new instance of AssetUpdateTransfers value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AssetUpdateTransfers() {} + + /** + * Creates or finds a AssetUpdateTransfers from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetUpdateTransfers. + */ + @Generated + @JsonCreator + public static AssetUpdateTransfers fromString(String name) { + return fromString(name, AssetUpdateTransfers.class); + } + + /** + * Gets known AssetUpdateTransfers values. + * + * @return known AssetUpdateTransfers values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..93a1a460cbe9 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Attribute.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The Attribute model. */ +@Immutable +public final class Attribute { + + /* + * 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; + + /** Creates an instance of Attribute class. */ + @Generated + private Attribute() {} + + /** + * Get the attributeType property: The attributeType property. + * + * @return the attributeType value. + */ + @Generated + public String getAttributeType() { + return this.attributeType; + } + + /** + * Get the attributeValue property: The attributeValue property. + * + * @return the attributeValue value. + */ + @Generated + public String getAttributeValue() { + return this.attributeValue; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } +} 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 new file mode 100644 index 000000000000..1daacb37da2f --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItem.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The history of how this asset was pulled into the workspace through the discovery process. */ +@Immutable +public final class AuditTrailItem { + + /* + * 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; + + /** Creates an instance of AuditTrailItem class. */ + @Generated + private AuditTrailItem() {} + + /** + * Get the id property: The system generated unique id for the resource. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the kind property: The kind of asset. + * + * @return the kind value. + */ + @Generated + public AuditTrailItemKind getKind() { + return this.kind; + } + + /** + * Get the reason property: An explanation of why this audit trail node was discovered from the previous node. + * + * @return the reason value. + */ + @Generated + public String getReason() { + return this.reason; + } +} 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 new file mode 100644 index 000000000000..8b8a24cdecec --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AuditTrailItemKind.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The kind of asset. */ +public final class AuditTrailItemKind extends ExpandableStringEnum { + + /** Static value as for AuditTrailItemKind. */ + @Generated public static final AuditTrailItemKind AS = fromString("as"); + + /** Static value contact for AuditTrailItemKind. */ + @Generated public static final AuditTrailItemKind CONTACT = fromString("contact"); + + /** Static value domain for AuditTrailItemKind. */ + @Generated public static final AuditTrailItemKind DOMAIN = fromString("domain"); + + /** Static value host for AuditTrailItemKind. */ + @Generated public static final AuditTrailItemKind HOST = fromString("host"); + + /** Static value ipAddress for AuditTrailItemKind. */ + @Generated public static final AuditTrailItemKind IP_ADDRESS = fromString("ipAddress"); + + /** Static value ipBlock for AuditTrailItemKind. */ + @Generated public static final AuditTrailItemKind IP_BLOCK = fromString("ipBlock"); + + /** Static value page for AuditTrailItemKind. */ + @Generated public static final AuditTrailItemKind PAGE = fromString("page"); + + /** Static value sslCert for AuditTrailItemKind. */ + @Generated public static final AuditTrailItemKind SSL_CERT = fromString("sslCert"); + + /** + * Creates a new instance of AuditTrailItemKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AuditTrailItemKind() {} + + /** + * Creates or finds a AuditTrailItemKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuditTrailItemKind. + */ + @Generated + @JsonCreator + public static AuditTrailItemKind fromString(String name) { + return fromString(name, AuditTrailItemKind.class); + } + + /** + * Gets known AuditTrailItemKind values. + * + * @return known AuditTrailItemKind values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..fd2a6b3ee16d --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnection.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The AzureDataExplorerDataConnection model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("azureDataExplorer") +@Immutable +public final class AzureDataExplorerDataConnection extends DataConnection { + + /* + * properties + */ + @Generated + @JsonProperty(value = "properties") + private AzureDataExplorerDataConnectionProperties properties; + + /** + * Creates an instance of AzureDataExplorerDataConnection class. + * + * @param properties the properties value to set. + */ + @Generated + @JsonCreator + private AzureDataExplorerDataConnection( + @JsonProperty(value = "properties") AzureDataExplorerDataConnectionProperties properties) { + this.properties = properties; + } + + /** + * Get the properties property: properties. + * + * @return the properties value. + */ + @Generated + public AzureDataExplorerDataConnectionProperties getProperties() { + return this.properties; + } +} 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 new file mode 100644 index 000000000000..17181606d80b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionData.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The AzureDataExplorerDataConnectionData model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("azureDataExplorer") +@Fluent +public final class AzureDataExplorerDataConnectionData extends DataConnectionData { + + /* + * properties + */ + @Generated + @JsonProperty(value = "properties") + private AzureDataExplorerDataConnectionProperties properties; + + /** + * Creates an instance of AzureDataExplorerDataConnectionData class. + * + * @param properties the properties value to set. + */ + @Generated + @JsonCreator + public AzureDataExplorerDataConnectionData( + @JsonProperty(value = "properties") AzureDataExplorerDataConnectionProperties properties) { + this.properties = properties; + } + + /** + * Get the properties property: properties. + * + * @return the properties value. + */ + @Generated + public AzureDataExplorerDataConnectionProperties getProperties() { + return this.properties; + } + + /** {@inheritDoc} */ + @Generated + @Override + public AzureDataExplorerDataConnectionData setName(String name) { + super.setName(name); + return this; + } + + /** {@inheritDoc} */ + @Generated + @Override + public AzureDataExplorerDataConnectionData setContent(DataConnectionContent content) { + super.setContent(content); + return this; + } + + /** {@inheritDoc} */ + @Generated + @Override + public AzureDataExplorerDataConnectionData setFrequency(DataConnectionFrequency frequency) { + super.setFrequency(frequency); + return this; + } + + /** {@inheritDoc} */ + @Generated + @Override + public AzureDataExplorerDataConnectionData setFrequencyOffset(Integer frequencyOffset) { + super.setFrequencyOffset(frequencyOffset); + return this; + } +} 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 new file mode 100644 index 000000000000..e21091a7fdf0 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/AzureDataExplorerDataConnectionProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AzureDataExplorerDataConnectionProperties model. */ +@Fluent +public final class AzureDataExplorerDataConnectionProperties extends DataConnectionProperties { + + /* + * 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; + + /** Creates an instance of AzureDataExplorerDataConnectionProperties class. */ + @Generated + public AzureDataExplorerDataConnectionProperties() {} + + /** + * Get the clusterName property: The azure data explorer cluster name. + * + * @return the clusterName value. + */ + @Generated + public String getClusterName() { + return this.clusterName; + } + + /** + * Set the clusterName property: The azure data explorer cluster name. + * + * @param clusterName the clusterName value to set. + * @return the AzureDataExplorerDataConnectionProperties object itself. + */ + @Generated + public AzureDataExplorerDataConnectionProperties setClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Get the region property: The azure data explorer region. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * Set the region property: The azure data explorer region. + * + * @param region the region value to set. + * @return the AzureDataExplorerDataConnectionProperties object itself. + */ + @Generated + public AzureDataExplorerDataConnectionProperties setRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the databaseName property: The azure data explorer database name. + * + * @return the databaseName value. + */ + @Generated + public String getDatabaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The azure data explorer database name. + * + * @param databaseName the databaseName value to set. + * @return the AzureDataExplorerDataConnectionProperties object itself. + */ + @Generated + public AzureDataExplorerDataConnectionProperties setDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } +} 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 new file mode 100644 index 000000000000..f3caca166ec0 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Banner.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The Banner model. */ +@Immutable +public final class Banner { + + /* + * 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; + + /** Creates an instance of Banner class. */ + @Generated + private Banner() {} + + /** + * Get the port property: The port property. + * + * @return the port value. + */ + @Generated + public Integer getPort() { + return this.port; + } + + /** + * Get the banner property: The banner property. + * + * @return the banner value. + */ + @Generated + public String getBanner() { + return this.banner; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the scanType property: The scanType property. + * + * @return the scanType value. + */ + @Generated + public String getScanType() { + return this.scanType; + } + + /** + * Get the bannerMetadata property: The bannerMetadata property. + * + * @return the bannerMetadata value. + */ + @Generated + public String getBannerMetadata() { + return this.bannerMetadata; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } + + /** + * Get the sha256 property: The sha256 property. + * + * @return the sha256 value. + */ + @Generated + public String getSha256() { + return this.sha256; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } +} 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 new file mode 100644 index 000000000000..a3c373a5ba30 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAsset.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The ContactAsset model. */ +@Immutable +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; + + /** Creates an instance of ContactAsset class. */ + @Generated + private ContactAsset() {} + + /** + * Get the email property: The email property. + * + * @return the email value. + */ + @Generated + public String getEmail() { + return this.email; + } + + /** + * Get the names property: The names property. + * + * @return the names value. + */ + @Generated + public List getNames() { + return this.names; + } + + /** + * Get the organizations property: The organizations property. + * + * @return the organizations value. + */ + @Generated + public List getOrganizations() { + return this.organizations; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } +} 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 new file mode 100644 index 000000000000..7343b9970a41 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ContactAssetResource.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The ContactAssetResource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("contact") +@Immutable +public final class ContactAssetResource extends AssetResource { + + /* + * asset + */ + @Generated + @JsonProperty(value = "asset") + private ContactAsset asset; + + /** + * Creates an instance of ContactAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + @JsonCreator + private ContactAssetResource(@JsonProperty(value = "asset") ContactAsset asset) { + this.asset = asset; + } + + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public ContactAsset getAsset() { + return this.asset; + } +} 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 new file mode 100644 index 000000000000..59ddf8257757 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cookie.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Cookie model. */ +@Immutable +public final class Cookie { + + /* + * 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; + + /** Creates an instance of Cookie class. */ + @Generated + private Cookie() {} + + /** + * Get the cookieName property: The cookieName property. + * + * @return the cookieName value. + */ + @Generated + public String getCookieName() { + return this.cookieName; + } + + /** + * Get the cookieDomain property: The cookieDomain property. + * + * @return the cookieDomain value. + */ + @Generated + public String getCookieDomain() { + return this.cookieDomain; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } + + /** + * Get the cookieExpiryDate property: The cookieExpiryDate property. + * + * @return the cookieExpiryDate value. + */ + @Generated + public OffsetDateTime getCookieExpiryDate() { + return this.cookieExpiryDate; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedIterable.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedIterable.java new file mode 100644 index 000000000000..1750c577096c --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedIterable.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.http.rest.PagedIterableBase; +import com.azure.core.http.rest.PagedResponse; + +import java.util.function.Function; +import java.util.function.Supplier; + +/** + Custom paged iterable to be used in list operations with the additional totalElements property + T: Resource used in the list operation + */ +public class CountPagedIterable extends PagedIterableBase> { + + /** + * The total number of elements in the entire collection. + */ + private final Long totalElements; + + /** + * Constructs a new CountPagedIterable with the provided retrievers for fetching the first page + * of elements and the subsequent pages of elements. + * @param firstPageRetriever A Supplier that retrieves the first page of elements in the collection. + * @param nextPageRetriever A Function that retrieves the next page of elements in the collection. + */ + public CountPagedIterable(Supplier> firstPageRetriever, Function> nextPageRetriever) { + super(() -> (continuationToken, pageSize) -> + continuationToken == null + ? firstPageRetriever.get() + : nextPageRetriever.apply(continuationToken)); + + this.totalElements = firstPageRetriever.get().getTotalElements(); + } + + /** + * Retrieve the total count of elements available in the entire collection. This count may not + * represent the actual number of elements retrieved in the current page, but rather the total + * count of elements in the collection. + * @return total elements of the full result set + */ + public Long getTotalElements() { + return totalElements; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedResponse.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedResponse.java new file mode 100644 index 000000000000..88eec566b17c --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedResponse.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.PagedResponseBase; + +import java.util.List; + +/** + * Represents a paged response model that includes additional information about the total count + * of elements available in the entire collection. This class extends the base class + * {@link PagedResponseBase} and provides the means to access the total count information + * @param The type of elements contained in the paged response + */ +public class CountPagedResponse extends PagedResponseBase { + /** + * The total number of elements in the entire collection. + */ + private Long totalElements; + + /** + * Constructs a CountPagedResponse with specified elements, continuation token, and total count. + * @param request The HTTP request that resulted in this paged response. + * @param statusCode The HTTP status code of the response. + * @param headers The HTTP headers of the response. + * @param items The elements in the current page. + * @param continuationToken A token that can be used to retrieve the next page of elements. + * @param deserializedHeaders The deserialized headers (maybe of type Void). + * @param totalElements The total count of elements available in the entire collection. + */ + public CountPagedResponse(HttpRequest request, int statusCode, HttpHeaders headers, List items, String continuationToken, Void deserializedHeaders, Long totalElements) { + super(request, statusCode, headers, items, continuationToken, deserializedHeaders); + this.totalElements = totalElements; + } + + /** + * Constructs a CountPagedResponse with specified elements, continuation token, and total count. + * @param request The HTTP request that resulted in this paged response. + * @param statusCode The HTTP status code of the response. + * @param headers The HTTP headers of the response. + * @param items The elements in the current page. + * @param continuationToken A token that can be used to retrieve the next page of elements. + * @param deserializedHeaders The deserialized headers (maybe of type Void). + */ + public CountPagedResponse(HttpRequest request, int statusCode, HttpHeaders headers, List items, String continuationToken, Void deserializedHeaders) { + super(request, statusCode, headers, items, continuationToken, deserializedHeaders); + } + + /** + * Retrieve the total count of elements in the entire collection. + * @return The total count of elements in the collection + */ + public Long getTotalElements() { + return totalElements; + } +} 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 new file mode 100644 index 000000000000..c60110e45ebc --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cve.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Cve model. */ +@Immutable +public final class Cve { + + /* + * 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; + + /** Creates an instance of Cve class. */ + @Generated + private Cve() {} + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the cweId property: The cweId property. + * + * @return the cweId value. + */ + @Generated + public String getCweId() { + return this.cweId; + } + + /** + * Get the cvssScore property: The cvssScore property. + * + * @return the cvssScore value. + */ + @Generated + public Double getCvssScore() { + return this.cvssScore; + } + + /** + * Get the cvss3Summary property: The cvss3Summary property. + * + * @return the cvss3Summary value. + */ + @Generated + public Cvss3Summary getCvss3Summary() { + return this.cvss3Summary; + } +} 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 new file mode 100644 index 000000000000..f59523e19e20 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Cvss3Summary.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Cvss3Summary model. */ +@Immutable +public final class Cvss3Summary { + + /* + * 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; + + /** Creates an instance of Cvss3Summary class. */ + @Generated + private Cvss3Summary() {} + + /** + * Get the version property: The version property. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Get the vectorString property: The vectorString property. + * + * @return the vectorString value. + */ + @Generated + public String getVectorString() { + return this.vectorString; + } + + /** + * Get the attackVector property: The attackVector property. + * + * @return the attackVector value. + */ + @Generated + public String getAttackVector() { + return this.attackVector; + } + + /** + * Get the attackComplexity property: The attackComplexity property. + * + * @return the attackComplexity value. + */ + @Generated + public String getAttackComplexity() { + return this.attackComplexity; + } + + /** + * Get the privilegesRequired property: The privilegesRequired property. + * + * @return the privilegesRequired value. + */ + @Generated + public String getPrivilegesRequired() { + return this.privilegesRequired; + } + + /** + * Get the userInteraction property: The userInteraction property. + * + * @return the userInteraction value. + */ + @Generated + public String getUserInteraction() { + return this.userInteraction; + } + + /** + * Get the scope property: The scope property. + * + * @return the scope value. + */ + @Generated + public String getScope() { + return this.scope; + } + + /** + * Get the confidentialityImpact property: The confidentialityImpact property. + * + * @return the confidentialityImpact value. + */ + @Generated + public String getConfidentialityImpact() { + return this.confidentialityImpact; + } + + /** + * Get the integrityImpact property: The integrityImpact property. + * + * @return the integrityImpact value. + */ + @Generated + public String getIntegrityImpact() { + return this.integrityImpact; + } + + /** + * Get the availabilityImpact property: The availabilityImpact property. + * + * @return the availabilityImpact value. + */ + @Generated + public String getAvailabilityImpact() { + return this.availabilityImpact; + } + + /** + * Get the baseScore property: The baseScore property. + * + * @return the baseScore value. + */ + @Generated + public Double getBaseScore() { + return this.baseScore; + } + + /** + * Get the baseSeverity property: The baseSeverity property. + * + * @return the baseSeverity value. + */ + @Generated + public String getBaseSeverity() { + return this.baseSeverity; + } + + /** + * Get the exploitCodeMaturity property: The exploitCodeMaturity property. + * + * @return the exploitCodeMaturity value. + */ + @Generated + public String getExploitCodeMaturity() { + return this.exploitCodeMaturity; + } + + /** + * Get the remediationLevel property: The remediationLevel property. + * + * @return the remediationLevel value. + */ + @Generated + public String getRemediationLevel() { + return this.remediationLevel; + } + + /** + * Get the reportConfidence property: The reportConfidence property. + * + * @return the reportConfidence value. + */ + @Generated + public String getReportConfidence() { + return this.reportConfidence; + } + + /** + * Get the exploitabilityScore property: The exploitabilityScore property. + * + * @return the exploitabilityScore value. + */ + @Generated + public Double getExploitabilityScore() { + return this.exploitabilityScore; + } + + /** + * Get the impactScore property: The impactScore property. + * + * @return the impactScore value. + */ + @Generated + public Double getImpactScore() { + return this.impactScore; + } +} 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 new file mode 100644 index 000000000000..e6603039762a --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnection.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +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 { + + /* + * 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; + + /** Creates an instance of DataConnection class. */ + @Generated + protected DataConnection() {} + + /** + * Get the id property: The system generated unique id for the resource. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the content property: The type of data the data connection will transfer. + * + * @return the content value. + */ + @Generated + public DataConnectionContent getContent() { + return this.content; + } + + /** + * Get the createdDate property: The date the data connection was created. + * + * @return the createdDate value. + */ + @Generated + 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 + public DataConnectionFrequency getFrequency() { + return this.frequency; + } + + /** + * Get the frequencyOffset property: The day to update the data connection on. + * + * @return the frequencyOffset value. + */ + @Generated + public Integer getFrequencyOffset() { + return this.frequencyOffset; + } + + /** + * Get the updatedDate property: The date the data connection was last updated. + * + * @return the updatedDate value. + */ + @Generated + 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 + public OffsetDateTime getUserUpdatedAt() { + return this.userUpdatedAt; + } + + /** + * Get the active property: An indicator of whether the data connection is active. + * + * @return the active value. + */ + @Generated + 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 + public String getInactiveMessage() { + return this.inactiveMessage; + } +} 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 new file mode 100644 index 000000000000..1ac57dde1e08 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionContent.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of data the data connection will transfer. */ +public final class DataConnectionContent extends ExpandableStringEnum { + + /** Static value assets for DataConnectionContent. */ + @Generated public static final DataConnectionContent ASSETS = fromString("assets"); + + /** Static value attackSurfaceInsights for DataConnectionContent. */ + @Generated public static final DataConnectionContent ATTACK_SURFACE_INSIGHTS = fromString("attackSurfaceInsights"); + + /** + * Creates a new instance of DataConnectionContent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DataConnectionContent() {} + + /** + * Creates or finds a DataConnectionContent from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectionContent. + */ + @Generated + @JsonCreator + public static DataConnectionContent fromString(String name) { + return fromString(name, DataConnectionContent.class); + } + + /** + * Gets known DataConnectionContent values. + * + * @return known DataConnectionContent values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..ec4c8addc38a --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionData.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** 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 { + + /* + * 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; + + /** Creates an instance of DataConnectionData class. */ + @Generated + public DataConnectionData() {} + + /** + * Get the name property: The name of data connection. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of data connection. + * + * @param name the name value to set. + * @return the DataConnectionData object itself. + */ + @Generated + public DataConnectionData setName(String name) { + this.name = name; + return this; + } + + /** + * Get the content property: The type of data the data connection will transfer. + * + * @return the content value. + */ + @Generated + public DataConnectionContent getContent() { + return this.content; + } + + /** + * Set the content property: The type of data the data connection will transfer. + * + * @param content the content value to set. + * @return the DataConnectionData object itself. + */ + @Generated + public DataConnectionData setContent(DataConnectionContent content) { + this.content = content; + return this; + } + + /** + * Get the frequency property: The rate at which the data connection will receive updates. + * + * @return the frequency value. + */ + @Generated + public DataConnectionFrequency getFrequency() { + return this.frequency; + } + + /** + * Set the frequency property: The rate at which the data connection will receive updates. + * + * @param frequency the frequency value to set. + * @return the DataConnectionData object itself. + */ + @Generated + public DataConnectionData setFrequency(DataConnectionFrequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get the frequencyOffset property: The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). + * + * @return the frequencyOffset value. + */ + @Generated + public Integer getFrequencyOffset() { + return this.frequencyOffset; + } + + /** + * Set the frequencyOffset property: The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). + * + * @param frequencyOffset the frequencyOffset value to set. + * @return the DataConnectionData object itself. + */ + @Generated + public DataConnectionData setFrequencyOffset(Integer frequencyOffset) { + this.frequencyOffset = frequencyOffset; + return this; + } +} 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 new file mode 100644 index 000000000000..cb0610949410 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionFrequency.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The rate at which the data connection will receive updates. */ +public final class DataConnectionFrequency extends ExpandableStringEnum { + + /** Static value daily for DataConnectionFrequency. */ + @Generated public static final DataConnectionFrequency DAILY = fromString("daily"); + + /** Static value weekly for DataConnectionFrequency. */ + @Generated public static final DataConnectionFrequency WEEKLY = fromString("weekly"); + + /** Static value monthly for DataConnectionFrequency. */ + @Generated public static final DataConnectionFrequency MONTHLY = fromString("monthly"); + + /** + * Creates a new instance of DataConnectionFrequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DataConnectionFrequency() {} + + /** + * Creates or finds a DataConnectionFrequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectionFrequency. + */ + @Generated + @JsonCreator + public static DataConnectionFrequency fromString(String name) { + return fromString(name, DataConnectionFrequency.class); + } + + /** + * Gets known DataConnectionFrequency values. + * + * @return known DataConnectionFrequency values. + */ + @Generated + public static Collection values() { + return values(DataConnectionFrequency.class); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionPageResult.java new file mode 100644 index 000000000000..223d2e2adcd6 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionPageResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** The DataConnectionPageResponse model. */ +@Immutable +public final class DataConnectionPageResult { + /* + * The total number of items available in the full result set. + */ + @Generated + @JsonProperty(value = "totalElements") + private Long totalElements; + + /* + * The link to access the next page of results. Not set if at the end of the result set. + */ + @Generated + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The items in the current page of results. + */ + @Generated + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of DataConnectionPageResponse class. */ + @Generated + private DataConnectionPageResult() {} + + /** + * Get the totalElements property: The total number of items available in the full result set. + * + * @return the totalElements value. + */ + @Generated + public Long getTotalElements() { + return this.totalElements; + } + + /** + * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result set. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * Get the value property: The items in the current page of results. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionProperties.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionProperties.java new file mode 100644 index 000000000000..ccc9b4a25c13 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionProperties.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** The properties required to establish connection to a particular service. */ +@Immutable +public class DataConnectionProperties { + + /** Creates an instance of DataConnectionProperties class. */ + @Generated + public DataConnectionProperties() {} +} 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 new file mode 100644 index 000000000000..bc44fd8bb066 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DependentResource.java @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The DependentResource model. */ +@Immutable +public final class DependentResource { + + /* + * 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; + + /** Creates an instance of DependentResource class. */ + @Generated + private DependentResource() {} + + /** + * Get the md5 property: The md5 property. + * + * @return the md5 value. + */ + @Generated + public String getMd5() { + return this.md5; + } + + /** + * Get the responseBodySize property: The responseBodySize property. + * + * @return the responseBodySize value. + */ + @Generated + public Long getResponseBodySize() { + return this.responseBodySize; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the firstSeenCrawlGuid property: The firstSeenCrawlGuid property. + * + * @return the firstSeenCrawlGuid value. + */ + @Generated + public String getFirstSeenCrawlGuid() { + return this.firstSeenCrawlGuid; + } + + /** + * Get the firstSeenPageGuid property: The firstSeenPageGuid property. + * + * @return the firstSeenPageGuid value. + */ + @Generated + public String getFirstSeenPageGuid() { + return this.firstSeenPageGuid; + } + + /** + * Get the firstSeenResourceGuid property: The firstSeenResourceGuid property. + * + * @return the firstSeenResourceGuid value. + */ + @Generated + public String getFirstSeenResourceGuid() { + return this.firstSeenResourceGuid; + } + + /** + * Get the lastSeenCrawlGuid property: The lastSeenCrawlGuid property. + * + * @return the lastSeenCrawlGuid value. + */ + @Generated + public String getLastSeenCrawlGuid() { + return this.lastSeenCrawlGuid; + } + + /** + * Get the lastSeenPageGuid property: The lastSeenPageGuid property. + * + * @return the lastSeenPageGuid value. + */ + @Generated + public String getLastSeenPageGuid() { + return this.lastSeenPageGuid; + } + + /** + * Get the lastSeenResourceGuid property: The lastSeenResourceGuid property. + * + * @return the lastSeenResourceGuid value. + */ + @Generated + public String getLastSeenResourceGuid() { + return this.lastSeenResourceGuid; + } + + /** + * Get the responseBodyMinhash property: The responseBodyMinhash property. + * + * @return the responseBodyMinhash value. + */ + @Generated + public List getResponseBodyMinhash() { + return this.responseBodyMinhash; + } + + /** + * Get the contentType property: The contentType property. + * + * @return the contentType value. + */ + @Generated + public String getContentType() { + return this.contentType; + } + + /** + * Get the sha256 property: The sha256 property. + * + * @return the sha256 value. + */ + @Generated + public String getSha256() { + return this.sha256; + } + + /** + * Get the sha384 property: The sha384 property. + * + * @return the sha384 value. + */ + @Generated + public String getSha384() { + return this.sha384; + } + + /** + * Get the sha512 property: The sha512 property. + * + * @return the sha512 value. + */ + @Generated + public String getSha512() { + return this.sha512; + } + + /** + * Get the url property: The url property. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Get the cached property: The cached property. + * + * @return the cached value. + */ + @Generated + public Boolean isCached() { + return this.cached; + } + + /** + * Get the sriChecks property: The sriChecks property. + * + * @return the sriChecks value. + */ + @Generated + public List getSriChecks() { + return this.sriChecks; + } + + /** + * Get the host property: The host property. + * + * @return the host value. + */ + @Generated + public String getHost() { + return this.host; + } + + /** + * Get the lastObservedViolation property: The lastObservedViolation property. + * + * @return the lastObservedViolation value. + */ + @Generated + public OffsetDateTime getLastObservedViolation() { + return this.lastObservedViolation; + } + + /** + * Get the lastObservedValidation property: The lastObservedValidation property. + * + * @return the lastObservedValidation value. + */ + @Generated + public OffsetDateTime getLastObservedValidation() { + return this.lastObservedValidation; + } + + /** + * Get the lastObservedActualSriHash property: The lastObservedActualSriHash property. + * + * @return the lastObservedActualSriHash value. + */ + @Generated + public String getLastObservedActualSriHash() { + return this.lastObservedActualSriHash; + } + + /** + * Get the lastObservedExpectedSriHash property: The lastObservedExpectedSriHash property. + * + * @return the lastObservedExpectedSriHash value. + */ + @Generated + public String getLastObservedExpectedSriHash() { + return this.lastObservedExpectedSriHash; + } +} 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 new file mode 100644 index 000000000000..2dc8d950e3f5 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroup.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The DiscoGroup model. */ +@Immutable +public final class DiscoGroup { + + /* + * 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; + + /** Creates an instance of DiscoGroup class. */ + @Generated + private DiscoGroup() {} + + /** + * Get the id property: The system generated unique id for the resource. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the description property: The description for a disco group. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in + * this group. + * + * @return the tier value. + */ + @Generated + public String getTier() { + return this.tier; + } + + /** + * Get the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in + * milliseconds. + * + * @return the frequencyMilliseconds value. + */ + @Generated + public Long getFrequencyMilliseconds() { + return this.frequencyMilliseconds; + } + + /** + * Get the seeds property: The list of seeds used for the disco group runs. + * + * @return the seeds value. + */ + @Generated + public List getSeeds() { + return this.seeds; + } + + /** + * Get the names property: The list of names used for the disco group runs. + * + * @return the names value. + */ + @Generated + public List getNames() { + return this.names; + } + + /** + * Get the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the + * discovery algorithm. + * + * @return the excludes value. + */ + @Generated + public List getExcludes() { + return this.excludes; + } + + /** + * Get the latestRun property: The latest run of this disco group with some limited information, null if the group + * has never been run. + * + * @return the latestRun value. + */ + @Generated + public DiscoRunResult getLatestRun() { + return this.latestRun; + } + + /** + * Get the createdDate property: The date for the disco group was created. + * + * @return the createdDate value. + */ + @Generated + public OffsetDateTime getCreatedDate() { + return this.createdDate; + } + + /** + * Get the templateId property: The unique identifier for the disco template used for the disco group creation. + * + * @return the templateId value. + */ + @Generated + public String getTemplateId() { + return this.templateId; + } +} 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 new file mode 100644 index 000000000000..365480a7381a --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupData.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A request body used to create a discovery group. */ +@Fluent +public final class DiscoGroupData { + + /* + * 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; + + /** Creates an instance of DiscoGroupData class. */ + @Generated + public DiscoGroupData() {} + + /** + * Get the name property: The name for a disco group. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The name for a disco group. + * + * @param name the name value to set. + * @return the DiscoGroupData object itself. + */ + @Generated + public DiscoGroupData setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: The description for a disco group. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The description for a disco group. + * + * @param description the description value to set. + * @return the DiscoGroupData object itself. + */ + @Generated + public DiscoGroupData setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in + * this group. + * + * @return the tier value. + */ + @Generated + public String getTier() { + return this.tier; + } + + /** + * Set the tier property: The tier for the disco group which will affect the algorithm used for the disco runs in + * this group. + * + * @param tier the tier value to set. + * @return the DiscoGroupData object itself. + */ + @Generated + public DiscoGroupData setTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in + * milliseconds. + * + * @return the frequencyMilliseconds value. + */ + @Generated + public Long getFrequencyMilliseconds() { + return this.frequencyMilliseconds; + } + + /** + * Set the frequencyMilliseconds property: The frequency at which the disco group is supposed to be rerun in + * milliseconds. + * + * @param frequencyMilliseconds the frequencyMilliseconds value to set. + * @return the DiscoGroupData object itself. + */ + @Generated + public DiscoGroupData setFrequencyMilliseconds(Long frequencyMilliseconds) { + this.frequencyMilliseconds = frequencyMilliseconds; + return this; + } + + /** + * Get the seeds property: The list of seeds used for the disco group runs. + * + * @return the seeds value. + */ + @Generated + public List getSeeds() { + return this.seeds; + } + + /** + * Set the seeds property: The list of seeds used for the disco group runs. + * + * @param seeds the seeds value to set. + * @return the DiscoGroupData object itself. + */ + @Generated + public DiscoGroupData setSeeds(List seeds) { + this.seeds = seeds; + return this; + } + + /** + * Get the names property: The list of names used for the disco group runs. + * + * @return the names value. + */ + @Generated + public List getNames() { + return this.names; + } + + /** + * Set the names property: The list of names used for the disco group runs. + * + * @param names the names value to set. + * @return the DiscoGroupData object itself. + */ + @Generated + public DiscoGroupData setNames(List names) { + this.names = names; + return this; + } + + /** + * Get the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the + * discovery algorithm. + * + * @return the excludes value. + */ + @Generated + public List getExcludes() { + return this.excludes; + } + + /** + * Set the excludes property: The list of excludes used for the disco group runs, aka assets to exclude from the + * discovery algorithm. + * + * @param excludes the excludes value to set. + * @return the DiscoGroupData object itself. + */ + @Generated + public DiscoGroupData setExcludes(List excludes) { + this.excludes = excludes; + return this; + } + + /** + * Get the templateId property: The unique identifier for the disco template used for the disco group creation. + * + * @return the templateId value. + */ + @Generated + public String getTemplateId() { + return this.templateId; + } + + /** + * Set the templateId property: The unique identifier for the disco template used for the disco group creation. + * + * @param templateId the templateId value to set. + * @return the DiscoGroupData object itself. + */ + @Generated + public DiscoGroupData setTemplateId(String templateId) { + this.templateId = templateId; + return this; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupPageResult.java new file mode 100644 index 000000000000..72324ea52d98 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupPageResult.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DiscoGroupPageResult model. */ +@Immutable +public final class DiscoGroupPageResult { + /* + * The total number of items available in the full result set. + */ + @Generated + @JsonProperty(value = "totalElements") + private Long totalElements; + + /* + * The link to access the next page of results. Not set if at the end of the result set. + */ + @Generated + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The items in the current page of results. + */ + @Generated + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of DiscoGroupPageResult class. */ + @Generated + private DiscoGroupPageResult() {} + + /** + * Get the totalElements property: The total number of items available in the full result set. + * + * @return the totalElements value. + */ + @Generated + public Long getTotalElements() { + return this.totalElements; + } + + /** + * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result set. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * Get the value property: The items in the current page of results. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunPageResult.java new file mode 100644 index 000000000000..a4462acaaf7d --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunPageResult.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DiscoRunPageResult model. */ +@Immutable +public final class DiscoRunPageResult { + /* + * The total number of items available in the full result set. + */ + @Generated + @JsonProperty(value = "totalElements") + private Long totalElements; + + /* + * The link to access the next page of results. Not set if at the end of the result set. + */ + @Generated + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The items in the current page of results. + */ + @Generated + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of DiscoRunPageResult class. */ + @Generated + private DiscoRunPageResult() {} + + /** + * Get the totalElements property: The total number of items available in the full result set. + * + * @return the totalElements value. + */ + @Generated + public Long getTotalElements() { + return this.totalElements; + } + + /** + * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result set. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * Get the value property: The items in the current page of results. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunResult.java new file mode 100644 index 000000000000..76eead32a190 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunResult.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +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 { + + /* + * 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; + + /** Creates an instance of DiscoRunResult class. */ + @Generated + private DiscoRunResult() {} + + /** + * Get the submittedDate property: The date for when the disco run was created in the system. + * + * @return the submittedDate value. + */ + @Generated + public OffsetDateTime getSubmittedDate() { + return this.submittedDate; + } + + /** + * Get the startedDate property: The date for when the disco run was actually started by the system. + * + * @return the startedDate value. + */ + @Generated + public OffsetDateTime getStartedDate() { + return this.startedDate; + } + + /** + * Get the completedDate property: The date for when the disco run was completed by the system. + * + * @return the completedDate value. + */ + @Generated + public OffsetDateTime getCompletedDate() { + return this.completedDate; + } + + /** + * Get the tier property: The tier which will affect the algorithm used for the disco run. + * + * @return the tier value. + */ + @Generated + public String getTier() { + return this.tier; + } + + /** + * Get the state property: The State of the disco run. + * + * @return the state value. + */ + @Generated + public DiscoRunState getState() { + return this.state; + } + + /** + * Get the totalAssetsFoundCount property: The total count of assets that were found this disco run. + * + * @return the totalAssetsFoundCount value. + */ + @Generated + public Long getTotalAssetsFoundCount() { + return this.totalAssetsFoundCount; + } + + /** + * Get the seeds property: The list of seeds used for the disco run. + * + * @return the seeds value. + */ + @Generated + public List getSeeds() { + return this.seeds; + } + + /** + * Get the excludes property: The list of excludes used for the disco run, aka assets to exclude from the discovery + * algorithm. + * + * @return the excludes value. + */ + @Generated + public List getExcludes() { + return this.excludes; + } + + /** + * Get the names property: The list of names used for the disco run. + * + * @return the names value. + */ + @Generated + public List getNames() { + return this.names; + } +} 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 new file mode 100644 index 000000000000..1157826ac1c5 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoRunState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The State of the disco run. */ +public final class DiscoRunState extends ExpandableStringEnum { + + /** Static value pending for DiscoRunState. */ + @Generated public static final DiscoRunState PENDING = fromString("pending"); + + /** Static value running for DiscoRunState. */ + @Generated public static final DiscoRunState RUNNING = fromString("running"); + + /** Static value completed for DiscoRunState. */ + @Generated public static final DiscoRunState COMPLETED = fromString("completed"); + + /** Static value failed for DiscoRunState. */ + @Generated public static final DiscoRunState FAILED = fromString("failed"); + + /** + * Creates a new instance of DiscoRunState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DiscoRunState() {} + + /** + * Creates or finds a DiscoRunState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiscoRunState. + */ + @Generated + @JsonCreator + public static DiscoRunState fromString(String name) { + return fromString(name, DiscoRunState.class); + } + + /** + * Gets known DiscoRunState values. + * + * @return known DiscoRunState values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..861c5be84924 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSource.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Source entity used to drive discovery. */ +@Fluent +public final class DiscoSource { + + /* + * 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; + + /** Creates an instance of DiscoSource class. */ + @Generated + public DiscoSource() {} + + /** + * Get the kind property: The kind of disco source. + * + * @return the kind value. + */ + @Generated + public DiscoSourceKind getKind() { + return this.kind; + } + + /** + * Set the kind property: The kind of disco source. + * + * @param kind the kind value to set. + * @return the DiscoSource object itself. + */ + @Generated + public DiscoSource setKind(DiscoSourceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the name property: The name for the disco source. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The name for the disco source. + * + * @param name the name value to set. + * @return the DiscoSource object itself. + */ + @Generated + public DiscoSource setName(String name) { + this.name = name; + return this; + } +} 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 new file mode 100644 index 000000000000..0650f07a6d09 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoSourceKind.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The kind of disco source. */ +public final class DiscoSourceKind extends ExpandableStringEnum { + + /** Static value as for DiscoSourceKind. */ + @Generated public static final DiscoSourceKind AS = fromString("as"); + + /** Static value attribute for DiscoSourceKind. */ + @Generated public static final DiscoSourceKind ATTRIBUTE = fromString("attribute"); + + /** Static value contact for DiscoSourceKind. */ + @Generated public static final DiscoSourceKind CONTACT = fromString("contact"); + + /** Static value domain for DiscoSourceKind. */ + @Generated public static final DiscoSourceKind DOMAIN = fromString("domain"); + + /** Static value host for DiscoSourceKind. */ + @Generated public static final DiscoSourceKind HOST = fromString("host"); + + /** Static value ipBlock for DiscoSourceKind. */ + @Generated public static final DiscoSourceKind IP_BLOCK = fromString("ipBlock"); + + /** + * Creates a new instance of DiscoSourceKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DiscoSourceKind() {} + + /** + * Creates or finds a DiscoSourceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiscoSourceKind. + */ + @Generated + @JsonCreator + public static DiscoSourceKind fromString(String name) { + return fromString(name, DiscoSourceKind.class); + } + + /** + * Gets known DiscoSourceKind values. + * + * @return known DiscoSourceKind values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..2ef21d65a9fc --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplate.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The items in the current page of results. */ +@Immutable +public final class DiscoTemplate { + + /* + * 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; + + /** Creates an instance of DiscoTemplate class. */ + @Generated + private DiscoTemplate() {} + + /** + * Get the id property: The system generated unique id for the resource. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the industry property: The name of the industry. + * + * @return the industry value. + */ + @Generated + public String getIndustry() { + return this.industry; + } + + /** + * Get the region property: The name of the region. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * Get the countryCode property: The country code. + * + * @return the countryCode value. + */ + @Generated + public String getCountryCode() { + return this.countryCode; + } + + /** + * Get the stateCode property: The state code. + * + * @return the stateCode value. + */ + @Generated + public String getStateCode() { + return this.stateCode; + } + + /** + * Get the city property: The name of the city. + * + * @return the city value. + */ + @Generated + public String getCity() { + return this.city; + } + + /** + * Get the seeds property: The list of disco template seeds. + * + * @return the seeds value. + */ + @Generated + public List getSeeds() { + return this.seeds; + } + + /** + * Get the names property: The list of disco template names. + * + * @return the names value. + */ + @Generated + public List getNames() { + return this.names; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplatePageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplatePageResult.java new file mode 100644 index 000000000000..9131cc47d732 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplatePageResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** The DiscoTemplatePageResponse model. */ +@Immutable +public final class DiscoTemplatePageResult { + /* + * The total number of items available in the full result set. + */ + @Generated + @JsonProperty(value = "totalElements") + private Long totalElements; + + /* + * The link to access the next page of results. Not set if at the end of the result set. + */ + @Generated + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The items in the current page of results. + */ + @Generated + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of DiscoTemplatePageResponse class. */ + @Generated + private DiscoTemplatePageResult() {} + + /** + * Get the totalElements property: The total number of items available in the full result set. + * + * @return the totalElements value. + */ + @Generated + public Long getTotalElements() { + return this.totalElements; + } + + /** + * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result set. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * Get the value property: The items in the current page of results. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAsset.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAsset.java new file mode 100644 index 000000000000..25b38f75607b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAsset.java @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The DomainAsset model. */ +@Immutable +public final class DomainAsset extends InventoryAsset { + + /* + * 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; + + /** Creates an instance of DomainAsset class. */ + @Generated + private DomainAsset() {} + + /** + * Get the domain property: The domain property. + * + * @return the domain value. + */ + @Generated + public String getDomain() { + return this.domain; + } + + /** + * Get the whoisId property: The whoisId property. + * + * @return the whoisId value. + */ + @Generated + public Long getWhoisId() { + return this.whoisId; + } + + /** + * Get the registrarIanaIds property: The registrarIanaIds property. + * + * @return the registrarIanaIds value. + */ + @Generated + public List getRegistrarIanaIds() { + return this.registrarIanaIds; + } + + /** + * Get the registrantContacts property: The registrantContacts property. + * + * @return the registrantContacts value. + */ + @Generated + public List getRegistrantContacts() { + return this.registrantContacts; + } + + /** + * Get the registrantOrgs property: The registrantOrgs property. + * + * @return the registrantOrgs value. + */ + @Generated + public List getRegistrantOrgs() { + return this.registrantOrgs; + } + + /** + * Get the adminContacts property: The adminContacts property. + * + * @return the adminContacts value. + */ + @Generated + public List getAdminContacts() { + return this.adminContacts; + } + + /** + * Get the technicalContacts property: The technicalContacts property. + * + * @return the technicalContacts value. + */ + @Generated + public List getTechnicalContacts() { + return this.technicalContacts; + } + + /** + * Get the alexaInfos property: The alexaInfos property. + * + * @return the alexaInfos value. + */ + @Generated + public List getAlexaInfos() { + return this.alexaInfos; + } + + /** + * Get the nameServers property: The nameServers property. + * + * @return the nameServers value. + */ + @Generated + public List getNameServers() { + return this.nameServers; + } + + /** + * Get the mailServers property: The mailServers property. + * + * @return the mailServers value. + */ + @Generated + public List getMailServers() { + return this.mailServers; + } + + /** + * Get the whoisServers property: The whoisServers property. + * + * @return the whoisServers value. + */ + @Generated + public List getWhoisServers() { + return this.whoisServers; + } + + /** + * Get the domainStatuses property: The domainStatuses property. + * + * @return the domainStatuses value. + */ + @Generated + public List getDomainStatuses() { + return this.domainStatuses; + } + + /** + * Get the registrarCreatedAt property: The registrarCreatedAt property. + * + * @return the registrarCreatedAt value. + */ + @Generated + public List getRegistrarCreatedAt() { + return this.registrarCreatedAt; + } + + /** + * Get the registrarUpdatedAt property: The registrarUpdatedAt property. + * + * @return the registrarUpdatedAt value. + */ + @Generated + public List getRegistrarUpdatedAt() { + return this.registrarUpdatedAt; + } + + /** + * Get the registrarExpiresAt property: The registrarExpiresAt property. + * + * @return the registrarExpiresAt value. + */ + @Generated + public List getRegistrarExpiresAt() { + return this.registrarExpiresAt; + } + + /** + * Get the soaRecords property: The soaRecords property. + * + * @return the soaRecords value. + */ + @Generated + public List getSoaRecords() { + return this.soaRecords; + } + + /** + * Get the detailedFromWhoisAt property: The detailedFromWhoisAt property. + * + * @return the detailedFromWhoisAt value. + */ + @Generated + public OffsetDateTime getDetailedFromWhoisAt() { + return this.detailedFromWhoisAt; + } + + /** + * Get the registrarNames property: The registrarNames property. + * + * @return the registrarNames value. + */ + @Generated + public List getRegistrarNames() { + return this.registrarNames; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the parkedDomain property: The parkedDomain property. + * + * @return the parkedDomain value. + */ + @Generated + public List getParkedDomain() { + return this.parkedDomain; + } + + /** + * Get the registrantNames property: The registrantNames property. + * + * @return the registrantNames value. + */ + @Generated + public List getRegistrantNames() { + return this.registrantNames; + } + + /** + * Get the adminNames property: The adminNames property. + * + * @return the adminNames value. + */ + @Generated + public List getAdminNames() { + return this.adminNames; + } + + /** + * Get the technicalNames property: The technicalNames property. + * + * @return the technicalNames value. + */ + @Generated + public List getTechnicalNames() { + return this.technicalNames; + } + + /** + * Get the adminOrgs property: The adminOrgs property. + * + * @return the adminOrgs value. + */ + @Generated + public List getAdminOrgs() { + return this.adminOrgs; + } + + /** + * Get the technicalOrgs property: The technicalOrgs property. + * + * @return the technicalOrgs value. + */ + @Generated + public List getTechnicalOrgs() { + return this.technicalOrgs; + } + + /** + * Get the registrantPhones property: The registrantPhones property. + * + * @return the registrantPhones value. + */ + @Generated + public List getRegistrantPhones() { + return this.registrantPhones; + } + + /** + * Get the adminPhones property: The adminPhones property. + * + * @return the adminPhones value. + */ + @Generated + public List getAdminPhones() { + return this.adminPhones; + } + + /** + * Get the technicalPhones property: The technicalPhones property. + * + * @return the technicalPhones value. + */ + @Generated + public List getTechnicalPhones() { + return this.technicalPhones; + } +} 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 new file mode 100644 index 000000000000..5bf1bb7c2b07 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DomainAssetResource.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The DomainAssetResource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("domain") +@Immutable +public final class DomainAssetResource extends AssetResource { + + /* + * asset + */ + @Generated + @JsonProperty(value = "asset") + private DomainAsset asset; + + /** + * Creates an instance of DomainAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + @JsonCreator + private DomainAssetResource(@JsonProperty(value = "asset") DomainAsset asset) { + this.asset = asset; + } + + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public DomainAsset getAsset() { + return this.asset; + } +} 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 new file mode 100644 index 000000000000..6ec44d028532 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ErrorDetail.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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 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 { + + /* + * This is one of a server-defined set of error codes. + */ + @Generated + @JsonProperty(value = "code") + private String code; + + /* + * This is a human-readable representation of the error. + */ + @Generated + @JsonProperty(value = "message") + private 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; + + /** + * Creates an instance of ErrorDetail class. + * + * @param code the code value to set. + * @param message the message value to set. + */ + @Generated + @JsonCreator + private ErrorDetail(@JsonProperty(value = "code") String code, @JsonProperty(value = "message") String message) { + this.code = code; + this.message = message; + } + + /** + * Get the code property: This is one of a server-defined set of error codes. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the message property: This is a human-readable representation of the error. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the target property: This is the error target. + * + * @return the target value. + */ + @Generated + public String getTarget() { + return this.target; + } + + /** + * Get the details property: This is an array of details about specific errors that led to this reported error. + * + * @return the details value. + */ + @Generated + public List getDetails() { + return this.details; + } + + /** + * Get the innererror property: This is an object containing more specific information than the current object about + * the error. + * + * @return the innererror value. + */ + @Generated + public InnerError getInnererror() { + return this.innererror; + } +} 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 new file mode 100644 index 000000000000..7f77a19cb1e4 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/GuidPair.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The GuidPair model. */ +@Immutable +public final class GuidPair { + + /* + * 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; + + /** Creates an instance of GuidPair class. */ + @Generated + private GuidPair() {} + + /** + * Get the pageGuid property: The pageGuid property. + * + * @return the pageGuid value. + */ + @Generated + public String getPageGuid() { + return this.pageGuid; + } + + /** + * Get the crawlStateGuid property: The crawlStateGuid property. + * + * @return the crawlStateGuid value. + */ + @Generated + public String getCrawlStateGuid() { + return this.crawlStateGuid; + } + + /** + * Get the loadDate property: The loadDate property. + * + * @return the loadDate value. + */ + @Generated + public OffsetDateTime getLoadDate() { + return this.loadDate; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } +} 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 new file mode 100644 index 000000000000..3d021c73a152 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAsset.java @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The HostAsset model. */ +@Immutable +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; + + /** Creates an instance of HostAsset class. */ + @Generated + private HostAsset() {} + + /** + * Get the host property: The host property. + * + * @return the host value. + */ + @Generated + public String getHost() { + return this.host; + } + + /** + * Get the domain property: The domain property. + * + * @return the domain value. + */ + @Generated + public String getDomain() { + return this.domain; + } + + /** + * Get the ipAddresses property: The ipAddresses property. + * + * @return the ipAddresses value. + */ + @Generated + public List getIpAddresses() { + return this.ipAddresses; + } + + /** + * Get the webComponents property: The webComponents property. + * + * @return the webComponents value. + */ + @Generated + public List getWebComponents() { + return this.webComponents; + } + + /** + * Get the headers property: The headers property. + * + * @return the headers value. + */ + @Generated + public List getHeaders() { + return this.headers; + } + + /** + * Get the attributes property: The attributes property. + * + * @return the attributes value. + */ + @Generated + public List getAttributes() { + return this.attributes; + } + + /** + * Get the cookies property: The cookies property. + * + * @return the cookies value. + */ + @Generated + public List getCookies() { + return this.cookies; + } + + /** + * Get the sslCerts property: The sslCerts property. + * + * @return the sslCerts value. + */ + @Generated + public List getSslCerts() { + return this.sslCerts; + } + + /** + * Get the parentHosts property: The parentHosts property. + * + * @return the parentHosts value. + */ + @Generated + public List getParentHosts() { + return this.parentHosts; + } + + /** + * Get the childHosts property: The childHosts property. + * + * @return the childHosts value. + */ + @Generated + public List getChildHosts() { + return this.childHosts; + } + + /** + * Get the hostCore property: The hostCore property. + * + * @return the hostCore value. + */ + @Generated + public HostCore getHostCore() { + return this.hostCore; + } + + /** + * Get the services property: The services property. + * + * @return the services value. + */ + @Generated + public List getServices() { + return this.services; + } + + /** + * Get the cnames property: The cnames property. + * + * @return the cnames value. + */ + @Generated + public List getCnames() { + return this.cnames; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the resourceUrls property: The resourceUrls property. + * + * @return the resourceUrls value. + */ + @Generated + public List getResourceUrls() { + return this.resourceUrls; + } + + /** + * Get the scanMetadata property: The scanMetadata property. + * + * @return the scanMetadata value. + */ + @Generated + public List getScanMetadata() { + return this.scanMetadata; + } + + /** + * Get the asns property: The asns property. + * + * @return the asns value. + */ + @Generated + public List getAsns() { + return this.asns; + } + + /** + * Get the ipBlocks property: The ipBlocks property. + * + * @return the ipBlocks value. + */ + @Generated + public List getIpBlocks() { + return this.ipBlocks; + } + + /** + * Get the responseBodies property: The responseBodies property. + * + * @return the responseBodies value. + */ + @Generated + public List getResponseBodies() { + return this.responseBodies; + } + + /** + * Get the domainAsset property: The domainAsset property. + * + * @return the domainAsset value. + */ + @Generated + public DomainAsset getDomainAsset() { + return this.domainAsset; + } + + /** + * Get the nsRecord property: The nsRecord property. + * + * @return the nsRecord value. + */ + @Generated + public List getNsRecord() { + return this.nsRecord; + } + + /** + * Get the mxRecord property: The mxRecord property. + * + * @return the mxRecord value. + */ + @Generated + public List getMxRecord() { + return this.mxRecord; + } + + /** + * Get the webserver property: The webserver property. + * + * @return the webserver value. + */ + @Generated + public List getWebserver() { + return this.webserver; + } + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + @Generated + public List getLocation() { + return this.location; + } + + /** + * Get the nxdomain property: The nxdomain property. + * + * @return the nxdomain value. + */ + @Generated + public List getNxdomain() { + return this.nxdomain; + } + + /** + * Get the sslServerConfig property: The sslServerConfig property. + * + * @return the sslServerConfig value. + */ + @Generated + public List getSslServerConfig() { + return this.sslServerConfig; + } + + /** + * Get the isWildcard property: The isWildcard property. + * + * @return the isWildcard value. + */ + @Generated + public List getIsWildcard() { + return this.isWildcard; + } + + /** + * Get the banners property: The banners property. + * + * @return the banners value. + */ + @Generated + public List getBanners() { + return this.banners; + } + + /** + * Get the ipv4 property: The ipv4 property. + * + * @return the ipv4 value. + */ + @Generated + public List getIpv4() { + return this.ipv4; + } + + /** + * Get the ipv6 property: The ipv6 property. + * + * @return the ipv6 value. + */ + @Generated + public List getIpv6() { + return this.ipv6; + } +} 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 new file mode 100644 index 000000000000..c19a8187c36f --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostAssetResource.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The HostAssetResource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("host") +@Immutable +public final class HostAssetResource extends AssetResource { + + /* + * asset + */ + @Generated + @JsonProperty(value = "asset") + private HostAsset asset; + + /** + * Creates an instance of HostAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + @JsonCreator + private HostAssetResource(@JsonProperty(value = "asset") HostAsset asset) { + this.asset = asset; + } + + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public HostAsset getAsset() { + return this.asset; + } +} 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 new file mode 100644 index 000000000000..07f00c5d1ce9 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/HostCore.java @@ -0,0 +1,664 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The HostCore model. */ +@Immutable +public final class HostCore { + + /* + * 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; + + /** Creates an instance of HostCore class. */ + @Generated + private HostCore() {} + + /** + * Get the host property: The host property. + * + * @return the host value. + */ + @Generated + public String getHost() { + return this.host; + } + + /** + * Get the domain property: The domain property. + * + * @return the domain value. + */ + @Generated + public String getDomain() { + return this.domain; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the blacklistCauseFirstSeen property: The blacklistCauseFirstSeen property. + * + * @return the blacklistCauseFirstSeen value. + */ + @Generated + public OffsetDateTime getBlacklistCauseFirstSeen() { + return this.blacklistCauseFirstSeen; + } + + /** + * Get the blacklistCauseLastSeen property: The blacklistCauseLastSeen property. + * + * @return the blacklistCauseLastSeen value. + */ + @Generated + public OffsetDateTime getBlacklistCauseLastSeen() { + return this.blacklistCauseLastSeen; + } + + /** + * Get the blacklistCauseCount property: The blacklistCauseCount property. + * + * @return the blacklistCauseCount value. + */ + @Generated + public Long getBlacklistCauseCount() { + return this.blacklistCauseCount; + } + + /** + * Get the blacklistResourceFirstSeen property: The blacklistResourceFirstSeen property. + * + * @return the blacklistResourceFirstSeen value. + */ + @Generated + public OffsetDateTime getBlacklistResourceFirstSeen() { + return this.blacklistResourceFirstSeen; + } + + /** + * Get the blacklistResourceLastSeen property: The blacklistResourceLastSeen property. + * + * @return the blacklistResourceLastSeen value. + */ + @Generated + public OffsetDateTime getBlacklistResourceLastSeen() { + return this.blacklistResourceLastSeen; + } + + /** + * Get the blacklistResourceCount property: The blacklistResourceCount property. + * + * @return the blacklistResourceCount value. + */ + @Generated + public Long getBlacklistResourceCount() { + return this.blacklistResourceCount; + } + + /** + * Get the blacklistSequenceFirstSeen property: The blacklistSequenceFirstSeen property. + * + * @return the blacklistSequenceFirstSeen value. + */ + @Generated + public OffsetDateTime getBlacklistSequenceFirstSeen() { + return this.blacklistSequenceFirstSeen; + } + + /** + * Get the blacklistSequenceLastSeen property: The blacklistSequenceLastSeen property. + * + * @return the blacklistSequenceLastSeen value. + */ + @Generated + public OffsetDateTime getBlacklistSequenceLastSeen() { + return this.blacklistSequenceLastSeen; + } + + /** + * Get the blacklistSequenceCount property: The blacklistSequenceCount property. + * + * @return the blacklistSequenceCount value. + */ + @Generated + public Long getBlacklistSequenceCount() { + return this.blacklistSequenceCount; + } + + /** + * Get the phishCauseCount property: The phishCauseCount property. + * + * @return the phishCauseCount value. + */ + @Generated + public Long getPhishCauseCount() { + return this.phishCauseCount; + } + + /** + * Get the malwareCauseCount property: The malwareCauseCount property. + * + * @return the malwareCauseCount value. + */ + @Generated + public Long getMalwareCauseCount() { + return this.malwareCauseCount; + } + + /** + * Get the spamCauseCount property: The spamCauseCount property. + * + * @return the spamCauseCount value. + */ + @Generated + public Long getSpamCauseCount() { + return this.spamCauseCount; + } + + /** + * Get the scamCauseCount property: The scamCauseCount property. + * + * @return the scamCauseCount value. + */ + @Generated + public Long getScamCauseCount() { + return this.scamCauseCount; + } + + /** + * Get the phishResourceCount property: The phishResourceCount property. + * + * @return the phishResourceCount value. + */ + @Generated + public Long getPhishResourceCount() { + return this.phishResourceCount; + } + + /** + * Get the malwareResourceCount property: The malwareResourceCount property. + * + * @return the malwareResourceCount value. + */ + @Generated + public Long getMalwareResourceCount() { + return this.malwareResourceCount; + } + + /** + * Get the spamResourceCount property: The spamResourceCount property. + * + * @return the spamResourceCount value. + */ + @Generated + public Long getSpamResourceCount() { + return this.spamResourceCount; + } + + /** + * Get the scamResourceCount property: The scamResourceCount property. + * + * @return the scamResourceCount value. + */ + @Generated + public Long getScamResourceCount() { + return this.scamResourceCount; + } + + /** + * Get the phishSequenceCount property: The phishSequenceCount property. + * + * @return the phishSequenceCount value. + */ + @Generated + public Long getPhishSequenceCount() { + return this.phishSequenceCount; + } + + /** + * Get the malwareSequenceCount property: The malwareSequenceCount property. + * + * @return the malwareSequenceCount value. + */ + @Generated + public Long getMalwareSequenceCount() { + return this.malwareSequenceCount; + } + + /** + * Get the spamSequenceCount property: The spamSequenceCount property. + * + * @return the spamSequenceCount value. + */ + @Generated + public Long getSpamSequenceCount() { + return this.spamSequenceCount; + } + + /** + * Get the scamSequenceCount property: The scamSequenceCount property. + * + * @return the scamSequenceCount value. + */ + @Generated + public Long getScamSequenceCount() { + return this.scamSequenceCount; + } + + /** + * Get the alexaRank property: The alexaRank property. + * + * @return the alexaRank value. + */ + @Generated + public Integer getAlexaRank() { + return this.alexaRank; + } + + /** + * Get the hostReputationScore property: The hostReputationScore property. + * + * @return the hostReputationScore value. + */ + @Generated + public Integer getHostReputationScore() { + return this.hostReputationScore; + } + + /** + * Get the hostPhishReputationScore property: The hostPhishReputationScore property. + * + * @return the hostPhishReputationScore value. + */ + @Generated + public Integer getHostPhishReputationScore() { + return this.hostPhishReputationScore; + } + + /** + * Get the hostMalwareReputationScore property: The hostMalwareReputationScore property. + * + * @return the hostMalwareReputationScore value. + */ + @Generated + public Integer getHostMalwareReputationScore() { + return this.hostMalwareReputationScore; + } + + /** + * Get the hostSpamReputationScore property: The hostSpamReputationScore property. + * + * @return the hostSpamReputationScore value. + */ + @Generated + public Integer getHostSpamReputationScore() { + return this.hostSpamReputationScore; + } + + /** + * Get the hostScamReputationScore property: The hostScamReputationScore property. + * + * @return the hostScamReputationScore value. + */ + @Generated + public Integer getHostScamReputationScore() { + return this.hostScamReputationScore; + } + + /** + * Get the domainReputationScore property: The domainReputationScore property. + * + * @return the domainReputationScore value. + */ + @Generated + public Integer getDomainReputationScore() { + return this.domainReputationScore; + } + + /** + * Get the domainPhishReputationScore property: The domainPhishReputationScore property. + * + * @return the domainPhishReputationScore value. + */ + @Generated + public Integer getDomainPhishReputationScore() { + return this.domainPhishReputationScore; + } + + /** + * Get the domainMalwareReputationScore property: The domainMalwareReputationScore property. + * + * @return the domainMalwareReputationScore value. + */ + @Generated + public Integer getDomainMalwareReputationScore() { + return this.domainMalwareReputationScore; + } + + /** + * Get the domainSpamReputationScore property: The domainSpamReputationScore property. + * + * @return the domainSpamReputationScore value. + */ + @Generated + public Integer getDomainSpamReputationScore() { + return this.domainSpamReputationScore; + } + + /** + * Get the domainScamReputationScore property: The domainScamReputationScore property. + * + * @return the domainScamReputationScore value. + */ + @Generated + public Integer getDomainScamReputationScore() { + return this.domainScamReputationScore; + } + + /** + * Get the uuid property: The uuid property. + * + * @return the uuid value. + */ + @Generated + public String getUuid() { + return this.uuid; + } +} 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 new file mode 100644 index 000000000000..011096a97233 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InnerError.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is an object containing more specific information than the current object about the error. */ +@Immutable +public final class InnerError { + + /* + * 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; + + /** Creates an instance of InnerError class. */ + @Generated + private InnerError() {} + + /** + * Get the code property: This is a more specific error code than was provided by the containing error. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the value property: This is an additional field representing the value that caused the error to help with + * debugging. + * + * @return the value value. + */ + @Generated + public Object getValue() { + return this.value; + } +} 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 new file mode 100644 index 000000000000..2176024a6993 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InventoryAsset.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** The InventoryAsset model. */ +@Immutable +public class InventoryAsset { + + /** Creates an instance of InventoryAsset class. */ + @Generated + protected InventoryAsset() {} +} 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 new file mode 100644 index 000000000000..369accf13dbe --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAsset.java @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The IpAddressAsset model. */ +@Immutable +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; + + /** Creates an instance of IpAddressAsset class. */ + @Generated + private IpAddressAsset() {} + + /** + * Get the ipAddress property: The ipAddress property. + * + * @return the ipAddress value. + */ + @Generated + public String getIpAddress() { + return this.ipAddress; + } + + /** + * Get the asns property: The asns property. + * + * @return the asns value. + */ + @Generated + public List getAsns() { + return this.asns; + } + + /** + * Get the reputations property: The reputations property. + * + * @return the reputations value. + */ + @Generated + public List getReputations() { + return this.reputations; + } + + /** + * Get the webComponents property: The webComponents property. + * + * @return the webComponents value. + */ + @Generated + public List getWebComponents() { + return this.webComponents; + } + + /** + * Get the netRanges property: The netRanges property. + * + * @return the netRanges value. + */ + @Generated + public List getNetRanges() { + return this.netRanges; + } + + /** + * Get the headers property: The headers property. + * + * @return the headers value. + */ + @Generated + public List getHeaders() { + return this.headers; + } + + /** + * Get the attributes property: The attributes property. + * + * @return the attributes value. + */ + @Generated + public List getAttributes() { + return this.attributes; + } + + /** + * Get the cookies property: The cookies property. + * + * @return the cookies value. + */ + @Generated + public List getCookies() { + return this.cookies; + } + + /** + * Get the sslCerts property: The sslCerts property. + * + * @return the sslCerts value. + */ + @Generated + public List getSslCerts() { + return this.sslCerts; + } + + /** + * Get the services property: The services property. + * + * @return the services value. + */ + @Generated + public List getServices() { + return this.services; + } + + /** + * Get the ipBlocks property: The ipBlocks property. + * + * @return the ipBlocks value. + */ + @Generated + public List getIpBlocks() { + return this.ipBlocks; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the banners property: The banners property. + * + * @return the banners value. + */ + @Generated + public List getBanners() { + return this.banners; + } + + /** + * Get the scanMetadata property: The scanMetadata property. + * + * @return the scanMetadata value. + */ + @Generated + public List getScanMetadata() { + return this.scanMetadata; + } + + /** + * Get the nsRecord property: The nsRecord property. + * + * @return the nsRecord value. + */ + @Generated + public List getNsRecord() { + return this.nsRecord; + } + + /** + * Get the mxRecord property: The mxRecord property. + * + * @return the mxRecord value. + */ + @Generated + public List getMxRecord() { + return this.mxRecord; + } + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + @Generated + public List getLocation() { + return this.location; + } + + /** + * Get the hosts property: The hosts property. + * + * @return the hosts value. + */ + @Generated + public List getHosts() { + return this.hosts; + } + + /** + * Get the nxdomain property: The nxdomain property. + * + * @return the nxdomain value. + */ + @Generated + public List getNxdomain() { + return this.nxdomain; + } + + /** + * Get the sslServerConfig property: The sslServerConfig property. + * + * @return the sslServerConfig value. + */ + @Generated + public List getSslServerConfig() { + return this.sslServerConfig; + } + + /** + * Get the ipv4 property: The ipv4 property. + * + * @return the ipv4 value. + */ + @Generated + public Boolean isIpv4() { + return this.ipv4; + } + + /** + * Get the ipv6 property: The ipv6 property. + * + * @return the ipv6 value. + */ + @Generated + public Boolean isIpv6() { + return this.ipv6; + } +} 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 new file mode 100644 index 000000000000..96d6f9023ebe --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpAddressAssetResource.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The IpAddressAssetResource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ipAddress") +@Immutable +public final class IpAddressAssetResource extends AssetResource { + + /* + * asset + */ + @Generated + @JsonProperty(value = "asset") + private IpAddressAsset asset; + + /** + * Creates an instance of IpAddressAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + @JsonCreator + private IpAddressAssetResource(@JsonProperty(value = "asset") IpAddressAsset asset) { + this.asset = asset; + } + + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public IpAddressAsset getAsset() { + return this.asset; + } +} 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 new file mode 100644 index 000000000000..58aa86b326c5 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlock.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The IpBlock model. */ +@Immutable +public final class IpBlock { + + /* + * 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; + + /** Creates an instance of IpBlock class. */ + @Generated + private IpBlock() {} + + /** + * Get the ipBlock property: The ipBlock property. + * + * @return the ipBlock value. + */ + @Generated + public String getIpBlock() { + return this.ipBlock; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } +} 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 new file mode 100644 index 000000000000..3de362ee3822 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAsset.java @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The IpBlockAsset model. */ +@Immutable +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; + + /** Creates an instance of IpBlockAsset class. */ + @Generated + private IpBlockAsset() {} + + /** + * Get the ipBlock property: The ipBlock property. + * + * @return the ipBlock value. + */ + @Generated + public String getIpBlock() { + return this.ipBlock; + } + + /** + * Get the asns property: The asns property. + * + * @return the asns value. + */ + @Generated + public List getAsns() { + return this.asns; + } + + /** + * Get the bgpPrefixes property: The bgpPrefixes property. + * + * @return the bgpPrefixes value. + */ + @Generated + public List getBgpPrefixes() { + return this.bgpPrefixes; + } + + /** + * Get the netNames property: The netNames property. + * + * @return the netNames value. + */ + @Generated + public List getNetNames() { + return this.netNames; + } + + /** + * Get the registrantContacts property: The registrantContacts property. + * + * @return the registrantContacts value. + */ + @Generated + public List getRegistrantContacts() { + return this.registrantContacts; + } + + /** + * Get the registrantOrgs property: The registrantOrgs property. + * + * @return the registrantOrgs value. + */ + @Generated + public List getRegistrantOrgs() { + return this.registrantOrgs; + } + + /** + * Get the adminContacts property: The adminContacts property. + * + * @return the adminContacts value. + */ + @Generated + public List getAdminContacts() { + return this.adminContacts; + } + + /** + * Get the technicalContacts property: The technicalContacts property. + * + * @return the technicalContacts value. + */ + @Generated + public List getTechnicalContacts() { + return this.technicalContacts; + } + + /** + * Get the registrarCreatedAt property: The registrarCreatedAt property. + * + * @return the registrarCreatedAt value. + */ + @Generated + public List getRegistrarCreatedAt() { + return this.registrarCreatedAt; + } + + /** + * Get the registrarUpdatedAt property: The registrarUpdatedAt property. + * + * @return the registrarUpdatedAt value. + */ + @Generated + public List getRegistrarUpdatedAt() { + return this.registrarUpdatedAt; + } + + /** + * Get the netRanges property: The netRanges property. + * + * @return the netRanges value. + */ + @Generated + public List getNetRanges() { + return this.netRanges; + } + + /** + * Get the startIp property: The startIp property. + * + * @return the startIp value. + */ + @Generated + public String getStartIp() { + return this.startIp; + } + + /** + * Get the endIp property: The endIp property. + * + * @return the endIp value. + */ + @Generated + public String getEndIp() { + return this.endIp; + } + + /** + * Get the reputations property: The reputations property. + * + * @return the reputations value. + */ + @Generated + public List getReputations() { + return this.reputations; + } + + /** + * Get the detailedFromWhoisAt property: The detailedFromWhoisAt property. + * + * @return the detailedFromWhoisAt value. + */ + @Generated + public OffsetDateTime getDetailedFromWhoisAt() { + return this.detailedFromWhoisAt; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + @Generated + public List getLocation() { + return this.location; + } + + /** + * Get the registrarExpiresAt property: The registrarExpiresAt property. + * + * @return the registrarExpiresAt value. + */ + @Generated + public List getRegistrarExpiresAt() { + return this.registrarExpiresAt; + } + + /** + * Get the registrantNames property: The registrantNames property. + * + * @return the registrantNames value. + */ + @Generated + public List getRegistrantNames() { + return this.registrantNames; + } + + /** + * Get the adminNames property: The adminNames property. + * + * @return the adminNames value. + */ + @Generated + public List getAdminNames() { + return this.adminNames; + } + + /** + * Get the technicalNames property: The technicalNames property. + * + * @return the technicalNames value. + */ + @Generated + public List getTechnicalNames() { + return this.technicalNames; + } + + /** + * Get the adminOrgs property: The adminOrgs property. + * + * @return the adminOrgs value. + */ + @Generated + public List getAdminOrgs() { + return this.adminOrgs; + } + + /** + * Get the technicalOrgs property: The technicalOrgs property. + * + * @return the technicalOrgs value. + */ + @Generated + public List getTechnicalOrgs() { + return this.technicalOrgs; + } + + /** + * Get the registrantPhones property: The registrantPhones property. + * + * @return the registrantPhones value. + */ + @Generated + public List getRegistrantPhones() { + return this.registrantPhones; + } + + /** + * Get the adminPhones property: The adminPhones property. + * + * @return the adminPhones value. + */ + @Generated + public List getAdminPhones() { + return this.adminPhones; + } + + /** + * Get the technicalPhones property: The technicalPhones property. + * + * @return the technicalPhones value. + */ + @Generated + public List getTechnicalPhones() { + return this.technicalPhones; + } + + /** + * Get the ipv4 property: The ipv4 property. + * + * @return the ipv4 value. + */ + @Generated + public Boolean isIpv4() { + return this.ipv4; + } + + /** + * Get the ipv6 property: The ipv6 property. + * + * @return the ipv6 value. + */ + @Generated + public Boolean isIpv6() { + return this.ipv6; + } +} 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 new file mode 100644 index 000000000000..1437a0121064 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/IpBlockAssetResource.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The IpBlockAssetResource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ipBlock") +@Immutable +public final class IpBlockAssetResource extends AssetResource { + + /* + * asset + */ + @Generated + @JsonProperty(value = "asset") + private IpBlockAsset asset; + + /** + * Creates an instance of IpBlockAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + @JsonCreator + private IpBlockAssetResource(@JsonProperty(value = "asset") IpBlockAsset asset) { + this.asset = asset; + } + + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public IpBlockAsset getAsset() { + return this.asset; + } +} 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 new file mode 100644 index 000000000000..c37a964981d4 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Location.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Location model. */ +@Immutable +public final class Location { + + /* + * 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; + + /** Creates an instance of Location class. */ + @Generated + private Location() {} + + /** + * Get the countryCode property: The countryCode property. + * + * @return the countryCode value. + */ + @Generated + public String getCountryCode() { + return this.countryCode; + } + + /** + * Get the countryName property: The countryName property. + * + * @return the countryName value. + */ + @Generated + public String getCountryName() { + return this.countryName; + } + + /** + * Get the region property: The region property. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * Get the regionName property: The regionName property. + * + * @return the regionName value. + */ + @Generated + public String getRegionName() { + return this.regionName; + } + + /** + * Get the city property: The city property. + * + * @return the city value. + */ + @Generated + public String getCity() { + return this.city; + } + + /** + * Get the areaCode property: The areaCode property. + * + * @return the areaCode value. + */ + @Generated + public Integer getAreaCode() { + return this.areaCode; + } + + /** + * Get the postalCode property: The postalCode property. + * + * @return the postalCode value. + */ + @Generated + public String getPostalCode() { + return this.postalCode; + } + + /** + * Get the latitude property: The latitude property. + * + * @return the latitude value. + */ + @Generated + public Double getLatitude() { + return this.latitude; + } + + /** + * Get the longitude property: The longitude property. + * + * @return the longitude value. + */ + @Generated + public Double getLongitude() { + return this.longitude; + } + + /** + * Get the dmaCode property: The dmaCode property. + * + * @return the dmaCode value. + */ + @Generated + public Integer getDmaCode() { + return this.dmaCode; + } + + /** + * Get the metroCodeId property: The metroCodeId property. + * + * @return the metroCodeId value. + */ + @Generated + public Integer getMetroCodeId() { + return this.metroCodeId; + } +} 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 new file mode 100644 index 000000000000..099c6fff4220 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnection.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The LogAnalyticsDataConnection model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("logAnalytics") +@Immutable +public final class LogAnalyticsDataConnection extends DataConnection { + + /* + * properties + */ + @Generated + @JsonProperty(value = "properties") + private LogAnalyticsDataConnectionProperties properties; + + /** + * Creates an instance of LogAnalyticsDataConnection class. + * + * @param properties the properties value to set. + */ + @Generated + @JsonCreator + private LogAnalyticsDataConnection( + @JsonProperty(value = "properties") LogAnalyticsDataConnectionProperties properties) { + this.properties = properties; + } + + /** + * Get the properties property: properties. + * + * @return the properties value. + */ + @Generated + public LogAnalyticsDataConnectionProperties getProperties() { + return this.properties; + } +} 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 new file mode 100644 index 000000000000..df09586cdefd --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionData.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The LogAnalyticsDataConnectionData model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("logAnalytics") +@Fluent +public final class LogAnalyticsDataConnectionData extends DataConnectionData { + + /* + * properties + */ + @Generated + @JsonProperty(value = "properties") + private LogAnalyticsDataConnectionProperties properties; + + /** + * Creates an instance of LogAnalyticsDataConnectionData class. + * + * @param properties the properties value to set. + */ + @Generated + @JsonCreator + public LogAnalyticsDataConnectionData( + @JsonProperty(value = "properties") LogAnalyticsDataConnectionProperties properties) { + this.properties = properties; + } + + /** + * Get the properties property: properties. + * + * @return the properties value. + */ + @Generated + public LogAnalyticsDataConnectionProperties getProperties() { + return this.properties; + } + + /** {@inheritDoc} */ + @Generated + @Override + public LogAnalyticsDataConnectionData setName(String name) { + super.setName(name); + return this; + } + + /** {@inheritDoc} */ + @Generated + @Override + public LogAnalyticsDataConnectionData setContent(DataConnectionContent content) { + super.setContent(content); + return this; + } + + /** {@inheritDoc} */ + @Generated + @Override + public LogAnalyticsDataConnectionData setFrequency(DataConnectionFrequency frequency) { + super.setFrequency(frequency); + return this; + } + + /** {@inheritDoc} */ + @Generated + @Override + public LogAnalyticsDataConnectionData setFrequencyOffset(Integer frequencyOffset) { + super.setFrequencyOffset(frequencyOffset); + return this; + } +} 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 new file mode 100644 index 000000000000..06d3c21f96a1 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/LogAnalyticsDataConnectionProperties.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LogAnalyticsDataConnectionProperties model. */ +@Fluent +public final class LogAnalyticsDataConnectionProperties extends DataConnectionProperties { + + /* + * log analytics api key + */ + @Generated + @JsonProperty(value = "apiKey") + private String apiKey; + + /* + * log analytics workspace id + */ + @Generated + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** Creates an instance of LogAnalyticsDataConnectionProperties class. */ + @Generated + public LogAnalyticsDataConnectionProperties() {} + + /** + * Get the apiKey property: log analytics api key. + * + * @return the apiKey value. + */ + @Generated + public String getApiKey() { + return this.apiKey; + } + + /** + * Set the apiKey property: log analytics api key. + * + * @param apiKey the apiKey value to set. + * @return the LogAnalyticsDataConnectionProperties object itself. + */ + @Generated + public LogAnalyticsDataConnectionProperties setApiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Get the workspaceId property: log analytics workspace id. + * + * @return the workspaceId value. + */ + @Generated + public String getWorkspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: log analytics workspace id. + * + * @param workspaceId the workspaceId value to set. + * @return the LogAnalyticsDataConnectionProperties object itself. + */ + @Generated + public LogAnalyticsDataConnectionProperties setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } +} 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 new file mode 100644 index 000000000000..1a0ef65cce55 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedBoolean.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ObservedBoolean model. */ +@Immutable +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; + + /** Creates an instance of ObservedBoolean class. */ + @Generated + private ObservedBoolean() {} + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public Boolean isValue() { + return this.value; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } +} 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 new file mode 100644 index 000000000000..0ce52cd1a61e --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedHeader.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ObservedHeader model. */ +@Immutable +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; + + /** Creates an instance of ObservedHeader class. */ + @Generated + private ObservedHeader() {} + + /** + * Get the headerName property: The headerName property. + * + * @return the headerName value. + */ + @Generated + public String getHeaderName() { + return this.headerName; + } + + /** + * Get the headerValue property: The headerValue property. + * + * @return the headerValue value. + */ + @Generated + public String getHeaderValue() { + return this.headerValue; + } +} 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 new file mode 100644 index 000000000000..e9ce1ccc9ea8 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedInteger.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ObservedInteger model. */ +@Immutable +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; + + /** Creates an instance of ObservedInteger class. */ + @Generated + private ObservedInteger() {} + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public Integer getValue() { + return this.value; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } +} 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 new file mode 100644 index 000000000000..2434beea6339 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedIntegers.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ObservedIntegers model. */ +@Immutable +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; + + /** Creates an instance of ObservedIntegers class. */ + @Generated + private ObservedIntegers() {} + + /** + * Get the values property: The values property. + * + * @return the values value. + */ + @Generated + public List getValues() { + return this.values; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } +} 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 new file mode 100644 index 000000000000..7d954355460b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLocation.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ObservedLocation model. */ +@Immutable +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; + + /** Creates an instance of ObservedLocation class. */ + @Generated + private ObservedLocation() {} + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public Location getValue() { + return this.value; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } +} 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 new file mode 100644 index 000000000000..5d281023d1a3 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedLong.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ObservedLong model. */ +@Immutable +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; + + /** Creates an instance of ObservedLong class. */ + @Generated + private ObservedLong() {} + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public Long getValue() { + return this.value; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } +} 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 new file mode 100644 index 000000000000..db30fdea6c16 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ObservedPortState model. */ +@Immutable +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; + + /** Creates an instance of ObservedPortState class. */ + @Generated + private ObservedPortState() {} + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public ObservedPortStateValue getValue() { + return this.value; + } + + /** + * Get the port property: The port property. + * + * @return the port value. + */ + @Generated + public Integer getPort() { + return this.port; + } +} 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 new file mode 100644 index 000000000000..4a92cd66192e --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedPortStateValue.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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. */ +public final class ObservedPortStateValue extends ExpandableStringEnum { + + /** Static value open for ObservedPortStateValue. */ + @Generated public static final ObservedPortStateValue OPEN = fromString("open"); + + /** Static value closed for ObservedPortStateValue. */ + @Generated public static final ObservedPortStateValue CLOSED = fromString("closed"); + + /** Static value filtered for ObservedPortStateValue. */ + @Generated public static final ObservedPortStateValue FILTERED = fromString("filtered"); + + /** + * Creates a new instance of ObservedPortStateValue value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ObservedPortStateValue() {} + + /** + * Creates or finds a ObservedPortStateValue from its string representation. + * + * @param name a name to look for. + * @return the corresponding ObservedPortStateValue. + */ + @Generated + @JsonCreator + public static ObservedPortStateValue fromString(String name) { + return fromString(name, ObservedPortStateValue.class); + } + + /** + * Gets known ObservedPortStateValue values. + * + * @return known ObservedPortStateValue values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..a3669a4ac0f1 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedString.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ObservedString model. */ +@Immutable +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; + + /** Creates an instance of ObservedString class. */ + @Generated + private ObservedString() {} + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public String getValue() { + return this.value; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } +} 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 new file mode 100644 index 000000000000..733814b3b1c1 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ObservedValue.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Template model for observed values. */ +@Immutable +public class ObservedValue { + + /* + * 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; + + /** Creates an instance of ObservedValue class. */ + @Generated + protected ObservedValue() {} + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } +} 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 new file mode 100644 index 000000000000..76eeb4ef1df1 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAsset.java @@ -0,0 +1,1056 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The PageAsset model. */ +@Immutable +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; + + /** Creates an instance of PageAsset class. */ + @Generated + private PageAsset() {} + + /** + * Get the url property: The url property. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Get the httpMethod property: The httpMethod property. + * + * @return the httpMethod value. + */ + @Generated + public String getHttpMethod() { + return this.httpMethod; + } + + /** + * Get the service property: The service property. + * + * @return the service value. + */ + @Generated + public String getService() { + return this.service; + } + + /** + * Get the ipAddresses property: The ipAddresses property. + * + * @return the ipAddresses value. + */ + @Generated + public List getIpAddresses() { + return this.ipAddresses; + } + + /** + * Get the successful property: The successful property. + * + * @return the successful value. + */ + @Generated + public List getSuccessful() { + return this.successful; + } + + /** + * Get the httpResponseCodes property: The httpResponseCodes property. + * + * @return the httpResponseCodes value. + */ + @Generated + public List getHttpResponseCodes() { + return this.httpResponseCodes; + } + + /** + * Get the httpResponseMessages property: The httpResponseMessages property. + * + * @return the httpResponseMessages value. + */ + @Generated + public List getHttpResponseMessages() { + return this.httpResponseMessages; + } + + /** + * Get the responseTimes property: The responseTimes property. + * + * @return the responseTimes value. + */ + @Generated + public List getResponseTimes() { + return this.responseTimes; + } + + /** + * Get the frames property: The frames property. + * + * @return the frames value. + */ + @Generated + public List getFrames() { + return this.frames; + } + + /** + * Get the windows property: The windows property. + * + * @return the windows value. + */ + @Generated + public List getWindows() { + return this.windows; + } + + /** + * Get the nonHtmlFrames property: The nonHtmlFrames property. + * + * @return the nonHtmlFrames value. + */ + @Generated + public List getNonHtmlFrames() { + return this.nonHtmlFrames; + } + + /** + * Get the undirectedContent property: The undirectedContent property. + * + * @return the undirectedContent value. + */ + @Generated + public List getUndirectedContent() { + return this.undirectedContent; + } + + /** + * Get the contentTypes property: The contentTypes property. + * + * @return the contentTypes value. + */ + @Generated + public List getContentTypes() { + return this.contentTypes; + } + + /** + * Get the contentLengths property: The contentLengths property. + * + * @return the contentLengths value. + */ + @Generated + public List getContentLengths() { + return this.contentLengths; + } + + /** + * Get the windowNames property: The windowNames property. + * + * @return the windowNames value. + */ + @Generated + public List getWindowNames() { + return this.windowNames; + } + + /** + * Get the charsets property: The charsets property. + * + * @return the charsets value. + */ + @Generated + public List getCharsets() { + return this.charsets; + } + + /** + * Get the titles property: The titles property. + * + * @return the titles value. + */ + @Generated + public List getTitles() { + return this.titles; + } + + /** + * Get the languages property: The languages property. + * + * @return the languages value. + */ + @Generated + public List getLanguages() { + return this.languages; + } + + /** + * Get the responseHeaders property: The responseHeaders property. + * + * @return the responseHeaders value. + */ + @Generated + public List getResponseHeaders() { + return this.responseHeaders; + } + + /** + * Get the cookies property: The cookies property. + * + * @return the cookies value. + */ + @Generated + public List getCookies() { + return this.cookies; + } + + /** + * Get the webComponents property: The webComponents property. + * + * @return the webComponents value. + */ + @Generated + public List getWebComponents() { + return this.webComponents; + } + + /** + * Get the attributes property: The attributes property. + * + * @return the attributes value. + */ + @Generated + public List getAttributes() { + return this.attributes; + } + + /** + * Get the assetSecurityPolicies property: The assetSecurityPolicies property. + * + * @return the assetSecurityPolicies value. + */ + @Generated + public List getAssetSecurityPolicies() { + return this.assetSecurityPolicies; + } + + /** + * Get the responseBodyMinhashSignatures property: The responseBodyMinhashSignatures property. + * + * @return the responseBodyMinhashSignatures value. + */ + @Generated + public List getResponseBodyMinhashSignatures() { + return this.responseBodyMinhashSignatures; + } + + /** + * Get the fullDomMinhashSignatures property: The fullDomMinhashSignatures property. + * + * @return the fullDomMinhashSignatures value. + */ + @Generated + public List getFullDomMinhashSignatures() { + return this.fullDomMinhashSignatures; + } + + /** + * Get the responseBodyHashSignatures property: The responseBodyHashSignatures property. + * + * @return the responseBodyHashSignatures value. + */ + @Generated + public List getResponseBodyHashSignatures() { + return this.responseBodyHashSignatures; + } + + /** + * Get the errors property: The errors property. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * Get the sslCerts property: The sslCerts property. + * + * @return the sslCerts value. + */ + @Generated + public List getSslCerts() { + return this.sslCerts; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the cause property: The cause property. + * + * @return the cause value. + */ + @Generated + public PageCause getCause() { + return this.cause; + } + + /** + * Get the referrer property: The referrer property. + * + * @return the referrer value. + */ + @Generated + public String getReferrer() { + return this.referrer; + } + + /** + * Get the redirectUrls property: The redirectUrls property. + * + * @return the redirectUrls value. + */ + @Generated + public List getRedirectUrls() { + return this.redirectUrls; + } + + /** + * Get the redirectType property: The redirectType property. + * + * @return the redirectType value. + */ + @Generated + public PageAssetRedirectType getRedirectType() { + return this.redirectType; + } + + /** + * Get the finalUrls property: The finalUrls property. + * + * @return the finalUrls value. + */ + @Generated + public List getFinalUrls() { + return this.finalUrls; + } + + /** + * Get the finalResponseCodes property: The finalResponseCodes property. + * + * @return the finalResponseCodes value. + */ + @Generated + public List getFinalResponseCodes() { + return this.finalResponseCodes; + } + + /** + * Get the parkedPage property: The parkedPage property. + * + * @return the parkedPage value. + */ + @Generated + public List getParkedPage() { + return this.parkedPage; + } + + /** + * Get the resourceUrls property: The resourceUrls property. + * + * @return the resourceUrls value. + */ + @Generated + public List getResourceUrls() { + return this.resourceUrls; + } + + /** + * Get the guids property: The guids property. + * + * @return the guids value. + */ + @Generated + public List getGuids() { + return this.guids; + } + + /** + * Get the finalIpAddresses property: The finalIpAddresses property. + * + * @return the finalIpAddresses value. + */ + @Generated + public List getFinalIpAddresses() { + return this.finalIpAddresses; + } + + /** + * Get the asns property: The asns property. + * + * @return the asns value. + */ + @Generated + public List getAsns() { + return this.asns; + } + + /** + * Get the ipBlocks property: The ipBlocks property. + * + * @return the ipBlocks value. + */ + @Generated + public List getIpBlocks() { + return this.ipBlocks; + } + + /** + * Get the finalAsns property: The finalAsns property. + * + * @return the finalAsns value. + */ + @Generated + public List getFinalAsns() { + return this.finalAsns; + } + + /** + * Get the finalIpBlocks property: The finalIpBlocks property. + * + * @return the finalIpBlocks value. + */ + @Generated + public List getFinalIpBlocks() { + return this.finalIpBlocks; + } + + /** + * Get the responseBodies property: The responseBodies property. + * + * @return the responseBodies value. + */ + @Generated + public List getResponseBodies() { + return this.responseBodies; + } + + /** + * Get the domainAsset property: The domainAsset property. + * + * @return the domainAsset value. + */ + @Generated + public DomainAsset getDomainAsset() { + return this.domainAsset; + } + + /** + * Get the rootUrl property: The rootUrl property. + * + * @return the rootUrl value. + */ + @Generated + public ObservedBoolean getRootUrl() { + return this.rootUrl; + } + + /** + * Get the isRootUrl property: The isRootUrl property. + * + * @return the isRootUrl value. + */ + @Generated + public Boolean isRootUrl() { + return this.isRootUrl; + } + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + @Generated + public List getLocation() { + return this.location; + } + + /** + * Get the services property: The services property. + * + * @return the services value. + */ + @Generated + public List getServices() { + return this.services; + } + + /** + * Get the siteStatus property: The siteStatus property. + * + * @return the siteStatus value. + */ + @Generated + public String getSiteStatus() { + return this.siteStatus; + } + + /** + * Get the cnames property: The cnames property. + * + * @return the cnames value. + */ + @Generated + public List getCnames() { + return this.cnames; + } + + /** + * Get the cdns property: The cdns property. + * + * @return the cdns value. + */ + @Generated + public List getCdns() { + return this.cdns; + } + + /** + * Get the host property: The host property. + * + * @return the host value. + */ + @Generated + public String getHost() { + return this.host; + } + + /** + * Get the domain property: The domain property. + * + * @return the domain value. + */ + @Generated + public String getDomain() { + return this.domain; + } + + /** + * Get the sslServerConfig property: The sslServerConfig property. + * + * @return the sslServerConfig value. + */ + @Generated + public List getSslServerConfig() { + return this.sslServerConfig; + } + + /** + * Get the gdprAssetSecurityPolicies property: The gdprAssetSecurityPolicies property. + * + * @return the gdprAssetSecurityPolicies value. + */ + @Generated + public List getGdprAssetSecurityPolicies() { + return this.gdprAssetSecurityPolicies; + } + + /** + * Get the ipv4 property: The ipv4 property. + * + * @return the ipv4 value. + */ + @Generated + public List getIpv4() { + return this.ipv4; + } + + /** + * Get the ipv6 property: The ipv6 property. + * + * @return the ipv6 value. + */ + @Generated + public List getIpv6() { + return this.ipv6; + } +} 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 new file mode 100644 index 000000000000..1febbad7771a --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetRedirectType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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. */ +public final class PageAssetRedirectType extends ExpandableStringEnum { + + /** Static value httpHeader for PageAssetRedirectType. */ + @Generated public static final PageAssetRedirectType HTTP_HEADER = fromString("httpHeader"); + + /** Static value metaRefresh for PageAssetRedirectType. */ + @Generated public static final PageAssetRedirectType META_REFRESH = fromString("metaRefresh"); + + /** Static value javascript for PageAssetRedirectType. */ + @Generated public static final PageAssetRedirectType JAVASCRIPT = fromString("javascript"); + + /** Static value final for PageAssetRedirectType. */ + @Generated public static final PageAssetRedirectType FINAL = fromString("final"); + + /** + * Creates a new instance of PageAssetRedirectType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public PageAssetRedirectType() {} + + /** + * Creates or finds a PageAssetRedirectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PageAssetRedirectType. + */ + @Generated + @JsonCreator + public static PageAssetRedirectType fromString(String name) { + return fromString(name, PageAssetRedirectType.class); + } + + /** + * Gets known PageAssetRedirectType values. + * + * @return known PageAssetRedirectType values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..9cfd6d28e895 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageAssetResource.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The PageAssetResource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("page") +@Immutable +public final class PageAssetResource extends AssetResource { + + /* + * asset + */ + @Generated + @JsonProperty(value = "asset") + private PageAsset asset; + + /** + * Creates an instance of PageAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + @JsonCreator + private PageAssetResource(@JsonProperty(value = "asset") PageAsset asset) { + this.asset = asset; + } + + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public PageAsset getAsset() { + return this.asset; + } +} 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 new file mode 100644 index 000000000000..0f6dc321da0a --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/PageCause.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PageCause model. */ +@Immutable +public final class PageCause { + + /* + * 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; + + /** Creates an instance of PageCause class. */ + @Generated + private PageCause() {} + + /** + * Get the cause property: The cause property. + * + * @return the cause value. + */ + @Generated + public String getCause() { + return this.cause; + } + + /** + * Get the causeElementXPath property: The causeElementXPath property. + * + * @return the causeElementXPath value. + */ + @Generated + public String getCauseElementXPath() { + return this.causeElementXPath; + } + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Get the possibleMatches property: The possibleMatches property. + * + * @return the possibleMatches value. + */ + @Generated + public Integer getPossibleMatches() { + return this.possibleMatches; + } + + /** + * Get the loopDetected property: The loopDetected property. + * + * @return the loopDetected value. + */ + @Generated + public Boolean isLoopDetected() { + return this.loopDetected; + } + + /** + * Get the version property: The version property. + * + * @return the version value. + */ + @Generated + public Integer getVersion() { + return this.version; + } + + /** + * Get the domChangeIndex property: The domChangeIndex property. + * + * @return the domChangeIndex value. + */ + @Generated + public Integer getDomChangeIndex() { + return this.domChangeIndex; + } +} 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 new file mode 100644 index 000000000000..b4b0593ca335 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Port.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Port model. */ +@Immutable +public final class Port { + + /* + * 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; + + /** Creates an instance of Port class. */ + @Generated + private Port() {} + + /** + * Get the port property: The port property. + * + * @return the port value. + */ + @Generated + public Integer getPort() { + return this.port; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } +} 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 new file mode 100644 index 000000000000..3d3ab86ec644 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotRequest.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A request body used to retrieve an asset report snapshot. */ +@Fluent +public final class ReportAssetSnapshotRequest { + + /* + * 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; + + /** Creates an instance of ReportAssetSnapshotRequest class. */ + @Generated + public ReportAssetSnapshotRequest() {} + + /** + * Get the metric property: The metric to retrieve a snapshot for. + * + * @return the metric value. + */ + @Generated + public String getMetric() { + return this.metric; + } + + /** + * Set the metric property: The metric to retrieve a snapshot for. + * + * @param metric the metric value to set. + * @return the ReportAssetSnapshotRequest object itself. + */ + @Generated + public ReportAssetSnapshotRequest setMetric(String metric) { + this.metric = metric; + return this; + } + + /** + * Get the labelName property: The name of the label to retrieve a snapshot for. + * + * @return the labelName value. + */ + @Generated + public String getLabelName() { + return this.labelName; + } + + /** + * Set the labelName property: The name of the label to retrieve a snapshot for. + * + * @param labelName the labelName value to set. + * @return the ReportAssetSnapshotRequest object itself. + */ + @Generated + public ReportAssetSnapshotRequest setLabelName(String labelName) { + this.labelName = labelName; + return this; + } + + /** + * Get the size property: The number of assets per page. + * + * @return the size value. + */ + @Generated + public Integer getSize() { + return this.size; + } + + /** + * Set the size property: The number of assets per page. + * + * @param size the size value to set. + * @return the ReportAssetSnapshotRequest object itself. + */ + @Generated + public ReportAssetSnapshotRequest setSize(Integer size) { + this.size = size; + return this; + } + + /** + * Get the page property: The page to retrieve. + * + * @return the page value. + */ + @Generated + public Integer getPage() { + return this.page; + } + + /** + * Set the page property: The page to retrieve. + * + * @param page the page value to set. + * @return the ReportAssetSnapshotRequest object itself. + */ + @Generated + public ReportAssetSnapshotRequest setPage(Integer page) { + this.page = page; + return this; + } +} 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 new file mode 100644 index 000000000000..b24a4e89bcea --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSnapshotResult.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * 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 { + + /* + * 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; + + /** Creates an instance of ReportAssetSnapshotResult class. */ + @Generated + private ReportAssetSnapshotResult() {} + + /** + * Get the displayName property: The name of the metric. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the metric property: The unique metric name. + * + * @return the metric value. + */ + @Generated + public String getMetric() { + return this.metric; + } + + /** + * Get the labelName property: The customer label that was filtered on, if one was provided. + * + * @return the labelName value. + */ + @Generated + public String getLabelName() { + return this.labelName; + } + + /** + * Get the updatedAt property: The last time this asset data was updated on this metric. + * + * @return the updatedAt value. + */ + @Generated + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Get the description property: A description of what the metric represents. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the assets property: The page of assets that match the provided metric. + * + * @return the assets value. + */ + @Generated + public AssetPageResult getAssets() { + return this.assets; + } +} 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 new file mode 100644 index 000000000000..156c5dd86d40 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryRequest.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; +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. + */ +@Fluent +public final class ReportAssetSummaryRequest { + + /* + * 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; + + /* + * A parameter to group the assets by (first level facet field), only used when the chosen summary identifier is + * filters. + */ + @Generated + @JsonProperty(value = "groupBy") + private String groupBy; + + /* + * A parameter to segment the assets by (second level facet field), only used when the chosen summary identifier is + * filters. + */ + @Generated + @JsonProperty(value = "segmentBy") + private String segmentBy; + + /* + * Currently unused. + */ + @Generated + @JsonProperty(value = "labelName") + private String labelName; + + /** Creates an instance of ReportAssetSummaryRequest class. */ + @Generated + public ReportAssetSummaryRequest() {} + + /** + * Get the metricCategories property: Categories to retrieve risk reporting data for. + * + * @return the metricCategories value. + */ + @Generated + public List getMetricCategories() { + return this.metricCategories; + } + + /** + * Set the metricCategories property: Categories to retrieve risk reporting data for. + * + * @param metricCategories the metricCategories value to set. + * @return the ReportAssetSummaryRequest object itself. + */ + @Generated + public ReportAssetSummaryRequest setMetricCategories(List metricCategories) { + this.metricCategories = metricCategories; + return this; + } + + /** + * Get the metrics property: Metrics to retrieve risk reporting data for. + * + * @return the metrics value. + */ + @Generated + public List getMetrics() { + return this.metrics; + } + + /** + * Set the metrics property: Metrics to retrieve risk reporting data for. + * + * @param metrics the metrics value to set. + * @return the ReportAssetSummaryRequest object itself. + */ + @Generated + public ReportAssetSummaryRequest setMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the filters property: Query filters to apply to the asset summary. + * + * @return the filters value. + */ + @Generated + public List getFilters() { + return this.filters; + } + + /** + * Set the filters property: Query filters to apply to the asset summary. + * + * @param filters the filters value to set. + * @return the ReportAssetSummaryRequest object itself. + */ + @Generated + public ReportAssetSummaryRequest setFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * 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. + */ + @Generated + public String getGroupBy() { + return this.groupBy; + } + + /** + * 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. + */ + @Generated + public ReportAssetSummaryRequest setGroupBy(String groupBy) { + this.groupBy = groupBy; + return this; + } + + /** + * Get the segmentBy property: A parameter to segment the assets by (second level facet field), only used when the + * chosen summary identifier is filters. + * + * @return the segmentBy value. + */ + @Generated + public String getSegmentBy() { + return this.segmentBy; + } + + /** + * Set the segmentBy property: A parameter to segment the assets by (second level facet field), only used when the + * chosen summary identifier is filters. + * + * @param segmentBy the segmentBy value to set. + * @return the ReportAssetSummaryRequest object itself. + */ + @Generated + public ReportAssetSummaryRequest setSegmentBy(String segmentBy) { + this.segmentBy = segmentBy; + return this; + } + + /** + * Get the labelName property: Currently unused. + * + * @return the labelName value. + */ + @Generated + public String getLabelName() { + return this.labelName; + } + + /** + * Set the labelName property: Currently unused. + * + * @param labelName the labelName value to set. + * @return the ReportAssetSummaryRequest object itself. + */ + @Generated + public ReportAssetSummaryRequest setLabelName(String labelName) { + this.labelName = labelName; + return this; + } +} 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 new file mode 100644 index 000000000000..2c5357ca6f9e --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportAssetSummaryResult.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ReportAssetSummaryResult model. */ +@Immutable +public final class ReportAssetSummaryResult { + + /* + * The collection of asset summaries. + */ + @Generated + @JsonProperty(value = "assetSummaries") + private List assetSummaries; + + /** Creates an instance of ReportAssetSummaryResult class. */ + @Generated + private ReportAssetSummaryResult() {} + + /** + * Get the assetSummaries property: The collection of asset summaries. + * + * @return the assetSummaries value. + */ + @Generated + public List getAssetSummaries() { + return this.assetSummaries; + } +} 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 new file mode 100644 index 000000000000..04af1d712bc4 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdown.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The breakdown of billable asset counts for each asset type. */ +@Immutable +public final class ReportBillableAssetBreakdown { + + /* + * 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; + + /** Creates an instance of ReportBillableAssetBreakdown class. */ + @Generated + private ReportBillableAssetBreakdown() {} + + /** + * Get the kind property: The kind of billable asset. + * + * @return the kind value. + */ + @Generated + public ReportBillableAssetBreakdownKind getKind() { + return this.kind; + } + + /** + * Get the count property: The number of assets of this type. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } +} 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 new file mode 100644 index 000000000000..5151b9e50191 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetBreakdownKind.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The kind of billable asset. */ +public final class ReportBillableAssetBreakdownKind extends ExpandableStringEnum { + + /** Static value domain for ReportBillableAssetBreakdownKind. */ + @Generated public static final ReportBillableAssetBreakdownKind DOMAIN = fromString("domain"); + + /** Static value host for ReportBillableAssetBreakdownKind. */ + @Generated public static final ReportBillableAssetBreakdownKind HOST = fromString("host"); + + /** Static value ipAddress for ReportBillableAssetBreakdownKind. */ + @Generated public static final ReportBillableAssetBreakdownKind IP_ADDRESS = fromString("ipAddress"); + + /** + * Creates a new instance of ReportBillableAssetBreakdownKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ReportBillableAssetBreakdownKind() {} + + /** + * Creates or finds a ReportBillableAssetBreakdownKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReportBillableAssetBreakdownKind. + */ + @Generated + @JsonCreator + public static ReportBillableAssetBreakdownKind fromString(String name) { + return fromString(name, ReportBillableAssetBreakdownKind.class); + } + + /** + * Gets known ReportBillableAssetBreakdownKind values. + * + * @return known ReportBillableAssetBreakdownKind values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..ff405f5e8512 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSnapshotResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; +import java.util.List; + +/** The ReportBillableAssetSnapshotResult model. */ +@Immutable +public final class ReportBillableAssetSnapshotResult { + + /* + * 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; + + /** Creates an instance of ReportBillableAssetSnapshotResult class. */ + @Generated + private ReportBillableAssetSnapshotResult() {} + + /** + * Get the date property: The date these assets were billed on. + * + * @return the date value. + */ + @Generated + public LocalDate getDate() { + return this.date; + } + + /** + * Get the total property: The total number of billable assets for this date. + * + * @return the total value. + */ + @Generated + public Long getTotal() { + return this.total; + } + + /** + * Get the assetBreakdown property: The breakdown of billable asset counts for each asset type. + * + * @return the assetBreakdown value. + */ + @Generated + public List getAssetBreakdown() { + return this.assetBreakdown; + } +} 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 new file mode 100644 index 000000000000..d5e0e60302eb --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ReportBillableAssetSummaryResult.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ReportBillableAssetSummaryResult model. */ +@Immutable +public final class ReportBillableAssetSummaryResult { + + /* + * The assetSummaries property. + */ + @Generated + @JsonProperty(value = "assetSummaries") + private List assetSummaries; + + /** Creates an instance of ReportBillableAssetSummaryResult class. */ + @Generated + private ReportBillableAssetSummaryResult() {} + + /** + * Get the assetSummaries property: The assetSummaries property. + * + * @return the assetSummaries value. + */ + @Generated + public List getAssetSummaries() { + return this.assetSummaries; + } +} 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 new file mode 100644 index 000000000000..1896e90d3423 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Reputation.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Reputation model. */ +@Immutable +public final class Reputation { + + /* + * 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; + + /** Creates an instance of Reputation class. */ + @Generated + private Reputation() {} + + /** + * Get the listName property: The listName property. + * + * @return the listName value. + */ + @Generated + public String getListName() { + return this.listName; + } + + /** + * Get the threatType property: The threatType property. + * + * @return the threatType value. + */ + @Generated + public String getThreatType() { + return this.threatType; + } + + /** + * Get the trusted property: The trusted property. + * + * @return the trusted value. + */ + @Generated + public Boolean isTrusted() { + return this.trusted; + } + + /** + * Get the cidr property: The cidr property. + * + * @return the cidr value. + */ + @Generated + public String getCidr() { + return this.cidr; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the listUpdatedAt property: The listUpdatedAt property. + * + * @return the listUpdatedAt value. + */ + @Generated + public OffsetDateTime getListUpdatedAt() { + return this.listUpdatedAt; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } +} 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 new file mode 100644 index 000000000000..3d3c02bfbd4f --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ResourceUrl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The ResourceUrl model. */ +@Immutable +public final class ResourceUrl { + + /* + * 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; + + /** Creates an instance of ResourceUrl class. */ + @Generated + private ResourceUrl() {} + + /** + * Get the url property: The url property. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Get the resources property: The resources property. + * + * @return the resources value. + */ + @Generated + public List getResources() { + return this.resources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } +} 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 new file mode 100644 index 000000000000..96cd8f475d9f --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilter.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SavedFilter model. */ +@Immutable +public final class SavedFilter { + + /* + * 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; + + /** Creates an instance of SavedFilter class. */ + @Generated + private SavedFilter() {} + + /** + * Get the id property: The system generated unique id for the resource. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The caller provided unique name for the resource. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the displayName property: The name that can be used for display purposes. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the filter property: The filter property. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Get the description property: The description property. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } +} 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 new file mode 100644 index 000000000000..a266977809ee --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterData.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A request body used to create a saved filter. */ +@Immutable +public final class SavedFilterData { + + /* + * An expression on the resource type that selects the resources to be returned. + */ + @Generated + @JsonProperty(value = "filter") + private String filter; + + /* + * A human readable description of the saved filter. + */ + @Generated + @JsonProperty(value = "description") + private String description; + + /** + * Creates an instance of SavedFilterData class. + * + * @param filter the filter value to set. + * @param description the description value to set. + */ + @Generated + @JsonCreator + public SavedFilterData( + @JsonProperty(value = "filter") String filter, @JsonProperty(value = "description") String description) { + this.filter = filter; + this.description = description; + } + + /** + * Get the filter property: An expression on the resource type that selects the resources to be returned. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Get the description property: A human readable description of the saved filter. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterPageResult.java new file mode 100644 index 000000000000..4cd8d95b0caf --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterPageResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** The SavedFilterPageResponse model. */ +@Immutable +public final class SavedFilterPageResult { + /* + * The total number of items available in the full result set. + */ + @Generated + @JsonProperty(value = "totalElements") + private Long totalElements; + + /* + * The link to access the next page of results. Not set if at the end of the result set. + */ + @Generated + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The items in the current page of results. + */ + @Generated + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of SavedFilterPageResponse class. */ + @Generated + private SavedFilterPageResult() {} + + /** + * Get the totalElements property: The total number of items available in the full result set. + * + * @return the totalElements value. + */ + @Generated + public Long getTotalElements() { + return this.totalElements; + } + + /** + * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result set. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * Get the value property: The items in the current page of results. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ScanMetadata.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ScanMetadata.java new file mode 100644 index 000000000000..1b5161ac59bf --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ScanMetadata.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The ScanMetadata model. */ +@Immutable +public final class ScanMetadata { + + /* + * 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; + + /** Creates an instance of ScanMetadata class. */ + @Generated + private ScanMetadata() {} + + /** + * Get the port property: The port property. + * + * @return the port value. + */ + @Generated + public Integer getPort() { + return this.port; + } + + /** + * Get the bannerMetadata property: The bannerMetadata property. + * + * @return the bannerMetadata value. + */ + @Generated + public String getBannerMetadata() { + return this.bannerMetadata; + } + + /** + * Get the startScan property: The startScan property. + * + * @return the startScan value. + */ + @Generated + public OffsetDateTime getStartScan() { + return this.startScan; + } + + /** + * Get the endScan property: The endScan property. + * + * @return the endScan value. + */ + @Generated + public OffsetDateTime getEndScan() { + return this.endScan; + } +} 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 new file mode 100644 index 000000000000..90d6bd55647f --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Service.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The Service model. */ +@Immutable +public final class Service { + + /* + * 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; + + /** Creates an instance of Service class. */ + @Generated + private Service() {} + + /** + * Get the scheme property: The scheme property. + * + * @return the scheme value. + */ + @Generated + public String getScheme() { + return this.scheme; + } + + /** + * Get the port property: The port property. + * + * @return the port value. + */ + @Generated + public Integer getPort() { + return this.port; + } + + /** + * Get the webComponents property: The webComponents property. + * + * @return the webComponents value. + */ + @Generated + public List getWebComponents() { + return this.webComponents; + } + + /** + * Get the sslCerts property: The sslCerts property. + * + * @return the sslCerts value. + */ + @Generated + public List getSslCerts() { + return this.sslCerts; + } + + /** + * Get the exceptions property: The exceptions property. + * + * @return the exceptions value. + */ + @Generated + public List getExceptions() { + return this.exceptions; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } + + /** + * Get the portStates property: The portStates property. + * + * @return the portStates value. + */ + @Generated + public List getPortStates() { + return this.portStates; + } +} 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 new file mode 100644 index 000000000000..e0ded0f90387 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SoaRecord.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The SoaRecord model. */ +@Immutable +public final class SoaRecord { + + /* + * 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; + + /** Creates an instance of SoaRecord class. */ + @Generated + private SoaRecord() {} + + /** + * Get the nameServer property: The nameServer property. + * + * @return the nameServer value. + */ + @Generated + public String getNameServer() { + return this.nameServer; + } + + /** + * Get the email property: The email property. + * + * @return the email value. + */ + @Generated + public String getEmail() { + return this.email; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the serialNumber property: The serialNumber property. + * + * @return the serialNumber value. + */ + @Generated + public Long getSerialNumber() { + return this.serialNumber; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } +} 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 new file mode 100644 index 000000000000..eb2980004322 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Source.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Source model. */ +@Immutable +public final class Source { + + /* + * 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; + + /** Creates an instance of Source class. */ + @Generated + private Source() {} + + /** + * Get the source property: The source property. + * + * @return the source value. + */ + @Generated + public String getSource() { + return this.source; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + @Generated + public String getReason() { + return this.reason; + } +} 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 new file mode 100644 index 000000000000..1eb1f00466ae --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAsset.java @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The SslCertAsset model. */ +@Immutable +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; + + /** Creates an instance of SslCertAsset class. */ + @Generated + private SslCertAsset() {} + + /** + * Get the sha1 property: The sha1 property. + * + * @return the sha1 value. + */ + @Generated + public String getSha1() { + return this.sha1; + } + + /** + * Get the subjectCommonNames property: The subjectCommonNames property. + * + * @return the subjectCommonNames value. + */ + @Generated + public List getSubjectCommonNames() { + return this.subjectCommonNames; + } + + /** + * Get the organizations property: The organizations property. + * + * @return the organizations value. + */ + @Generated + public List getOrganizations() { + return this.organizations; + } + + /** + * Get the organizationalUnits property: The organizationalUnits property. + * + * @return the organizationalUnits value. + */ + @Generated + public List getOrganizationalUnits() { + return this.organizationalUnits; + } + + /** + * Get the issuerCommonNames property: The issuerCommonNames property. + * + * @return the issuerCommonNames value. + */ + @Generated + public List getIssuerCommonNames() { + return this.issuerCommonNames; + } + + /** + * Get the sigAlgName property: The sigAlgName property. + * + * @return the sigAlgName value. + */ + @Generated + public String getSigAlgName() { + return this.sigAlgName; + } + + /** + * Get the invalidAfter property: The invalidAfter property. + * + * @return the invalidAfter value. + */ + @Generated + public OffsetDateTime getInvalidAfter() { + return this.invalidAfter; + } + + /** + * Get the serialNumber property: The serialNumber property. + * + * @return the serialNumber value. + */ + @Generated + public String getSerialNumber() { + return this.serialNumber; + } + + /** + * Get the subjectAlternativeNames property: The subjectAlternativeNames property. + * + * @return the subjectAlternativeNames value. + */ + @Generated + public List getSubjectAlternativeNames() { + return this.subjectAlternativeNames; + } + + /** + * Get the issuerAlternativeNames property: The issuerAlternativeNames property. + * + * @return the issuerAlternativeNames value. + */ + @Generated + public List getIssuerAlternativeNames() { + return this.issuerAlternativeNames; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the invalidBefore property: The invalidBefore property. + * + * @return the invalidBefore value. + */ + @Generated + public OffsetDateTime getInvalidBefore() { + return this.invalidBefore; + } + + /** + * Get the keySize property: The keySize property. + * + * @return the keySize value. + */ + @Generated + public Integer getKeySize() { + return this.keySize; + } + + /** + * Get the keyAlgorithm property: The keyAlgorithm property. + * + * @return the keyAlgorithm value. + */ + @Generated + public String getKeyAlgorithm() { + return this.keyAlgorithm; + } + + /** + * Get the subjectLocality property: The subjectLocality property. + * + * @return the subjectLocality value. + */ + @Generated + public List getSubjectLocality() { + return this.subjectLocality; + } + + /** + * Get the subjectState property: The subjectState property. + * + * @return the subjectState value. + */ + @Generated + public List getSubjectState() { + return this.subjectState; + } + + /** + * Get the subjectCountry property: The subjectCountry property. + * + * @return the subjectCountry value. + */ + @Generated + public List getSubjectCountry() { + return this.subjectCountry; + } + + /** + * Get the issuerLocality property: The issuerLocality property. + * + * @return the issuerLocality value. + */ + @Generated + public List getIssuerLocality() { + return this.issuerLocality; + } + + /** + * Get the issuerState property: The issuerState property. + * + * @return the issuerState value. + */ + @Generated + public List getIssuerState() { + return this.issuerState; + } + + /** + * Get the issuerCountry property: The issuerCountry property. + * + * @return the issuerCountry value. + */ + @Generated + public List getIssuerCountry() { + return this.issuerCountry; + } + + /** + * Get the subjectOrganizations property: The subjectOrganizations property. + * + * @return the subjectOrganizations value. + */ + @Generated + public List getSubjectOrganizations() { + return this.subjectOrganizations; + } + + /** + * Get the subjectOrganizationalUnits property: The subjectOrganizationalUnits property. + * + * @return the subjectOrganizationalUnits value. + */ + @Generated + public List getSubjectOrganizationalUnits() { + return this.subjectOrganizationalUnits; + } + + /** + * Get the issuerOrganizations property: The issuerOrganizations property. + * + * @return the issuerOrganizations value. + */ + @Generated + public List getIssuerOrganizations() { + return this.issuerOrganizations; + } + + /** + * Get the issuerOrganizationalUnits property: The issuerOrganizationalUnits property. + * + * @return the issuerOrganizationalUnits value. + */ + @Generated + public List getIssuerOrganizationalUnits() { + return this.issuerOrganizationalUnits; + } + + /** + * Get the version property: The version property. + * + * @return the version value. + */ + @Generated + public Integer getVersion() { + return this.version; + } + + /** + * Get the certificateAuthority property: The certificateAuthority property. + * + * @return the certificateAuthority value. + */ + @Generated + public Boolean isCertificateAuthority() { + return this.certificateAuthority; + } + + /** + * Get the selfSigned property: The selfSigned property. + * + * @return the selfSigned value. + */ + @Generated + public Boolean isSelfSigned() { + return this.selfSigned; + } + + /** + * Get the sigAlgOid property: The sigAlgOid property. + * + * @return the sigAlgOid value. + */ + @Generated + public String getSigAlgOid() { + return this.sigAlgOid; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } + + /** + * Get the validationType property: The validationType property. + * + * @return the validationType value. + */ + @Generated + public SslCertAssetValidationType getValidationType() { + return this.validationType; + } +} 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 new file mode 100644 index 000000000000..445dc0656111 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetResource.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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; + +/** The SslCertAssetResource model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("sslCert") +@Immutable +public final class SslCertAssetResource extends AssetResource { + + /* + * asset + */ + @Generated + @JsonProperty(value = "asset") + private SslCertAsset asset; + + /** + * Creates an instance of SslCertAssetResource class. + * + * @param asset the asset value to set. + */ + @Generated + @JsonCreator + private SslCertAssetResource(@JsonProperty(value = "asset") SslCertAsset asset) { + this.asset = asset; + } + + /** + * Get the asset property: asset. + * + * @return the asset value. + */ + @Generated + public SslCertAsset getAsset() { + return this.asset; + } +} 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 new file mode 100644 index 000000000000..3980cb245793 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslCertAssetValidationType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +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. */ +public final class SslCertAssetValidationType extends ExpandableStringEnum { + + /** Static value domainValidation for SslCertAssetValidationType. */ + @Generated public static final SslCertAssetValidationType DOMAIN_VALIDATION = fromString("domainValidation"); + + /** Static value organizationValidation for SslCertAssetValidationType. */ + @Generated + public static final SslCertAssetValidationType ORGANIZATION_VALIDATION = fromString("organizationValidation"); + + /** Static value extendedValidation for SslCertAssetValidationType. */ + @Generated public static final SslCertAssetValidationType EXTENDED_VALIDATION = fromString("extendedValidation"); + + /** + * Creates a new instance of SslCertAssetValidationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public SslCertAssetValidationType() {} + + /** + * Creates or finds a SslCertAssetValidationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SslCertAssetValidationType. + */ + @Generated + @JsonCreator + public static SslCertAssetValidationType fromString(String name) { + return fromString(name, SslCertAssetValidationType.class); + } + + /** + * Gets known SslCertAssetValidationType values. + * + * @return known SslCertAssetValidationType values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..fcbf1f2c909f --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SslServerConfig.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The SslServerConfig model. */ +@Immutable +public final class SslServerConfig { + + /* + * 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; + + /** Creates an instance of SslServerConfig class. */ + @Generated + private SslServerConfig() {} + + /** + * Get the tlsVersions property: The tlsVersions property. + * + * @return the tlsVersions value. + */ + @Generated + public List getTlsVersions() { + return this.tlsVersions; + } + + /** + * Get the cipherSuites property: The cipherSuites property. + * + * @return the cipherSuites value. + */ + @Generated + public List getCipherSuites() { + return this.cipherSuites; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } +} 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 new file mode 100644 index 000000000000..70746158d820 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SubResourceIntegrityCheck.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The SubResourceIntegrityCheck model. */ +@Immutable +public final class SubResourceIntegrityCheck { + + /* + * 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; + + /** Creates an instance of SubResourceIntegrityCheck class. */ + @Generated + private SubResourceIntegrityCheck() {} + + /** + * Get the violation property: The violation property. + * + * @return the violation value. + */ + @Generated + public Boolean isViolation() { + return this.violation; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the causePageUrl property: The causePageUrl property. + * + * @return the causePageUrl value. + */ + @Generated + public String getCausePageUrl() { + return this.causePageUrl; + } + + /** + * Get the crawlGuid property: The crawlGuid property. + * + * @return the crawlGuid value. + */ + @Generated + public String getCrawlGuid() { + return this.crawlGuid; + } + + /** + * Get the pageGuid property: The pageGuid property. + * + * @return the pageGuid value. + */ + @Generated + public String getPageGuid() { + return this.pageGuid; + } + + /** + * Get the resourceGuid property: The resourceGuid property. + * + * @return the resourceGuid value. + */ + @Generated + public String getResourceGuid() { + return this.resourceGuid; + } + + /** + * Get the expectedHash property: The expectedHash property. + * + * @return the expectedHash value. + */ + @Generated + public String getExpectedHash() { + return this.expectedHash; + } +} 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 new file mode 100644 index 000000000000..a05eda79c414 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/Task.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** The Task model. */ +@Immutable +public final class Task { + + /* + * 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; + + /** Creates an instance of Task class. */ + @Generated + private Task() {} + + /** + * Get the id property: The unique identifier of the task. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the startedAt property: The time the task started. + * + * @return the startedAt value. + */ + @Generated + public OffsetDateTime getStartedAt() { + return this.startedAt; + } + + /** + * Get the completedAt property: The time the task completed. + * + * @return the completedAt value. + */ + @Generated + public OffsetDateTime getCompletedAt() { + return this.completedAt; + } + + /** + * Get the lastPolledAt property: The last time the status of the task was updated. + * + * @return the lastPolledAt value. + */ + @Generated + public OffsetDateTime getLastPolledAt() { + return this.lastPolledAt; + } + + /** + * Get the state property: The state the task is in. + * + * @return the state value. + */ + @Generated + public TaskState getState() { + return this.state; + } + + /** + * Get the phase property: The phase the task is in. + * + * @return the phase value. + */ + @Generated + public TaskPhase getPhase() { + return this.phase; + } + + /** + * Get the reason property: The reason the task was moved into its current state, if the task wasn't completed. + * + * @return the reason value. + */ + @Generated + public String getReason() { + return this.reason; + } + + /** + * Get the metadata property: Attributes unique to the task. This differs by task type. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPageResult.java new file mode 100644 index 000000000000..4d09ff6a2843 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPageResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** The TaskPageResponse model. */ +@Immutable +public final class TaskPageResult { + /* + * The total number of items available in the full result set. + */ + @Generated + @JsonProperty(value = "totalElements") + private Long totalElements; + + /* + * The link to access the next page of results. Not set if at the end of the result set. + */ + @Generated + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The items in the current page of results. + */ + @Generated + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of TaskPageResponse class. */ + @Generated + private TaskPageResult() {} + + /** + * Get the totalElements property: The total number of items available in the full result set. + * + * @return the totalElements value. + */ + @Generated + public Long getTotalElements() { + return this.totalElements; + } + + /** + * Get the nextLink property: The link to access the next page of results. Not set if at the end of the result set. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * Get the value property: The items in the current page of results. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPhase.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPhase.java new file mode 100644 index 000000000000..3b8cafc35e19 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPhase.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The phase the task is in. */ +public final class TaskPhase extends ExpandableStringEnum { + + /** Static value running for TaskPhase. */ + @Generated public static final TaskPhase RUNNING = fromString("running"); + + /** Static value polling for TaskPhase. */ + @Generated public static final TaskPhase POLLING = fromString("polling"); + + /** Static value complete for TaskPhase. */ + @Generated public static final TaskPhase COMPLETE = fromString("complete"); + + /** + * Creates a new instance of TaskPhase value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TaskPhase() {} + + /** + * Creates or finds a TaskPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding TaskPhase. + */ + @Generated + @JsonCreator + public static TaskPhase fromString(String name) { + return fromString(name, TaskPhase.class); + } + + /** + * Gets known TaskPhase values. + * + * @return known TaskPhase values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..1c8b5a47419b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskState.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The state the task is in. */ +public final class TaskState extends ExpandableStringEnum { + + /** Static value pending for TaskState. */ + @Generated public static final TaskState PENDING = fromString("pending"); + + /** Static value running for TaskState. */ + @Generated public static final TaskState RUNNING = fromString("running"); + + /** Static value paused for TaskState. */ + @Generated public static final TaskState PAUSED = fromString("paused"); + + /** Static value complete for TaskState. */ + @Generated public static final TaskState COMPLETE = fromString("complete"); + + /** Static value incomplete for TaskState. */ + @Generated public static final TaskState INCOMPLETE = fromString("incomplete"); + + /** Static value failed for TaskState. */ + @Generated public static final TaskState FAILED = fromString("failed"); + + /** Static value warning for TaskState. */ + @Generated public static final TaskState WARNING = fromString("warning"); + + /** + * Creates a new instance of TaskState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TaskState() {} + + /** + * Creates or finds a TaskState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TaskState. + */ + @Generated + @JsonCreator + public static TaskState fromString(String name) { + return fromString(name, TaskState.class); + } + + /** + * Gets known TaskState values. + * + * @return known TaskState values. + */ + @Generated + public static Collection values() { + return values(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 new file mode 100644 index 000000000000..565b68dfdff2 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/ValidateResult.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ValidateResult model. */ +@Immutable +public final class ValidateResult { + + /* + * This is the top-level error object whose code matches the x-ms-error-code response header. + */ + @Generated + @JsonProperty(value = "error") + private ErrorDetail error; + + /** Creates an instance of ValidateResult class. */ + @Generated + private ValidateResult() {} + + /** + * Get the error property: This is the top-level error object whose code matches the x-ms-error-code response + * header. + * + * @return the error value. + */ + @Generated + public ErrorDetail getError() { + return this.error; + } +} 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 new file mode 100644 index 000000000000..4c6bed446a17 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/WebComponent.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.analytics.defender.easm.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The WebComponent model. */ +@Immutable +public final class WebComponent { + + /* + * 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; + + /** Creates an instance of WebComponent class. */ + @Generated + private WebComponent() {} + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the version property: The version property. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Get the ruleId property: The ruleId property. + * + * @return the ruleId value. + */ + @Generated + public List getRuleId() { + return this.ruleId; + } + + /** + * Get the firstSeen property: The firstSeen property. + * + * @return the firstSeen value. + */ + @Generated + public OffsetDateTime getFirstSeen() { + return this.firstSeen; + } + + /** + * Get the lastSeen property: The lastSeen property. + * + * @return the lastSeen value. + */ + @Generated + public OffsetDateTime getLastSeen() { + return this.lastSeen; + } + + /** + * Get the count property: The count property. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the cve property: The cve property. + * + * @return the cve value. + */ + @Generated + public List getCve() { + return this.cve; + } + + /** + * Get the endOfLife property: The endOfLife property. + * + * @return the endOfLife value. + */ + @Generated + public Long getEndOfLife() { + return this.endOfLife; + } + + /** + * Get the recent property: The recent property. + * + * @return the recent value. + */ + @Generated + public Boolean isRecent() { + return this.recent; + } + + /** + * Get the ports property: The ports property. + * + * @return the ports value. + */ + @Generated + public List getPorts() { + return this.ports; + } + + /** + * Get the sources property: The sources property. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the service property: The service property. + * + * @return the service value. + */ + @Generated + public String getService() { + return this.service; + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/package-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/package-info.java new file mode 100644 index 000000000000..792af307c557 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +/** + * Package containing the data models for Easm. Defender EASM discovers and maps your digital attack surface to provide + * an "outside-in" perspective using probes to discover assets. The assets are provided with detailed metadata + * associated, including vulnerabilities, configurations and web components, allowing customers to view and prioritize + * external risk. The EASM REST API enables you to develop clients that integrate with your application. + */ +package com.azure.analytics.defender.easm.models; diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/package-info.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/package-info.java new file mode 100644 index 000000000000..442a1cfd2254 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +/** + * Package containing the classes for Easm. Defender EASM discovers and maps your digital attack surface to provide an + * "outside-in" perspective using probes to discover assets. The assets are provided with detailed metadata associated, + * including vulnerabilities, configurations and web components, allowing customers to view and prioritize external + * risk. The EASM REST API enables you to develop clients that integrate with your application. + */ +package com.azure.analytics.defender.easm; 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 new file mode 100644 index 000000000000..3d8dace02f7c --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/module-info.java @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.analytics.defender.easm { + requires transitive com.azure.core; + + exports com.azure.analytics.defender.easm; + exports com.azure.analytics.defender.easm.models; + + opens com.azure.analytics.defender.easm.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/resources/azure-analytics-defender-easm.properties b/sdk/easm/azure-analytics-defender-easm/src/main/resources/azure-analytics-defender-easm.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/main/resources/azure-analytics-defender-easm.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java new file mode 100644 index 000000000000..d518cba2f470 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.DiscoGroup; +import com.azure.analytics.defender.easm.models.DiscoGroupData; +import com.azure.analytics.defender.easm.models.DiscoTemplate; +import com.azure.core.util.Configuration; +import com.azure.identity.InteractiveBrowserCredentialBuilder; + + +import java.util.Scanner; + +/** + * This sample shows you how to use the discovery_groups module to create discovery groups using templates provided by the discovery_templates module of the EasmClient + * + * Set the following environment variables before running the sample: + * 1) SUBSCRIPTION_ID - the subscription id for your resource + * 2) WORKSPACENAME - the workspace name for your resource + * 3) RESOURCEGROUPNAME - the resource group for your resource + * 4) REGION - the azure region your resource is in + * 5) PARTIAL_NAME - the search term for the templates. used for a case insensitive "contains" search + */ +public class DiscoTemplateSample { + public static void main(String[] args) { + String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); + String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); + String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); + String region = Configuration.getGlobalConfiguration().get("REGION"); + String endpoint = "https://" + region + ".easm.defender.microsoft.com"; + + EasmClient easmClient = new EasmClientBuilder() + .endpoint(endpoint) + .subscriptionId(subscriptionId) + .workspaceName(workspaceName) + .resourceGroupName(resourceGroupName) + .credential(new InteractiveBrowserCredentialBuilder().build()) + .buildClient(); + + // The discoveryTemplatesList method can be used to find a discovery template using a filter. + // The endpoint will return templates based on a partial match on the name field. + + String partialName = Configuration.getGlobalConfiguration().get("PARTIAL_NAME"); + System.out.println("Partial name is " + partialName); + easmClient.listDiscoTemplate(partialName, 0) + .forEach((discoTemplateResult -> { + System.out.println(discoTemplateResult.getId() + ": " + discoTemplateResult.getDisplayName()); + })); + + // To get more detail about a disco template, we can use the discoveryTemplatesGet method. + // From here, we can see the names and seeds which would be used in a discovery run. + + System.out.println("Enter the template id:"); + + Scanner scanner = new Scanner(System.in); + String templateId = scanner.nextLine(); + + DiscoTemplate discoTemplateResult = easmClient.getDiscoTemplate(templateId); + + System.out.println("Chosen template id: " + discoTemplateResult.getId()); + System.out.println("The following names will be used:"); + discoTemplateResult.getNames().forEach(System.out::println); + System.out.println("The following seeds will be used:"); + discoTemplateResult.getSeeds().forEach(discoSource -> { + System.out.println(discoSource.getKind() + ", " + discoSource.getName()); + }); + + String groupName = "Sample discovery group"; + DiscoGroupData discoGroupRequest = new DiscoGroupData().setTemplateId(templateId); + + DiscoGroup discoGroupResult = easmClient.createOrReplaceDiscoGroup(groupName, discoGroupRequest); + + easmClient.runDiscoGroup(discoGroupResult.getName()); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java new file mode 100644 index 000000000000..b3d186b93e71 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.DiscoRunResult; +import com.azure.analytics.defender.easm.models.DiscoSource; +import com.azure.analytics.defender.easm.models.DiscoSourceKind; +import com.azure.analytics.defender.easm.models.DiscoGroupData; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.identity.InteractiveBrowserCredentialBuilder; + + +import java.util.ArrayList; +import java.util.List; + +/** + * This sample demonstrates how to create and manage discovery runs in a workspace + * + * Set the following environment variables before running the sample: + * 1) SUBSCRIPTION_ID - the subscription id for your resource + * 2) WORKSPACE_NAME - the workspace name for your resource + * 3) RESOURCE_GROUP - the resource group for your resource + * 4) REGION - the azure region your resource is in + * 5) HOSTS - a comma separated list of hosts you would like to run discovery on + * 6) DOMAINS - a comma separated list of hosts you would like to run discovery on + */ +public class DiscoveryRunsSample { + public static void main(String[] args) { + + // To create an easmClient, you need your subscription ID, endpoint, and some sort of credential. + String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); + String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); + String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); + String region = Configuration.getGlobalConfiguration().get("REGION"); + String endpoint = "https://" + region + ".easm.defender.microsoft.com"; + String discoveryGroupName = "Sample Disco"; + String discoveryGroupDescription = "This is a sample description for a discovery group"; + + EasmClient easmClient = new EasmClientBuilder() + .endpoint(endpoint) + .subscriptionId(subscriptionId) + .workspaceName(workspaceName) + .resourceGroupName(resourceGroupName) + // For the purposes of this demo, I've chosen the InteractiveBrowserCredential but any credential will work. + .credential(new InteractiveBrowserCredentialBuilder().build()) + .buildClient(); + + // In order to start discovery runs, we must first create a discovery group, which is a collection of known assets that we can pivot off of. + // These are created using the discoveryGroupsPut method + List seeds = new ArrayList<>(); + seeds.add(new DiscoSource() + .setKind(DiscoSourceKind.DOMAIN) + .setName("contoso.org")); + + DiscoGroupData discoGroupRequest = new DiscoGroupData().setName(discoveryGroupName).setDescription(discoveryGroupDescription).setSeeds(seeds); + + easmClient.createOrReplaceDiscoGroup(discoveryGroupName, discoGroupRequest); + + // Discovery groups created through the API's `put` method aren't run automatically, so we need to start the run ourselves. + easmClient.runDiscoGroup(discoveryGroupName); + + easmClient.listDiscoGroup() + .forEach((discoGroupResponse -> { + System.out.println(discoGroupResponse.getName()); + PagedIterable discoRunPageResponse = easmClient.listRuns(discoGroupResponse.getName(), null, 0); + discoRunPageResponse.forEach(discoRunResponse -> { + System.out.println(" - started: " + discoRunResponse.getStartedDate() + + ", finished: " + discoRunResponse.getCompletedDate() + + ", assets found: " + discoRunResponse.getTotalAssetsFoundCount()); + }); + })); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ManagingExternalIdsSample.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ManagingExternalIdsSample.java new file mode 100644 index 000000000000..efae63ec03a9 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ManagingExternalIdsSample.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.AssetUpdateData; +import com.azure.analytics.defender.easm.models.Task; +import com.azure.core.util.Configuration; +import com.azure.identity.InteractiveBrowserCredentialBuilder; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.ArrayList; +import java.util.List; + +/** + * External IDs can be a useful method of keeping track of assets in multiple systems, but it can be time consuming to + * manually tag each asset. In this example, we'll take a look at how you can, with a map of name/kind/external id, tag + * each asset in your inventory with an external id automatically using the SDK + * + * Set the following environment variables before running the sample: + * 1) SUBSCRIPTION_ID - the subscription id for your resource + * 2) WORKSPACE_NAME - the workspace name for your resource + * 3) RESOURCE_GROUP - the resource group for your resource + * 4) REGION - the azure region your resource is in + * 5) MAPPING - a json file with an external id mapping, like so: + * + * [ + * * { + * * 'name': 'example.com', + * * 'kind': 'host', + * * 'external_id': 'EXT040' + * * }, + * * { + * * 'name': 'example.com', + * * 'kind': 'domain', + * * 'external_id': 'EXT041' + * * } + * * ] + * + */ +public class ManagingExternalIdsSample { + public static void main(String[] args) throws JsonProcessingException { + String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); + String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); + String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); + String region = Configuration.getGlobalConfiguration().get("REGION"); + String endpoint = "https://" + region + ".easm.defender.microsoft.com"; + String externalIdMapping = Configuration.getGlobalConfiguration().get("MAPPING"); + + EasmClient easmClient = new EasmClientBuilder() + .endpoint(endpoint) + .subscriptionId(subscriptionId) + .workspaceName(workspaceName) + .resourceGroupName(resourceGroupName) + // For the purposes of this demo, I've chosen the InteractiveBrowserCredential but any credential will work. + .credential(new InteractiveBrowserCredentialBuilder().build()) + .buildClient(); + + // We can update each asset and append the tracking id of the update to our update ID list, so that + // we can keep track of the progress on each update later + List updateIds = new ArrayList<>(); + List externalIds = new ArrayList<>(); + + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode mapping = objectMapper.readTree(externalIdMapping); + + mapping.elements().forEachRemaining((mappingInstance) -> { + + externalIds.add(mappingInstance.get("externalId").toString()); + + AssetUpdateData assetUpdateRequest = new AssetUpdateData() + .setExternalId(mappingInstance.get("externalId").toString()); + String filter = "kind = " + + mappingInstance.get("kind") + + " AND name = " + + mappingInstance.get("name"); + Task taskResponse = easmClient.updateAssets(filter, assetUpdateRequest); + updateIds.add(taskResponse.getId()); + }); + + // We can view the progress of each update using the tasksGet method + updateIds.forEach(id -> { + Task taskResponse = easmClient.getTask(id); + System.out.println(taskResponse.getId() + ": " + taskResponse.getState()); + }); + + // The updates can be viewed using the `assetsList` method by creating a filter that matches on each + // external id using an `in` query + String assetFilter = "External ID in ".concat(String.join(", ", externalIds)); + + easmClient.listAssetResource(assetFilter, "lastSeen", 0, null) + .forEach(assetResponse -> { + System.out.println(assetResponse.getExternalId() + ", " + assetResponse.getName()); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ReadmeSamples.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ReadmeSamples.java new file mode 100644 index 000000000000..5a3c3b413ebd --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/ReadmeSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.analytics.defender.easm; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: readme-sample-createDefenderEasmClient + String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); + String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); + String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); + String endpoint = Configuration.getGlobalConfiguration().get("ENDPOINT"); + + EasmClient easmClient = new EasmClientBuilder() + .endpoint(endpoint) + .subscriptionId(subscriptionId) + .workspaceName(workspaceName) + .resourceGroupName(resourceGroupName) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildClient(); + // END: readme-sample-createDefenderEasmClient + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java new file mode 100644 index 000000000000..d3a9e76620d3 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.AssetUpdateData; +import com.azure.analytics.defender.easm.models.AssetUpdateState; +import com.azure.analytics.defender.easm.models.SavedFilter; +import com.azure.analytics.defender.easm.models.SavedFilterData; +import com.azure.core.util.Configuration; +import com.azure.identity.InteractiveBrowserCredentialBuilder; + +/** + * Saved Filters are used to store a query within EASM, these saved queries can be used to synchronize exact queries across multiple scripts, or to ensure a team is looking at the same assets + * In this example, we'll go over how a saved filter could be used to synchronize the a query across multiple scripts + * + * Set the following environment variables before running the sample: + * 1) SUBSCRIPTION_ID - the subscription id for your resource + * 2) WORKSPACE_NAME - the workspace name for your resource + * 3) RESOURCE_GROUP - the resource group for your resource + * 4) REGION - the azure region your resource is in + */ +public class SavedFilterSample { + + /* + A sample asset list call that could be used to monitor the assets: + */ + private static void monitor(SavedFilter response){ + // your monitor logic here + } + + + public static void main(String[] args) { + String subscriptionId = Configuration.getGlobalConfiguration().get("SUBSCRIPTION_ID"); + String workspaceName = Configuration.getGlobalConfiguration().get("WORKSPACENAME"); + String resourceGroupName = Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME"); + String region = Configuration.getGlobalConfiguration().get("REGION"); + String endpoint = "https://" + region + ".easm.defender.microsoft.com"; + + EasmClient easmClient = new EasmClientBuilder() + .endpoint(endpoint) + .subscriptionId(subscriptionId) + .workspaceName(workspaceName) + .resourceGroupName(resourceGroupName) + // For the purposes of this demo, I've chosen the InteractiveBrowserCredential but any credential will work. + .credential(new InteractiveBrowserCredentialBuilder().build()) + .buildClient(); + + String savedFilterName = "Sample saved filter"; + SavedFilterData savedFilterRequest = new SavedFilterData("IP Address = 1.1.1.1", "Monitored Addresses"); + + easmClient.createOrReplaceSavedFilter(savedFilterName, savedFilterRequest); + + String monitorFilter = easmClient.getSavedFilter(savedFilterName).getFilter(); + + easmClient.listSavedFilter(monitorFilter, 0) + .forEach(SavedFilterSample::monitor); + + AssetUpdateData assetUpdateRequest = new AssetUpdateData().setState(AssetUpdateState.CONFIRMED); + easmClient.updateAssets(monitorFilter, assetUpdateRequest); + + // Should your needs change, the filter can be updated with no need to update the scripts it's used in + // Simply submit a new `savedFiltersPut` request to replace the old description and filter with a new set + + SavedFilterData newSavedFilterRequest = new SavedFilterData("IP Address = 0.0.0.0", "Monitoring Addresses"); + + easmClient.createOrReplaceSavedFilter(savedFilterName, newSavedFilterRequest); + + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/AssetsAsyncTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/AssetsAsyncTest.java new file mode 100644 index 000000000000..28fadad05323 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/AssetsAsyncTest.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.*; +import com.azure.core.http.rest.PagedFlux; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; + +public class AssetsAsyncTest extends EasmClientTestBase { + private String assetName = "kumed.com"; + private String assetKind = "domain"; + private String filter = "name = " + assetName + " and type = " + assetKind; + private String assetId = assetKind + "$$" + "kumc.edu"; + + private Class getAssetResourceClass(String kind) { + switch (kind) { + case "as": + return AsAssetResource.class; + case "contact": + return ContactAssetResource.class; + case "domain": + return DomainAssetResource.class; + case "host": + return HostAssetResource.class; + case "ipAddress": + return IpAddressAssetResource.class; + case "ipBlock": + return IpBlockAssetResource.class; + case "page": + return PageAssetResource.class; + case "sslCert": + return SslCertAssetResource.class; + default: + return null; + + } + } + + @Test + public void testAssetsListAsync() { + PagedFlux assetPageResponse = easmAsyncClient.listAssetResource(filter, "lastSeen", 0, null); + + StepVerifier.create(assetPageResponse) + .assertNext(assetResource -> { + assertEquals(assetName, assetResource.getName()); + assertInstanceOf(getAssetResourceClass(assetKind), assetResource); + }) + .expectComplete() + .verify(); + } + + @Test + public void testAssetsUpdateAsync() { + AssetUpdateData assetUpdateData = new AssetUpdateData().setExternalId("new_external_id"); + Mono taskMono = easmAsyncClient.updateAssets(filter, assetUpdateData); + StepVerifier.create(taskMono) + .assertNext(task -> { + assertEquals(TaskState.COMPLETE, task.getState()); + assertEquals(TaskPhase.COMPLETE, task.getPhase()); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } + + @Test + public void testAssetsGetAsync() { + Mono assetMono = easmAsyncClient.getAssetResource(assetId); + StepVerifier.create(assetMono) + .assertNext(assetResource -> { + System.out.println("Asset name is: " + assetResource.getName()); + assertInstanceOf(getAssetResourceClass(assetKind), assetResource); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/AssetsTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/AssetsTest.java new file mode 100644 index 000000000000..f258281e965f --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/AssetsTest.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.*; +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; + +public class AssetsTest extends EasmClientTestBase { + private String assetName = "kumed.com"; + private String assetKind = "domain"; + private String filter = "name = " + assetName + " and type = " + assetKind; + private String assetId = assetKind + "$$" + "kumc.edu"; + private Class getAssetResourceClass(String kind) { + switch (kind) { + case "as": + return AsAssetResource.class; + case "contact": + return ContactAssetResource.class; + case "domain": + return DomainAssetResource.class; + case "host": + return HostAssetResource.class; + case "ipAddress": + return IpAddressAssetResource.class; + case "ipBlock": + return IpBlockAssetResource.class; + case "page": + return PageAssetResource.class; + case "sslCert": + return SslCertAssetResource.class; + default: + return null; + + } + } + + + @Test + public void testAssetsListWithResponse() { + + PagedIterable assetPageResponse = easmClient.listAssetResource(filter, "lastSeen", 0, null); + AssetResource assetResponse = assetPageResponse.iterator().next(); + assertEquals(assetName, assetResponse.getName()); + assertInstanceOf(getAssetResourceClass(assetKind), assetResponse); + } + + @Test + public void testAssetsUpdateWithResponse() { + AssetUpdateData assetUpdateData = new AssetUpdateData().setExternalId("new_external_id"); + Task taskResponse = easmClient.updateAssets(filter, assetUpdateData); + assertEquals(TaskState.COMPLETE, taskResponse.getState()); + assertEquals(TaskPhase.COMPLETE, taskResponse.getPhase()); + //assertTrue(taskResponse.getId().matches(UUID_REGEX)); + } + // + @Test + public void testAssetsGetWithResponse() { + AssetResource assetResponse = easmClient.getAssetResource(assetId); + assertInstanceOf(getAssetResourceClass(assetKind), assetResponse); + //assertTrue(assetResponse.getUuid().matches(UUID_REGEX)); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DataConnectionAsyncTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DataConnectionAsyncTest.java new file mode 100644 index 000000000000..fb22c9dc4aa2 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DataConnectionAsyncTest.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.*; +import com.azure.core.http.rest.PagedFlux; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +public class DataConnectionAsyncTest extends EasmClientTestBase { + String dataConnectionName = "sample-dc"; + String newDataConnectionName = "new-sample-dc"; + String logAnalyticsKey = "sample-key"; + String logAnalyticsWorkspace = "sample-workspace"; + + @Test + public void testDataConnectionListAsync() { + PagedFlux dataConnectionPagedFlux = easmAsyncClient.listDataConnection(0); + List dataConnectionList = new ArrayList<>(); + StepVerifier.create(dataConnectionPagedFlux) + .thenConsumeWhile(dataConnectionList::add) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + for (DataConnection dataConnection : dataConnectionList) { + assertNotNull(dataConnection); + assertNotNull(dataConnection.getName()); + assertNotNull(dataConnection.getDisplayName()); + } + } + + @Test + public void testDataConnectionValidateAsync() { + LogAnalyticsDataConnectionProperties properties = new LogAnalyticsDataConnectionProperties() + .setApiKey(logAnalyticsKey) + .setWorkspaceId(logAnalyticsWorkspace); + LogAnalyticsDataConnectionData request = new LogAnalyticsDataConnectionData(properties) + .setName(newDataConnectionName) + .setContent(DataConnectionContent.ATTACK_SURFACE_INSIGHTS) + .setFrequency(DataConnectionFrequency.WEEKLY) + .setFrequencyOffset(1); + Mono validateResultMono = easmAsyncClient.validateDataConnection(request); + StepVerifier.create(validateResultMono) + .assertNext(validateResult -> { + assertNull(validateResult.getError()); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } + + @Test + public void testDataConnectionsPutAsync() { + LogAnalyticsDataConnectionProperties properties = new LogAnalyticsDataConnectionProperties() + .setWorkspaceId(logAnalyticsWorkspace) + .setApiKey(logAnalyticsKey); + LogAnalyticsDataConnectionData request = new LogAnalyticsDataConnectionData(properties) + .setName(newDataConnectionName) + .setContent(DataConnectionContent.ATTACK_SURFACE_INSIGHTS) + .setFrequency(DataConnectionFrequency.WEEKLY) + .setFrequencyOffset(1); + Mono dataConnectionMono = easmAsyncClient.createOrReplaceDataConnection(newDataConnectionName, request); + StepVerifier.create(dataConnectionMono) + .assertNext(dataConnection -> { + assertNotNull(dataConnection); + assertEquals(newDataConnectionName, dataConnection.getName()); + assertEquals(newDataConnectionName, dataConnection.getDisplayName()); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } + + @Test + public void testDataConnectionDeleteAsync() { + Mono deleteMono = easmAsyncClient.deleteDataConnection(dataConnectionName); + StepVerifier.create(deleteMono) + .expectComplete(); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DataConnectionsTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DataConnectionsTest.java new file mode 100644 index 000000000000..0e9e40f495ea --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DataConnectionsTest.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.*; +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class DataConnectionsTest extends EasmClientTestBase { + + String dataConnectionName = "sample-dc"; + String newDataConnectionName = "sample-dc"; + String clusterName = "sample-cluster"; + String databaseName = "sample-db"; + + + @Test + public void testdataConnectionsListWithResponse() { + PagedIterable dataConnectionPageResult = easmClient.listDataConnection(); + DataConnection dataConnection = dataConnectionPageResult.stream().iterator().next(); + assertEquals("new-sample-dc", dataConnection.getName()); + assertNotNull("new-sample-dc", dataConnection.getDisplayName()); + + } + + @Test + public void testdataConnectionsValidateWithResponse() { + AzureDataExplorerDataConnectionProperties properties = new AzureDataExplorerDataConnectionProperties() + .setClusterName(clusterName) + .setDatabaseName(databaseName) + .setRegion("eastus"); + AzureDataExplorerDataConnectionData request = new AzureDataExplorerDataConnectionData(properties) + .setName(newDataConnectionName) + .setContent(DataConnectionContent.ASSETS) + .setFrequency(DataConnectionFrequency.DAILY); + ValidateResult response = easmClient.validateDataConnection(request); + assertNull(response.getError()); + } + + @Test + public void testdataConnectionsGetWithResponse() { + DataConnection response = easmClient.getDataConnection(dataConnectionName); + assertEquals(dataConnectionName, response.getName()); + assertEquals(dataConnectionName, response.getDisplayName()); + } + + @Test + public void testdataConnectionsPutWithResponse() { + AzureDataExplorerDataConnectionProperties properties = new AzureDataExplorerDataConnectionProperties() + .setClusterName(clusterName) + .setDatabaseName(databaseName) + .setRegion("eastus"); + AzureDataExplorerDataConnectionData request = new AzureDataExplorerDataConnectionData(properties) + .setName(newDataConnectionName) + .setContent(DataConnectionContent.ASSETS) + .setFrequency(DataConnectionFrequency.DAILY); + DataConnection dataConnectionResponse = easmClient.createOrReplaceDataConnection(newDataConnectionName, request); + + assertEquals(newDataConnectionName, dataConnectionResponse.getName()); + assertEquals(newDataConnectionName, dataConnectionResponse.getDisplayName()); + } + + @Test + public void testdataConnectionsDeleteWithResponse() { + easmClient.deleteDataConnection(dataConnectionName); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryGroupsAsyncTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryGroupsAsyncTest.java new file mode 100644 index 000000000000..5498cc6cb48b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryGroupsAsyncTest.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.*; +import com.azure.core.http.rest.PagedFlux; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +public class DiscoveryGroupsAsyncTest extends EasmClientTestBase { + String knownGroupName = "University of Kansas"; + String newGroupName = "Async Test"; + String newGroupDescription = "Group created for async test"; + String seedKind = "domain"; + String seedName = "sampleseed.org"; + + private boolean doSeedsMatch(DiscoSource seedA, DiscoSource seedB) { + return seedA.getKind() == seedB.getKind() && seedA.getName().equals(seedB.getName()); + } + + @Test + public void testDiscoveryGroupsListAsync() { + List discoGroupList = new ArrayList<>(); + PagedFlux discoGroupPagedFlux = easmAsyncClient.listDiscoGroup(null, 0); + StepVerifier.create(discoGroupPagedFlux) + .thenConsumeWhile(discoGroupList::add) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + + for (DiscoGroup discoGroup : discoGroupList) { + assertNotNull(discoGroup.getName()); + assertNotNull(discoGroup.getDescription()); + assertNotNull(discoGroup.getTier()); + assertNotNull(discoGroup.getId()); + } + } + + @Test + public void testDiscoveryGroupValidateAsync() { + List seeds = Arrays.asList(new DiscoSource() + .setKind(DiscoSourceKind.fromString(seedKind)) + .setName(seedName)); + DiscoGroupData discoGroupData = new DiscoGroupData() + .setName(newGroupName) + .setDescription(newGroupDescription) + .setSeeds(seeds) + .setFrequencyMilliseconds(604800000L) + .setTier("advanced"); + + Mono validateResultMono = easmAsyncClient.validateDiscoGroup(discoGroupData); + StepVerifier.create(validateResultMono) + .assertNext(validateResult -> { + assertNull(validateResult.getError()); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } + + @Test + public void testDiscoveryGroupGetAsync() { + Mono discoGroupMono = easmAsyncClient.getDiscoGroup(knownGroupName); + StepVerifier.create(discoGroupMono) + .assertNext(discoGroup -> { + assertEquals(knownGroupName, discoGroup.getId()); + assertEquals(knownGroupName, discoGroup.getName()); + assertEquals(knownGroupName, discoGroup.getDisplayName()); + assertNotNull(discoGroup.getDescription()); + assertNotNull(discoGroup.getTier()); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } + + @Test + public void testDiscoveryGroupRunAsync() { + Mono runDiscoGroupMono = easmAsyncClient.runDiscoGroup(knownGroupName); + StepVerifier.create(runDiscoGroupMono) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } + + @Test + public void testDiscoveryGroupListRunsAsync() { + PagedFlux discoRunResultPagedFlux = easmAsyncClient.listRuns(knownGroupName, null, 0); + List discoRunResults = new ArrayList<>(); + + StepVerifier.create(discoRunResultPagedFlux) + .thenConsumeWhile(discoRunResults::add) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + assertTrue(discoRunResults.size() > 2); + for (DiscoRunResult discoRunResult : discoRunResults) { + assertNotNull(discoRunResult.getState()); + } + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryGroupsTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryGroupsTest.java new file mode 100644 index 000000000000..c34ecf1dbcbc --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryGroupsTest.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.*; +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +public class DiscoveryGroupsTest extends EasmClientTestBase { + + String knownGroupName = "University of Kansas"; + String newGroupName = "New disco group Name"; + String newGroupDescription = "This is a description"; + String seedKind = "domain"; + String seedName = "example.org"; + + private boolean doSeedsMatch(DiscoSource seedA, DiscoSource seedB) { + return seedA.getKind() == seedB.getKind() && seedA.getName().equals(seedB.getName()); + } + + @Test + public void testdiscoveryGroupsListWithResponse() { + PagedIterable discoGroups = easmClient.listDiscoGroup(null, 0); + DiscoGroup discoGroup = discoGroups.stream().iterator().next(); + assertNotNull(discoGroup.getName()); + assertNotNull(discoGroup.getDescription()); + assertNotNull(discoGroup.getTier()); + assertNotNull(discoGroup.getId()); + } + + @Test + public void testdiscoveryGroupsValidateWithResponse() { + List seeds = Arrays.asList(new DiscoSource() + .setKind(DiscoSourceKind.fromString(seedKind)) + .setName(seedName)); + DiscoGroupData discoGroupData = new DiscoGroupData() + .setName("validate group name") + .setDescription(newGroupDescription) + .setSeeds(seeds) + .setFrequencyMilliseconds(604800000L) + .setTier("advanced"); + ValidateResult validateResponse = easmClient.validateDiscoGroup(discoGroupData); + assertNull(validateResponse.getError()); + } + + @Test + public void testdiscoveryGroupsGetWithResponse() { + DiscoGroup discoGroupResponse = easmClient.getDiscoGroup(knownGroupName); + assertEquals(knownGroupName, discoGroupResponse.getId()); + assertEquals(knownGroupName, discoGroupResponse.getName()); + assertEquals(knownGroupName, discoGroupResponse.getDisplayName()); + assertNotNull(discoGroupResponse.getDescription()); + assertNotNull(discoGroupResponse.getTier()); + + } + + @Test + public void testdiscoveryGroupsPutWithResponse() { + List seeds = Arrays.asList(new DiscoSource() + .setKind(DiscoSourceKind.fromString(seedKind)) + .setName(seedName)); + DiscoGroupData discoGroupData = new DiscoGroupData() + .setName(newGroupName) + .setDescription(newGroupDescription) + .setSeeds(seeds); + + DiscoGroup discoGroupResponse = easmClient.createOrReplaceDiscoGroup(newGroupName, discoGroupData); + + assertEquals(newGroupName, discoGroupResponse.getName()); + assertEquals(newGroupName, discoGroupResponse.getDisplayName()); + assertEquals(newGroupDescription, discoGroupResponse.getDescription()); + assertTrue(doSeedsMatch(seeds.get(0), discoGroupResponse.getSeeds().get(0))); + } + + @Test + public void testdiscoveryGroupsRunWithResponse() { + easmClient.runDiscoGroup(knownGroupName); + } + + @Test + public void testdiscoveryGroupsListRunsWithResponse() { + PagedIterable discoRunPageResponse = easmClient.listRuns(knownGroupName, null, 0); + assertNotNull(discoRunPageResponse); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryTemplatesAsyncTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryTemplatesAsyncTest.java new file mode 100644 index 000000000000..73c606e1c7d3 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryTemplatesAsyncTest.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.DiscoTemplate; +import com.azure.core.http.rest.PagedFlux; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class DiscoveryTemplatesAsyncTest extends EasmClientTestBase { + String templateId = "43488"; + String partialName = "sample"; + + @Test + public void testDiscoveryTemplatesListAsync() { + PagedFlux discoTemplatePagedFlux = easmAsyncClient.listDiscoTemplate(partialName, 0); + List discoTemplateList = new ArrayList<>(); + + StepVerifier.create(discoTemplatePagedFlux) + .thenConsumeWhile(discoTemplateList::add) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + + assertTrue(discoTemplateList.size() > 1); + for (DiscoTemplate discoTemplate : discoTemplateList) { + if (!discoTemplate.getName().toLowerCase().contains(partialName)) { + System.out.println("That name is: " + discoTemplate.getName().toLowerCase()); + } + assertTrue(discoTemplate.getName().toLowerCase().contains(partialName)); + assertNotNull(discoTemplate.getId()); + } + } + + @Test + public void testDiscoveryTemplateGetAsync() { + Mono discoTemplateMono = easmAsyncClient.getDiscoTemplate(templateId); + StepVerifier.create(discoTemplateMono) + .assertNext(discoTemplate -> { + assertNotNull(discoTemplate.getName()); + assertNotNull(discoTemplate.getId()); + }); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryTemplatesTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryTemplatesTest.java new file mode 100644 index 000000000000..c2e2fa21e310 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/DiscoveryTemplatesTest.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.DiscoTemplate; +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class DiscoveryTemplatesTest extends EasmClientTestBase { + + String templateId = "43488"; + String partialName = "ku"; + + @Test + public void testdiscoveryTemplatesListWithResponse() { + + PagedIterable discoTemplatePageResponse = easmClient.listDiscoTemplate(partialName, 0); + DiscoTemplate discoTemplateResponse = discoTemplatePageResponse.stream().iterator().next(); + assertTrue(discoTemplateResponse.getName().toLowerCase().contains(partialName)); + assertNotNull(discoTemplateResponse.getId()); + } + + @Test + public void testdiscoveryTemplatesGetWithResponse() { + DiscoTemplate discoTemplateResponse = easmClient.getDiscoTemplate(templateId); + assertNotNull(discoTemplateResponse.getName()); + assertNotNull(discoTemplateResponse.getId()); + } + + +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/EasmClientTestBase.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/EasmClientTestBase.java new file mode 100644 index 000000000000..c60d61d0687d --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/EasmClientTestBase.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.analytics.defender.easm; + +// 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.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.test.models.TestProxySanitizer; +import com.azure.core.test.models.TestProxySanitizerType; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; + +import reactor.core.publisher.Mono; + +public class EasmClientTestBase extends TestProxyTestBase { + private final String sanitizedRequestUri = "https://REDACTED/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/REDACTED/workspaces/REDACTED/"; + private final String requestUriRegex = "https://.*/subscriptions/.*/resourceGroups/.*/workspaces/.*?/"; + protected final String uuidRegex = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"; + private final String sanitizedUuid = "00000000-0000-0000-0000-000000000000"; + protected EasmClient easmClient; + protected EasmAsyncClient easmAsyncClient; + protected static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(60); + + @Override + protected void beforeTest() { + List customSanitizers = new ArrayList<>(); + EasmClientBuilder easmClientbuilder = + new EasmClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "https://REDACTED")) + .subscriptionId(Configuration.getGlobalConfiguration().get("SUBSCRIPTIONID", "00000000-0000-0000-0000-000000000000")) + .resourceGroupName( + Configuration.getGlobalConfiguration().get("RESOURCEGROUPNAME", "REDACTED")) + .workspaceName(Configuration.getGlobalConfiguration().get("WORKSPACENAME", "REDACTED")) + .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()); + } + customSanitizers.add(new TestProxySanitizer(requestUriRegex, sanitizedRequestUri, TestProxySanitizerType.URL)); + customSanitizers.add(new TestProxySanitizer("$..uuid", uuidRegex, sanitizedUuid, TestProxySanitizerType.BODY_KEY)); + if (getTestMode() != TestMode.LIVE) { + interceptorManager.addSanitizers(customSanitizers); + } + easmClient = easmClientbuilder.buildClient(); + easmAsyncClient = easmClientbuilder.buildAsyncClient(); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/ReportsAsyncTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/ReportsAsyncTest.java new file mode 100644 index 000000000000..cc5d38dd56c7 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/ReportsAsyncTest.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.ReportAssetSnapshotRequest; +import com.azure.analytics.defender.easm.models.ReportAssetSnapshotResult; +import com.azure.analytics.defender.easm.models.ReportBillableAssetSummaryResult; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import static org.junit.jupiter.api.Assertions.*; + +public class ReportsAsyncTest extends EasmClientTestBase { + String metric = "savedfilter_metric_51126"; + + @Test + public void testReportsBillableAsync() { + Mono reportBillableAssetSummaryResultMono = easmAsyncClient.getBillable(); + StepVerifier.create(reportBillableAssetSummaryResultMono) + .assertNext(reportBillableAssetSummaryResult -> { + assertTrue(reportBillableAssetSummaryResult.getAssetSummaries().size() > 0); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } + + @Test + public void testReportsSnapshotAsync() { + ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest() + .setMetric(metric) + .setPage(0) + .setSize(25); + Mono reportAssetSnapshotResultMono = easmAsyncClient.getSnapshot(reportAssetSnapshotRequest); + StepVerifier.create(reportAssetSnapshotResultMono) + .assertNext(reportAssetSnapshotResult -> { + assertNotNull(reportAssetSnapshotResult.getDisplayName()); + assertEquals(metric, reportAssetSnapshotResult.getMetric()); + assertNotNull(reportAssetSnapshotResult.getDescription()); + assertNotNull(reportAssetSnapshotResult.getAssets()); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/ReportsTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/ReportsTest.java new file mode 100644 index 000000000000..f0a3d1cd5033 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/ReportsTest.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.*; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; + +import static org.junit.jupiter.api.Assertions.*; + +public class ReportsTest extends EasmClientTestBase { + String metric = "savedfilter_metric_51126"; + + @Test + public void testreportsBillableWithResult() { + ReportBillableAssetSummaryResult reportBillableAssetSummaryResult = easmClient.getBillable(); + assertTrue(reportBillableAssetSummaryResult.getAssetSummaries().size() > 0); + } + + @Test + public void testreportsSnapshotWithResult() { + ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest().setMetric(metric).setPage(0).setSize(25); + ReportAssetSnapshotResult reportAssetSnapshotResult = easmClient.getSnapshot(reportAssetSnapshotRequest); + assertNotNull(reportAssetSnapshotResult.getDisplayName()); + assertEquals(metric, reportAssetSnapshotResult.getMetric()); + assertNotNull(reportAssetSnapshotResult.getDescription()); + assertNotNull(reportAssetSnapshotResult.getAssets()); + } + + @Test + public void testreportsSummaryWithResult() { + ReportAssetSummaryRequest reportAssetSummaryRequest = new ReportAssetSummaryRequest().setMetrics(Arrays.asList(metric)); + ReportAssetSummaryResult reportAssetSummaryResult = easmClient.getSummary(reportAssetSummaryRequest); + assertTrue(reportAssetSummaryResult.getAssetSummaries().size() > 0); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/SavedFiltersAsyncTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/SavedFiltersAsyncTest.java new file mode 100644 index 000000000000..fde7e112142b --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/SavedFiltersAsyncTest.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.SavedFilter; +import com.azure.analytics.defender.easm.models.SavedFilterData; +import com.azure.core.http.rest.PagedFlux; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +public class SavedFiltersAsyncTest extends EasmClientTestBase { + String deleteSavedFilterName = "put_filter"; + String putSavedFilterName = "put_filter"; + String knownExistingFilter = "new_put_filter"; + String filter = "name = \"" + putSavedFilterName + "\""; + + @Test + public void testSavedFiltersListAsync() { + PagedFlux savedFilterPagedFlux = easmAsyncClient.listSavedFilter(); + List savedFilterList = new ArrayList<>(); + + StepVerifier.create(savedFilterPagedFlux) + .thenConsumeWhile(savedFilterList::add) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + for (SavedFilter savedFilter : savedFilterList) { + assertNotNull(savedFilter.getId()); + assertNotNull(savedFilter.getDescription()); + } + } + + @Test + public void testSavedFiltersGetAsync() { + Mono savedFilterMono = easmAsyncClient.getSavedFilter(knownExistingFilter); + StepVerifier.create(savedFilterMono) + .assertNext(savedFilter -> { + assertEquals(knownExistingFilter, savedFilter.getId()); + assertEquals(knownExistingFilter, savedFilter.getName()); + assertNotNull(savedFilter.getDisplayName()); + assertNotNull(savedFilter.getFilter()); + assertNotNull(savedFilter.getDescription()); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } + + @Test + public void testSavedFiltersCreateOrReplaceAsync() { + SavedFilterData savedFilterData = new SavedFilterData(filter, "Sample description"); + Mono savedFilterMono = easmAsyncClient.createOrReplaceSavedFilter(putSavedFilterName, savedFilterData); + StepVerifier.create(savedFilterMono) + .assertNext(savedFilter -> { + assertEquals(putSavedFilterName, savedFilter.getName()); + assertEquals(putSavedFilterName, savedFilter.getId()); + assertEquals(putSavedFilterName, savedFilter.getDisplayName()); + assertEquals(savedFilterData.getDescription(), savedFilter.getDescription()); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + + } + + @Test + public void testSavedFiltersDeleteAsync() { + Mono deleteMono = easmAsyncClient.deleteSavedFilter(deleteSavedFilterName); + StepVerifier.create(deleteMono) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/SavedFiltersTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/SavedFiltersTest.java new file mode 100644 index 000000000000..f32e3b5a3c4d --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/SavedFiltersTest.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.SavedFilterData; +import com.azure.analytics.defender.easm.models.SavedFilter; +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +public class SavedFiltersTest extends EasmClientTestBase { + + String deleteSavedFilterName = "put_filter"; + String putSavedFilterName = "put_filter"; + String knownExistingFilter = "new_put_filter"; + String filter = "name = \"" + putSavedFilterName + "\""; + + @Test + public void testsavedFiltersListWithResponse() { + PagedIterable savedFilters = easmClient.listSavedFilter(); + SavedFilter savedFilterResponse = savedFilters.stream().iterator().next(); + assertNotNull(savedFilterResponse.getId()); + assertNotNull(savedFilterResponse.getDescription()); + + } + + @Test + public void testsavedFiltersGetWithResponse() { + SavedFilter savedFilterResponse = easmClient.getSavedFilter(knownExistingFilter); + assertEquals(knownExistingFilter, savedFilterResponse.getId()); + assertEquals(knownExistingFilter, savedFilterResponse.getName()); + assertNotNull(savedFilterResponse.getDisplayName()); + assertNotNull(savedFilterResponse.getFilter()); + assertNotNull(savedFilterResponse.getDescription()); + } + + @Test + public void testsavedFiltersPutWithResponse() { + SavedFilterData savedFilterData = new SavedFilterData(filter, "Sample description"); + SavedFilter savedFilterResponse = easmClient.createOrReplaceSavedFilter(putSavedFilterName, savedFilterData); + assertEquals(putSavedFilterName, savedFilterResponse.getName()); + assertEquals(putSavedFilterName, savedFilterResponse.getId()); + assertEquals(putSavedFilterName, savedFilterResponse.getDisplayName()); + assertEquals(savedFilterData.getDescription(), savedFilterResponse.getDescription()); + } + + @Test + public void testsavedFiltersDeleteWithResponse() { + easmClient.deleteSavedFilter(deleteSavedFilterName); + } + +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/TasksAsyncTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/TasksAsyncTest.java new file mode 100644 index 000000000000..ef3be2a4126c --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/TasksAsyncTest.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.Task; +import com.azure.core.http.rest.PagedFlux; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class TasksAsyncTest extends EasmClientTestBase { + String existingTaskId = "efad1fac-52d5-4ea9-b601-d5bf54a83780"; + String cancelTaskId = "efad1fac-52d5-4ea9-b601-d5bf54a83780"; + + @Test + public void testTasksListAsync() { + PagedFlux taskPagedFlux = easmAsyncClient.listTask(); + StepVerifier.create(taskPagedFlux) + .assertNext(task -> { + task.getId().matches(uuidRegex); + }); + } + + @Test + public void testTasksGetAsync() { + Mono taskMono = easmAsyncClient.getTask(existingTaskId); + StepVerifier.create(taskMono) + .assertNext(task -> { + assertTrue(task.getId().equals(existingTaskId)); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } + + @Test + public void testTasksCancelAsync() { + Mono taskMono = easmAsyncClient.cancelTask(cancelTaskId); + StepVerifier.create(taskMono) + .assertNext(task -> { + assertTrue(task.getId().equals(existingTaskId)); + }) + .expectComplete() + .verify(DEFAULT_TIMEOUT); + } +} diff --git a/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/TasksTest.java b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/TasksTest.java new file mode 100644 index 000000000000..0dbc5c1d021d --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/src/test/java/com/azure/analytics/defender/easm/TasksTest.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.analytics.defender.easm; + +import com.azure.analytics.defender.easm.models.Task; +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class TasksTest extends EasmClientTestBase { + + String existingTaskId = "efad1fac-52d5-4ea9-b601-d5bf54a83780"; + String cancelTaskId = "efad1fac-52d5-4ea9-b601-d5bf54a83780"; + + @Test + public void testtasksListWithResponse() { + PagedIterable taskPageResponse = easmClient.listTask(); + Task taskResponse = taskPageResponse.stream().iterator().next(); + assertTrue(taskResponse.getId().matches(uuidRegex)); + + } + + @Test + public void testtasksGetWithResponse() { + Task taskResponse = easmClient.getTask(existingTaskId); + assertTrue(taskResponse.getId().matches(uuidRegex)); + } + + @Test + public void testtasksCancelWithResponse() { + Task taskResponse = easmClient.cancelTask(cancelTaskId); + assertTrue(taskResponse.getId().matches(uuidRegex)); + } + +} diff --git a/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml b/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml new file mode 100644 index 000000000000..40d9a2c338a4 --- /dev/null +++ b/sdk/easm/azure-analytics-defender-easm/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification/riskiq/Easm +commit: f5f584c65071dc0306544a195fbcdff156023040 +repo: Azure/azure-rest-api-specs diff --git a/sdk/easm/ci.yml b/sdk/easm/ci.yml new file mode 100644 index 000000000000..3810ff29361b --- /dev/null +++ b/sdk/easm/ci.yml @@ -0,0 +1,40 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/easm/ci.yml + - sdk/easm/azure-analytics-defender-easm/ + exclude: + - sdk/easm/pom.xml + - sdk/easm/azure-analytics-defender-easm/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/easm/ci.yml + - sdk/easm/azure-analytics-defender-easm/ + exclude: + - sdk/easm/pom.xml + - sdk/easm/azure-analytics-defender-easm/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: easm + EnableBatchRelease: true + Artifacts: + - name: azure-analytics-defender-easm + groupId: com.azure + safeName: azureanalyticsdefendereasm diff --git a/sdk/easm/pom.xml b/sdk/easm/pom.xml new file mode 100644 index 000000000000..7f40570b63a7 --- /dev/null +++ b/sdk/easm/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-easm-service + pom + 1.0.0 + + azure-analytics-defender-easm + +