From bb8202ec0f72f042d51d3227c9abe9c85600d2d1 Mon Sep 17 00:00:00 2001 From: thang-bit Date: Tue, 24 Oct 2023 23:38:59 -0500 Subject: [PATCH 1/4] Update readme sample links to point to main branch --- sdk/easm/azure-analytics-defender-easm/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/easm/azure-analytics-defender-easm/README.md b/sdk/easm/azure-analytics-defender-easm/README.md index 38dbf1141e9e..f0fb4d691659 100644 --- a/sdk/easm/azure-analytics-defender-easm/README.md +++ b/sdk/easm/azure-analytics-defender-easm/README.md @@ -104,12 +104,12 @@ For details on contributing to this repository, see the [contributing guide](htt [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 +[discovery_runs_sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java +[disco_template_sample]: https://github.com/Azrue/azure-sdk-for-java/blob/main/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java +[saved_filter_sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java +[external_ids_sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/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 +[samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/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 From 99447ec060db045ac89917d88a90d267a2654337 Mon Sep 17 00:00:00 2001 From: thang-bit Date: Tue, 24 Oct 2023 23:48:56 -0500 Subject: [PATCH 2/4] Update broken link --- sdk/easm/azure-analytics-defender-easm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/easm/azure-analytics-defender-easm/README.md b/sdk/easm/azure-analytics-defender-easm/README.md index f0fb4d691659..f33ccf5b43fd 100644 --- a/sdk/easm/azure-analytics-defender-easm/README.md +++ b/sdk/easm/azure-analytics-defender-easm/README.md @@ -105,7 +105,7 @@ For details on contributing to this repository, see the [contributing guide](htt [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/Azure/azure-sdk-for-java/blob/main/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoveryRunsSample.java -[disco_template_sample]: https://github.com/Azrue/azure-sdk-for-java/blob/main/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java +[disco_template_sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/DiscoTemplateSample.java [saved_filter_sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/easm/azure-analytics-defender-easm/src/samples/java/com/azure/analytics/defender/easm/SavedFilterSample.java [external_ids_sample]: https://github.com/Azure/azure-sdk-for-java/blob/main/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 From 17b1e3327d941a8251e0df486d6f3c82b9238baa Mon Sep 17 00:00:00 2001 From: thang-bit Date: Wed, 25 Oct 2023 00:14:56 -0500 Subject: [PATCH 3/4] Remove unused Count* classes --- .../easm/models/CountPagedIterable.java | 46 --------------- .../easm/models/CountPagedResponse.java | 58 ------------------- 2 files changed, 104 deletions(-) delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedIterable.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedResponse.java 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 deleted file mode 100644 index 1750c577096c..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedIterable.java +++ /dev/null @@ -1,46 +0,0 @@ -// 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 deleted file mode 100644 index 88eec566b17c..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/CountPagedResponse.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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; - } -} From 29568ef12d76b03901af6a63009c9310fc49a80a Mon Sep 17 00:00:00 2001 From: thang-bit Date: Wed, 25 Oct 2023 00:20:17 -0500 Subject: [PATCH 4/4] Remove unused *PageResult classes --- .../easm/models/DataConnectionPageResult.java | 70 ------------------- .../easm/models/DiscoGroupPageResult.java | 69 ------------------ .../easm/models/DiscoTemplatePageResult.java | 70 ------------------- .../easm/models/SavedFilterPageResult.java | 70 ------------------- .../defender/easm/models/TaskPageResult.java | 70 ------------------- 5 files changed, 349 deletions(-) delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionPageResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupPageResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplatePageResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterPageResult.java delete mode 100644 sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPageResult.java 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 deleted file mode 100644 index 223d2e2adcd6..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DataConnectionPageResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** The 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/DiscoGroupPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupPageResult.java deleted file mode 100644 index 72324ea52d98..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoGroupPageResult.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The 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/DiscoTemplatePageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplatePageResult.java deleted file mode 100644 index 9131cc47d732..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/DiscoTemplatePageResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** The 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/SavedFilterPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterPageResult.java deleted file mode 100644 index 4cd8d95b0caf..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/SavedFilterPageResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** The 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/TaskPageResult.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPageResult.java deleted file mode 100644 index 4d09ff6a2843..000000000000 --- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/TaskPageResult.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.analytics.defender.easm.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** The 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; - } -}