diff --git a/eng/lintingconfigs/revapi/track2/revapi.json b/eng/lintingconfigs/revapi/track2/revapi.json index 5080650de40c..25191224e58a 100644 --- a/eng/lintingconfigs/revapi/track2/revapi.json +++ b/eng/lintingconfigs/revapi/track2/revapi.json @@ -674,6 +674,35 @@ "code": "java.method.removed", "old" : "method java.lang.String com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile::nodeImageVersion()", "justification": "Not a break, same method exists on its parent class." + }, + { + "ignore": true, + "code": "java.method.visibilityReduced", + "old": "method void com.azure.resourcemanager.monitor.models.AlertSeverity::()", + "new": "method void com.azure.resourcemanager.monitor.models.AlertSeverity::(java.lang.Long)", + "oldVisibility": "public", + "newVisibility": "private", + "justification": "Changed due to stream-style serialization." + }, + { + "ignore": true, + "code": "java.method.removed", + "old": "method com.azure.resourcemanager.monitor.models.AlertSeverity com.azure.resourcemanager.monitor.models.AlertSeverity::fromLong(long)", + "justification": "Changed due to stream-style serialization." + }, + { + "ignore": true, + "code": "java.missing.oldSuperType", + "old": "class com.azure.resourcemanager.monitor.models.AlertSeverity", + "new": "class com.azure.resourcemanager.monitor.models.AlertSeverity", + "superClass": "com.azure.core.util.ExpandableStringEnum", + "justification": "Changed due to stream-style serialization." + }, + { + "ignore": true, + "code": "java.method.removed", + "old": "method com.azure.resourcemanager.monitor.models.AutoscaleNotification com.azure.resourcemanager.monitor.models.AutoscaleNotification::withOperation(java.lang.String)", + "justification": "The property is a constant, and hence not settable." } ] } diff --git a/sdk/monitor/azure-resourcemanager-monitor/CHANGELOG.md b/sdk/monitor/azure-resourcemanager-monitor/CHANGELOG.md index 291040a84345..3f1bbb37b7f2 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/CHANGELOG.md +++ b/sdk/monitor/azure-resourcemanager-monitor/CHANGELOG.md @@ -1,15 +1,15 @@ # Release History -## 2.54.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed +## 2.54.0-beta.1 (2025-11-06) ### Other Changes +- Updated `api-version` of metric alert to `2024-03-01-preview`. +- Updated `api-version` of metric definitions to `2021-05-01`. +- Updated `api-version` of metrics to `2021-05-01`. +- Updated `api-version` of scheduled query rule to `2023-12-01`. +- Updated `api-version` of data collection to `2024-03-11`. + ## 2.53.4 (2025-10-27) ### Other Changes diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java index 4e3bc880fa59..80645df30a17 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java @@ -23,7 +23,7 @@ public interface BaselinesClient { * @param resourceUri The identifier of the resource. * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace that contains the requested metric names. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. @@ -80,7 +80,7 @@ PagedFlux listAsync(String resourceUri, String metric * @param resourceUri The identifier of the resource. * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace that contains the requested metric names. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java index 1afe15c48c8e..68054b7a6249 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java @@ -56,6 +56,22 @@ public interface DataCollectionRuleAssociationsClient extends InnerSupportsDelet PagedIterable listByResource(String resourceUri, Context context); + /** + * Lists associations for the specified data collection rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param skipToken (Optional) The continuation token for paginated responses. + * @param top (Optional) The max number of items to return per page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByRuleAsync(String resourceGroupName, + String dataCollectionRuleName, String skipToken, Integer top); + /** * Lists associations for the specified data collection rule. * @@ -89,6 +105,8 @@ PagedIterable listByRule(St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param skipToken (Optional) The continuation token for paginated responses. + * @param top (Optional) The max number of items to return per page. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -97,7 +115,7 @@ PagedIterable listByRule(St */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByRule(String resourceGroupName, - String dataCollectionRuleName, Context context); + String dataCollectionRuleName, String skipToken, Integer top, Context context); /** * Lists associations for the specified data collection endpoint. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java index 235b1f9c35ad..13610fe8fcec 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java @@ -269,13 +269,16 @@ Response updateWithResponse(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param deleteAssociations If set to 'true' then all associations of this data collection rule will also be + * deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionRuleName); + Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionRuleName, + Boolean deleteAssociations); /** * Deletes a data collection rule. @@ -295,6 +298,8 @@ Response updateWithResponse(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param deleteAssociations If set to 'true' then all associations of this data collection rule will also be + * deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -302,7 +307,8 @@ Response updateWithResponse(String resourceGrou * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String dataCollectionRuleName, Context context); + Response deleteWithResponse(String resourceGroupName, String dataCollectionRuleName, + Boolean deleteAssociations, Context context); /** * Deletes a data collection rule. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java index fca11c7aba09..60fc2856251e 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java @@ -10,16 +10,70 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.monitor.fluent.models.MetricDefinitionInner; +import com.azure.resourcemanager.monitor.fluent.models.SubscriptionScopeMetricDefinitionInner; /** * An instance of this class provides access to all the operations defined in MetricDefinitionsClient. */ public interface MetricDefinitionsClient { + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtSubscriptionScopeAsync(String region, + String metricnamespace); + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtSubscriptionScopeAsync(String region); + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtSubscriptionScope(String region); + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtSubscriptionScope(String region, String metricnamespace, + Context context); + /** * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -56,7 +110,7 @@ public interface MetricDefinitionsClient { * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java index 1afda9c74516..d033e52c2810 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java @@ -9,7 +9,10 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.monitor.fluent.models.ResponseInner; +import com.azure.resourcemanager.monitor.fluent.models.SubscriptionScopeMetricResponseInner; +import com.azure.resourcemanager.monitor.models.MetricResultType; import com.azure.resourcemanager.monitor.models.ResultType; +import com.azure.resourcemanager.monitor.models.SubscriptionScopeMetricsRequestBodyParameters; import java.time.Duration; import reactor.core.publisher.Mono; @@ -18,14 +21,244 @@ */ public interface MetricsClient { /** - * **Lists the metric values for a resource**. + * **Lists the metric data for a subscription**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> listAtSubscriptionScopeWithResponseAsync(String region, + String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, + String filter, MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, + Boolean validateDimensions); + + /** + * **Lists the metric data for a subscription**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAtSubscriptionScopeAsync(String region); + + /** + * **Lists the metric data for a subscription**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAtSubscriptionScopeWithResponse(String region, String timespan, + Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, + MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, + Context context); + + /** + * **Lists the metric data for a subscription**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubscriptionScopeMetricResponseInner listAtSubscriptionScope(String region); + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param body Parameters serialized in the body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> listAtSubscriptionScopePostWithResponseAsync(String region, + String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, + String filter, MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, + Boolean validateDimensions, SubscriptionScopeMetricsRequestBodyParameters body); + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAtSubscriptionScopePostAsync(String region); + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param body Parameters serialized in the body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAtSubscriptionScopePostWithResponse(String region, + String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, + String filter, MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, + Boolean validateDimensions, SubscriptionScopeMetricsRequestBodyParameters body, Context context); + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubscriptionScopeMetricResponseInner listAtSubscriptionScopePost(String region); + + /** + * **Lists the metric values for a resource**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). * * @param resourceUri The identifier of the resource. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. * @param aggregation The list of aggregation types (comma separated) to retrieve. * @param top The maximum number of records to retrieve. * Valid only if $filter is specified. @@ -33,19 +266,21 @@ public interface MetricsClient { * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -54,10 +289,11 @@ public interface MetricsClient { @ServiceMethod(returns = ReturnType.SINGLE) Mono> listWithResponseAsync(String resourceUri, String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, ResultType resultType, - String metricnamespace); + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions); /** - * **Lists the metric values for a resource**. + * **Lists the metric values for a resource**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). * * @param resourceUri The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -69,14 +305,14 @@ Mono> listWithResponseAsync(String resourceUri, String t Mono listAsync(String resourceUri); /** - * **Lists the metric values for a resource**. + * **Lists the metric values for a resource**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). * * @param resourceUri The identifier of the resource. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. * @param aggregation The list of aggregation types (comma separated) to retrieve. * @param top The maximum number of records to retrieve. * Valid only if $filter is specified. @@ -84,19 +320,21 @@ Mono> listWithResponseAsync(String resourceUri, String t * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -106,10 +344,11 @@ Mono> listWithResponseAsync(String resourceUri, String t @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse(String resourceUri, String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, ResultType resultType, String metricnamespace, - Context context); + Boolean autoAdjustTimegrain, Boolean validateDimensions, Context context); /** - * **Lists the metric values for a resource**. + * **Lists the metric values for a resource**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). * * @param resourceUri The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java index b74e3f72fdb7..c4cbcc124176 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java @@ -35,9 +35,9 @@ public final class ActionGroupResourceInner extends Resource { private ActionGroup innerProperties; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -45,9 +45,9 @@ public final class ActionGroupResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ActionGroupResourceInner class. @@ -65,13 +65,13 @@ private ActionGroup innerProperties() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -85,13 +85,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java index 3fb54f314d89..cc7ccd752d71 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java @@ -26,9 +26,9 @@ public final class ActivityLogAlertResourceInner extends Resource { private AlertRuleProperties innerProperties; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -36,9 +36,9 @@ public final class ActivityLogAlertResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ActivityLogAlertResourceInner class. @@ -56,13 +56,13 @@ private AlertRuleProperties innerProperties() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -76,13 +76,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java index 27db2588ad0d..06579f239169 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java @@ -28,9 +28,9 @@ public final class AlertRuleResourceInner extends Resource { private AlertRule innerProperties = new AlertRule(); /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -38,9 +38,9 @@ public final class AlertRuleResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of AlertRuleResourceInner class. @@ -58,13 +58,13 @@ private AlertRule innerProperties() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -78,13 +78,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java index ca035733f5fb..a355ee5ef250 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java @@ -33,9 +33,9 @@ public final class AutoscaleSettingResourceInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -43,9 +43,9 @@ public final class AutoscaleSettingResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of AutoscaleSettingResourceInner class. @@ -72,13 +72,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -92,13 +92,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.java index cda8742d801e..ff88c7a97ee6 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.java @@ -32,9 +32,9 @@ public final class AzureMonitorPrivateLinkScopeInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -42,9 +42,9 @@ public final class AzureMonitorPrivateLinkScopeInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of AzureMonitorPrivateLinkScopeInner class. @@ -71,13 +71,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -91,13 +91,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java index 9c7eace9c1e8..9bf72c3ec4cd 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java @@ -11,11 +11,18 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.monitor.models.DataCollectionEndpointConfigurationAccess; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointFailoverConfiguration; import com.azure.resourcemanager.monitor.models.DataCollectionEndpointLogsIngestion; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointMetadata; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointMetricsIngestion; import com.azure.resourcemanager.monitor.models.DataCollectionEndpointNetworkAcls; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointResourceIdentity; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointResourceSku; import com.azure.resourcemanager.monitor.models.KnownDataCollectionEndpointProvisioningState; import com.azure.resourcemanager.monitor.models.KnownDataCollectionEndpointResourceKind; +import com.azure.resourcemanager.monitor.models.PrivateLinkScopedResource; import java.io.IOException; +import java.util.List; import java.util.Map; /** @@ -24,7 +31,7 @@ @Fluent public final class DataCollectionEndpointResourceInner extends Resource { /* - * Resource properties. + * The properties property. */ private DataCollectionEndpointResourceProperties innerProperties; @@ -33,6 +40,16 @@ public final class DataCollectionEndpointResourceInner extends Resource { */ private KnownDataCollectionEndpointResourceKind kind; + /* + * The SKU of the resource. + */ + private DataCollectionEndpointResourceSku sku; + + /* + * Managed service identity of the resource. + */ + private DataCollectionEndpointResourceIdentity identity; + /* * Resource entity tag (ETag). */ @@ -44,9 +61,9 @@ public final class DataCollectionEndpointResourceInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -54,9 +71,9 @@ public final class DataCollectionEndpointResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of DataCollectionEndpointResourceInner class. @@ -65,7 +82,7 @@ public DataCollectionEndpointResourceInner() { } /** - * Get the innerProperties property: Resource properties. + * Get the innerProperties property: The properties property. * * @return the innerProperties value. */ @@ -93,6 +110,46 @@ public DataCollectionEndpointResourceInner withKind(KnownDataCollectionEndpointR return this; } + /** + * Get the sku property: The SKU of the resource. + * + * @return the sku value. + */ + public DataCollectionEndpointResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the resource. + * + * @param sku the sku value to set. + * @return the DataCollectionEndpointResourceInner object itself. + */ + public DataCollectionEndpointResourceInner withSku(DataCollectionEndpointResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Managed service identity of the resource. + * + * @return the identity value. + */ + public DataCollectionEndpointResourceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity of the resource. + * + * @param identity the identity value to set. + * @return the DataCollectionEndpointResourceInner object itself. + */ + public DataCollectionEndpointResourceInner withIdentity(DataCollectionEndpointResourceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the etag property: Resource entity tag (ETag). * @@ -112,13 +169,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -132,13 +189,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -254,6 +311,30 @@ public DataCollectionEndpointResourceInner withLogsIngestion(DataCollectionEndpo return this; } + /** + * Get the metricsIngestion property: The endpoint used by clients to ingest metrics. + * + * @return the metricsIngestion value. + */ + public DataCollectionEndpointMetricsIngestion metricsIngestion() { + return this.innerProperties() == null ? null : this.innerProperties().metricsIngestion(); + } + + /** + * Set the metricsIngestion property: The endpoint used by clients to ingest metrics. + * + * @param metricsIngestion the metricsIngestion value to set. + * @return the DataCollectionEndpointResourceInner object itself. + */ + public DataCollectionEndpointResourceInner + withMetricsIngestion(DataCollectionEndpointMetricsIngestion metricsIngestion) { + if (this.innerProperties() == null) { + this.innerProperties = new DataCollectionEndpointResourceProperties(); + } + this.innerProperties().withMetricsIngestion(metricsIngestion); + return this; + } + /** * Get the networkAcls property: Network access control rules for the endpoints. * @@ -286,6 +367,36 @@ public KnownDataCollectionEndpointProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Get the privateLinkScopedResources property: List of Azure Monitor Private Link Scope Resources to which this + * data collection endpoint resource is associated. This property is READ-ONLY. + * + * @return the privateLinkScopedResources value. + */ + public List privateLinkScopedResources() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopedResources(); + } + + /** + * Get the failoverConfiguration property: Metadata for the resource. This property can only be updated by Log + * Analytics Control Plane for Data Collection Endpoint with Log Analytics Destination. + * + * @return the failoverConfiguration value. + */ + public DataCollectionEndpointFailoverConfiguration failoverConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().failoverConfiguration(); + } + + /** + * Get the metadata property: Metadata for the resource. This property can only be updated by Log Analytics Control + * Plane for Data Collection Endpoint with Log Analytics Destination. + * + * @return the metadata value. + */ + public DataCollectionEndpointMetadata metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + /** * Validates the instance. * @@ -295,6 +406,12 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } } /** @@ -307,6 +424,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -344,6 +463,12 @@ public static DataCollectionEndpointResourceInner fromJson(JsonReader jsonReader } else if ("kind".equals(fieldName)) { deserializedDataCollectionEndpointResourceInner.kind = KnownDataCollectionEndpointResourceKind.fromString(reader.getString()); + } else if ("sku".equals(fieldName)) { + deserializedDataCollectionEndpointResourceInner.sku + = DataCollectionEndpointResourceSku.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedDataCollectionEndpointResourceInner.identity + = DataCollectionEndpointResourceIdentity.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedDataCollectionEndpointResourceInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceProperties.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceProperties.java index c9869371ab4f..50517a41b0b9 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceProperties.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceProperties.java @@ -10,16 +10,39 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.monitor.models.DataCollectionEndpoint; import com.azure.resourcemanager.monitor.models.DataCollectionEndpointConfigurationAccess; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointFailoverConfiguration; import com.azure.resourcemanager.monitor.models.DataCollectionEndpointLogsIngestion; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointMetadata; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointMetricsIngestion; import com.azure.resourcemanager.monitor.models.DataCollectionEndpointNetworkAcls; import com.azure.resourcemanager.monitor.models.KnownDataCollectionEndpointProvisioningState; +import com.azure.resourcemanager.monitor.models.PrivateLinkScopedResource; import java.io.IOException; +import java.util.List; /** - * Resource properties. + * The DataCollectionEndpointResourceProperties model. */ @Fluent public final class DataCollectionEndpointResourceProperties extends DataCollectionEndpoint { + /* + * Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection + * Endpoint with Log Analytics Destination. + */ + private DataCollectionEndpointMetadata metadata; + + /* + * Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection + * Endpoint with Log Analytics Destination. + */ + private DataCollectionEndpointFailoverConfiguration failoverConfiguration; + + /* + * List of Azure Monitor Private Link Scope Resources to which this data collection endpoint resource is associated. + * This property is READ-ONLY. + */ + private List privateLinkScopedResources; + /* * The resource provisioning state. This property is READ-ONLY. */ @@ -31,6 +54,39 @@ public final class DataCollectionEndpointResourceProperties extends DataCollecti public DataCollectionEndpointResourceProperties() { } + /** + * Get the metadata property: Metadata for the resource. This property can only be updated by Log Analytics Control + * Plane for Data Collection Endpoint with Log Analytics Destination. + * + * @return the metadata value. + */ + @Override + public DataCollectionEndpointMetadata metadata() { + return this.metadata; + } + + /** + * Get the failoverConfiguration property: Metadata for the resource. This property can only be updated by Log + * Analytics Control Plane for Data Collection Endpoint with Log Analytics Destination. + * + * @return the failoverConfiguration value. + */ + @Override + public DataCollectionEndpointFailoverConfiguration failoverConfiguration() { + return this.failoverConfiguration; + } + + /** + * Get the privateLinkScopedResources property: List of Azure Monitor Private Link Scope Resources to which this + * data collection endpoint resource is associated. This property is READ-ONLY. + * + * @return the privateLinkScopedResources value. + */ + @Override + public List privateLinkScopedResources() { + return this.privateLinkScopedResources; + } + /** * Get the provisioningState property: The resource provisioning state. This property is READ-ONLY. * @@ -79,6 +135,16 @@ public DataCollectionEndpointResourceProperties withImmutableId(String immutable return this; } + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointResourceProperties + withMetricsIngestion(DataCollectionEndpointMetricsIngestion metricsIngestion) { + super.withMetricsIngestion(metricsIngestion); + return this; + } + /** * {@inheritDoc} */ @@ -95,7 +161,27 @@ public DataCollectionEndpointResourceProperties withNetworkAcls(DataCollectionEn */ @Override public void validate() { - super.validate(); + if (configurationAccess() != null) { + configurationAccess().validate(); + } + if (logsIngestion() != null) { + logsIngestion().validate(); + } + if (metricsIngestion() != null) { + metricsIngestion().validate(); + } + if (networkAcls() != null) { + networkAcls().validate(); + } + if (privateLinkScopedResources() != null) { + privateLinkScopedResources().forEach(e -> e.validate()); + } + if (failoverConfiguration() != null) { + failoverConfiguration().validate(); + } + if (metadata() != null) { + metadata().validate(); + } } /** @@ -108,6 +194,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("immutableId", immutableId()); jsonWriter.writeJsonField("configurationAccess", configurationAccess()); jsonWriter.writeJsonField("logsIngestion", logsIngestion()); + jsonWriter.writeJsonField("metricsIngestion", metricsIngestion()); jsonWriter.writeJsonField("networkAcls", networkAcls()); return jsonWriter.writeEndObject(); } @@ -138,12 +225,26 @@ public static DataCollectionEndpointResourceProperties fromJson(JsonReader jsonR } else if ("logsIngestion".equals(fieldName)) { deserializedDataCollectionEndpointResourceProperties .withLogsIngestion(DataCollectionEndpointLogsIngestion.fromJson(reader)); + } else if ("metricsIngestion".equals(fieldName)) { + deserializedDataCollectionEndpointResourceProperties + .withMetricsIngestion(DataCollectionEndpointMetricsIngestion.fromJson(reader)); } else if ("networkAcls".equals(fieldName)) { deserializedDataCollectionEndpointResourceProperties .withNetworkAcls(DataCollectionEndpointNetworkAcls.fromJson(reader)); } else if ("provisioningState".equals(fieldName)) { deserializedDataCollectionEndpointResourceProperties.provisioningState = KnownDataCollectionEndpointProvisioningState.fromString(reader.getString()); + } else if ("privateLinkScopedResources".equals(fieldName)) { + List privateLinkScopedResources + = reader.readArray(reader1 -> PrivateLinkScopedResource.fromJson(reader1)); + deserializedDataCollectionEndpointResourceProperties.privateLinkScopedResources + = privateLinkScopedResources; + } else if ("failoverConfiguration".equals(fieldName)) { + deserializedDataCollectionEndpointResourceProperties.failoverConfiguration + = DataCollectionEndpointFailoverConfiguration.fromJson(reader); + } else if ("metadata".equals(fieldName)) { + deserializedDataCollectionEndpointResourceProperties.metadata + = DataCollectionEndpointMetadata.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java index 0fcf5b5e2542..b6625a23a888 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java @@ -20,7 +20,7 @@ @Fluent public final class DataCollectionRuleAssociationProxyOnlyResourceInner extends ProxyResource { /* - * Resource properties. + * The properties property. */ private DataCollectionRuleAssociationProxyOnlyResourceProperties innerProperties; @@ -35,9 +35,9 @@ public final class DataCollectionRuleAssociationProxyOnlyResourceInner extends P private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -45,9 +45,9 @@ public final class DataCollectionRuleAssociationProxyOnlyResourceInner extends P private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of DataCollectionRuleAssociationProxyOnlyResourceInner class. @@ -56,7 +56,7 @@ public DataCollectionRuleAssociationProxyOnlyResourceInner() { } /** - * Get the innerProperties property: Resource properties. + * Get the innerProperties property: The properties property. * * @return the innerProperties value. */ @@ -83,13 +83,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -103,13 +103,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java index c31249951ca3..4e4f39970ac9 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java @@ -14,19 +14,19 @@ import java.io.IOException; /** - * Resource properties. + * The DataCollectionRuleAssociationProxyOnlyResourceProperties model. */ @Fluent public final class DataCollectionRuleAssociationProxyOnlyResourceProperties extends DataCollectionRuleAssociation { /* - * The resource provisioning state. + * Metadata about the resource */ - private KnownDataCollectionRuleAssociationProvisioningState provisioningState; + private DataCollectionRuleAssociationMetadata metadata; /* - * Metadata about the resource + * The resource provisioning state. */ - private DataCollectionRuleAssociationMetadata metadata; + private KnownDataCollectionRuleAssociationProvisioningState provisioningState; /** * Creates an instance of DataCollectionRuleAssociationProxyOnlyResourceProperties class. @@ -35,23 +35,23 @@ public DataCollectionRuleAssociationProxyOnlyResourceProperties() { } /** - * Get the provisioningState property: The resource provisioning state. + * Get the metadata property: Metadata about the resource. * - * @return the provisioningState value. + * @return the metadata value. */ @Override - public KnownDataCollectionRuleAssociationProvisioningState provisioningState() { - return this.provisioningState; + public DataCollectionRuleAssociationMetadata metadata() { + return this.metadata; } /** - * Get the metadata property: Metadata about the resource. + * Get the provisioningState property: The resource provisioning state. * - * @return the metadata value. + * @return the provisioningState value. */ @Override - public DataCollectionRuleAssociationMetadata metadata() { - return this.metadata; + public KnownDataCollectionRuleAssociationProvisioningState provisioningState() { + return this.provisioningState; } /** @@ -90,7 +90,9 @@ public DataCollectionRuleAssociationProxyOnlyResourceProperties withDescription( */ @Override public void validate() { - super.validate(); + if (metadata() != null) { + metadata().validate(); + } } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java index 0dc6b6a6e9d9..538e99bad1e7 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java @@ -10,9 +10,16 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleAgentSettings; import com.azure.resourcemanager.monitor.models.DataCollectionRuleDataSources; import com.azure.resourcemanager.monitor.models.DataCollectionRuleDestinations; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleDirectDataSources; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleEndpoints; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleIngestionQuotas; import com.azure.resourcemanager.monitor.models.DataCollectionRuleMetadata; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleReferences; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleResourceIdentity; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleResourceSku; import com.azure.resourcemanager.monitor.models.DataFlow; import com.azure.resourcemanager.monitor.models.KnownDataCollectionRuleProvisioningState; import com.azure.resourcemanager.monitor.models.KnownDataCollectionRuleResourceKind; @@ -27,7 +34,7 @@ @Fluent public final class DataCollectionRuleResourceInner extends Resource { /* - * Resource properties. + * The properties property. */ private DataCollectionRuleResourceProperties innerProperties; @@ -36,6 +43,16 @@ public final class DataCollectionRuleResourceInner extends Resource { */ private KnownDataCollectionRuleResourceKind kind; + /* + * The SKU of the resource. + */ + private DataCollectionRuleResourceSku sku; + + /* + * Managed service identity of the resource. + */ + private DataCollectionRuleResourceIdentity identity; + /* * Resource entity tag (ETag). */ @@ -47,9 +64,9 @@ public final class DataCollectionRuleResourceInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -57,9 +74,9 @@ public final class DataCollectionRuleResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of DataCollectionRuleResourceInner class. @@ -68,7 +85,7 @@ public DataCollectionRuleResourceInner() { } /** - * Get the innerProperties property: Resource properties. + * Get the innerProperties property: The properties property. * * @return the innerProperties value. */ @@ -96,6 +113,46 @@ public DataCollectionRuleResourceInner withKind(KnownDataCollectionRuleResourceK return this; } + /** + * Get the sku property: The SKU of the resource. + * + * @return the sku value. + */ + public DataCollectionRuleResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the resource. + * + * @param sku the sku value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner withSku(DataCollectionRuleResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Managed service identity of the resource. + * + * @return the identity value. + */ + public DataCollectionRuleResourceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity of the resource. + * + * @param identity the identity value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner withIdentity(DataCollectionRuleResourceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the etag property: Resource entity tag (ETag). * @@ -115,13 +172,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -135,13 +192,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -228,6 +285,61 @@ public DataCollectionRuleMetadata metadata() { return this.innerProperties() == null ? null : this.innerProperties().metadata(); } + /** + * Get the endpoints property: Defines the ingestion endpoints to send data to via this rule. + * + * @return the endpoints value. + */ + public DataCollectionRuleEndpoints endpoints() { + return this.innerProperties() == null ? null : this.innerProperties().endpoints(); + } + + /** + * Get the references property: Defines all the references that may be used in other sections of the DCR. + * + * @return the references value. + */ + public DataCollectionRuleReferences references() { + return this.innerProperties() == null ? null : this.innerProperties().references(); + } + + /** + * Set the references property: Defines all the references that may be used in other sections of the DCR. + * + * @param references the references value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner withReferences(DataCollectionRuleReferences references) { + if (this.innerProperties() == null) { + this.innerProperties = new DataCollectionRuleResourceProperties(); + } + this.innerProperties().withReferences(references); + return this; + } + + /** + * Get the agentSettings property: Agent settings used to modify agent behavior on a given host. + * + * @return the agentSettings value. + */ + public DataCollectionRuleAgentSettings agentSettings() { + return this.innerProperties() == null ? null : this.innerProperties().agentSettings(); + } + + /** + * Set the agentSettings property: Agent settings used to modify agent behavior on a given host. + * + * @param agentSettings the agentSettings value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner withAgentSettings(DataCollectionRuleAgentSettings agentSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DataCollectionRuleResourceProperties(); + } + this.innerProperties().withAgentSettings(agentSettings); + return this; + } + /** * Get the streamDeclarations property: Declaration of custom streams used in this rule. * @@ -278,6 +390,32 @@ public DataCollectionRuleResourceInner withDataSources(DataCollectionRuleDataSou return this; } + /** + * Get the directDataSources property: The specification of direct data sources. + * This property is optional and can be omitted. + * + * @return the directDataSources value. + */ + public DataCollectionRuleDirectDataSources directDataSources() { + return this.innerProperties() == null ? null : this.innerProperties().directDataSources(); + } + + /** + * Set the directDataSources property: The specification of direct data sources. + * This property is optional and can be omitted. + * + * @param directDataSources the directDataSources value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner + withDirectDataSources(DataCollectionRuleDirectDataSources directDataSources) { + if (this.innerProperties() == null) { + this.innerProperties = new DataCollectionRuleResourceProperties(); + } + this.innerProperties().withDirectDataSources(directDataSources); + return this; + } + /** * Get the destinations property: The specification of destinations. * @@ -324,6 +462,15 @@ public DataCollectionRuleResourceInner withDataFlows(List dataFlows) { return this; } + /** + * Get the ingestionQuotas property: The specification for ingestion limits. + * + * @return the ingestionQuotas value. + */ + public DataCollectionRuleIngestionQuotas ingestionQuotas() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionQuotas(); + } + /** * Get the provisioningState property: The resource provisioning state. * @@ -342,6 +489,12 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } } /** @@ -354,6 +507,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -391,6 +546,11 @@ public static DataCollectionRuleResourceInner fromJson(JsonReader jsonReader) th } else if ("kind".equals(fieldName)) { deserializedDataCollectionRuleResourceInner.kind = KnownDataCollectionRuleResourceKind.fromString(reader.getString()); + } else if ("sku".equals(fieldName)) { + deserializedDataCollectionRuleResourceInner.sku = DataCollectionRuleResourceSku.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedDataCollectionRuleResourceInner.identity + = DataCollectionRuleResourceIdentity.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedDataCollectionRuleResourceInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceProperties.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceProperties.java index f7f51f0fe057..4e0a081a15c5 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceProperties.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceProperties.java @@ -9,9 +9,14 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.monitor.models.DataCollectionRule; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleAgentSettings; import com.azure.resourcemanager.monitor.models.DataCollectionRuleDataSources; import com.azure.resourcemanager.monitor.models.DataCollectionRuleDestinations; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleDirectDataSources; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleEndpoints; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleIngestionQuotas; import com.azure.resourcemanager.monitor.models.DataCollectionRuleMetadata; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleReferences; import com.azure.resourcemanager.monitor.models.DataFlow; import com.azure.resourcemanager.monitor.models.KnownDataCollectionRuleProvisioningState; import com.azure.resourcemanager.monitor.models.StreamDeclaration; @@ -20,14 +25,24 @@ import java.util.Map; /** - * Resource properties. + * The DataCollectionRuleResourceProperties model. */ @Fluent public final class DataCollectionRuleResourceProperties extends DataCollectionRule { /* - * The immutable ID of this data collection rule. This property is READ-ONLY. + * The resource provisioning state. */ - private String immutableId; + private KnownDataCollectionRuleProvisioningState provisioningState; + + /* + * The specification for ingestion limits + */ + private DataCollectionRuleIngestionQuotas ingestionQuotas; + + /* + * Defines the ingestion endpoints to send data to via this rule. + */ + private DataCollectionRuleEndpoints endpoints; /* * Metadata about the resource @@ -35,9 +50,9 @@ public final class DataCollectionRuleResourceProperties extends DataCollectionRu private DataCollectionRuleMetadata metadata; /* - * The resource provisioning state. + * The immutable ID of this data collection rule. This property is READ-ONLY. */ - private KnownDataCollectionRuleProvisioningState provisioningState; + private String immutableId; /** * Creates an instance of DataCollectionRuleResourceProperties class. @@ -46,13 +61,33 @@ public DataCollectionRuleResourceProperties() { } /** - * Get the immutableId property: The immutable ID of this data collection rule. This property is READ-ONLY. + * Get the provisioningState property: The resource provisioning state. * - * @return the immutableId value. + * @return the provisioningState value. */ @Override - public String immutableId() { - return this.immutableId; + public KnownDataCollectionRuleProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ingestionQuotas property: The specification for ingestion limits. + * + * @return the ingestionQuotas value. + */ + @Override + public DataCollectionRuleIngestionQuotas ingestionQuotas() { + return this.ingestionQuotas; + } + + /** + * Get the endpoints property: Defines the ingestion endpoints to send data to via this rule. + * + * @return the endpoints value. + */ + @Override + public DataCollectionRuleEndpoints endpoints() { + return this.endpoints; } /** @@ -66,13 +101,13 @@ public DataCollectionRuleMetadata metadata() { } /** - * Get the provisioningState property: The resource provisioning state. + * Get the immutableId property: The immutable ID of this data collection rule. This property is READ-ONLY. * - * @return the provisioningState value. + * @return the immutableId value. */ @Override - public KnownDataCollectionRuleProvisioningState provisioningState() { - return this.provisioningState; + public String immutableId() { + return this.immutableId; } /** @@ -93,6 +128,24 @@ public DataCollectionRuleResourceProperties withDataCollectionEndpointId(String return this; } + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceProperties withReferences(DataCollectionRuleReferences references) { + super.withReferences(references); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceProperties withAgentSettings(DataCollectionRuleAgentSettings agentSettings) { + super.withAgentSettings(agentSettings); + return this; + } + /** * {@inheritDoc} */ @@ -112,6 +165,16 @@ public DataCollectionRuleResourceProperties withDataSources(DataCollectionRuleDa return this; } + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceProperties + withDirectDataSources(DataCollectionRuleDirectDataSources directDataSources) { + super.withDirectDataSources(directDataSources); + return this; + } + /** * {@inheritDoc} */ @@ -137,7 +200,40 @@ public DataCollectionRuleResourceProperties withDataFlows(List dataFlo */ @Override public void validate() { - super.validate(); + if (metadata() != null) { + metadata().validate(); + } + if (endpoints() != null) { + endpoints().validate(); + } + if (references() != null) { + references().validate(); + } + if (agentSettings() != null) { + agentSettings().validate(); + } + if (streamDeclarations() != null) { + streamDeclarations().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (dataSources() != null) { + dataSources().validate(); + } + if (directDataSources() != null) { + directDataSources().validate(); + } + if (destinations() != null) { + destinations().validate(); + } + if (dataFlows() != null) { + dataFlows().forEach(e -> e.validate()); + } + if (ingestionQuotas() != null) { + ingestionQuotas().validate(); + } } /** @@ -148,9 +244,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("description", description()); jsonWriter.writeStringField("dataCollectionEndpointId", dataCollectionEndpointId()); + jsonWriter.writeJsonField("references", references()); + jsonWriter.writeJsonField("agentSettings", agentSettings()); jsonWriter.writeMapField("streamDeclarations", streamDeclarations(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("dataSources", dataSources()); + jsonWriter.writeJsonField("directDataSources", directDataSources()); jsonWriter.writeJsonField("destinations", destinations()); jsonWriter.writeArrayField("dataFlows", dataFlows(), (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); @@ -181,6 +280,15 @@ public static DataCollectionRuleResourceProperties fromJson(JsonReader jsonReade } else if ("metadata".equals(fieldName)) { deserializedDataCollectionRuleResourceProperties.metadata = DataCollectionRuleMetadata.fromJson(reader); + } else if ("endpoints".equals(fieldName)) { + deserializedDataCollectionRuleResourceProperties.endpoints + = DataCollectionRuleEndpoints.fromJson(reader); + } else if ("references".equals(fieldName)) { + deserializedDataCollectionRuleResourceProperties + .withReferences(DataCollectionRuleReferences.fromJson(reader)); + } else if ("agentSettings".equals(fieldName)) { + deserializedDataCollectionRuleResourceProperties + .withAgentSettings(DataCollectionRuleAgentSettings.fromJson(reader)); } else if ("streamDeclarations".equals(fieldName)) { Map streamDeclarations = reader.readMap(reader1 -> StreamDeclaration.fromJson(reader1)); @@ -188,12 +296,18 @@ public static DataCollectionRuleResourceProperties fromJson(JsonReader jsonReade } else if ("dataSources".equals(fieldName)) { deserializedDataCollectionRuleResourceProperties .withDataSources(DataCollectionRuleDataSources.fromJson(reader)); + } else if ("directDataSources".equals(fieldName)) { + deserializedDataCollectionRuleResourceProperties + .withDirectDataSources(DataCollectionRuleDirectDataSources.fromJson(reader)); } else if ("destinations".equals(fieldName)) { deserializedDataCollectionRuleResourceProperties .withDestinations(DataCollectionRuleDestinations.fromJson(reader)); } else if ("dataFlows".equals(fieldName)) { List dataFlows = reader.readArray(reader1 -> DataFlow.fromJson(reader1)); deserializedDataCollectionRuleResourceProperties.withDataFlows(dataFlows); + } else if ("ingestionQuotas".equals(fieldName)) { + deserializedDataCollectionRuleResourceProperties.ingestionQuotas + = DataCollectionRuleIngestionQuotas.fromJson(reader); } else if ("provisioningState".equals(fieldName)) { deserializedDataCollectionRuleResourceProperties.provisioningState = KnownDataCollectionRuleProvisioningState.fromString(reader.getString()); diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceInner.java index 8fa9dfd20169..a420665ef9a0 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsCategoryResourceInner.java @@ -30,9 +30,9 @@ public final class DiagnosticSettingsCategoryResourceInner extends ProxyResource private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -40,9 +40,9 @@ public final class DiagnosticSettingsCategoryResourceInner extends ProxyResource private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of DiagnosticSettingsCategoryResourceInner class. @@ -69,13 +69,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -89,13 +89,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -107,20 +107,6 @@ public CategoryType categoryType() { return this.innerProperties() == null ? null : this.innerProperties().categoryType(); } - /** - * Set the categoryType property: The type of the diagnostic settings category. - * - * @param categoryType the categoryType value to set. - * @return the DiagnosticSettingsCategoryResourceInner object itself. - */ - public DiagnosticSettingsCategoryResourceInner withCategoryType(CategoryType categoryType) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticSettingsCategory(); - } - this.innerProperties().withCategoryType(categoryType); - return this; - } - /** * Get the categoryGroups property: the collection of what category groups are supported. * @@ -130,20 +116,6 @@ public List categoryGroups() { return this.innerProperties() == null ? null : this.innerProperties().categoryGroups(); } - /** - * Set the categoryGroups property: the collection of what category groups are supported. - * - * @param categoryGroups the categoryGroups value to set. - * @return the DiagnosticSettingsCategoryResourceInner object itself. - */ - public DiagnosticSettingsCategoryResourceInner withCategoryGroups(List categoryGroups) { - if (this.innerProperties() == null) { - this.innerProperties = new DiagnosticSettingsCategory(); - } - this.innerProperties().withCategoryGroups(categoryGroups); - return this; - } - /** * Validates the instance. * diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceInner.java index 48c3c5ca305b..4fdb03cc5f51 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DiagnosticSettingsResourceInner.java @@ -31,9 +31,9 @@ public final class DiagnosticSettingsResourceInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -41,9 +41,9 @@ public final class DiagnosticSettingsResourceInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of DiagnosticSettingsResourceInner class. @@ -70,13 +70,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -90,13 +90,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java index a1896ad894f9..7ee0f7944930 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java @@ -26,9 +26,9 @@ public final class LogProfileResourceInner extends Resource { private LogProfileProperties innerProperties = new LogProfileProperties(); /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -36,9 +36,9 @@ public final class LogProfileResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of LogProfileResourceInner class. @@ -56,13 +56,13 @@ private LogProfileProperties innerProperties() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -76,13 +76,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertProperties.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertProperties.java index a84fbcb65898..94fd754caf1d 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertProperties.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertProperties.java @@ -13,10 +13,12 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.monitor.models.MetricAlertAction; import com.azure.resourcemanager.monitor.models.MetricAlertCriteria; +import com.azure.resourcemanager.monitor.models.ResolveConfiguration; import java.io.IOException; import java.time.Duration; import java.time.OffsetDateTime; import java.util.List; +import java.util.Map; /** * An alert rule. @@ -24,7 +26,7 @@ @Fluent public final class MetricAlertProperties implements JsonSerializable { /* - * the description of the metric alert that will be included in the alert email. + * The description of the metric alert that will be included in the alert email. */ private String description; @@ -34,49 +36,55 @@ public final class MetricAlertProperties implements JsonSerializable scopes; /* - * how often the metric alert is evaluated represented in ISO 8601 duration format. + * How often the metric alert is evaluated represented in ISO 8601 duration format. */ private Duration evaluationFrequency; /* - * the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. + * The period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. */ private Duration windowSize; /* - * the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope + * The resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope * contains a subscription, resource group, or more than one resource. */ private String targetResourceType; /* - * the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a + * The region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a * subscription, resource group, or more than one resource. */ private String targetResourceRegion; /* - * defines the specific alert criteria information. + * Defines the specific alert criteria information. */ private MetricAlertCriteria criteria; /* - * the flag that indicates whether the alert should be auto resolved or not. The default is true. + * The flag that indicates whether the alert should be auto resolved or not. The default is true. */ private Boolean autoMitigate; /* - * the array of actions that are performed when the alert rule becomes active, and when an alert condition is + * The configuration for how the alert is resolved. Applicable for PromQLCriteria. + */ + private ResolveConfiguration resolveConfiguration; + + /* + * The array of actions that are performed when the alert rule becomes active, and when an alert condition is * resolved. */ private List actions; @@ -87,10 +95,20 @@ public final class MetricAlertProperties implements JsonSerializable customProperties; + + /* + * The properties of an action properties. + */ + private Map actionProperties; + /** * Creates an instance of MetricAlertProperties class. */ @@ -98,7 +116,7 @@ public MetricAlertProperties() { } /** - * Get the description property: the description of the metric alert that will be included in the alert email. + * Get the description property: The description of the metric alert that will be included in the alert email. * * @return the description value. */ @@ -107,7 +125,7 @@ public String description() { } /** - * Set the description property: the description of the metric alert that will be included in the alert email. + * Set the description property: The description of the metric alert that will be included in the alert email. * * @param description the description value to set. * @return the MetricAlertProperties object itself. @@ -138,7 +156,7 @@ public MetricAlertProperties withSeverity(int severity) { } /** - * Get the enabled property: the flag that indicates whether the metric alert is enabled. + * Get the enabled property: The flag that indicates whether the metric alert is enabled. * * @return the enabled value. */ @@ -147,7 +165,7 @@ public boolean enabled() { } /** - * Set the enabled property: the flag that indicates whether the metric alert is enabled. + * Set the enabled property: The flag that indicates whether the metric alert is enabled. * * @param enabled the enabled value to set. * @return the MetricAlertProperties object itself. @@ -158,7 +176,8 @@ public MetricAlertProperties withEnabled(boolean enabled) { } /** - * Get the scopes property: the list of resource id's that this metric alert is scoped to. + * Get the scopes property: The list of resource id's that this metric alert is scoped to. You cannot change the + * scope of a metric rule based on logs. * * @return the scopes value. */ @@ -167,7 +186,8 @@ public List scopes() { } /** - * Set the scopes property: the list of resource id's that this metric alert is scoped to. + * Set the scopes property: The list of resource id's that this metric alert is scoped to. You cannot change the + * scope of a metric rule based on logs. * * @param scopes the scopes value to set. * @return the MetricAlertProperties object itself. @@ -178,7 +198,7 @@ public MetricAlertProperties withScopes(List scopes) { } /** - * Get the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration + * Get the evaluationFrequency property: How often the metric alert is evaluated represented in ISO 8601 duration * format. * * @return the evaluationFrequency value. @@ -188,7 +208,7 @@ public Duration evaluationFrequency() { } /** - * Set the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration + * Set the evaluationFrequency property: How often the metric alert is evaluated represented in ISO 8601 duration * format. * * @param evaluationFrequency the evaluationFrequency value to set. @@ -200,7 +220,7 @@ public MetricAlertProperties withEvaluationFrequency(Duration evaluationFrequenc } /** - * Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert + * Get the windowSize property: The period of time (in ISO 8601 duration format) that is used to monitor alert * activity based on the threshold. * * @return the windowSize value. @@ -210,7 +230,7 @@ public Duration windowSize() { } /** - * Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert + * Set the windowSize property: The period of time (in ISO 8601 duration format) that is used to monitor alert * activity based on the threshold. * * @param windowSize the windowSize value to set. @@ -222,7 +242,7 @@ public MetricAlertProperties withWindowSize(Duration windowSize) { } /** - * Get the targetResourceType property: the resource type of the target resource(s) on which the alert is + * Get the targetResourceType property: The resource type of the target resource(s) on which the alert is * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @return the targetResourceType value. @@ -232,7 +252,7 @@ public String targetResourceType() { } /** - * Set the targetResourceType property: the resource type of the target resource(s) on which the alert is + * Set the targetResourceType property: The resource type of the target resource(s) on which the alert is * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @param targetResourceType the targetResourceType value to set. @@ -244,7 +264,7 @@ public MetricAlertProperties withTargetResourceType(String targetResourceType) { } /** - * Get the targetResourceRegion property: the region of the target resource(s) on which the alert is + * Get the targetResourceRegion property: The region of the target resource(s) on which the alert is * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @return the targetResourceRegion value. @@ -254,7 +274,7 @@ public String targetResourceRegion() { } /** - * Set the targetResourceRegion property: the region of the target resource(s) on which the alert is + * Set the targetResourceRegion property: The region of the target resource(s) on which the alert is * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @param targetResourceRegion the targetResourceRegion value to set. @@ -266,7 +286,7 @@ public MetricAlertProperties withTargetResourceRegion(String targetResourceRegio } /** - * Get the criteria property: defines the specific alert criteria information. + * Get the criteria property: Defines the specific alert criteria information. * * @return the criteria value. */ @@ -275,7 +295,7 @@ public MetricAlertCriteria criteria() { } /** - * Set the criteria property: defines the specific alert criteria information. + * Set the criteria property: Defines the specific alert criteria information. * * @param criteria the criteria value to set. * @return the MetricAlertProperties object itself. @@ -286,7 +306,7 @@ public MetricAlertProperties withCriteria(MetricAlertCriteria criteria) { } /** - * Get the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The + * Get the autoMitigate property: The flag that indicates whether the alert should be auto resolved or not. The * default is true. * * @return the autoMitigate value. @@ -296,7 +316,7 @@ public Boolean autoMitigate() { } /** - * Set the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The + * Set the autoMitigate property: The flag that indicates whether the alert should be auto resolved or not. The * default is true. * * @param autoMitigate the autoMitigate value to set. @@ -308,7 +328,29 @@ public MetricAlertProperties withAutoMitigate(Boolean autoMitigate) { } /** - * Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an + * Get the resolveConfiguration property: The configuration for how the alert is resolved. Applicable for + * PromQLCriteria. + * + * @return the resolveConfiguration value. + */ + public ResolveConfiguration resolveConfiguration() { + return this.resolveConfiguration; + } + + /** + * Set the resolveConfiguration property: The configuration for how the alert is resolved. Applicable for + * PromQLCriteria. + * + * @param resolveConfiguration the resolveConfiguration value to set. + * @return the MetricAlertProperties object itself. + */ + public MetricAlertProperties withResolveConfiguration(ResolveConfiguration resolveConfiguration) { + this.resolveConfiguration = resolveConfiguration; + return this; + } + + /** + * Get the actions property: The array of actions that are performed when the alert rule becomes active, and when an * alert condition is resolved. * * @return the actions value. @@ -318,7 +360,7 @@ public List actions() { } /** - * Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an + * Set the actions property: The array of actions that are performed when the alert rule becomes active, and when an * alert condition is resolved. * * @param actions the actions value to set. @@ -339,7 +381,7 @@ public OffsetDateTime lastUpdatedTime() { } /** - * Get the isMigrated property: the value indicating whether this alert rule is migrated. + * Get the isMigrated property: The value indicating whether this alert rule is migrated. * * @return the isMigrated value. */ @@ -347,6 +389,46 @@ public Boolean isMigrated() { return this.isMigrated; } + /** + * Get the customProperties property: The properties of an alert payload. + * + * @return the customProperties value. + */ + public Map customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: The properties of an alert payload. + * + * @param customProperties the customProperties value to set. + * @return the MetricAlertProperties object itself. + */ + public MetricAlertProperties withCustomProperties(Map customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Get the actionProperties property: The properties of an action properties. + * + * @return the actionProperties value. + */ + public Map actionProperties() { + return this.actionProperties; + } + + /** + * Set the actionProperties property: The properties of an action properties. + * + * @param actionProperties the actionProperties value to set. + * @return the MetricAlertProperties object itself. + */ + public MetricAlertProperties withActionProperties(Map actionProperties) { + this.actionProperties = actionProperties; + return this; + } + /** * Validates the instance. * @@ -362,17 +444,15 @@ public void validate() { .log(new IllegalArgumentException( "Missing required property evaluationFrequency in model MetricAlertProperties")); } - if (windowSize() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property windowSize in model MetricAlertProperties")); - } if (criteria() == null) { throw LOGGER.atError() .log(new IllegalArgumentException("Missing required property criteria in model MetricAlertProperties")); } else { criteria().validate(); } + if (resolveConfiguration() != null) { + resolveConfiguration().validate(); + } if (actions() != null) { actions().forEach(e -> e.validate()); } @@ -391,13 +471,18 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("evaluationFrequency", CoreUtils.durationToStringWithDays(this.evaluationFrequency)); - jsonWriter.writeStringField("windowSize", CoreUtils.durationToStringWithDays(this.windowSize)); jsonWriter.writeJsonField("criteria", this.criteria); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("windowSize", CoreUtils.durationToStringWithDays(this.windowSize)); jsonWriter.writeStringField("targetResourceType", this.targetResourceType); jsonWriter.writeStringField("targetResourceRegion", this.targetResourceRegion); jsonWriter.writeBooleanField("autoMitigate", this.autoMitigate); + jsonWriter.writeJsonField("resolveConfiguration", this.resolveConfiguration); jsonWriter.writeArrayField("actions", this.actions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("customProperties", this.customProperties, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("actionProperties", this.actionProperties, + (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -427,19 +512,21 @@ public static MetricAlertProperties fromJson(JsonReader jsonReader) throws IOExc } else if ("evaluationFrequency".equals(fieldName)) { deserializedMetricAlertProperties.evaluationFrequency = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("windowSize".equals(fieldName)) { - deserializedMetricAlertProperties.windowSize - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); } else if ("criteria".equals(fieldName)) { deserializedMetricAlertProperties.criteria = MetricAlertCriteria.fromJson(reader); } else if ("description".equals(fieldName)) { deserializedMetricAlertProperties.description = reader.getString(); + } else if ("windowSize".equals(fieldName)) { + deserializedMetricAlertProperties.windowSize + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); } else if ("targetResourceType".equals(fieldName)) { deserializedMetricAlertProperties.targetResourceType = reader.getString(); } else if ("targetResourceRegion".equals(fieldName)) { deserializedMetricAlertProperties.targetResourceRegion = reader.getString(); } else if ("autoMitigate".equals(fieldName)) { deserializedMetricAlertProperties.autoMitigate = reader.getNullable(JsonReader::getBoolean); + } else if ("resolveConfiguration".equals(fieldName)) { + deserializedMetricAlertProperties.resolveConfiguration = ResolveConfiguration.fromJson(reader); } else if ("actions".equals(fieldName)) { List actions = reader.readArray(reader1 -> MetricAlertAction.fromJson(reader1)); deserializedMetricAlertProperties.actions = actions; @@ -448,6 +535,12 @@ public static MetricAlertProperties fromJson(JsonReader jsonReader) throws IOExc .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("isMigrated".equals(fieldName)) { deserializedMetricAlertProperties.isMigrated = reader.getNullable(JsonReader::getBoolean); + } else if ("customProperties".equals(fieldName)) { + Map customProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedMetricAlertProperties.customProperties = customProperties; + } else if ("actionProperties".equals(fieldName)) { + Map actionProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedMetricAlertProperties.actionProperties = actionProperties; } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertPropertiesPatch.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertPropertiesPatch.java index bef7636420de..c89009f6f184 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertPropertiesPatch.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertPropertiesPatch.java @@ -12,10 +12,12 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.monitor.models.MetricAlertAction; import com.azure.resourcemanager.monitor.models.MetricAlertCriteria; +import com.azure.resourcemanager.monitor.models.ResolveConfiguration; import java.io.IOException; import java.time.Duration; import java.time.OffsetDateTime; import java.util.List; +import java.util.Map; /** * An alert rule properties for patch. @@ -23,7 +25,7 @@ @Fluent public final class MetricAlertPropertiesPatch implements JsonSerializable { /* - * the description of the metric alert that will be included in the alert email. + * The description of the metric alert that will be included in the alert email. */ private String description; @@ -33,49 +35,54 @@ public final class MetricAlertPropertiesPatch implements JsonSerializable scopes; /* - * how often the metric alert is evaluated represented in ISO 8601 duration format. + * How often the metric alert is evaluated represented in ISO 8601 duration format. */ private Duration evaluationFrequency; /* - * the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. + * The period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. */ private Duration windowSize; /* - * the resource type of the target resource(s) on which the alert is created/updated. Mandatory for + * The resource type of the target resource(s) on which the alert is created/updated. Mandatory for * MultipleResourceMultipleMetricCriteria. */ private String targetResourceType; /* - * the region of the target resource(s) on which the alert is created/updated. Mandatory for + * The region of the target resource(s) on which the alert is created/updated. Mandatory for * MultipleResourceMultipleMetricCriteria. */ private String targetResourceRegion; /* - * defines the specific alert criteria information. + * Defines the specific alert criteria information. */ private MetricAlertCriteria criteria; /* - * the flag that indicates whether the alert should be auto resolved or not. The default is true. + * The flag that indicates whether the alert should be auto resolved or not. The default is true. */ private Boolean autoMitigate; /* - * the array of actions that are performed when the alert rule becomes active, and when an alert condition is + * The configuration for how the alert is resolved. Applicable for PromQLCriteria. + */ + private ResolveConfiguration resolveConfiguration; + + /* + * The array of actions that are performed when the alert rule becomes active, and when an alert condition is * resolved. */ private List actions; @@ -86,10 +93,20 @@ public final class MetricAlertPropertiesPatch implements JsonSerializable customProperties; + + /* + * The properties of an action properties. + */ + private Map actionProperties; + /** * Creates an instance of MetricAlertPropertiesPatch class. */ @@ -97,7 +114,7 @@ public MetricAlertPropertiesPatch() { } /** - * Get the description property: the description of the metric alert that will be included in the alert email. + * Get the description property: The description of the metric alert that will be included in the alert email. * * @return the description value. */ @@ -106,7 +123,7 @@ public String description() { } /** - * Set the description property: the description of the metric alert that will be included in the alert email. + * Set the description property: The description of the metric alert that will be included in the alert email. * * @param description the description value to set. * @return the MetricAlertPropertiesPatch object itself. @@ -137,7 +154,7 @@ public MetricAlertPropertiesPatch withSeverity(Integer severity) { } /** - * Get the enabled property: the flag that indicates whether the metric alert is enabled. + * Get the enabled property: The flag that indicates whether the metric alert is enabled. * * @return the enabled value. */ @@ -146,7 +163,7 @@ public Boolean enabled() { } /** - * Set the enabled property: the flag that indicates whether the metric alert is enabled. + * Set the enabled property: The flag that indicates whether the metric alert is enabled. * * @param enabled the enabled value to set. * @return the MetricAlertPropertiesPatch object itself. @@ -157,7 +174,7 @@ public MetricAlertPropertiesPatch withEnabled(Boolean enabled) { } /** - * Get the scopes property: the list of resource id's that this metric alert is scoped to. + * Get the scopes property: The list of resource id's that this metric alert is scoped to. * * @return the scopes value. */ @@ -166,7 +183,7 @@ public List scopes() { } /** - * Set the scopes property: the list of resource id's that this metric alert is scoped to. + * Set the scopes property: The list of resource id's that this metric alert is scoped to. * * @param scopes the scopes value to set. * @return the MetricAlertPropertiesPatch object itself. @@ -177,7 +194,7 @@ public MetricAlertPropertiesPatch withScopes(List scopes) { } /** - * Get the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration + * Get the evaluationFrequency property: How often the metric alert is evaluated represented in ISO 8601 duration * format. * * @return the evaluationFrequency value. @@ -187,7 +204,7 @@ public Duration evaluationFrequency() { } /** - * Set the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration + * Set the evaluationFrequency property: How often the metric alert is evaluated represented in ISO 8601 duration * format. * * @param evaluationFrequency the evaluationFrequency value to set. @@ -199,7 +216,7 @@ public MetricAlertPropertiesPatch withEvaluationFrequency(Duration evaluationFre } /** - * Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert + * Get the windowSize property: The period of time (in ISO 8601 duration format) that is used to monitor alert * activity based on the threshold. * * @return the windowSize value. @@ -209,7 +226,7 @@ public Duration windowSize() { } /** - * Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert + * Set the windowSize property: The period of time (in ISO 8601 duration format) that is used to monitor alert * activity based on the threshold. * * @param windowSize the windowSize value to set. @@ -221,7 +238,7 @@ public MetricAlertPropertiesPatch withWindowSize(Duration windowSize) { } /** - * Get the targetResourceType property: the resource type of the target resource(s) on which the alert is + * Get the targetResourceType property: The resource type of the target resource(s) on which the alert is * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. * * @return the targetResourceType value. @@ -231,7 +248,7 @@ public String targetResourceType() { } /** - * Set the targetResourceType property: the resource type of the target resource(s) on which the alert is + * Set the targetResourceType property: The resource type of the target resource(s) on which the alert is * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. * * @param targetResourceType the targetResourceType value to set. @@ -243,7 +260,7 @@ public MetricAlertPropertiesPatch withTargetResourceType(String targetResourceTy } /** - * Get the targetResourceRegion property: the region of the target resource(s) on which the alert is + * Get the targetResourceRegion property: The region of the target resource(s) on which the alert is * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. * * @return the targetResourceRegion value. @@ -253,7 +270,7 @@ public String targetResourceRegion() { } /** - * Set the targetResourceRegion property: the region of the target resource(s) on which the alert is + * Set the targetResourceRegion property: The region of the target resource(s) on which the alert is * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. * * @param targetResourceRegion the targetResourceRegion value to set. @@ -265,7 +282,7 @@ public MetricAlertPropertiesPatch withTargetResourceRegion(String targetResource } /** - * Get the criteria property: defines the specific alert criteria information. + * Get the criteria property: Defines the specific alert criteria information. * * @return the criteria value. */ @@ -274,7 +291,7 @@ public MetricAlertCriteria criteria() { } /** - * Set the criteria property: defines the specific alert criteria information. + * Set the criteria property: Defines the specific alert criteria information. * * @param criteria the criteria value to set. * @return the MetricAlertPropertiesPatch object itself. @@ -285,7 +302,7 @@ public MetricAlertPropertiesPatch withCriteria(MetricAlertCriteria criteria) { } /** - * Get the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The + * Get the autoMitigate property: The flag that indicates whether the alert should be auto resolved or not. The * default is true. * * @return the autoMitigate value. @@ -295,7 +312,7 @@ public Boolean autoMitigate() { } /** - * Set the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The + * Set the autoMitigate property: The flag that indicates whether the alert should be auto resolved or not. The * default is true. * * @param autoMitigate the autoMitigate value to set. @@ -307,7 +324,29 @@ public MetricAlertPropertiesPatch withAutoMitigate(Boolean autoMitigate) { } /** - * Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an + * Get the resolveConfiguration property: The configuration for how the alert is resolved. Applicable for + * PromQLCriteria. + * + * @return the resolveConfiguration value. + */ + public ResolveConfiguration resolveConfiguration() { + return this.resolveConfiguration; + } + + /** + * Set the resolveConfiguration property: The configuration for how the alert is resolved. Applicable for + * PromQLCriteria. + * + * @param resolveConfiguration the resolveConfiguration value to set. + * @return the MetricAlertPropertiesPatch object itself. + */ + public MetricAlertPropertiesPatch withResolveConfiguration(ResolveConfiguration resolveConfiguration) { + this.resolveConfiguration = resolveConfiguration; + return this; + } + + /** + * Get the actions property: The array of actions that are performed when the alert rule becomes active, and when an * alert condition is resolved. * * @return the actions value. @@ -317,7 +356,7 @@ public List actions() { } /** - * Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an + * Set the actions property: The array of actions that are performed when the alert rule becomes active, and when an * alert condition is resolved. * * @param actions the actions value to set. @@ -338,7 +377,7 @@ public OffsetDateTime lastUpdatedTime() { } /** - * Get the isMigrated property: the value indicating whether this alert rule is migrated. + * Get the isMigrated property: The value indicating whether this alert rule is migrated. * * @return the isMigrated value. */ @@ -346,6 +385,46 @@ public Boolean isMigrated() { return this.isMigrated; } + /** + * Get the customProperties property: The properties of an alert payload. + * + * @return the customProperties value. + */ + public Map customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: The properties of an alert payload. + * + * @param customProperties the customProperties value to set. + * @return the MetricAlertPropertiesPatch object itself. + */ + public MetricAlertPropertiesPatch withCustomProperties(Map customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Get the actionProperties property: The properties of an action properties. + * + * @return the actionProperties value. + */ + public Map actionProperties() { + return this.actionProperties; + } + + /** + * Set the actionProperties property: The properties of an action properties. + * + * @param actionProperties the actionProperties value to set. + * @return the MetricAlertPropertiesPatch object itself. + */ + public MetricAlertPropertiesPatch withActionProperties(Map actionProperties) { + this.actionProperties = actionProperties; + return this; + } + /** * Validates the instance. * @@ -355,6 +434,9 @@ public void validate() { if (criteria() != null) { criteria().validate(); } + if (resolveConfiguration() != null) { + resolveConfiguration().validate(); + } if (actions() != null) { actions().forEach(e -> e.validate()); } @@ -377,7 +459,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("targetResourceRegion", this.targetResourceRegion); jsonWriter.writeJsonField("criteria", this.criteria); jsonWriter.writeBooleanField("autoMitigate", this.autoMitigate); + jsonWriter.writeJsonField("resolveConfiguration", this.resolveConfiguration); jsonWriter.writeArrayField("actions", this.actions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("customProperties", this.customProperties, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("actionProperties", this.actionProperties, + (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -419,6 +506,8 @@ public static MetricAlertPropertiesPatch fromJson(JsonReader jsonReader) throws deserializedMetricAlertPropertiesPatch.criteria = MetricAlertCriteria.fromJson(reader); } else if ("autoMitigate".equals(fieldName)) { deserializedMetricAlertPropertiesPatch.autoMitigate = reader.getNullable(JsonReader::getBoolean); + } else if ("resolveConfiguration".equals(fieldName)) { + deserializedMetricAlertPropertiesPatch.resolveConfiguration = ResolveConfiguration.fromJson(reader); } else if ("actions".equals(fieldName)) { List actions = reader.readArray(reader1 -> MetricAlertAction.fromJson(reader1)); deserializedMetricAlertPropertiesPatch.actions = actions; @@ -427,6 +516,12 @@ public static MetricAlertPropertiesPatch fromJson(JsonReader jsonReader) throws .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("isMigrated".equals(fieldName)) { deserializedMetricAlertPropertiesPatch.isMigrated = reader.getNullable(JsonReader::getBoolean); + } else if ("customProperties".equals(fieldName)) { + Map customProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedMetricAlertPropertiesPatch.customProperties = customProperties; + } else if ("actionProperties".equals(fieldName)) { + Map actionProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedMetricAlertPropertiesPatch.actionProperties = actionProperties; } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java index 7dce6f0da9bd..e37f8cfc407b 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java @@ -10,8 +10,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.monitor.models.Identity; import com.azure.resourcemanager.monitor.models.MetricAlertAction; import com.azure.resourcemanager.monitor.models.MetricAlertCriteria; +import com.azure.resourcemanager.monitor.models.ResolveConfiguration; import java.io.IOException; import java.time.Duration; import java.time.OffsetDateTime; @@ -29,9 +31,14 @@ public final class MetricAlertResourceInner extends Resource { private MetricAlertProperties innerProperties = new MetricAlertProperties(); /* - * Fully qualified resource Id for the resource. + * The identity of the resource. */ - private String id; + private Identity identity; + + /* + * The type of the resource. + */ + private String type; /* * The name of the resource. @@ -39,9 +46,9 @@ public final class MetricAlertResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of MetricAlertResourceInner class. @@ -59,13 +66,33 @@ private MetricAlertProperties innerProperties() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the identity property: The identity of the resource. * - * @return the id value. + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -79,13 +106,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -107,7 +134,7 @@ public MetricAlertResourceInner withTags(Map tags) { } /** - * Get the description property: the description of the metric alert that will be included in the alert email. + * Get the description property: The description of the metric alert that will be included in the alert email. * * @return the description value. */ @@ -116,7 +143,7 @@ public String description() { } /** - * Set the description property: the description of the metric alert that will be included in the alert email. + * Set the description property: The description of the metric alert that will be included in the alert email. * * @param description the description value to set. * @return the MetricAlertResourceInner object itself. @@ -153,7 +180,7 @@ public MetricAlertResourceInner withSeverity(int severity) { } /** - * Get the enabled property: the flag that indicates whether the metric alert is enabled. + * Get the enabled property: The flag that indicates whether the metric alert is enabled. * * @return the enabled value. */ @@ -162,7 +189,7 @@ public boolean enabled() { } /** - * Set the enabled property: the flag that indicates whether the metric alert is enabled. + * Set the enabled property: The flag that indicates whether the metric alert is enabled. * * @param enabled the enabled value to set. * @return the MetricAlertResourceInner object itself. @@ -176,7 +203,8 @@ public MetricAlertResourceInner withEnabled(boolean enabled) { } /** - * Get the scopes property: the list of resource id's that this metric alert is scoped to. + * Get the scopes property: The list of resource id's that this metric alert is scoped to. You cannot change the + * scope of a metric rule based on logs. * * @return the scopes value. */ @@ -185,7 +213,8 @@ public List scopes() { } /** - * Set the scopes property: the list of resource id's that this metric alert is scoped to. + * Set the scopes property: The list of resource id's that this metric alert is scoped to. You cannot change the + * scope of a metric rule based on logs. * * @param scopes the scopes value to set. * @return the MetricAlertResourceInner object itself. @@ -199,7 +228,7 @@ public MetricAlertResourceInner withScopes(List scopes) { } /** - * Get the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration + * Get the evaluationFrequency property: How often the metric alert is evaluated represented in ISO 8601 duration * format. * * @return the evaluationFrequency value. @@ -209,7 +238,7 @@ public Duration evaluationFrequency() { } /** - * Set the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration + * Set the evaluationFrequency property: How often the metric alert is evaluated represented in ISO 8601 duration * format. * * @param evaluationFrequency the evaluationFrequency value to set. @@ -224,7 +253,7 @@ public MetricAlertResourceInner withEvaluationFrequency(Duration evaluationFrequ } /** - * Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert + * Get the windowSize property: The period of time (in ISO 8601 duration format) that is used to monitor alert * activity based on the threshold. * * @return the windowSize value. @@ -234,7 +263,7 @@ public Duration windowSize() { } /** - * Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert + * Set the windowSize property: The period of time (in ISO 8601 duration format) that is used to monitor alert * activity based on the threshold. * * @param windowSize the windowSize value to set. @@ -249,7 +278,7 @@ public MetricAlertResourceInner withWindowSize(Duration windowSize) { } /** - * Get the targetResourceType property: the resource type of the target resource(s) on which the alert is + * Get the targetResourceType property: The resource type of the target resource(s) on which the alert is * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @return the targetResourceType value. @@ -259,7 +288,7 @@ public String targetResourceType() { } /** - * Set the targetResourceType property: the resource type of the target resource(s) on which the alert is + * Set the targetResourceType property: The resource type of the target resource(s) on which the alert is * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @param targetResourceType the targetResourceType value to set. @@ -274,7 +303,7 @@ public MetricAlertResourceInner withTargetResourceType(String targetResourceType } /** - * Get the targetResourceRegion property: the region of the target resource(s) on which the alert is + * Get the targetResourceRegion property: The region of the target resource(s) on which the alert is * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @return the targetResourceRegion value. @@ -284,7 +313,7 @@ public String targetResourceRegion() { } /** - * Set the targetResourceRegion property: the region of the target resource(s) on which the alert is + * Set the targetResourceRegion property: The region of the target resource(s) on which the alert is * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @param targetResourceRegion the targetResourceRegion value to set. @@ -299,7 +328,7 @@ public MetricAlertResourceInner withTargetResourceRegion(String targetResourceRe } /** - * Get the criteria property: defines the specific alert criteria information. + * Get the criteria property: Defines the specific alert criteria information. * * @return the criteria value. */ @@ -308,7 +337,7 @@ public MetricAlertCriteria criteria() { } /** - * Set the criteria property: defines the specific alert criteria information. + * Set the criteria property: Defines the specific alert criteria information. * * @param criteria the criteria value to set. * @return the MetricAlertResourceInner object itself. @@ -322,7 +351,7 @@ public MetricAlertResourceInner withCriteria(MetricAlertCriteria criteria) { } /** - * Get the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The + * Get the autoMitigate property: The flag that indicates whether the alert should be auto resolved or not. The * default is true. * * @return the autoMitigate value. @@ -332,7 +361,7 @@ public Boolean autoMitigate() { } /** - * Set the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The + * Set the autoMitigate property: The flag that indicates whether the alert should be auto resolved or not. The * default is true. * * @param autoMitigate the autoMitigate value to set. @@ -347,7 +376,32 @@ public MetricAlertResourceInner withAutoMitigate(Boolean autoMitigate) { } /** - * Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an + * Get the resolveConfiguration property: The configuration for how the alert is resolved. Applicable for + * PromQLCriteria. + * + * @return the resolveConfiguration value. + */ + public ResolveConfiguration resolveConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().resolveConfiguration(); + } + + /** + * Set the resolveConfiguration property: The configuration for how the alert is resolved. Applicable for + * PromQLCriteria. + * + * @param resolveConfiguration the resolveConfiguration value to set. + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withResolveConfiguration(ResolveConfiguration resolveConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new MetricAlertProperties(); + } + this.innerProperties().withResolveConfiguration(resolveConfiguration); + return this; + } + + /** + * Get the actions property: The array of actions that are performed when the alert rule becomes active, and when an * alert condition is resolved. * * @return the actions value. @@ -357,7 +411,7 @@ public List actions() { } /** - * Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an + * Set the actions property: The array of actions that are performed when the alert rule becomes active, and when an * alert condition is resolved. * * @param actions the actions value to set. @@ -381,7 +435,7 @@ public OffsetDateTime lastUpdatedTime() { } /** - * Get the isMigrated property: the value indicating whether this alert rule is migrated. + * Get the isMigrated property: The value indicating whether this alert rule is migrated. * * @return the isMigrated value. */ @@ -389,6 +443,52 @@ public Boolean isMigrated() { return this.innerProperties() == null ? null : this.innerProperties().isMigrated(); } + /** + * Get the customProperties property: The properties of an alert payload. + * + * @return the customProperties value. + */ + public Map customProperties() { + return this.innerProperties() == null ? null : this.innerProperties().customProperties(); + } + + /** + * Set the customProperties property: The properties of an alert payload. + * + * @param customProperties the customProperties value to set. + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withCustomProperties(Map customProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new MetricAlertProperties(); + } + this.innerProperties().withCustomProperties(customProperties); + return this; + } + + /** + * Get the actionProperties property: The properties of an action properties. + * + * @return the actionProperties value. + */ + public Map actionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().actionProperties(); + } + + /** + * Set the actionProperties property: The properties of an action properties. + * + * @param actionProperties the actionProperties value to set. + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withActionProperties(Map actionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new MetricAlertProperties(); + } + this.innerProperties().withActionProperties(actionProperties); + return this; + } + /** * Validates the instance. * @@ -402,6 +502,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(MetricAlertResourceInner.class); @@ -415,6 +518,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -447,6 +551,8 @@ public static MetricAlertResourceInner fromJson(JsonReader jsonReader) throws IO deserializedMetricAlertResourceInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedMetricAlertResourceInner.innerProperties = MetricAlertProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedMetricAlertResourceInner.identity = Identity.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertStatusCollectionInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertStatusCollectionInner.java index e8159a8a8e28..ea17ea7cb202 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertStatusCollectionInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertStatusCollectionInner.java @@ -19,7 +19,7 @@ @Fluent public final class MetricAlertStatusCollectionInner implements JsonSerializable { /* - * the values for the alert rule resources. + * The values for the alert rule resources. */ private List value; @@ -30,7 +30,7 @@ public MetricAlertStatusCollectionInner() { } /** - * Get the value property: the values for the alert rule resources. + * Get the value property: The values for the alert rule resources. * * @return the value value. */ @@ -39,7 +39,7 @@ public List value() { } /** - * Set the value property: the values for the alert rule resources. + * Set the value property: The values for the alert rule resources. * * @param value the value value to set. * @return the MetricAlertStatusCollectionInner object itself. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java index a73940b15df5..c2feb8ad8743 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java @@ -57,7 +57,7 @@ public final class MetricDefinitionInner implements JsonSerializable writer.writeString(element)); jsonWriter.writeStringField("evaluationFrequency", @@ -525,6 +556,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.checkWorkspaceAlertsStorageConfigured); jsonWriter.writeBooleanField("skipQueryValidation", this.skipQueryValidation); jsonWriter.writeBooleanField("autoMitigate", this.autoMitigate); + jsonWriter.writeJsonField("resolveConfiguration", this.resolveConfiguration); return jsonWriter.writeEndObject(); } @@ -553,7 +585,7 @@ public static ScheduledQueryRuleProperties fromJson(JsonReader jsonReader) throw } else if ("displayName".equals(fieldName)) { deserializedScheduledQueryRuleProperties.displayName = reader.getString(); } else if ("severity".equals(fieldName)) { - deserializedScheduledQueryRuleProperties.severity = AlertSeverity.fromLong(reader.getLong()); + deserializedScheduledQueryRuleProperties.severity = AlertSeverity.fromValue(reader.getLong()); } else if ("enabled".equals(fieldName)) { deserializedScheduledQueryRuleProperties.enabled = reader.getNullable(JsonReader::getBoolean); } else if ("scopes".equals(fieldName)) { @@ -589,6 +621,9 @@ public static ScheduledQueryRuleProperties fromJson(JsonReader jsonReader) throw = reader.getNullable(JsonReader::getBoolean); } else if ("autoMitigate".equals(fieldName)) { deserializedScheduledQueryRuleProperties.autoMitigate = reader.getNullable(JsonReader::getBoolean); + } else if ("resolveConfiguration".equals(fieldName)) { + deserializedScheduledQueryRuleProperties.resolveConfiguration + = RuleResolveConfiguration.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScheduledQueryRuleResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScheduledQueryRuleResourceInner.java index 951600c17ad1..8b0c2ac32240 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScheduledQueryRuleResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScheduledQueryRuleResourceInner.java @@ -13,7 +13,9 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.monitor.models.Actions; import com.azure.resourcemanager.monitor.models.AlertSeverity; +import com.azure.resourcemanager.monitor.models.Identity; import com.azure.resourcemanager.monitor.models.Kind; +import com.azure.resourcemanager.monitor.models.RuleResolveConfiguration; import com.azure.resourcemanager.monitor.models.ScheduledQueryRuleCriteria; import java.io.IOException; import java.time.Duration; @@ -25,6 +27,11 @@ */ @Fluent public final class ScheduledQueryRuleResourceInner extends Resource { + /* + * The identity of the resource. + */ + private Identity identity; + /* * Indicates the type of scheduled query rule. The default is LogAlert. */ @@ -49,9 +56,9 @@ public final class ScheduledQueryRuleResourceInner extends Resource { private ScheduledQueryRuleProperties innerProperties = new ScheduledQueryRuleProperties(); /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -59,9 +66,9 @@ public final class ScheduledQueryRuleResourceInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ScheduledQueryRuleResourceInner class. @@ -69,6 +76,26 @@ public final class ScheduledQueryRuleResourceInner extends Resource { public ScheduledQueryRuleResourceInner() { } + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the ScheduledQueryRuleResourceInner object itself. + */ + public ScheduledQueryRuleResourceInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + /** * Get the kind property: Indicates the type of scheduled query rule. The default is LogAlert. * @@ -120,13 +147,13 @@ private ScheduledQueryRuleProperties innerProperties() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -140,13 +167,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -567,12 +594,40 @@ public ScheduledQueryRuleResourceInner withAutoMitigate(Boolean autoMitigate) { return this; } + /** + * Get the resolveConfiguration property: Defines the configuration for resolving fired alerts. Relevant only for + * rules of the kind LogAlert. + * + * @return the resolveConfiguration value. + */ + public RuleResolveConfiguration resolveConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().resolveConfiguration(); + } + + /** + * Set the resolveConfiguration property: Defines the configuration for resolving fired alerts. Relevant only for + * rules of the kind LogAlert. + * + * @param resolveConfiguration the resolveConfiguration value to set. + * @return the ScheduledQueryRuleResourceInner object itself. + */ + public ScheduledQueryRuleResourceInner withResolveConfiguration(RuleResolveConfiguration resolveConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledQueryRuleProperties(); + } + this.innerProperties().withResolveConfiguration(resolveConfiguration); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } if (innerProperties() == null) { throw LOGGER.atError() .log(new IllegalArgumentException( @@ -593,6 +648,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); } @@ -628,6 +684,8 @@ public static ScheduledQueryRuleResourceInner fromJson(JsonReader jsonReader) th } else if ("properties".equals(fieldName)) { deserializedScheduledQueryRuleResourceInner.innerProperties = ScheduledQueryRuleProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedScheduledQueryRuleResourceInner.identity = Identity.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedScheduledQueryRuleResourceInner.kind = Kind.fromString(reader.getString()); } else if ("etag".equals(fieldName)) { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java index bfcd8b48a884..0ddb8770e8d2 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java @@ -28,9 +28,9 @@ public final class ScopedResourceInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -38,9 +38,9 @@ public final class ScopedResourceInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ScopedResourceInner class. @@ -67,13 +67,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -87,13 +87,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SubscriptionScopeMetricDefinitionInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SubscriptionScopeMetricDefinitionInner.java new file mode 100644 index 000000000000..f2887a241b82 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SubscriptionScopeMetricDefinitionInner.java @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.monitor.models.MetricAggregationType; +import com.azure.resourcemanager.monitor.models.MetricAvailability; +import com.azure.resourcemanager.monitor.models.MetricClass; +import com.azure.resourcemanager.monitor.models.Unit; +import java.io.IOException; +import java.util.List; + +/** + * Metric definition class specifies the metadata for a metric. + */ +@Fluent +public final class SubscriptionScopeMetricDefinitionInner + implements JsonSerializable { + /* + * Flag to indicate whether the dimension is required. + */ + private Boolean isDimensionRequired; + + /* + * the resource identifier of the resource that emitted the metric. + */ + private String resourceId; + + /* + * the namespace the metric belongs to. + */ + private String namespace; + + /* + * the name and the display name of the metric, i.e. it is a localizable string. + */ + private LocalizableStringInner name; + + /* + * Detailed description of this metric. + */ + private String displayDescription; + + /* + * Custom category name for this metric. + */ + private String category; + + /* + * The class of the metric. + */ + private MetricClass metricClass; + + /* + * the unit of the metric. + */ + private Unit unit; + + /* + * the primary aggregation type value defining how to use the values for display. + */ + private MetricAggregationType primaryAggregationType; + + /* + * the collection of what aggregation types are supported. + */ + private List supportedAggregationTypes; + + /* + * the collection of what aggregation intervals are available to be queried. + */ + private List metricAvailabilities; + + /* + * the resource identifier of the metric definition. + */ + private String id; + + /* + * the name and the display name of the dimension, i.e. it is a localizable string. + */ + private List dimensions; + + /** + * Creates an instance of SubscriptionScopeMetricDefinitionInner class. + */ + public SubscriptionScopeMetricDefinitionInner() { + } + + /** + * Get the isDimensionRequired property: Flag to indicate whether the dimension is required. + * + * @return the isDimensionRequired value. + */ + public Boolean isDimensionRequired() { + return this.isDimensionRequired; + } + + /** + * Set the isDimensionRequired property: Flag to indicate whether the dimension is required. + * + * @param isDimensionRequired the isDimensionRequired value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withIsDimensionRequired(Boolean isDimensionRequired) { + this.isDimensionRequired = isDimensionRequired; + return this; + } + + /** + * Get the resourceId property: the resource identifier of the resource that emitted the metric. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: the resource identifier of the resource that emitted the metric. + * + * @param resourceId the resourceId value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the namespace property: the namespace the metric belongs to. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: the namespace the metric belongs to. + * + * @param namespace the namespace value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the name property: the name and the display name of the metric, i.e. it is a localizable string. + * + * @return the name value. + */ + public LocalizableStringInner name() { + return this.name; + } + + /** + * Set the name property: the name and the display name of the metric, i.e. it is a localizable string. + * + * @param name the name value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withName(LocalizableStringInner name) { + this.name = name; + return this; + } + + /** + * Get the displayDescription property: Detailed description of this metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Detailed description of this metric. + * + * @param displayDescription the displayDescription value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the category property: Custom category name for this metric. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: Custom category name for this metric. + * + * @param category the category value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the metricClass property: The class of the metric. + * + * @return the metricClass value. + */ + public MetricClass metricClass() { + return this.metricClass; + } + + /** + * Set the metricClass property: The class of the metric. + * + * @param metricClass the metricClass value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withMetricClass(MetricClass metricClass) { + this.metricClass = metricClass; + return this; + } + + /** + * Get the unit property: the unit of the metric. + * + * @return the unit value. + */ + public Unit unit() { + return this.unit; + } + + /** + * Set the unit property: the unit of the metric. + * + * @param unit the unit value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withUnit(Unit unit) { + this.unit = unit; + return this; + } + + /** + * Get the primaryAggregationType property: the primary aggregation type value defining how to use the values for + * display. + * + * @return the primaryAggregationType value. + */ + public MetricAggregationType primaryAggregationType() { + return this.primaryAggregationType; + } + + /** + * Set the primaryAggregationType property: the primary aggregation type value defining how to use the values for + * display. + * + * @param primaryAggregationType the primaryAggregationType value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner + withPrimaryAggregationType(MetricAggregationType primaryAggregationType) { + this.primaryAggregationType = primaryAggregationType; + return this; + } + + /** + * Get the supportedAggregationTypes property: the collection of what aggregation types are supported. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: the collection of what aggregation types are supported. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner + withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get the metricAvailabilities property: the collection of what aggregation intervals are available to be queried. + * + * @return the metricAvailabilities value. + */ + public List metricAvailabilities() { + return this.metricAvailabilities; + } + + /** + * Set the metricAvailabilities property: the collection of what aggregation intervals are available to be queried. + * + * @param metricAvailabilities the metricAvailabilities value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner + withMetricAvailabilities(List metricAvailabilities) { + this.metricAvailabilities = metricAvailabilities; + return this; + } + + /** + * Get the id property: the resource identifier of the metric definition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: the resource identifier of the metric definition. + * + * @param id the id value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the dimensions property: the name and the display name of the dimension, i.e. it is a localizable string. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: the name and the display name of the dimension, i.e. it is a localizable string. + * + * @param dimensions the dimensions value to set. + * @return the SubscriptionScopeMetricDefinitionInner object itself. + */ + public SubscriptionScopeMetricDefinitionInner withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + if (metricAvailabilities() != null) { + metricAvailabilities().forEach(e -> e.validate()); + } + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isDimensionRequired", this.isDimensionRequired); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeJsonField("name", this.name); + jsonWriter.writeStringField("displayDescription", this.displayDescription); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("metricClass", this.metricClass == null ? null : this.metricClass.toString()); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + jsonWriter.writeStringField("primaryAggregationType", + this.primaryAggregationType == null ? null : this.primaryAggregationType.toString()); + jsonWriter.writeArrayField("supportedAggregationTypes", this.supportedAggregationTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("metricAvailabilities", this.metricAvailabilities, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionScopeMetricDefinitionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionScopeMetricDefinitionInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubscriptionScopeMetricDefinitionInner. + */ + public static SubscriptionScopeMetricDefinitionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionScopeMetricDefinitionInner deserializedSubscriptionScopeMetricDefinitionInner + = new SubscriptionScopeMetricDefinitionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isDimensionRequired".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.isDimensionRequired + = reader.getNullable(JsonReader::getBoolean); + } else if ("resourceId".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.resourceId = reader.getString(); + } else if ("namespace".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.namespace = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.name = LocalizableStringInner.fromJson(reader); + } else if ("displayDescription".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.displayDescription = reader.getString(); + } else if ("category".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.category = reader.getString(); + } else if ("metricClass".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.metricClass + = MetricClass.fromString(reader.getString()); + } else if ("unit".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.unit = Unit.fromString(reader.getString()); + } else if ("primaryAggregationType".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.primaryAggregationType + = MetricAggregationType.fromString(reader.getString()); + } else if ("supportedAggregationTypes".equals(fieldName)) { + List supportedAggregationTypes + = reader.readArray(reader1 -> MetricAggregationType.fromString(reader1.getString())); + deserializedSubscriptionScopeMetricDefinitionInner.supportedAggregationTypes + = supportedAggregationTypes; + } else if ("metricAvailabilities".equals(fieldName)) { + List metricAvailabilities + = reader.readArray(reader1 -> MetricAvailability.fromJson(reader1)); + deserializedSubscriptionScopeMetricDefinitionInner.metricAvailabilities = metricAvailabilities; + } else if ("id".equals(fieldName)) { + deserializedSubscriptionScopeMetricDefinitionInner.id = reader.getString(); + } else if ("dimensions".equals(fieldName)) { + List dimensions + = reader.readArray(reader1 -> LocalizableStringInner.fromJson(reader1)); + deserializedSubscriptionScopeMetricDefinitionInner.dimensions = dimensions; + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionScopeMetricDefinitionInner; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SubscriptionScopeMetricInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SubscriptionScopeMetricInner.java new file mode 100644 index 000000000000..696ec3052cbc --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SubscriptionScopeMetricInner.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.monitor.models.TimeSeriesElement; +import com.azure.resourcemanager.monitor.models.Unit; +import java.io.IOException; +import java.util.List; + +/** + * The result data of a query. + */ +@Fluent +public final class SubscriptionScopeMetricInner implements JsonSerializable { + /* + * the metric Id. + */ + private String id; + + /* + * the resource type of the metric resource. + */ + private String type; + + /* + * the name and the display name of the metric, i.e. it is localizable string. + */ + private LocalizableStringInner name; + + /* + * Detailed description of this metric. + */ + private String displayDescription; + + /* + * 'Success' or the error details on query failures for this metric. + */ + private String errorCode; + + /* + * Error message encountered querying this specific metric. + */ + private String errorMessage; + + /* + * The unit of the metric. + */ + private Unit unit; + + /* + * the time series returned when a data query is performed. + */ + private List timeseries; + + /** + * Creates an instance of SubscriptionScopeMetricInner class. + */ + public SubscriptionScopeMetricInner() { + } + + /** + * Get the id property: the metric Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: the metric Id. + * + * @param id the id value to set. + * @return the SubscriptionScopeMetricInner object itself. + */ + public SubscriptionScopeMetricInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: the resource type of the metric resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: the resource type of the metric resource. + * + * @param type the type value to set. + * @return the SubscriptionScopeMetricInner object itself. + */ + public SubscriptionScopeMetricInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: the name and the display name of the metric, i.e. it is localizable string. + * + * @return the name value. + */ + public LocalizableStringInner name() { + return this.name; + } + + /** + * Set the name property: the name and the display name of the metric, i.e. it is localizable string. + * + * @param name the name value to set. + * @return the SubscriptionScopeMetricInner object itself. + */ + public SubscriptionScopeMetricInner withName(LocalizableStringInner name) { + this.name = name; + return this; + } + + /** + * Get the displayDescription property: Detailed description of this metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Detailed description of this metric. + * + * @param displayDescription the displayDescription value to set. + * @return the SubscriptionScopeMetricInner object itself. + */ + public SubscriptionScopeMetricInner withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the errorCode property: 'Success' or the error details on query failures for this metric. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: 'Success' or the error details on query failures for this metric. + * + * @param errorCode the errorCode value to set. + * @return the SubscriptionScopeMetricInner object itself. + */ + public SubscriptionScopeMetricInner withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Error message encountered querying this specific metric. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message encountered querying this specific metric. + * + * @param errorMessage the errorMessage value to set. + * @return the SubscriptionScopeMetricInner object itself. + */ + public SubscriptionScopeMetricInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the unit property: The unit of the metric. + * + * @return the unit value. + */ + public Unit unit() { + return this.unit; + } + + /** + * Set the unit property: The unit of the metric. + * + * @param unit the unit value to set. + * @return the SubscriptionScopeMetricInner object itself. + */ + public SubscriptionScopeMetricInner withUnit(Unit unit) { + this.unit = unit; + return this; + } + + /** + * Get the timeseries property: the time series returned when a data query is performed. + * + * @return the timeseries value. + */ + public List timeseries() { + return this.timeseries; + } + + /** + * Set the timeseries property: the time series returned when a data query is performed. + * + * @param timeseries the timeseries value to set. + * @return the SubscriptionScopeMetricInner object itself. + */ + public SubscriptionScopeMetricInner withTimeseries(List timeseries) { + this.timeseries = timeseries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property id in model SubscriptionScopeMetricInner")); + } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model SubscriptionScopeMetricInner")); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model SubscriptionScopeMetricInner")); + } else { + name().validate(); + } + if (unit() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property unit in model SubscriptionScopeMetricInner")); + } + if (timeseries() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property timeseries in model SubscriptionScopeMetricInner")); + } else { + timeseries().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionScopeMetricInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("name", this.name); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + jsonWriter.writeArrayField("timeseries", this.timeseries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("displayDescription", this.displayDescription); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionScopeMetricInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionScopeMetricInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SubscriptionScopeMetricInner. + */ + public static SubscriptionScopeMetricInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionScopeMetricInner deserializedSubscriptionScopeMetricInner = new SubscriptionScopeMetricInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSubscriptionScopeMetricInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSubscriptionScopeMetricInner.type = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSubscriptionScopeMetricInner.name = LocalizableStringInner.fromJson(reader); + } else if ("unit".equals(fieldName)) { + deserializedSubscriptionScopeMetricInner.unit = Unit.fromString(reader.getString()); + } else if ("timeseries".equals(fieldName)) { + List timeseries + = reader.readArray(reader1 -> TimeSeriesElement.fromJson(reader1)); + deserializedSubscriptionScopeMetricInner.timeseries = timeseries; + } else if ("displayDescription".equals(fieldName)) { + deserializedSubscriptionScopeMetricInner.displayDescription = reader.getString(); + } else if ("errorCode".equals(fieldName)) { + deserializedSubscriptionScopeMetricInner.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedSubscriptionScopeMetricInner.errorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionScopeMetricInner; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SubscriptionScopeMetricResponseInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SubscriptionScopeMetricResponseInner.java new file mode 100644 index 000000000000..76b7d52dd03c --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/SubscriptionScopeMetricResponseInner.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.List; + +/** + * The response to a subscription scope metrics query. + */ +@Fluent +public final class SubscriptionScopeMetricResponseInner + implements JsonSerializable { + /* + * The integer value representing the relative cost of the query. + */ + private Integer cost; + + /* + * The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by + * '/'. This may be adjusted in the future and returned back from what was originally requested. + */ + private String timespan; + + /* + * The interval (window size) for which the metric data was returned in. This may be adjusted in the future and + * returned back from what was originally requested. This is not present if a metadata request was made. + */ + private Duration interval; + + /* + * The namespace of the metrics being queried + */ + private String namespace; + + /* + * The region of the resource being queried for metrics. + */ + private String resourceRegion; + + /* + * the value of the collection. + */ + private List value; + + /** + * Creates an instance of SubscriptionScopeMetricResponseInner class. + */ + public SubscriptionScopeMetricResponseInner() { + } + + /** + * Get the cost property: The integer value representing the relative cost of the query. + * + * @return the cost value. + */ + public Integer cost() { + return this.cost; + } + + /** + * Set the cost property: The integer value representing the relative cost of the query. + * + * @param cost the cost value to set. + * @return the SubscriptionScopeMetricResponseInner object itself. + */ + public SubscriptionScopeMetricResponseInner withCost(Integer cost) { + this.cost = cost; + return this; + } + + /** + * Get the timespan property: The timespan for which the data was retrieved. Its value consists of two datetimes + * concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally + * requested. + * + * @return the timespan value. + */ + public String timespan() { + return this.timespan; + } + + /** + * Set the timespan property: The timespan for which the data was retrieved. Its value consists of two datetimes + * concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally + * requested. + * + * @param timespan the timespan value to set. + * @return the SubscriptionScopeMetricResponseInner object itself. + */ + public SubscriptionScopeMetricResponseInner withTimespan(String timespan) { + this.timespan = timespan; + return this; + } + + /** + * Get the interval property: The interval (window size) for which the metric data was returned in. This may be + * adjusted in the future and returned back from what was originally requested. This is not present if a metadata + * request was made. + * + * @return the interval value. + */ + public Duration interval() { + return this.interval; + } + + /** + * Set the interval property: The interval (window size) for which the metric data was returned in. This may be + * adjusted in the future and returned back from what was originally requested. This is not present if a metadata + * request was made. + * + * @param interval the interval value to set. + * @return the SubscriptionScopeMetricResponseInner object itself. + */ + public SubscriptionScopeMetricResponseInner withInterval(Duration interval) { + this.interval = interval; + return this; + } + + /** + * Get the namespace property: The namespace of the metrics being queried. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the metrics being queried. + * + * @param namespace the namespace value to set. + * @return the SubscriptionScopeMetricResponseInner object itself. + */ + public SubscriptionScopeMetricResponseInner withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the resourceRegion property: The region of the resource being queried for metrics. + * + * @return the resourceRegion value. + */ + public String resourceRegion() { + return this.resourceRegion; + } + + /** + * Set the resourceRegion property: The region of the resource being queried for metrics. + * + * @param resourceRegion the resourceRegion value to set. + * @return the SubscriptionScopeMetricResponseInner object itself. + */ + public SubscriptionScopeMetricResponseInner withResourceRegion(String resourceRegion) { + this.resourceRegion = resourceRegion; + return this; + } + + /** + * Get the value property: the value of the collection. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: the value of the collection. + * + * @param value the value value to set. + * @return the SubscriptionScopeMetricResponseInner object itself. + */ + public SubscriptionScopeMetricResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timespan() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property timespan in model SubscriptionScopeMetricResponseInner")); + } + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SubscriptionScopeMetricResponseInner")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionScopeMetricResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timespan", this.timespan); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("cost", this.cost); + jsonWriter.writeStringField("interval", CoreUtils.durationToStringWithDays(this.interval)); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeStringField("resourceregion", this.resourceRegion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionScopeMetricResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionScopeMetricResponseInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SubscriptionScopeMetricResponseInner. + */ + public static SubscriptionScopeMetricResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionScopeMetricResponseInner deserializedSubscriptionScopeMetricResponseInner + = new SubscriptionScopeMetricResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timespan".equals(fieldName)) { + deserializedSubscriptionScopeMetricResponseInner.timespan = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SubscriptionScopeMetricInner.fromJson(reader1)); + deserializedSubscriptionScopeMetricResponseInner.value = value; + } else if ("cost".equals(fieldName)) { + deserializedSubscriptionScopeMetricResponseInner.cost = reader.getNullable(JsonReader::getInt); + } else if ("interval".equals(fieldName)) { + deserializedSubscriptionScopeMetricResponseInner.interval + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("namespace".equals(fieldName)) { + deserializedSubscriptionScopeMetricResponseInner.namespace = reader.getString(); + } else if ("resourceregion".equals(fieldName)) { + deserializedSubscriptionScopeMetricResponseInner.resourceRegion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionScopeMetricResponseInner; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/VMInsightsOnboardingStatusInner.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/VMInsightsOnboardingStatusInner.java index 3be6fc53be19..7899372b7161 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/VMInsightsOnboardingStatusInner.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/VMInsightsOnboardingStatusInner.java @@ -26,9 +26,9 @@ public final class VMInsightsOnboardingStatusInner extends ProxyResource { private VMInsightsOnboardingStatusProperties innerProperties; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -36,9 +36,9 @@ public final class VMInsightsOnboardingStatusInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of VMInsightsOnboardingStatusInner class. @@ -56,13 +56,13 @@ private VMInsightsOnboardingStatusProperties innerProperties() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -76,13 +76,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java index a85f3dd9d08a..6c8d9761773c 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java @@ -78,7 +78,7 @@ public final class ActionGroupsClientImpl implements InnerSupportsGet listByResourceGroup(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Activity Log Alert rules along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of all Activity Log Alert rules in a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> @@ -964,8 +964,8 @@ public PagedIterable listByResourceGroup(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Activity Log Alert rules along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of all Activity Log Alert rules in a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink, @@ -991,8 +991,8 @@ private Mono> listBySubscriptionIdN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Activity Log Alert rules along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of all Activity Log Alert rules in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1020,8 +1020,8 @@ private Mono> listByResourceGroupNe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Activity Log Alert rules along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of all Activity Log Alert rules in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java index b71a0f3e4d57..005b31eadba5 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java @@ -60,7 +60,7 @@ public final class ActivityLogsClientImpl implements ActivityLogsClient { * REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientActivit") + @ServiceInterface(name = "MonitorClientActivityLogs") public interface ActivityLogsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/eventtypes/management/values") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java index b381408afa42..a8b828164a73 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java @@ -60,7 +60,7 @@ public final class AlertRuleIncidentsClientImpl implements AlertRuleIncidentsCli * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientAlertRu") + @ServiceInterface(name = "MonitorClientAlertRuleIncidents") public interface AlertRuleIncidentsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents/{incidentName}") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java index edc50010fcf7..d30089da6e6a 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java @@ -69,7 +69,7 @@ public final class AlertRulesClientImpl implements InnerSupportsGet> list(@HostParam("$host") String endpoint * @param resourceUri The identifier of the resource. * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace that contains the requested metric names. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. @@ -132,7 +132,7 @@ private Mono> listSinglePageAsync(Strin * @param resourceUri The identifier of the resource. * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace that contains the requested metric names. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. @@ -182,7 +182,7 @@ private Mono> listSinglePageAsync(Strin * @param resourceUri The identifier of the resource. * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace that contains the requested metric names. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. @@ -241,7 +241,7 @@ public PagedFlux listAsync(String resourceUri) { * @param resourceUri The identifier of the resource. * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace that contains the requested metric names. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. @@ -301,7 +301,7 @@ public PagedIterable list(String resourceUri) { * @param resourceUri The identifier of the resource. * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace that contains the requested metric names. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java index 1aef8138bd1c..71eab23f91f3 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java @@ -70,7 +70,7 @@ public final class DataCollectionEndpointsClientImpl implements InnerSupportsGet * to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientDataCol") + @ServiceInterface(name = "MonitorClientDataCollectionEndpoints") public interface DataCollectionEndpointsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints") @@ -173,7 +173,7 @@ Mono> listBySubscriptionNext( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), @@ -208,7 +208,7 @@ Mono> listBySubscriptionNext( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -297,7 +297,7 @@ private Mono> listSinglePageA return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, @@ -326,7 +326,7 @@ private Mono> listSinglePageA return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) @@ -418,7 +418,7 @@ public PagedIterable list(Context context) return Mono.error( new IllegalArgumentException("Parameter dataCollectionEndpointName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext( @@ -458,7 +458,7 @@ private Mono> getByResourceGroupWi return Mono.error( new IllegalArgumentException("Parameter dataCollectionEndpointName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -549,7 +549,7 @@ public Mono> createWithResponseAsy if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -592,7 +592,7 @@ private Mono> createWithResponseAs if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -685,7 +685,7 @@ public Mono> updateWithResponseAsy if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -728,7 +728,7 @@ private Mono> updateWithResponseAs if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -815,7 +815,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono.error( new IllegalArgumentException("Parameter dataCollectionEndpointName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -853,7 +853,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error( new IllegalArgumentException("Parameter dataCollectionEndpointName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -907,6 +907,8 @@ public void delete(String resourceGroupName, String dataCollectionEndpointName) } /** + * Lists all data collection endpoints in the specified resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -935,6 +937,8 @@ public void delete(String resourceGroupName, String dataCollectionEndpointName) } /** + * Lists all data collection endpoints in the specified resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -962,6 +966,8 @@ public void delete(String resourceGroupName, String dataCollectionEndpointName) } /** + * Lists all data collection endpoints in the specified subscription + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -990,6 +996,8 @@ public void delete(String resourceGroupName, String dataCollectionEndpointName) } /** + * Lists all data collection endpoints in the specified subscription + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java index bcdf5480a2ff..83b8c5608667 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java @@ -65,7 +65,7 @@ public final class DataCollectionRuleAssociationsClientImpl * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientDataCol") + @ServiceInterface(name = "MonitorClientDataCollectionRuleAssociations") public interface DataCollectionRuleAssociationsService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations") @@ -83,6 +83,7 @@ Mono> listByR @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dataCollectionRuleName") String dataCollectionRuleName, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -167,7 +168,7 @@ Mono> listByD if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext( @@ -198,7 +199,7 @@ Mono> listByD if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.listByResource(this.client.getEndpoint(), resourceUri, apiVersion, accept, context) @@ -273,14 +274,16 @@ public PagedIterable listBy * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param skipToken (Optional) The continuation token for paginated responses. + * @param top (Optional) The max number of items to return per page. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a pageable list of resources along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByRuleSinglePageAsync(String resourceGroupName, String dataCollectionRuleName) { + private Mono> listByRuleSinglePageAsync( + String resourceGroupName, String dataCollectionRuleName, String skipToken, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -297,11 +300,11 @@ public PagedIterable listBy return Mono.error( new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByRule(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, dataCollectionRuleName, apiVersion, accept, context)) + resourceGroupName, dataCollectionRuleName, skipToken, top, apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -313,6 +316,8 @@ public PagedIterable listBy * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param skipToken (Optional) The continuation token for paginated responses. + * @param top (Optional) The max number of items to return per page. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -320,8 +325,8 @@ public PagedIterable listBy * @return a pageable list of resources along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByRuleSinglePageAsync(String resourceGroupName, String dataCollectionRuleName, Context context) { + private Mono> listByRuleSinglePageAsync( + String resourceGroupName, String dataCollectionRuleName, String skipToken, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -338,16 +343,36 @@ public PagedIterable listBy return Mono.error( new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByRule(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - dataCollectionRuleName, apiVersion, accept, context) + dataCollectionRuleName, skipToken, top, apiVersion, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } + /** + * Lists associations for the specified data collection rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param skipToken (Optional) The continuation token for paginated responses. + * @param top (Optional) The max number of items to return per page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByRuleAsync(String resourceGroupName, + String dataCollectionRuleName, String skipToken, Integer top) { + return new PagedFlux<>( + () -> listByRuleSinglePageAsync(resourceGroupName, dataCollectionRuleName, skipToken, top), + nextLink -> listByRuleNextSinglePageAsync(nextLink)); + } + /** * Lists associations for the specified data collection rule. * @@ -361,7 +386,10 @@ public PagedIterable listBy @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByRuleAsync(String resourceGroupName, String dataCollectionRuleName) { - return new PagedFlux<>(() -> listByRuleSinglePageAsync(resourceGroupName, dataCollectionRuleName), + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByRuleSinglePageAsync(resourceGroupName, dataCollectionRuleName, skipToken, top), nextLink -> listByRuleNextSinglePageAsync(nextLink)); } @@ -370,6 +398,8 @@ public PagedFlux listByRule * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param skipToken (Optional) The continuation token for paginated responses. + * @param top (Optional) The max number of items to return per page. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -378,8 +408,9 @@ public PagedFlux listByRule */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByRuleAsync(String resourceGroupName, - String dataCollectionRuleName, Context context) { - return new PagedFlux<>(() -> listByRuleSinglePageAsync(resourceGroupName, dataCollectionRuleName, context), + String dataCollectionRuleName, String skipToken, Integer top, Context context) { + return new PagedFlux<>( + () -> listByRuleSinglePageAsync(resourceGroupName, dataCollectionRuleName, skipToken, top, context), nextLink -> listByRuleNextSinglePageAsync(nextLink, context)); } @@ -396,7 +427,9 @@ private PagedFlux listByRul @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByRule(String resourceGroupName, String dataCollectionRuleName) { - return new PagedIterable<>(listByRuleAsync(resourceGroupName, dataCollectionRuleName)); + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(listByRuleAsync(resourceGroupName, dataCollectionRuleName, skipToken, top)); } /** @@ -404,6 +437,8 @@ public PagedIterable listBy * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param skipToken (Optional) The continuation token for paginated responses. + * @param top (Optional) The max number of items to return per page. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -412,8 +447,8 @@ public PagedIterable listBy */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByRule(String resourceGroupName, - String dataCollectionRuleName, Context context) { - return new PagedIterable<>(listByRuleAsync(resourceGroupName, dataCollectionRuleName, context)); + String dataCollectionRuleName, String skipToken, Integer top, Context context) { + return new PagedIterable<>(listByRuleAsync(resourceGroupName, dataCollectionRuleName, skipToken, top, context)); } /** @@ -445,7 +480,7 @@ public PagedIterable listBy return Mono.error( new IllegalArgumentException("Parameter dataCollectionEndpointName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByDataCollectionEndpoint(this.client.getEndpoint(), @@ -488,7 +523,7 @@ public PagedIterable listBy return Mono.error( new IllegalArgumentException("Parameter dataCollectionEndpointName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -594,7 +629,7 @@ public Mono> getWi return Mono .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceUri, associationName, apiVersion, @@ -628,7 +663,7 @@ private Mono> getW return Mono .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context); @@ -711,7 +746,7 @@ public Mono> creat if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.create(this.client.getEndpoint(), resourceUri, associationName, apiVersion, @@ -750,7 +785,7 @@ private Mono> crea if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), resourceUri, associationName, apiVersion, body, accept, @@ -832,7 +867,7 @@ public Mono> deleteWithResponseAsync(String resourceUri, String a return Mono .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceUri, associationName, apiVersion, @@ -864,7 +899,7 @@ private Mono> deleteWithResponseAsync(String resourceUri, String return Mono .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context); @@ -916,6 +951,8 @@ public void delete(String resourceUri, String associationName) { } /** + * Lists associations for the specified resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -944,6 +981,8 @@ public void delete(String resourceUri, String associationName) { } /** + * Lists associations for the specified resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -971,6 +1010,8 @@ public void delete(String resourceUri, String associationName) { } /** + * Lists associations for the specified data collection rule. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -999,6 +1040,8 @@ public void delete(String resourceUri, String associationName) { } /** + * Lists associations for the specified data collection rule. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1026,6 +1069,8 @@ public void delete(String resourceUri, String associationName) { } /** + * Lists associations for the specified data collection endpoint. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1054,6 +1099,8 @@ public void delete(String resourceUri, String associationName) { } /** + * Lists associations for the specified data collection endpoint. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java index bfc2f9cb3b17..b8bd5cb6e5e9 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java @@ -69,7 +69,7 @@ public final class DataCollectionRulesClientImpl implements InnerSupportsGet> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dataCollectionRuleName") String dataCollectionRuleName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @QueryParam("deleteAssociations") Boolean deleteAssociations, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -172,7 +173,7 @@ Mono> listBySubscriptionNext( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), @@ -207,7 +208,7 @@ Mono> listBySubscriptionNext( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -296,7 +297,7 @@ private Mono> listSinglePageAsync return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, @@ -325,7 +326,7 @@ private Mono> listSinglePageAsync return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) @@ -417,7 +418,7 @@ public Mono> getByResourceGroupWithRes return Mono.error( new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext( @@ -457,7 +458,7 @@ public Mono> getByResourceGroupWithRes return Mono.error( new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -547,7 +548,7 @@ public Mono> createWithResponseAsync(S if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -590,7 +591,7 @@ private Mono> createWithResponseAsync( if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -682,7 +683,7 @@ public Mono> updateWithResponseAsync(S if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -725,7 +726,7 @@ private Mono> updateWithResponseAsync( if (body != null) { body.validate(); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -788,13 +789,16 @@ public DataCollectionRuleResourceInner update(String resourceGroupName, String d * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param deleteAssociations If set to 'true' then all associations of this data collection rule will also be + * deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionRuleName) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionRuleName, + Boolean deleteAssociations) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -811,11 +815,11 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono.error( new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, dataCollectionRuleName, apiVersion, accept, context)) + resourceGroupName, dataCollectionRuleName, deleteAssociations, apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -824,6 +828,8 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param deleteAssociations If set to 'true' then all associations of this data collection rule will also be + * deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -832,7 +838,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionRuleName, - Context context) { + Boolean deleteAssociations, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -849,11 +855,11 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error( new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); } - final String apiVersion = "2021-09-01-preview"; + final String apiVersion = "2024-03-11"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - dataCollectionRuleName, apiVersion, accept, context); + dataCollectionRuleName, deleteAssociations, apiVersion, accept, context); } /** @@ -868,7 +874,9 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String dataCollectionRuleName) { - return deleteWithResponseAsync(resourceGroupName, dataCollectionRuleName).flatMap(ignored -> Mono.empty()); + final Boolean deleteAssociations = null; + return deleteWithResponseAsync(resourceGroupName, dataCollectionRuleName, deleteAssociations) + .flatMap(ignored -> Mono.empty()); } /** @@ -876,6 +884,8 @@ public Mono deleteAsync(String resourceGroupName, String dataCollectionRul * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dataCollectionRuleName The name of the data collection rule. The name is case insensitive. + * @param deleteAssociations If set to 'true' then all associations of this data collection rule will also be + * deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -883,8 +893,9 @@ public Mono deleteAsync(String resourceGroupName, String dataCollectionRul * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String dataCollectionRuleName, Context context) { - return deleteWithResponseAsync(resourceGroupName, dataCollectionRuleName, context).block(); + public Response deleteWithResponse(String resourceGroupName, String dataCollectionRuleName, + Boolean deleteAssociations, Context context) { + return deleteWithResponseAsync(resourceGroupName, dataCollectionRuleName, deleteAssociations, context).block(); } /** @@ -898,10 +909,13 @@ public Response deleteWithResponse(String resourceGroupName, String dataCo */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String dataCollectionRuleName) { - deleteWithResponse(resourceGroupName, dataCollectionRuleName, Context.NONE); + final Boolean deleteAssociations = null; + deleteWithResponse(resourceGroupName, dataCollectionRuleName, deleteAssociations, Context.NONE); } /** + * Lists all data collection rules in the specified resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -930,6 +944,8 @@ public void delete(String resourceGroupName, String dataCollectionRuleName) { } /** + * Lists all data collection rules in the specified resource group. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -957,6 +973,8 @@ private Mono> listByResourceGroup } /** + * Lists all data collection rules in the specified subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -985,6 +1003,8 @@ private Mono> listByResourceGroup } /** + * Lists all data collection rules in the specified subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java index aad7999b7876..c0be5e8cccd9 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java @@ -60,7 +60,7 @@ public final class DiagnosticSettingsCategoriesClientImpl implements DiagnosticS * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientDiagnos") + @ServiceInterface(name = "MonitorClientDiagnosticSettingsCategories") public interface DiagnosticSettingsCategoriesService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsOperationsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsOperationsClientImpl.java index b2be155872d9..9b2d354851a9 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsOperationsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsOperationsClientImpl.java @@ -65,7 +65,7 @@ public final class DiagnosticSettingsOperationsClientImpl * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientDiagnos") + @ServiceInterface(name = "MonitorClientDiagnosticSettingsOperations") public interface DiagnosticSettingsOperationsService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java index e3507016df0d..7d0769160936 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java @@ -59,7 +59,7 @@ public final class EventCategoriesClientImpl implements EventCategoriesClient { * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientEventCa") + @ServiceInterface(name = "MonitorClientEventCategories") public interface EventCategoriesService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Insights/eventcategories") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java index bac4e4e83558..ffa21abaf94e 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java @@ -65,7 +65,7 @@ public final class LogProfilesClientImpl implements LogProfilesClient { * REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientLogProf") + @ServiceInterface(name = "MonitorClientLogProfiles") public interface LogProfilesService { @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsClientImpl.java index 07d32b2bca13..08b1cdbdde2d 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsClientImpl.java @@ -69,7 +69,7 @@ public final class MetricAlertsClientImpl implements InnerSupportsGet> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, @@ -177,7 +177,7 @@ private Mono> listSinglePageAsync(Contex return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) @@ -261,7 +261,7 @@ private Mono> listByResourceGroupSingleP return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), @@ -297,7 +297,7 @@ private Mono> listByResourceGroupSingleP return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -393,7 +393,7 @@ public Mono> getByResourceGroupWithResponseAs if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), @@ -430,7 +430,7 @@ private Mono> getByResourceGroupWithResponseA if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -519,7 +519,7 @@ public Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -562,7 +562,7 @@ private Mono> createOrUpdateWithResponseAsync } else { parameters.validate(); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -656,7 +656,7 @@ public Mono> updateWithResponseAsync(String r } else { parameters.validate(); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -699,7 +699,7 @@ private Mono> updateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ruleName, @@ -786,7 +786,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -822,7 +822,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ruleName, diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java index 41ca51c3d12a..55eee1adc137 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java @@ -55,7 +55,7 @@ public final class MetricAlertsStatusClientImpl implements MetricAlertsStatusCli * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientMetricA") + @ServiceInterface(name = "MonitorClientMetricAlertsStatus") public interface MetricAlertsStatusService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status") @@ -106,7 +106,7 @@ public Mono> listWithResponseAsync(St if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -144,7 +144,7 @@ private Mono> listWithResponseAsync(S if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ruleName, @@ -231,7 +231,7 @@ public Mono> listByNameWithResponseAs if (statusName == null) { return Mono.error(new IllegalArgumentException("Parameter statusName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByName(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -273,7 +273,7 @@ private Mono> listByNameWithResponseA if (statusName == null) { return Mono.error(new IllegalArgumentException("Parameter statusName is required and cannot be null.")); } - final String apiVersion = "2018-03-01"; + final String apiVersion = "2024-03-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.listByName(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java index 29dacfc49c6c..bdb5251957b1 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java @@ -185,7 +185,7 @@ public Mono executeAsync() { DateTimeFormatter.ISO_INSTANT.format(this.queryStartTime.atZoneSameInstant(ZoneOffset.UTC)), DateTimeFormatter.ISO_INSTANT.format(this.queryEndTime.atZoneSameInstant(ZoneOffset.UTC))), this.interval, this.inner.name().value(), this.aggreagation, this.top, this.orderBy, this.odataFilter, - this.resultType, this.namespaceFilter) + this.resultType, this.namespaceFilter, false, true) .map(Response::getValue) .map(MetricCollectionImpl::new); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java index caa17957bf47..9996118cc89b 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java @@ -27,7 +27,9 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.monitor.fluent.MetricDefinitionsClient; import com.azure.resourcemanager.monitor.fluent.models.MetricDefinitionInner; +import com.azure.resourcemanager.monitor.fluent.models.SubscriptionScopeMetricDefinitionInner; import com.azure.resourcemanager.monitor.models.MetricDefinitionCollection; +import com.azure.resourcemanager.monitor.models.SubscriptionScopeMetricDefinitionCollection; import reactor.core.publisher.Mono; /** @@ -60,8 +62,18 @@ public final class MetricDefinitionsClientImpl implements MetricDefinitionsClien * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientMetricD") + @ServiceInterface(name = "MonitorClientMetricDefinitions") public interface MetricDefinitionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtSubscriptionScope( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @QueryParam("region") String region, + @QueryParam("metricnamespace") String metricnamespace, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.Insights/metricDefinitions") @ExpectedResponses({ 200 }) @@ -72,11 +84,162 @@ Mono> list(@HostParam("$host") String endpo @HeaderParam("Accept") String accept, Context context); } + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAtSubscriptionScopeSinglePageAsync(String region, String metricnamespace) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (region == null) { + return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); + } + final String apiVersion = "2021-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAtSubscriptionScope(this.client.getEndpoint(), + this.client.getSubscriptionId(), apiVersion, region, metricnamespace, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAtSubscriptionScopeSinglePageAsync(String region, String metricnamespace, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (region == null) { + return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); + } + final String apiVersion = "2021-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAtSubscriptionScope(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, region, + metricnamespace, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtSubscriptionScopeAsync(String region, + String metricnamespace) { + return new PagedFlux<>(() -> listAtSubscriptionScopeSinglePageAsync(region, metricnamespace)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtSubscriptionScopeAsync(String region) { + final String metricnamespace = null; + return new PagedFlux<>(() -> listAtSubscriptionScopeSinglePageAsync(region, metricnamespace)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtSubscriptionScopeAsync(String region, + String metricnamespace, Context context) { + return new PagedFlux<>(() -> listAtSubscriptionScopeSinglePageAsync(region, metricnamespace, context)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtSubscriptionScope(String region) { + final String metricnamespace = null; + return new PagedIterable<>(listAtSubscriptionScopeAsync(region, metricnamespace)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtSubscriptionScope(String region, + String metricnamespace, Context context) { + return new PagedIterable<>(listAtSubscriptionScopeAsync(region, metricnamespace, context)); + } + /** * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -92,7 +255,7 @@ private Mono> listSinglePageAsync(String re if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } - final String apiVersion = "2018-01-01"; + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, metricnamespace, @@ -106,7 +269,7 @@ private Mono> listSinglePageAsync(String re * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -124,7 +287,7 @@ private Mono> listSinglePageAsync(String re if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } - final String apiVersion = "2018-01-01"; + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), resourceUri, apiVersion, metricnamespace, accept, context) @@ -136,7 +299,7 @@ private Mono> listSinglePageAsync(String re * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -166,7 +329,7 @@ public PagedFlux listAsync(String resourceUri) { * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -197,7 +360,7 @@ public PagedIterable list(String resourceUri) { * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java index 98edbe323e75..51ea9e0ee39e 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java @@ -60,7 +60,7 @@ public final class MetricNamespacesClientImpl implements MetricNamespacesClient * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientMetricN") + @ServiceInterface(name = "MonitorClientMetricNamespaces") public interface MetricNamespacesService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/microsoft.insights/metricNamespaces") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java index 4bc0b2609d49..52e25368d7f4 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.monitor.implementation; +import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; @@ -11,6 +12,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -23,7 +25,10 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.monitor.fluent.MetricsClient; import com.azure.resourcemanager.monitor.fluent.models.ResponseInner; +import com.azure.resourcemanager.monitor.fluent.models.SubscriptionScopeMetricResponseInner; +import com.azure.resourcemanager.monitor.models.MetricResultType; import com.azure.resourcemanager.monitor.models.ResultType; +import com.azure.resourcemanager.monitor.models.SubscriptionScopeMetricsRequestBodyParameters; import java.time.Duration; import reactor.core.publisher.Mono; @@ -58,6 +63,39 @@ public final class MetricsClientImpl implements MetricsClient { @Host("{$host}") @ServiceInterface(name = "MonitorClientMetrics") public interface MetricsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtSubscriptionScope( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @QueryParam("region") String region, + @QueryParam("timespan") String timespan, @QueryParam("interval") Duration interval, + @QueryParam("metricnames") String metricnames, @QueryParam("aggregation") String aggregation, + @QueryParam("top") Integer top, @QueryParam("orderby") String orderBy, @QueryParam("$filter") String filter, + @QueryParam("resultType") MetricResultType resultType, + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("AutoAdjustTimegrain") Boolean autoAdjustTimegrain, + @QueryParam("ValidateDimensions") Boolean validateDimensions, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtSubscriptionScopePost( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @QueryParam("region") String region, + @QueryParam("timespan") String timespan, @QueryParam("interval") Duration interval, + @QueryParam("metricnames") String metricnames, @QueryParam("aggregation") String aggregation, + @QueryParam("top") Integer top, @QueryParam("orderby") String orderBy, @QueryParam("$filter") String filter, + @QueryParam("resultType") MetricResultType resultType, + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("AutoAdjustTimegrain") Boolean autoAdjustTimegrain, + @QueryParam("ValidateDimensions") Boolean validateDimensions, + @BodyParam("application/json") SubscriptionScopeMetricsRequestBodyParameters body, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.Insights/metrics") @ExpectedResponses({ 200 }) @@ -68,19 +106,490 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("metricnames") String metricnames, @QueryParam("aggregation") String aggregation, @QueryParam("top") Integer top, @QueryParam("orderby") String orderBy, @QueryParam("$filter") String filter, @QueryParam("resultType") ResultType resultType, @QueryParam("api-version") String apiVersion, - @QueryParam("metricnamespace") String metricnamespace, @HeaderParam("Accept") String accept, + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("AutoAdjustTimegrain") Boolean autoAdjustTimegrain, + @QueryParam("ValidateDimensions") Boolean validateDimensions, @HeaderParam("Accept") String accept, Context context); } /** - * **Lists the metric values for a resource**. + * **Lists the metric data for a subscription**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAtSubscriptionScopeWithResponseAsync(String region, + String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, + String filter, MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, + Boolean validateDimensions) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (region == null) { + return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); + } + final String apiVersion = "2021-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAtSubscriptionScope(this.client.getEndpoint(), + this.client.getSubscriptionId(), apiVersion, region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * **Lists the metric data for a subscription**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtSubscriptionScopeWithResponseAsync(String region, + String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, + String filter, MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, + Boolean validateDimensions, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (region == null) { + return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); + } + final String apiVersion = "2021-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAtSubscriptionScope(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + region, timespan, interval, metricnames, aggregation, top, orderBy, filter, resultType, metricnamespace, + autoAdjustTimegrain, validateDimensions, accept, context); + } + + /** + * **Lists the metric data for a subscription**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAtSubscriptionScopeAsync(String region) { + final String timespan = null; + final Duration interval = null; + final String metricnames = null; + final String aggregation = null; + final Integer top = null; + final String orderBy = null; + final String filter = null; + final MetricResultType resultType = null; + final String metricnamespace = null; + final Boolean autoAdjustTimegrain = null; + final Boolean validateDimensions = null; + return listAtSubscriptionScopeWithResponseAsync(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * **Lists the metric data for a subscription**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAtSubscriptionScopeWithResponse(String region, + String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, + String filter, MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, + Boolean validateDimensions, Context context) { + return listAtSubscriptionScopeWithResponseAsync(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, context).block(); + } + + /** + * **Lists the metric data for a subscription**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubscriptionScopeMetricResponseInner listAtSubscriptionScope(String region) { + final String timespan = null; + final Duration interval = null; + final String metricnames = null; + final String aggregation = null; + final Integer top = null; + final String orderBy = null; + final String filter = null; + final MetricResultType resultType = null; + final String metricnamespace = null; + final Boolean autoAdjustTimegrain = null; + final Boolean validateDimensions = null; + return listAtSubscriptionScopeWithResponse(region, timespan, interval, metricnames, aggregation, top, orderBy, + filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, Context.NONE).getValue(); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param body Parameters serialized in the body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAtSubscriptionScopePostWithResponseAsync( + String region, String timespan, Duration interval, String metricnames, String aggregation, Integer top, + String orderBy, String filter, MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, + Boolean validateDimensions, SubscriptionScopeMetricsRequestBodyParameters body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (region == null) { + return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String apiVersion = "2021-05-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAtSubscriptionScopePost(this.client.getEndpoint(), + this.client.getSubscriptionId(), apiVersion, region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param body Parameters serialized in the body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtSubscriptionScopePostWithResponseAsync( + String region, String timespan, Duration interval, String metricnames, String aggregation, Integer top, + String orderBy, String filter, MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, + Boolean validateDimensions, SubscriptionScopeMetricsRequestBodyParameters body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (region == null) { + return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String apiVersion = "2021-05-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAtSubscriptionScopePost(this.client.getEndpoint(), this.client.getSubscriptionId(), + apiVersion, region, timespan, interval, metricnames, aggregation, top, orderBy, filter, resultType, + metricnamespace, autoAdjustTimegrain, validateDimensions, body, accept, context); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAtSubscriptionScopePostAsync(String region) { + final String timespan = null; + final Duration interval = null; + final String metricnames = null; + final String aggregation = null; + final Integer top = null; + final String orderBy = null; + final String filter = null; + final MetricResultType resultType = null; + final String metricnamespace = null; + final Boolean autoAdjustTimegrain = null; + final Boolean validateDimensions = null; + final SubscriptionScopeMetricsRequestBodyParameters body = null; + return listAtSubscriptionScopePostWithResponseAsync(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * @param top The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param body Parameters serialized in the body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAtSubscriptionScopePostWithResponse(String region, + String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, + String filter, MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, + Boolean validateDimensions, SubscriptionScopeMetricsRequestBodyParameters body, Context context) { + return listAtSubscriptionScopePostWithResponseAsync(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, body, context) + .block(); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). + * + * @param region The region where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a subscription scope metrics query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubscriptionScopeMetricResponseInner listAtSubscriptionScopePost(String region) { + final String timespan = null; + final Duration interval = null; + final String metricnames = null; + final String aggregation = null; + final Integer top = null; + final String orderBy = null; + final String filter = null; + final MetricResultType resultType = null; + final String metricnamespace = null; + final Boolean autoAdjustTimegrain = null; + final Boolean validateDimensions = null; + final SubscriptionScopeMetricsRequestBodyParameters body = null; + return listAtSubscriptionScopePostWithResponse(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, body, Context.NONE) + .getValue(); + } + + /** + * **Lists the metric values for a resource**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). * * @param resourceUri The identifier of the resource. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. * @param aggregation The list of aggregation types (comma separated) to retrieve. * @param top The maximum number of records to retrieve. * Valid only if $filter is specified. @@ -88,19 +597,21 @@ Mono> list(@HostParam("$host") String endpoint, * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -109,7 +620,7 @@ Mono> list(@HostParam("$host") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listWithResponseAsync(String resourceUri, String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, ResultType resultType, - String metricnamespace) { + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -117,24 +628,24 @@ public Mono> listWithResponseAsync(String resourceUri, S if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } - final String apiVersion = "2018-01-01"; + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), resourceUri, timespan, interval, metricnames, - aggregation, top, orderBy, filter, resultType, apiVersion, metricnamespace, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, timespan, interval, + metricnames, aggregation, top, orderBy, filter, resultType, apiVersion, metricnamespace, + autoAdjustTimegrain, validateDimensions, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * **Lists the metric values for a resource**. + * **Lists the metric values for a resource**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). * * @param resourceUri The identifier of the resource. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. * @param aggregation The list of aggregation types (comma separated) to retrieve. * @param top The maximum number of records to retrieve. * Valid only if $filter is specified. @@ -142,19 +653,21 @@ public Mono> listWithResponseAsync(String resourceUri, S * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -164,7 +677,7 @@ public Mono> listWithResponseAsync(String resourceUri, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String resourceUri, String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, ResultType resultType, - String metricnamespace, Context context) { + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -172,15 +685,17 @@ private Mono> listWithResponseAsync(String resourceUri, if (resourceUri == null) { return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } - final String apiVersion = "2018-01-01"; + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), resourceUri, timespan, interval, metricnames, aggregation, top, - orderBy, filter, resultType, apiVersion, metricnamespace, accept, context); + orderBy, filter, resultType, apiVersion, metricnamespace, autoAdjustTimegrain, validateDimensions, accept, + context); } /** - * **Lists the metric values for a resource**. + * **Lists the metric values for a resource**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). * * @param resourceUri The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -199,19 +714,22 @@ public Mono listAsync(String resourceUri) { final String filter = null; final ResultType resultType = null; final String metricnamespace = null; + final Boolean autoAdjustTimegrain = null; + final Boolean validateDimensions = null; return listWithResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderBy, filter, - resultType, metricnamespace).flatMap(res -> Mono.justOrEmpty(res.getValue())); + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * **Lists the metric values for a resource**. + * **Lists the metric values for a resource**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). * * @param resourceUri The identifier of the resource. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. * @param interval The interval (i.e. timegrain) of the query. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. Limit 20 metrics. * @param aggregation The list of aggregation types (comma separated) to retrieve. * @param top The maximum number of records to retrieve. * Valid only if $filter is specified. @@ -219,19 +737,21 @@ public Mono listAsync(String resourceUri) { * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -241,13 +761,14 @@ public Mono listAsync(String resourceUri) { @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(String resourceUri, String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, ResultType resultType, - String metricnamespace, Context context) { + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, Context context) { return listWithResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderBy, filter, - resultType, metricnamespace, context).block(); + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, context).block(); } /** - * **Lists the metric values for a resource**. + * **Lists the metric values for a resource**. This API used the [default ARM throttling + * limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). * * @param resourceUri The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -266,7 +787,9 @@ public ResponseInner list(String resourceUri) { final String filter = null; final ResultType resultType = null; final String metricnamespace = null; + final Boolean autoAdjustTimegrain = null; + final Boolean validateDimensions = null; return listWithResponse(resourceUri, timespan, interval, metricnames, aggregation, top, orderBy, filter, - resultType, metricnamespace, Context.NONE).getValue(); + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, Context.NONE).getValue(); } } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java index f3f955d4433b..5e7e0eb3c03d 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java @@ -32,8 +32,8 @@ import com.azure.resourcemanager.monitor.fluent.PredictiveMetricsClient; import com.azure.resourcemanager.monitor.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.monitor.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopedResourcesClient; import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopeOperationStatusClient; +import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopedResourcesClient; import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopesClient; import com.azure.resourcemanager.monitor.fluent.ScheduledQueryRulesClient; import com.azure.resourcemanager.monitor.fluent.TenantActivityLogsClient; diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java index 29ca79ae4e99..29d018e9157c 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java @@ -54,7 +54,7 @@ public final class OperationsClientImpl implements OperationsClient { * REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientOperati") + @ServiceInterface(name = "MonitorClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Insights/operations") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PredictiveMetricsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PredictiveMetricsClientImpl.java index 81fc2e1b3249..c1e9429e3c5a 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PredictiveMetricsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PredictiveMetricsClientImpl.java @@ -56,7 +56,7 @@ public final class PredictiveMetricsClientImpl implements PredictiveMetricsClien * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientPredict") + @ServiceInterface(name = "MonitorClientPredictiveMetrics") public interface PredictiveMetricsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}/predictiveMetrics") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java index 2b701921a705..1f6a7051c593 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java @@ -64,7 +64,7 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientPrivate") + @ServiceInterface(name = "MonitorClientPrivateEndpointConnections") public interface PrivateEndpointConnectionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java index b3cbcf4d733a..a014f98dbad4 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java @@ -56,7 +56,7 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientPrivate") + @ServiceInterface(name = "MonitorClientPrivateLinkResources") public interface PrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.java index c0fcf45887de..b6cd9db329a2 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.java @@ -57,7 +57,7 @@ public final class PrivateLinkScopeOperationStatusClientImpl * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientPrivate") + @ServiceInterface(name = "MonitorClientPrivateLinkScopeOperationStatus") public interface PrivateLinkScopeOperationStatusService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId}") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java index f63fef94c3ef..00ff703c320d 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java @@ -68,7 +68,7 @@ public final class PrivateLinkScopedResourcesClientImpl implements PrivateLinkSc * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientPrivate") + @ServiceInterface(name = "MonitorClientPrivateLinkScopedResources") public interface PrivateLinkScopedResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}") @@ -875,7 +875,7 @@ public PagedIterable listByPrivateLinkScope(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scoped resources in a private link scope along with {@link PagedResponse} on successful + * @return all private endpoint connections on a private link scope along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -904,7 +904,7 @@ private Mono> listByPrivateLinkScopeNextSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scoped resources in a private link scope along with {@link PagedResponse} on successful + * @return all private endpoint connections on a private link scope along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java index 191b0a40a13c..e46768cea98e 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java @@ -74,7 +74,7 @@ public final class PrivateLinkScopesClientImpl implements InnerSupportsGet> listNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the list of Azure Monitor PrivateLinkScope resources along with {@link PagedResponse} on + * @return a list of all Azure Monitor PrivateLinkScopes within a subscription along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1074,7 +1074,7 @@ private Mono> listNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the list of Azure Monitor PrivateLinkScope resources along with {@link PagedResponse} on + * @return a list of Azure Monitor PrivateLinkScopes within a resource group along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1104,7 +1104,7 @@ private Mono> listNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the list of Azure Monitor PrivateLinkScope resources along with {@link PagedResponse} on + * @return a list of Azure Monitor PrivateLinkScopes within a resource group along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java index 221a934b0450..255046c5edb1 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java @@ -69,7 +69,7 @@ public final class ScheduledQueryRulesClientImpl implements InnerSupportsGet> listSinglePageAsync return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, @@ -193,7 +193,7 @@ private Mono> listSinglePageAsync return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) @@ -282,7 +282,7 @@ public PagedIterable list(Context context) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), @@ -318,7 +318,7 @@ public PagedIterable list(Context context) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -420,7 +420,7 @@ public Mono> getByResourceGroupWithRes if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), @@ -457,7 +457,7 @@ public Mono> getByResourceGroupWithRes if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -546,7 +546,7 @@ public Mono> createOrUpdateWithRespons } else { parameters.validate(); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -589,7 +589,7 @@ private Mono> createOrUpdateWithRespon } else { parameters.validate(); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, @@ -683,7 +683,7 @@ public Mono> updateWithResponseAsync(S } else { parameters.validate(); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -726,7 +726,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ruleName, @@ -813,7 +813,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -849,7 +849,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (ruleName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } - final String apiVersion = "2022-06-15"; + final String apiVersion = "2023-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ruleName, diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java index d13d2f2080c4..950498ccf94c 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java @@ -60,7 +60,7 @@ public final class TenantActivityLogsClientImpl implements TenantActivityLogsCli * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientTenantA") + @ServiceInterface(name = "MonitorClientTenantActivityLogs") public interface TenantActivityLogsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Insights/eventtypes/management/values") @@ -333,8 +333,11 @@ public PagedIterable list(String filter, String select, Context * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity + * Logs for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point + * out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only + * surfaces the logs that were generated at the tenant level along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -360,8 +363,11 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents collection of events along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity + * Logs for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point + * out here is that this API does *not* retrieve the logs at the individual subscription of the tenant but only + * surfaces the logs that were generated at the tenant level along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java index 00f989f03973..cd18f3d51718 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java @@ -55,7 +55,7 @@ public final class VMInsightsClientImpl implements VMInsightsClient { * REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorClientVMInsig") + @ServiceInterface(name = "MonitorClientVMInsights") public interface VMInsightsService { @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default") diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Actions.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Actions.java index c065d4368b82..ce4a8fcd9886 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Actions.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Actions.java @@ -28,6 +28,11 @@ public final class Actions implements JsonSerializable { */ private Map customProperties; + /* + * The properties of an action properties. + */ + private Map actionProperties; + /** * Creates an instance of Actions class. */ @@ -74,6 +79,26 @@ public Actions withCustomProperties(Map customProperties) { return this; } + /** + * Get the actionProperties property: The properties of an action properties. + * + * @return the actionProperties value. + */ + public Map actionProperties() { + return this.actionProperties; + } + + /** + * Set the actionProperties property: The properties of an action properties. + * + * @param actionProperties the actionProperties value to set. + * @return the Actions object itself. + */ + public Actions withActionProperties(Map actionProperties) { + this.actionProperties = actionProperties; + return this; + } + /** * Validates the instance. * @@ -91,6 +116,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("actionGroups", this.actionGroups, (writer, element) -> writer.writeString(element)); jsonWriter.writeMapField("customProperties", this.customProperties, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("actionProperties", this.actionProperties, + (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -115,6 +142,9 @@ public static Actions fromJson(JsonReader jsonReader) throws IOException { } else if ("customProperties".equals(fieldName)) { Map customProperties = reader.readMap(reader1 -> reader1.getString()); deserializedActions.customProperties = customProperties; + } else if ("actionProperties".equals(fieldName)) { + Map actionProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedActions.actionProperties = actionProperties; } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertLeafCondition.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertLeafCondition.java index 6058ec08d8e2..c2f40edc9ff2 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertLeafCondition.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ActivityLogAlertLeafCondition.java @@ -90,7 +90,6 @@ public ActivityLogAlertLeafCondition withContainsAny(List containsAny) { */ @Override public void validate() { - super.validate(); if (anyOf() != null) { anyOf().forEach(e -> e.validate()); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AdxDestination.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AdxDestination.java new file mode 100644 index 000000000000..3def440f7a7e --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AdxDestination.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Data Explorer (Adx) destination. + */ +@Fluent +public final class AdxDestination implements JsonSerializable { + /* + * The ARM resource id of the Adx resource. + */ + private String resourceId; + + /* + * The name of the database to which data will be ingested. + */ + private String databaseName; + + /* + * The ingestion uri of the Adx resource. + */ + private String ingestionUri; + + /* + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of AdxDestination class. + */ + public AdxDestination() { + } + + /** + * Get the resourceId property: The ARM resource id of the Adx resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ARM resource id of the Adx resource. + * + * @param resourceId the resourceId value to set. + * @return the AdxDestination object itself. + */ + public AdxDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the databaseName property: The name of the database to which data will be ingested. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The name of the database to which data will be ingested. + * + * @param databaseName the databaseName value to set. + * @return the AdxDestination object itself. + */ + public AdxDestination withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the ingestionUri property: The ingestion uri of the Adx resource. + * + * @return the ingestionUri value. + */ + public String ingestionUri() { + return this.ingestionUri; + } + + /** + * Get the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the AdxDestination object itself. + */ + public AdxDestination withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdxDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdxDestination if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AdxDestination. + */ + public static AdxDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdxDestination deserializedAdxDestination = new AdxDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedAdxDestination.resourceId = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedAdxDestination.databaseName = reader.getString(); + } else if ("ingestionUri".equals(fieldName)) { + deserializedAdxDestination.ingestionUri = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAdxDestination.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdxDestination; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AgentSetting.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AgentSetting.java new file mode 100644 index 000000000000..5f6b1b12a136 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AgentSetting.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A setting used to control an agent behavior on a host machine. + */ +@Fluent +public final class AgentSetting implements JsonSerializable { + /* + * The name of the setting. + * Must be part of the list of supported settings + */ + private KnownAgentSettingName name; + + /* + * The value of the setting + */ + private String value; + + /** + * Creates an instance of AgentSetting class. + */ + public AgentSetting() { + } + + /** + * Get the name property: The name of the setting. + * Must be part of the list of supported settings. + * + * @return the name value. + */ + public KnownAgentSettingName name() { + return this.name; + } + + /** + * Set the name property: The name of the setting. + * Must be part of the list of supported settings. + * + * @param name the name value to set. + * @return the AgentSetting object itself. + */ + public AgentSetting withName(KnownAgentSettingName name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of the setting. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the setting. + * + * @param value the value value to set. + * @return the AgentSetting object itself. + */ + public AgentSetting withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentSetting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentSetting. + */ + public static AgentSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentSetting deserializedAgentSetting = new AgentSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAgentSetting.name = KnownAgentSettingName.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedAgentSetting.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentSetting; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AgentSettingsSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AgentSettingsSpec.java new file mode 100644 index 000000000000..d9af6f62adc1 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AgentSettingsSpec.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * An agent setting. + */ +@Fluent +public class AgentSettingsSpec implements JsonSerializable { + /* + * All the settings that are applicable to the logs agent (AMA) + */ + private List logs; + + /** + * Creates an instance of AgentSettingsSpec class. + */ + public AgentSettingsSpec() { + } + + /** + * Get the logs property: All the settings that are applicable to the logs agent (AMA). + * + * @return the logs value. + */ + public List logs() { + return this.logs; + } + + /** + * Set the logs property: All the settings that are applicable to the logs agent (AMA). + * + * @param logs the logs value to set. + * @return the AgentSettingsSpec object itself. + */ + public AgentSettingsSpec withLogs(List logs) { + this.logs = logs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logs() != null) { + logs().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("logs", this.logs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentSettingsSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentSettingsSpec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentSettingsSpec. + */ + public static AgentSettingsSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentSettingsSpec deserializedAgentSettingsSpec = new AgentSettingsSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logs".equals(fieldName)) { + List logs = reader.readArray(reader1 -> AgentSetting.fromJson(reader1)); + deserializedAgentSettingsSpec.logs = logs; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentSettingsSpec; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java index 4b7d525d314e..f2873a1341f8 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * the criteria time aggregation types. + * The criteria time aggregation types. Previously undocumented values might be returned. */ public final class AggregationTypeEnum extends ExpandableStringEnum { /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertSeverity.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertSeverity.java index f40310ce9942..e6d885d0a919 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertSeverity.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertSeverity.java @@ -4,64 +4,133 @@ package com.azure.resourcemanager.monitor.models; -import com.azure.core.util.ExpandableStringEnum; +import com.azure.core.util.ExpandableEnum; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; import java.util.Collection; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; /** * Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for * rules of the kind LogAlert. */ -public final class AlertSeverity extends ExpandableStringEnum { +public final class AlertSeverity implements ExpandableEnum, JsonSerializable { + private static final Map VALUES = new ConcurrentHashMap<>(); + + private static final Function NEW_INSTANCE = AlertSeverity::new; + /** * Static value 0 for AlertSeverity. */ - public static final AlertSeverity ZERO = fromLong(0L); + public static final AlertSeverity ZERO = fromValue(0L); /** * Static value 1 for AlertSeverity. */ - public static final AlertSeverity ONE = fromLong(1L); + public static final AlertSeverity ONE = fromValue(1L); /** * Static value 2 for AlertSeverity. */ - public static final AlertSeverity TWO = fromLong(2L); + public static final AlertSeverity TWO = fromValue(2L); /** * Static value 3 for AlertSeverity. */ - public static final AlertSeverity THREE = fromLong(3L); + public static final AlertSeverity THREE = fromValue(3L); /** * Static value 4 for AlertSeverity. */ - public static final AlertSeverity FOUR = fromLong(4L); + public static final AlertSeverity FOUR = fromValue(4L); - /** - * Creates a new instance of AlertSeverity value. - * - * @deprecated Use the {@link #fromLong(long)} factory method. - */ - @Deprecated - public AlertSeverity() { + private final Long value; + + private AlertSeverity(Long value) { + this.value = value; } /** - * Creates or finds a AlertSeverity from its string representation. + * Creates or finds a AlertSeverity. * - * @param name a name to look for. + * @param value a value to look for. * @return the corresponding AlertSeverity. + * @throws IllegalArgumentException if value is null. */ - public static AlertSeverity fromLong(long name) { - return fromString(String.valueOf(name), AlertSeverity.class); + public static AlertSeverity fromValue(Long value) { + if (value == null) { + throw new IllegalArgumentException("'value' cannot be null."); + } + return VALUES.computeIfAbsent(value, NEW_INSTANCE); } /** * Gets known AlertSeverity values. * - * @return known AlertSeverity values. + * @return Known AlertSeverity values. */ public static Collection values() { - return values(AlertSeverity.class); + return new ArrayList<>(VALUES.values()); + } + + /** + * Gets the value of the AlertSeverity instance. + * + * @return the value of the AlertSeverity instance. + */ + @Override + public Long getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + return jsonWriter.writeLong(getValue()); + } + + /** + * Reads an instance of AlertSeverity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AlertSeverity if the JsonReader was pointing to an instance of it, or null if the + * JsonReader was pointing to JSON null. + * @throws IOException If an error occurs while reading the AlertSeverity. + * @throws IllegalStateException If unexpected JSON token is found. + */ + public static AlertSeverity fromJson(JsonReader jsonReader) throws IOException { + JsonToken nextToken = jsonReader.nextToken(); + if (nextToken == JsonToken.NULL) { + return null; + } + if (nextToken != JsonToken.NUMBER) { + throw new IllegalStateException( + String.format("Unexpected JSON token for %s deserialization: %s", JsonToken.NUMBER, nextToken)); + } + return AlertSeverity.fromValue(jsonReader.getLong()); + } + + @Override + public String toString() { + return Objects.toString(this.value); + } + + @Override + public boolean equals(Object obj) { + return this == obj; + } + + @Override + public int hashCode() { + return Objects.hashCode(this.value); } } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ApplicationInsights.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ApplicationInsights.java new file mode 100644 index 000000000000..f52e9dd349b7 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ApplicationInsights.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ApplicationInsights model. + */ +@Fluent +public final class ApplicationInsights implements JsonSerializable { + /* + * Id of the application insights resource + */ + private String resourceId; + + /* + * The name of the reference used as an alias when referencing this application insights in Otel data sources + */ + private String name; + + /** + * Creates an instance of ApplicationInsights class. + */ + public ApplicationInsights() { + } + + /** + * Get the resourceId property: Id of the application insights resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Id of the application insights resource. + * + * @param resourceId the resourceId value to set. + * @return the ApplicationInsights object itself. + */ + public ApplicationInsights withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the name property: The name of the reference used as an alias when referencing this application insights in + * Otel data sources. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the reference used as an alias when referencing this application insights in + * Otel data sources. + * + * @param name the name value to set. + * @return the ApplicationInsights object itself. + */ + public ApplicationInsights withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property resourceId in model ApplicationInsights")); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ApplicationInsights")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationInsights.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationInsights from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationInsights if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationInsights. + */ + public static ApplicationInsights fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationInsights deserializedApplicationInsights = new ApplicationInsights(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedApplicationInsights.resourceId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApplicationInsights.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationInsights; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleNotification.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleNotification.java index dfd7deb8136e..38f6bef37d0a 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleNotification.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleNotification.java @@ -20,7 +20,7 @@ public final class AutoscaleNotification implements JsonSerializable { /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java index b2a87fc2e48e..a652ba292089 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * Definition of data collection endpoint. @@ -36,6 +37,11 @@ public class DataCollectionEndpoint implements JsonSerializable privateLinkScopedResources; + + /* + * Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection + * Endpoint with Log Analytics Destination. + */ + private DataCollectionEndpointFailoverConfiguration failoverConfiguration; + + /* + * Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection + * Endpoint with Log Analytics Destination. + */ + private DataCollectionEndpointMetadata metadata; + /** * Creates an instance of DataCollectionEndpoint class. */ @@ -135,6 +159,26 @@ public DataCollectionEndpoint withLogsIngestion(DataCollectionEndpointLogsIngest return this; } + /** + * Get the metricsIngestion property: The endpoint used by clients to ingest metrics. + * + * @return the metricsIngestion value. + */ + public DataCollectionEndpointMetricsIngestion metricsIngestion() { + return this.metricsIngestion; + } + + /** + * Set the metricsIngestion property: The endpoint used by clients to ingest metrics. + * + * @param metricsIngestion the metricsIngestion value to set. + * @return the DataCollectionEndpoint object itself. + */ + public DataCollectionEndpoint withMetricsIngestion(DataCollectionEndpointMetricsIngestion metricsIngestion) { + this.metricsIngestion = metricsIngestion; + return this; + } + /** * Get the networkAcls property: Network access control rules for the endpoints. * @@ -175,6 +219,73 @@ DataCollectionEndpoint withProvisioningState(KnownDataCollectionEndpointProvisio return this; } + /** + * Get the privateLinkScopedResources property: List of Azure Monitor Private Link Scope Resources to which this + * data collection endpoint resource is associated. This property is READ-ONLY. + * + * @return the privateLinkScopedResources value. + */ + public List privateLinkScopedResources() { + return this.privateLinkScopedResources; + } + + /** + * Set the privateLinkScopedResources property: List of Azure Monitor Private Link Scope Resources to which this + * data collection endpoint resource is associated. This property is READ-ONLY. + * + * @param privateLinkScopedResources the privateLinkScopedResources value to set. + * @return the DataCollectionEndpoint object itself. + */ + DataCollectionEndpoint withPrivateLinkScopedResources(List privateLinkScopedResources) { + this.privateLinkScopedResources = privateLinkScopedResources; + return this; + } + + /** + * Get the failoverConfiguration property: Metadata for the resource. This property can only be updated by Log + * Analytics Control Plane for Data Collection Endpoint with Log Analytics Destination. + * + * @return the failoverConfiguration value. + */ + public DataCollectionEndpointFailoverConfiguration failoverConfiguration() { + return this.failoverConfiguration; + } + + /** + * Set the failoverConfiguration property: Metadata for the resource. This property can only be updated by Log + * Analytics Control Plane for Data Collection Endpoint with Log Analytics Destination. + * + * @param failoverConfiguration the failoverConfiguration value to set. + * @return the DataCollectionEndpoint object itself. + */ + DataCollectionEndpoint + withFailoverConfiguration(DataCollectionEndpointFailoverConfiguration failoverConfiguration) { + this.failoverConfiguration = failoverConfiguration; + return this; + } + + /** + * Get the metadata property: Metadata for the resource. This property can only be updated by Log Analytics Control + * Plane for Data Collection Endpoint with Log Analytics Destination. + * + * @return the metadata value. + */ + public DataCollectionEndpointMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata for the resource. This property can only be updated by Log Analytics Control + * Plane for Data Collection Endpoint with Log Analytics Destination. + * + * @param metadata the metadata value to set. + * @return the DataCollectionEndpoint object itself. + */ + DataCollectionEndpoint withMetadata(DataCollectionEndpointMetadata metadata) { + this.metadata = metadata; + return this; + } + /** * Validates the instance. * @@ -187,9 +298,21 @@ public void validate() { if (logsIngestion() != null) { logsIngestion().validate(); } + if (metricsIngestion() != null) { + metricsIngestion().validate(); + } if (networkAcls() != null) { networkAcls().validate(); } + if (privateLinkScopedResources() != null) { + privateLinkScopedResources().forEach(e -> e.validate()); + } + if (failoverConfiguration() != null) { + failoverConfiguration().validate(); + } + if (metadata() != null) { + metadata().validate(); + } } /** @@ -202,6 +325,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("immutableId", this.immutableId); jsonWriter.writeJsonField("configurationAccess", this.configurationAccess); jsonWriter.writeJsonField("logsIngestion", this.logsIngestion); + jsonWriter.writeJsonField("metricsIngestion", this.metricsIngestion); jsonWriter.writeJsonField("networkAcls", this.networkAcls); return jsonWriter.writeEndObject(); } @@ -231,11 +355,23 @@ public static DataCollectionEndpoint fromJson(JsonReader jsonReader) throws IOEx } else if ("logsIngestion".equals(fieldName)) { deserializedDataCollectionEndpoint.logsIngestion = DataCollectionEndpointLogsIngestion.fromJson(reader); + } else if ("metricsIngestion".equals(fieldName)) { + deserializedDataCollectionEndpoint.metricsIngestion + = DataCollectionEndpointMetricsIngestion.fromJson(reader); } else if ("networkAcls".equals(fieldName)) { deserializedDataCollectionEndpoint.networkAcls = DataCollectionEndpointNetworkAcls.fromJson(reader); } else if ("provisioningState".equals(fieldName)) { deserializedDataCollectionEndpoint.provisioningState = KnownDataCollectionEndpointProvisioningState.fromString(reader.getString()); + } else if ("privateLinkScopedResources".equals(fieldName)) { + List privateLinkScopedResources + = reader.readArray(reader1 -> PrivateLinkScopedResource.fromJson(reader1)); + deserializedDataCollectionEndpoint.privateLinkScopedResources = privateLinkScopedResources; + } else if ("failoverConfiguration".equals(fieldName)) { + deserializedDataCollectionEndpoint.failoverConfiguration + = DataCollectionEndpointFailoverConfiguration.fromJson(reader); + } else if ("metadata".equals(fieldName)) { + deserializedDataCollectionEndpoint.metadata = DataCollectionEndpointMetadata.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java index 6451c4468098..366ce388b3f2 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java @@ -43,7 +43,6 @@ public String endpoint() { */ @Override public void validate() { - super.validate(); } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointFailoverConfiguration.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointFailoverConfiguration.java new file mode 100644 index 000000000000..2ae0a25b11ea --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointFailoverConfiguration.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection + * Endpoint with Log Analytics Destination. + */ +@Fluent +public final class DataCollectionEndpointFailoverConfiguration extends FailoverConfigurationSpec { + /** + * Creates an instance of DataCollectionEndpointFailoverConfiguration class. + */ + public DataCollectionEndpointFailoverConfiguration() { + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointFailoverConfiguration withActiveLocation(String activeLocation) { + super.withActiveLocation(activeLocation); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointFailoverConfiguration withLocations(List locations) { + super.withLocations(locations); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (locations() != null) { + locations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("activeLocation", activeLocation()); + jsonWriter.writeArrayField("locations", locations(), (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionEndpointFailoverConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionEndpointFailoverConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataCollectionEndpointFailoverConfiguration. + */ + public static DataCollectionEndpointFailoverConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionEndpointFailoverConfiguration deserializedDataCollectionEndpointFailoverConfiguration + = new DataCollectionEndpointFailoverConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activeLocation".equals(fieldName)) { + deserializedDataCollectionEndpointFailoverConfiguration.withActiveLocation(reader.getString()); + } else if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> LocationSpec.fromJson(reader1)); + deserializedDataCollectionEndpointFailoverConfiguration.withLocations(locations); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionEndpointFailoverConfiguration; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java index 098e99ff52ee..85c87872b37a 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java @@ -43,7 +43,6 @@ public String endpoint() { */ @Override public void validate() { - super.validate(); } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointMetadata.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointMetadata.java new file mode 100644 index 000000000000..7583dd2e9b72 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointMetadata.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection + * Endpoint with Log Analytics Destination. + */ +@Immutable +public final class DataCollectionEndpointMetadata extends Metadata { + /* + * Immutable Id of azure offering managing this resource on-behalf-of customer. + */ + private String provisionedByImmutableId; + + /* + * Resource Id of azure offering managing this resource on-behalf-of customer. + */ + private String provisionedByResourceId; + + /* + * Azure offering managing this resource on-behalf-of customer. + */ + private String provisionedBy; + + /** + * Creates an instance of DataCollectionEndpointMetadata class. + */ + public DataCollectionEndpointMetadata() { + } + + /** + * Get the provisionedByImmutableId property: Immutable Id of azure offering managing this resource on-behalf-of + * customer. + * + * @return the provisionedByImmutableId value. + */ + @Override + public String provisionedByImmutableId() { + return this.provisionedByImmutableId; + } + + /** + * Get the provisionedByResourceId property: Resource Id of azure offering managing this resource on-behalf-of + * customer. + * + * @return the provisionedByResourceId value. + */ + @Override + public String provisionedByResourceId() { + return this.provisionedByResourceId; + } + + /** + * Get the provisionedBy property: Azure offering managing this resource on-behalf-of customer. + * + * @return the provisionedBy value. + */ + @Override + public String provisionedBy() { + return this.provisionedBy; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionEndpointMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionEndpointMetadata if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataCollectionEndpointMetadata. + */ + public static DataCollectionEndpointMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionEndpointMetadata deserializedDataCollectionEndpointMetadata + = new DataCollectionEndpointMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisionedBy".equals(fieldName)) { + deserializedDataCollectionEndpointMetadata.provisionedBy = reader.getString(); + } else if ("provisionedByResourceId".equals(fieldName)) { + deserializedDataCollectionEndpointMetadata.provisionedByResourceId = reader.getString(); + } else if ("provisionedByImmutableId".equals(fieldName)) { + deserializedDataCollectionEndpointMetadata.provisionedByImmutableId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionEndpointMetadata; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointMetricsIngestion.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointMetricsIngestion.java new file mode 100644 index 000000000000..544ace98fb68 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointMetricsIngestion.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The endpoint used by clients to ingest metrics. + */ +@Immutable +public final class DataCollectionEndpointMetricsIngestion extends MetricsIngestionEndpointSpec { + /* + * The endpoint. This property is READ-ONLY. + */ + private String endpoint; + + /** + * Creates an instance of DataCollectionEndpointMetricsIngestion class. + */ + public DataCollectionEndpointMetricsIngestion() { + } + + /** + * Get the endpoint property: The endpoint. This property is READ-ONLY. + * + * @return the endpoint value. + */ + @Override + public String endpoint() { + return this.endpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionEndpointMetricsIngestion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionEndpointMetricsIngestion if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataCollectionEndpointMetricsIngestion. + */ + public static DataCollectionEndpointMetricsIngestion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionEndpointMetricsIngestion deserializedDataCollectionEndpointMetricsIngestion + = new DataCollectionEndpointMetricsIngestion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoint".equals(fieldName)) { + deserializedDataCollectionEndpointMetricsIngestion.endpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionEndpointMetricsIngestion; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java index 19f24117700a..8ac794dfb807 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java @@ -38,7 +38,6 @@ public DataCollectionEndpointNetworkAcls() { */ @Override public void validate() { - super.validate(); } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceIdentity.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceIdentity.java new file mode 100644 index 000000000000..3679c8415c10 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceIdentity.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity of the resource. + */ +@Fluent +public final class DataCollectionEndpointResourceIdentity extends ManagedServiceIdentity { + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /** + * Creates an instance of DataCollectionEndpointResourceIdentity class. + */ + public DataCollectionEndpointResourceIdentity() { + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + @Override + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + @Override + public UUID principalId() { + return this.principalId; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointResourceIdentity withType(ManagedServiceIdentityType type) { + super.withType(type); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointResourceIdentity + withUserAssignedIdentities(Map userAssignedIdentities) { + super.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model DataCollectionEndpointResourceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataCollectionEndpointResourceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + jsonWriter.writeMapField("userAssignedIdentities", userAssignedIdentities(), + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionEndpointResourceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionEndpointResourceIdentity if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataCollectionEndpointResourceIdentity. + */ + public static DataCollectionEndpointResourceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionEndpointResourceIdentity deserializedDataCollectionEndpointResourceIdentity + = new DataCollectionEndpointResourceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDataCollectionEndpointResourceIdentity + .withType(ManagedServiceIdentityType.fromString(reader.getString())); + } else if ("principalId".equals(fieldName)) { + deserializedDataCollectionEndpointResourceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedDataCollectionEndpointResourceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedDataCollectionEndpointResourceIdentity + .withUserAssignedIdentities(userAssignedIdentities); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionEndpointResourceIdentity; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceSku.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceSku.java new file mode 100644 index 000000000000..e36d0f98af11 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceSku.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SKU of the resource. + */ +@Fluent +public final class DataCollectionEndpointResourceSku extends Sku { + /** + * Creates an instance of DataCollectionEndpointResourceSku class. + */ + public DataCollectionEndpointResourceSku() { + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointResourceSku withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointResourceSku withTier(SkuTier tier) { + super.withTier(tier); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointResourceSku withSize(String size) { + super.withSize(size); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointResourceSku withFamily(String family) { + super.withFamily(family); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionEndpointResourceSku withCapacity(Integer capacity) { + super.withCapacity(capacity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model DataCollectionEndpointResourceSku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataCollectionEndpointResourceSku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("tier", tier() == null ? null : tier().toString()); + jsonWriter.writeStringField("size", size()); + jsonWriter.writeStringField("family", family()); + jsonWriter.writeNumberField("capacity", capacity()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionEndpointResourceSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionEndpointResourceSku if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataCollectionEndpointResourceSku. + */ + public static DataCollectionEndpointResourceSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionEndpointResourceSku deserializedDataCollectionEndpointResourceSku + = new DataCollectionEndpointResourceSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDataCollectionEndpointResourceSku.withName(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedDataCollectionEndpointResourceSku.withTier(SkuTier.fromString(reader.getString())); + } else if ("size".equals(fieldName)) { + deserializedDataCollectionEndpointResourceSku.withSize(reader.getString()); + } else if ("family".equals(fieldName)) { + deserializedDataCollectionEndpointResourceSku.withFamily(reader.getString()); + } else if ("capacity".equals(fieldName)) { + deserializedDataCollectionEndpointResourceSku.withCapacity(reader.getNullable(JsonReader::getInt)); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionEndpointResourceSku; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java index 46363bb65745..06992a1e4a92 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java @@ -38,6 +38,21 @@ public class DataCollectionRule implements JsonSerializable */ private DataCollectionRuleMetadata metadata; + /* + * Defines the ingestion endpoints to send data to via this rule. + */ + private DataCollectionRuleEndpoints endpoints; + + /* + * Defines all the references that may be used in other sections of the DCR + */ + private DataCollectionRuleReferences references; + + /* + * Agent settings used to modify agent behavior on a given host + */ + private DataCollectionRuleAgentSettings agentSettings; + /* * Declaration of custom streams used in this rule. */ @@ -50,6 +65,12 @@ public class DataCollectionRule implements JsonSerializable */ private DataCollectionRuleDataSources dataSources; + /* + * The specification of direct data sources. + * This property is optional and can be omitted. + */ + private DataCollectionRuleDirectDataSources directDataSources; + /* * The specification of destinations. */ @@ -60,6 +81,11 @@ public class DataCollectionRule implements JsonSerializable */ private List dataFlows; + /* + * The specification for ingestion limits + */ + private DataCollectionRuleIngestionQuotas ingestionQuotas; + /* * The resource provisioning state. */ @@ -153,6 +179,66 @@ DataCollectionRule withMetadata(DataCollectionRuleMetadata metadata) { return this; } + /** + * Get the endpoints property: Defines the ingestion endpoints to send data to via this rule. + * + * @return the endpoints value. + */ + public DataCollectionRuleEndpoints endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: Defines the ingestion endpoints to send data to via this rule. + * + * @param endpoints the endpoints value to set. + * @return the DataCollectionRule object itself. + */ + DataCollectionRule withEndpoints(DataCollectionRuleEndpoints endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the references property: Defines all the references that may be used in other sections of the DCR. + * + * @return the references value. + */ + public DataCollectionRuleReferences references() { + return this.references; + } + + /** + * Set the references property: Defines all the references that may be used in other sections of the DCR. + * + * @param references the references value to set. + * @return the DataCollectionRule object itself. + */ + public DataCollectionRule withReferences(DataCollectionRuleReferences references) { + this.references = references; + return this; + } + + /** + * Get the agentSettings property: Agent settings used to modify agent behavior on a given host. + * + * @return the agentSettings value. + */ + public DataCollectionRuleAgentSettings agentSettings() { + return this.agentSettings; + } + + /** + * Set the agentSettings property: Agent settings used to modify agent behavior on a given host. + * + * @param agentSettings the agentSettings value to set. + * @return the DataCollectionRule object itself. + */ + public DataCollectionRule withAgentSettings(DataCollectionRuleAgentSettings agentSettings) { + this.agentSettings = agentSettings; + return this; + } + /** * Get the streamDeclarations property: Declaration of custom streams used in this rule. * @@ -197,6 +283,28 @@ public DataCollectionRule withDataSources(DataCollectionRuleDataSources dataSour return this; } + /** + * Get the directDataSources property: The specification of direct data sources. + * This property is optional and can be omitted. + * + * @return the directDataSources value. + */ + public DataCollectionRuleDirectDataSources directDataSources() { + return this.directDataSources; + } + + /** + * Set the directDataSources property: The specification of direct data sources. + * This property is optional and can be omitted. + * + * @param directDataSources the directDataSources value to set. + * @return the DataCollectionRule object itself. + */ + public DataCollectionRule withDirectDataSources(DataCollectionRuleDirectDataSources directDataSources) { + this.directDataSources = directDataSources; + return this; + } + /** * Get the destinations property: The specification of destinations. * @@ -237,6 +345,26 @@ public DataCollectionRule withDataFlows(List dataFlows) { return this; } + /** + * Get the ingestionQuotas property: The specification for ingestion limits. + * + * @return the ingestionQuotas value. + */ + public DataCollectionRuleIngestionQuotas ingestionQuotas() { + return this.ingestionQuotas; + } + + /** + * Set the ingestionQuotas property: The specification for ingestion limits. + * + * @param ingestionQuotas the ingestionQuotas value to set. + * @return the DataCollectionRule object itself. + */ + DataCollectionRule withIngestionQuotas(DataCollectionRuleIngestionQuotas ingestionQuotas) { + this.ingestionQuotas = ingestionQuotas; + return this; + } + /** * Get the provisioningState property: The resource provisioning state. * @@ -266,6 +394,15 @@ public void validate() { if (metadata() != null) { metadata().validate(); } + if (endpoints() != null) { + endpoints().validate(); + } + if (references() != null) { + references().validate(); + } + if (agentSettings() != null) { + agentSettings().validate(); + } if (streamDeclarations() != null) { streamDeclarations().values().forEach(e -> { if (e != null) { @@ -276,12 +413,18 @@ public void validate() { if (dataSources() != null) { dataSources().validate(); } + if (directDataSources() != null) { + directDataSources().validate(); + } if (destinations() != null) { destinations().validate(); } if (dataFlows() != null) { dataFlows().forEach(e -> e.validate()); } + if (ingestionQuotas() != null) { + ingestionQuotas().validate(); + } } /** @@ -292,9 +435,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("description", this.description); jsonWriter.writeStringField("dataCollectionEndpointId", this.dataCollectionEndpointId); + jsonWriter.writeJsonField("references", this.references); + jsonWriter.writeJsonField("agentSettings", this.agentSettings); jsonWriter.writeMapField("streamDeclarations", this.streamDeclarations, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("dataSources", this.dataSources); + jsonWriter.writeJsonField("directDataSources", this.directDataSources); jsonWriter.writeJsonField("destinations", this.destinations); jsonWriter.writeArrayField("dataFlows", this.dataFlows, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); @@ -323,17 +469,28 @@ public static DataCollectionRule fromJson(JsonReader jsonReader) throws IOExcept deserializedDataCollectionRule.dataCollectionEndpointId = reader.getString(); } else if ("metadata".equals(fieldName)) { deserializedDataCollectionRule.metadata = DataCollectionRuleMetadata.fromJson(reader); + } else if ("endpoints".equals(fieldName)) { + deserializedDataCollectionRule.endpoints = DataCollectionRuleEndpoints.fromJson(reader); + } else if ("references".equals(fieldName)) { + deserializedDataCollectionRule.references = DataCollectionRuleReferences.fromJson(reader); + } else if ("agentSettings".equals(fieldName)) { + deserializedDataCollectionRule.agentSettings = DataCollectionRuleAgentSettings.fromJson(reader); } else if ("streamDeclarations".equals(fieldName)) { Map streamDeclarations = reader.readMap(reader1 -> StreamDeclaration.fromJson(reader1)); deserializedDataCollectionRule.streamDeclarations = streamDeclarations; } else if ("dataSources".equals(fieldName)) { deserializedDataCollectionRule.dataSources = DataCollectionRuleDataSources.fromJson(reader); + } else if ("directDataSources".equals(fieldName)) { + deserializedDataCollectionRule.directDataSources + = DataCollectionRuleDirectDataSources.fromJson(reader); } else if ("destinations".equals(fieldName)) { deserializedDataCollectionRule.destinations = DataCollectionRuleDestinations.fromJson(reader); } else if ("dataFlows".equals(fieldName)) { List dataFlows = reader.readArray(reader1 -> DataFlow.fromJson(reader1)); deserializedDataCollectionRule.dataFlows = dataFlows; + } else if ("ingestionQuotas".equals(fieldName)) { + deserializedDataCollectionRule.ingestionQuotas = DataCollectionRuleIngestionQuotas.fromJson(reader); } else if ("provisioningState".equals(fieldName)) { deserializedDataCollectionRule.provisioningState = KnownDataCollectionRuleProvisioningState.fromString(reader.getString()); diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAgentSettings.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAgentSettings.java new file mode 100644 index 000000000000..fc7be467b737 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAgentSettings.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Agent settings used to modify agent behavior on a given host. + */ +@Fluent +public final class DataCollectionRuleAgentSettings extends AgentSettingsSpec { + /** + * Creates an instance of DataCollectionRuleAgentSettings class. + */ + public DataCollectionRuleAgentSettings() { + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleAgentSettings withLogs(List logs) { + super.withLogs(logs); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (logs() != null) { + logs().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("logs", logs(), (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionRuleAgentSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionRuleAgentSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataCollectionRuleAgentSettings. + */ + public static DataCollectionRuleAgentSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionRuleAgentSettings deserializedDataCollectionRuleAgentSettings + = new DataCollectionRuleAgentSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logs".equals(fieldName)) { + List logs = reader.readArray(reader1 -> AgentSetting.fromJson(reader1)); + deserializedDataCollectionRuleAgentSettings.withLogs(logs); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionRuleAgentSettings; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationMetadata.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationMetadata.java index 6d6c9c71189f..ade88032bc4e 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationMetadata.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationMetadata.java @@ -15,6 +15,16 @@ */ @Immutable public final class DataCollectionRuleAssociationMetadata extends Metadata { + /* + * Immutable Id of azure offering managing this resource on-behalf-of customer. + */ + private String provisionedByImmutableId; + + /* + * Resource Id of azure offering managing this resource on-behalf-of customer. + */ + private String provisionedByResourceId; + /* * Azure offering managing this resource on-behalf-of customer. */ @@ -26,6 +36,28 @@ public final class DataCollectionRuleAssociationMetadata extends Metadata { public DataCollectionRuleAssociationMetadata() { } + /** + * Get the provisionedByImmutableId property: Immutable Id of azure offering managing this resource on-behalf-of + * customer. + * + * @return the provisionedByImmutableId value. + */ + @Override + public String provisionedByImmutableId() { + return this.provisionedByImmutableId; + } + + /** + * Get the provisionedByResourceId property: Resource Id of azure offering managing this resource on-behalf-of + * customer. + * + * @return the provisionedByResourceId value. + */ + @Override + public String provisionedByResourceId() { + return this.provisionedByResourceId; + } + /** * Get the provisionedBy property: Azure offering managing this resource on-behalf-of customer. * @@ -43,7 +75,6 @@ public String provisionedBy() { */ @Override public void validate() { - super.validate(); } /** @@ -73,6 +104,10 @@ public static DataCollectionRuleAssociationMetadata fromJson(JsonReader jsonRead if ("provisionedBy".equals(fieldName)) { deserializedDataCollectionRuleAssociationMetadata.provisionedBy = reader.getString(); + } else if ("provisionedByResourceId".equals(fieldName)) { + deserializedDataCollectionRuleAssociationMetadata.provisionedByResourceId = reader.getString(); + } else if ("provisionedByImmutableId".equals(fieldName)) { + deserializedDataCollectionRuleAssociationMetadata.provisionedByImmutableId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.java index c9ec670b3601..44b9fd42432e 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.java @@ -33,6 +33,16 @@ public DataCollectionRuleDataSources withPerformanceCounters(List performanceCountersOTel) { + super.withPerformanceCountersOTel(performanceCountersOTel); + return this; + } + /** * {@inheritDoc} */ @@ -78,6 +88,80 @@ public DataCollectionRuleDataSources withIisLogs(List iisLogs return this; } + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDataSources + withWindowsFirewallLogs(List windowsFirewallLogs) { + super.withWindowsFirewallLogs(windowsFirewallLogs); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDataSources + withPrometheusForwarder(List prometheusForwarder) { + super.withPrometheusForwarder(prometheusForwarder); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDataSources withPlatformTelemetry(List platformTelemetry) { + super.withPlatformTelemetry(platformTelemetry); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDataSources withDataImports(DataSourcesSpecDataImports dataImports) { + super.withDataImports(dataImports); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDataSources withOtelLogs(List otelLogs) { + super.withOtelLogs(otelLogs); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDataSources withOtelTraces(List otelTraces) { + super.withOtelTraces(otelTraces); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDataSources withOtelMetrics(List otelMetrics) { + super.withOtelMetrics(otelMetrics); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDataSources withEtwProviders(List etwProviders) { + super.withEtwProviders(etwProviders); + return this; + } + /** * Validates the instance. * @@ -85,7 +169,51 @@ public DataCollectionRuleDataSources withIisLogs(List iisLogs */ @Override public void validate() { - super.validate(); + if (performanceCounters() != null) { + performanceCounters().forEach(e -> e.validate()); + } + if (performanceCountersOTel() != null) { + performanceCountersOTel().forEach(e -> e.validate()); + } + if (windowsEventLogs() != null) { + windowsEventLogs().forEach(e -> e.validate()); + } + if (syslog() != null) { + syslog().forEach(e -> e.validate()); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + if (logFiles() != null) { + logFiles().forEach(e -> e.validate()); + } + if (iisLogs() != null) { + iisLogs().forEach(e -> e.validate()); + } + if (windowsFirewallLogs() != null) { + windowsFirewallLogs().forEach(e -> e.validate()); + } + if (prometheusForwarder() != null) { + prometheusForwarder().forEach(e -> e.validate()); + } + if (platformTelemetry() != null) { + platformTelemetry().forEach(e -> e.validate()); + } + if (dataImports() != null) { + dataImports().validate(); + } + if (otelLogs() != null) { + otelLogs().forEach(e -> e.validate()); + } + if (otelTraces() != null) { + otelTraces().forEach(e -> e.validate()); + } + if (otelMetrics() != null) { + otelMetrics().forEach(e -> e.validate()); + } + if (etwProviders() != null) { + etwProviders().forEach(e -> e.validate()); + } } /** @@ -96,12 +224,25 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("performanceCounters", performanceCounters(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("performanceCountersOTel", performanceCountersOTel(), + (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("windowsEventLogs", windowsEventLogs(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("syslog", syslog(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("extensions", extensions(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("logFiles", logFiles(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("iisLogs", iisLogs(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("windowsFirewallLogs", windowsFirewallLogs(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("prometheusForwarder", prometheusForwarder(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("platformTelemetry", platformTelemetry(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dataImports", dataImports()); + jsonWriter.writeArrayField("otelLogs", otelLogs(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("otelTraces", otelTraces(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("otelMetrics", otelMetrics(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("etwProviders", etwProviders(), (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -125,6 +266,10 @@ public static DataCollectionRuleDataSources fromJson(JsonReader jsonReader) thro List performanceCounters = reader.readArray(reader1 -> PerfCounterDataSource.fromJson(reader1)); deserializedDataCollectionRuleDataSources.withPerformanceCounters(performanceCounters); + } else if ("performanceCountersOTel".equals(fieldName)) { + List performanceCountersOTel + = reader.readArray(reader1 -> PerformanceCountersOTelDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDataSources.withPerformanceCountersOTel(performanceCountersOTel); } else if ("windowsEventLogs".equals(fieldName)) { List windowsEventLogs = reader.readArray(reader1 -> WindowsEventLogDataSource.fromJson(reader1)); @@ -143,6 +288,37 @@ public static DataCollectionRuleDataSources fromJson(JsonReader jsonReader) thro } else if ("iisLogs".equals(fieldName)) { List iisLogs = reader.readArray(reader1 -> IisLogsDataSource.fromJson(reader1)); deserializedDataCollectionRuleDataSources.withIisLogs(iisLogs); + } else if ("windowsFirewallLogs".equals(fieldName)) { + List windowsFirewallLogs + = reader.readArray(reader1 -> WindowsFirewallLogsDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDataSources.withWindowsFirewallLogs(windowsFirewallLogs); + } else if ("prometheusForwarder".equals(fieldName)) { + List prometheusForwarder + = reader.readArray(reader1 -> PrometheusForwarderDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDataSources.withPrometheusForwarder(prometheusForwarder); + } else if ("platformTelemetry".equals(fieldName)) { + List platformTelemetry + = reader.readArray(reader1 -> PlatformTelemetryDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDataSources.withPlatformTelemetry(platformTelemetry); + } else if ("dataImports".equals(fieldName)) { + deserializedDataCollectionRuleDataSources + .withDataImports(DataSourcesSpecDataImports.fromJson(reader)); + } else if ("otelLogs".equals(fieldName)) { + List otelLogs + = reader.readArray(reader1 -> OtelLogsDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDataSources.withOtelLogs(otelLogs); + } else if ("otelTraces".equals(fieldName)) { + List otelTraces + = reader.readArray(reader1 -> OtelTracesDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDataSources.withOtelTraces(otelTraces); + } else if ("otelMetrics".equals(fieldName)) { + List otelMetrics + = reader.readArray(reader1 -> OtelMetricsDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDataSources.withOtelMetrics(otelMetrics); + } else if ("etwProviders".equals(fieldName)) { + List etwProviders + = reader.readArray(reader1 -> EtwProviderDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDataSources.withEtwProviders(etwProviders); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java index a278c328f39d..5959d58b97f0 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java @@ -31,6 +31,16 @@ public DataCollectionRuleDestinations withLogAnalytics(List monitoringAccounts) { + super.withMonitoringAccounts(monitoringAccounts); + return this; + } + /** * {@inheritDoc} */ @@ -41,6 +51,69 @@ public DataCollectionRuleDestinations withLogAnalytics(List eventHubs) { + super.withEventHubs(eventHubs); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDestinations withEventHubsDirect(List eventHubsDirect) { + super.withEventHubsDirect(eventHubsDirect); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDestinations withStorageBlobsDirect(List storageBlobsDirect) { + super.withStorageBlobsDirect(storageBlobsDirect); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDestinations withStorageTablesDirect(List storageTablesDirect) { + super.withStorageTablesDirect(storageTablesDirect); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDestinations withStorageAccounts(List storageAccounts) { + super.withStorageAccounts(storageAccounts); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDestinations withMicrosoftFabric(List microsoftFabric) { + super.withMicrosoftFabric(microsoftFabric); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDestinations withAzureDataExplorer(List azureDataExplorer) { + super.withAzureDataExplorer(azureDataExplorer); + return this; + } + /** * Validates the instance. * @@ -48,7 +121,36 @@ public DataCollectionRuleDestinations withLogAnalytics(List e.validate()); + } + if (monitoringAccounts() != null) { + monitoringAccounts().forEach(e -> e.validate()); + } + if (azureMonitorMetrics() != null) { + azureMonitorMetrics().validate(); + } + if (eventHubs() != null) { + eventHubs().forEach(e -> e.validate()); + } + if (eventHubsDirect() != null) { + eventHubsDirect().forEach(e -> e.validate()); + } + if (storageBlobsDirect() != null) { + storageBlobsDirect().forEach(e -> e.validate()); + } + if (storageTablesDirect() != null) { + storageTablesDirect().forEach(e -> e.validate()); + } + if (storageAccounts() != null) { + storageAccounts().forEach(e -> e.validate()); + } + if (microsoftFabric() != null) { + microsoftFabric().forEach(e -> e.validate()); + } + if (azureDataExplorer() != null) { + azureDataExplorer().forEach(e -> e.validate()); + } } /** @@ -58,7 +160,22 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("logAnalytics", logAnalytics(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("monitoringAccounts", monitoringAccounts(), + (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("azureMonitorMetrics", azureMonitorMetrics()); + jsonWriter.writeArrayField("eventHubs", eventHubs(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("eventHubsDirect", eventHubsDirect(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("storageBlobsDirect", storageBlobsDirect(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("storageTablesDirect", storageTablesDirect(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("storageAccounts", storageAccounts(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("microsoftFabric", microsoftFabric(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("azureDataExplorer", azureDataExplorer(), + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -82,9 +199,41 @@ public static DataCollectionRuleDestinations fromJson(JsonReader jsonReader) thr List logAnalytics = reader.readArray(reader1 -> LogAnalyticsDestination.fromJson(reader1)); deserializedDataCollectionRuleDestinations.withLogAnalytics(logAnalytics); + } else if ("monitoringAccounts".equals(fieldName)) { + List monitoringAccounts + = reader.readArray(reader1 -> MonitoringAccountDestination.fromJson(reader1)); + deserializedDataCollectionRuleDestinations.withMonitoringAccounts(monitoringAccounts); } else if ("azureMonitorMetrics".equals(fieldName)) { deserializedDataCollectionRuleDestinations .withAzureMonitorMetrics(DestinationsSpecAzureMonitorMetrics.fromJson(reader)); + } else if ("eventHubs".equals(fieldName)) { + List eventHubs + = reader.readArray(reader1 -> EventHubDestination.fromJson(reader1)); + deserializedDataCollectionRuleDestinations.withEventHubs(eventHubs); + } else if ("eventHubsDirect".equals(fieldName)) { + List eventHubsDirect + = reader.readArray(reader1 -> EventHubDirectDestination.fromJson(reader1)); + deserializedDataCollectionRuleDestinations.withEventHubsDirect(eventHubsDirect); + } else if ("storageBlobsDirect".equals(fieldName)) { + List storageBlobsDirect + = reader.readArray(reader1 -> StorageBlobDestination.fromJson(reader1)); + deserializedDataCollectionRuleDestinations.withStorageBlobsDirect(storageBlobsDirect); + } else if ("storageTablesDirect".equals(fieldName)) { + List storageTablesDirect + = reader.readArray(reader1 -> StorageTableDestination.fromJson(reader1)); + deserializedDataCollectionRuleDestinations.withStorageTablesDirect(storageTablesDirect); + } else if ("storageAccounts".equals(fieldName)) { + List storageAccounts + = reader.readArray(reader1 -> StorageBlobDestination.fromJson(reader1)); + deserializedDataCollectionRuleDestinations.withStorageAccounts(storageAccounts); + } else if ("microsoftFabric".equals(fieldName)) { + List microsoftFabric + = reader.readArray(reader1 -> MicrosoftFabricDestination.fromJson(reader1)); + deserializedDataCollectionRuleDestinations.withMicrosoftFabric(microsoftFabric); + } else if ("azureDataExplorer".equals(fieldName)) { + List azureDataExplorer + = reader.readArray(reader1 -> AdxDestination.fromJson(reader1)); + deserializedDataCollectionRuleDestinations.withAzureDataExplorer(azureDataExplorer); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDirectDataSources.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDirectDataSources.java new file mode 100644 index 000000000000..df5c5854d7cb --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDirectDataSources.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The specification of direct data sources. + * This property is optional and can be omitted. + */ +@Fluent +public final class DataCollectionRuleDirectDataSources extends DirectDataSourcesSpec { + /** + * Creates an instance of DataCollectionRuleDirectDataSources class. + */ + public DataCollectionRuleDirectDataSources() { + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDirectDataSources withOtelMetrics(List otelMetrics) { + super.withOtelMetrics(otelMetrics); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDirectDataSources withOtelLogs(List otelLogs) { + super.withOtelLogs(otelLogs); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleDirectDataSources withOtelTraces(List otelTraces) { + super.withOtelTraces(otelTraces); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (otelMetrics() != null) { + otelMetrics().forEach(e -> e.validate()); + } + if (otelLogs() != null) { + otelLogs().forEach(e -> e.validate()); + } + if (otelTraces() != null) { + otelTraces().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("otelMetrics", otelMetrics(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("otelLogs", otelLogs(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("otelTraces", otelTraces(), (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionRuleDirectDataSources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionRuleDirectDataSources if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataCollectionRuleDirectDataSources. + */ + public static DataCollectionRuleDirectDataSources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionRuleDirectDataSources deserializedDataCollectionRuleDirectDataSources + = new DataCollectionRuleDirectDataSources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("otelMetrics".equals(fieldName)) { + List otelMetrics + = reader.readArray(reader1 -> OtelMetricsDirectDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDirectDataSources.withOtelMetrics(otelMetrics); + } else if ("otelLogs".equals(fieldName)) { + List otelLogs + = reader.readArray(reader1 -> OtelLogsDirectDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDirectDataSources.withOtelLogs(otelLogs); + } else if ("otelTraces".equals(fieldName)) { + List otelTraces + = reader.readArray(reader1 -> OtelTracesDirectDataSource.fromJson(reader1)); + deserializedDataCollectionRuleDirectDataSources.withOtelTraces(otelTraces); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionRuleDirectDataSources; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleEndpoints.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleEndpoints.java new file mode 100644 index 000000000000..f36d4037313f --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleEndpoints.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the ingestion endpoints to send data to via this rule. + */ +@Immutable +public final class DataCollectionRuleEndpoints extends EndpointsSpec { + /* + * The ingestion endpoint for metrics + */ + private String metricsIngestion; + + /* + * The ingestion endpoint for logs + */ + private String logsIngestion; + + /** + * Creates an instance of DataCollectionRuleEndpoints class. + */ + public DataCollectionRuleEndpoints() { + } + + /** + * Get the metricsIngestion property: The ingestion endpoint for metrics. + * + * @return the metricsIngestion value. + */ + @Override + public String metricsIngestion() { + return this.metricsIngestion; + } + + /** + * Get the logsIngestion property: The ingestion endpoint for logs. + * + * @return the logsIngestion value. + */ + @Override + public String logsIngestion() { + return this.logsIngestion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionRuleEndpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionRuleEndpoints if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataCollectionRuleEndpoints. + */ + public static DataCollectionRuleEndpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionRuleEndpoints deserializedDataCollectionRuleEndpoints = new DataCollectionRuleEndpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logsIngestion".equals(fieldName)) { + deserializedDataCollectionRuleEndpoints.logsIngestion = reader.getString(); + } else if ("metricsIngestion".equals(fieldName)) { + deserializedDataCollectionRuleEndpoints.metricsIngestion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionRuleEndpoints; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleIngestionQuotas.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleIngestionQuotas.java new file mode 100644 index 000000000000..1ddd61f52201 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleIngestionQuotas.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The specification for ingestion limits. + */ +@Fluent +public final class DataCollectionRuleIngestionQuotas extends IngestionQuotas { + /** + * Creates an instance of DataCollectionRuleIngestionQuotas class. + */ + public DataCollectionRuleIngestionQuotas() { + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleIngestionQuotas withLogs(IngestionQuotasLogs logs) { + super.withLogs(logs); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (logs() != null) { + logs().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logs", logs()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionRuleIngestionQuotas from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionRuleIngestionQuotas if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataCollectionRuleIngestionQuotas. + */ + public static DataCollectionRuleIngestionQuotas fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionRuleIngestionQuotas deserializedDataCollectionRuleIngestionQuotas + = new DataCollectionRuleIngestionQuotas(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logs".equals(fieldName)) { + deserializedDataCollectionRuleIngestionQuotas.withLogs(IngestionQuotasLogs.fromJson(reader)); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionRuleIngestionQuotas; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleMetadata.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleMetadata.java index 5788d4899fc4..b508869d4348 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleMetadata.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleMetadata.java @@ -15,6 +15,16 @@ */ @Immutable public final class DataCollectionRuleMetadata extends Metadata { + /* + * Immutable Id of azure offering managing this resource on-behalf-of customer. + */ + private String provisionedByImmutableId; + + /* + * Resource Id of azure offering managing this resource on-behalf-of customer. + */ + private String provisionedByResourceId; + /* * Azure offering managing this resource on-behalf-of customer. */ @@ -26,6 +36,28 @@ public final class DataCollectionRuleMetadata extends Metadata { public DataCollectionRuleMetadata() { } + /** + * Get the provisionedByImmutableId property: Immutable Id of azure offering managing this resource on-behalf-of + * customer. + * + * @return the provisionedByImmutableId value. + */ + @Override + public String provisionedByImmutableId() { + return this.provisionedByImmutableId; + } + + /** + * Get the provisionedByResourceId property: Resource Id of azure offering managing this resource on-behalf-of + * customer. + * + * @return the provisionedByResourceId value. + */ + @Override + public String provisionedByResourceId() { + return this.provisionedByResourceId; + } + /** * Get the provisionedBy property: Azure offering managing this resource on-behalf-of customer. * @@ -43,7 +75,6 @@ public String provisionedBy() { */ @Override public void validate() { - super.validate(); } /** @@ -72,6 +103,10 @@ public static DataCollectionRuleMetadata fromJson(JsonReader jsonReader) throws if ("provisionedBy".equals(fieldName)) { deserializedDataCollectionRuleMetadata.provisionedBy = reader.getString(); + } else if ("provisionedByResourceId".equals(fieldName)) { + deserializedDataCollectionRuleMetadata.provisionedByResourceId = reader.getString(); + } else if ("provisionedByImmutableId".equals(fieldName)) { + deserializedDataCollectionRuleMetadata.provisionedByImmutableId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleReferences.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleReferences.java new file mode 100644 index 000000000000..48bee2fbe913 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleReferences.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines all the references that may be used in other sections of the DCR. + */ +@Fluent +public final class DataCollectionRuleReferences extends ReferencesSpec { + /** + * Creates an instance of DataCollectionRuleReferences class. + */ + public DataCollectionRuleReferences() { + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleReferences withEnrichmentData(ReferencesSpecEnrichmentData enrichmentData) { + super.withEnrichmentData(enrichmentData); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleReferences withApplicationInsights(List applicationInsights) { + super.withApplicationInsights(applicationInsights); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (enrichmentData() != null) { + enrichmentData().validate(); + } + if (applicationInsights() != null) { + applicationInsights().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("enrichmentData", enrichmentData()); + jsonWriter.writeArrayField("applicationInsights", applicationInsights(), + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionRuleReferences from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionRuleReferences if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataCollectionRuleReferences. + */ + public static DataCollectionRuleReferences fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionRuleReferences deserializedDataCollectionRuleReferences = new DataCollectionRuleReferences(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enrichmentData".equals(fieldName)) { + deserializedDataCollectionRuleReferences + .withEnrichmentData(ReferencesSpecEnrichmentData.fromJson(reader)); + } else if ("applicationInsights".equals(fieldName)) { + List applicationInsights + = reader.readArray(reader1 -> ApplicationInsights.fromJson(reader1)); + deserializedDataCollectionRuleReferences.withApplicationInsights(applicationInsights); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionRuleReferences; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceIdentity.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceIdentity.java new file mode 100644 index 000000000000..94043b8fffd9 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceIdentity.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity of the resource. + */ +@Fluent +public final class DataCollectionRuleResourceIdentity extends ManagedServiceIdentity { + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /** + * Creates an instance of DataCollectionRuleResourceIdentity class. + */ + public DataCollectionRuleResourceIdentity() { + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + @Override + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + @Override + public UUID principalId() { + return this.principalId; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceIdentity withType(ManagedServiceIdentityType type) { + super.withType(type); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceIdentity + withUserAssignedIdentities(Map userAssignedIdentities) { + super.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model DataCollectionRuleResourceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataCollectionRuleResourceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + jsonWriter.writeMapField("userAssignedIdentities", userAssignedIdentities(), + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionRuleResourceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionRuleResourceIdentity if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataCollectionRuleResourceIdentity. + */ + public static DataCollectionRuleResourceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionRuleResourceIdentity deserializedDataCollectionRuleResourceIdentity + = new DataCollectionRuleResourceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDataCollectionRuleResourceIdentity + .withType(ManagedServiceIdentityType.fromString(reader.getString())); + } else if ("principalId".equals(fieldName)) { + deserializedDataCollectionRuleResourceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedDataCollectionRuleResourceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedDataCollectionRuleResourceIdentity.withUserAssignedIdentities(userAssignedIdentities); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionRuleResourceIdentity; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceSku.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceSku.java new file mode 100644 index 000000000000..e85c73e76ec8 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceSku.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SKU of the resource. + */ +@Fluent +public final class DataCollectionRuleResourceSku extends Sku { + /** + * Creates an instance of DataCollectionRuleResourceSku class. + */ + public DataCollectionRuleResourceSku() { + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceSku withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceSku withTier(SkuTier tier) { + super.withTier(tier); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceSku withSize(String size) { + super.withSize(size); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceSku withFamily(String family) { + super.withFamily(family); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataCollectionRuleResourceSku withCapacity(Integer capacity) { + super.withCapacity(capacity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model DataCollectionRuleResourceSku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataCollectionRuleResourceSku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("tier", tier() == null ? null : tier().toString()); + jsonWriter.writeStringField("size", size()); + jsonWriter.writeStringField("family", family()); + jsonWriter.writeNumberField("capacity", capacity()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataCollectionRuleResourceSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataCollectionRuleResourceSku if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataCollectionRuleResourceSku. + */ + public static DataCollectionRuleResourceSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataCollectionRuleResourceSku deserializedDataCollectionRuleResourceSku + = new DataCollectionRuleResourceSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDataCollectionRuleResourceSku.withName(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedDataCollectionRuleResourceSku.withTier(SkuTier.fromString(reader.getString())); + } else if ("size".equals(fieldName)) { + deserializedDataCollectionRuleResourceSku.withSize(reader.getString()); + } else if ("family".equals(fieldName)) { + deserializedDataCollectionRuleResourceSku.withFamily(reader.getString()); + } else if ("capacity".equals(fieldName)) { + deserializedDataCollectionRuleResourceSku.withCapacity(reader.getNullable(JsonReader::getInt)); + } else { + reader.skipChildren(); + } + } + + return deserializedDataCollectionRuleResourceSku; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java index c4c17cdaa3dc..bb699246a26f 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java @@ -37,6 +37,16 @@ public final class DataFlow implements JsonSerializable { */ private String outputStream; + /* + * The builtIn transform to transform stream data + */ + private String builtInTransform; + + /* + * Flag to enable overflow column in LA destinations + */ + private Boolean captureOverflow; + /** * Creates an instance of DataFlow class. */ @@ -125,6 +135,46 @@ public DataFlow withOutputStream(String outputStream) { return this; } + /** + * Get the builtInTransform property: The builtIn transform to transform stream data. + * + * @return the builtInTransform value. + */ + public String builtInTransform() { + return this.builtInTransform; + } + + /** + * Set the builtInTransform property: The builtIn transform to transform stream data. + * + * @param builtInTransform the builtInTransform value to set. + * @return the DataFlow object itself. + */ + public DataFlow withBuiltInTransform(String builtInTransform) { + this.builtInTransform = builtInTransform; + return this; + } + + /** + * Get the captureOverflow property: Flag to enable overflow column in LA destinations. + * + * @return the captureOverflow value. + */ + public Boolean captureOverflow() { + return this.captureOverflow; + } + + /** + * Set the captureOverflow property: Flag to enable overflow column in LA destinations. + * + * @param captureOverflow the captureOverflow value to set. + * @return the DataFlow object itself. + */ + public DataFlow withCaptureOverflow(Boolean captureOverflow) { + this.captureOverflow = captureOverflow; + return this; + } + /** * Validates the instance. * @@ -144,6 +194,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("transformKql", this.transformKql); jsonWriter.writeStringField("outputStream", this.outputStream); + jsonWriter.writeStringField("builtInTransform", this.builtInTransform); + jsonWriter.writeBooleanField("captureOverflow", this.captureOverflow); return jsonWriter.writeEndObject(); } @@ -173,6 +225,10 @@ public static DataFlow fromJson(JsonReader jsonReader) throws IOException { deserializedDataFlow.transformKql = reader.getString(); } else if ("outputStream".equals(fieldName)) { deserializedDataFlow.outputStream = reader.getString(); + } else if ("builtInTransform".equals(fieldName)) { + deserializedDataFlow.builtInTransform = reader.getString(); + } else if ("captureOverflow".equals(fieldName)) { + deserializedDataFlow.captureOverflow = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataImportSources.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataImportSources.java new file mode 100644 index 000000000000..51b2ef192ccc --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataImportSources.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The DataImportSources model. + */ +@Fluent +public class DataImportSources implements JsonSerializable { + /* + * Definition of Event Hub configuration. + */ + private DataImportSourcesEventHub eventHub; + + /** + * Creates an instance of DataImportSources class. + */ + public DataImportSources() { + } + + /** + * Get the eventHub property: Definition of Event Hub configuration. + * + * @return the eventHub value. + */ + public DataImportSourcesEventHub eventHub() { + return this.eventHub; + } + + /** + * Set the eventHub property: Definition of Event Hub configuration. + * + * @param eventHub the eventHub value to set. + * @return the DataImportSources object itself. + */ + public DataImportSources withEventHub(DataImportSourcesEventHub eventHub) { + this.eventHub = eventHub; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (eventHub() != null) { + eventHub().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("eventHub", this.eventHub); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataImportSources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataImportSources if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataImportSources. + */ + public static DataImportSources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataImportSources deserializedDataImportSources = new DataImportSources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventHub".equals(fieldName)) { + deserializedDataImportSources.eventHub = DataImportSourcesEventHub.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataImportSources; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataImportSourcesEventHub.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataImportSourcesEventHub.java new file mode 100644 index 000000000000..4593f41d8231 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataImportSourcesEventHub.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Event Hub configuration. + */ +@Fluent +public final class DataImportSourcesEventHub extends EventHubDataSource { + /** + * Creates an instance of DataImportSourcesEventHub class. + */ + public DataImportSourcesEventHub() { + } + + /** + * {@inheritDoc} + */ + @Override + public DataImportSourcesEventHub withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataImportSourcesEventHub withConsumerGroup(String consumerGroup) { + super.withConsumerGroup(consumerGroup); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataImportSourcesEventHub withStream(String stream) { + super.withStream(stream); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("consumerGroup", consumerGroup()); + jsonWriter.writeStringField("stream", stream()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataImportSourcesEventHub from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataImportSourcesEventHub if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataImportSourcesEventHub. + */ + public static DataImportSourcesEventHub fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataImportSourcesEventHub deserializedDataImportSourcesEventHub = new DataImportSourcesEventHub(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDataImportSourcesEventHub.withName(reader.getString()); + } else if ("consumerGroup".equals(fieldName)) { + deserializedDataImportSourcesEventHub.withConsumerGroup(reader.getString()); + } else if ("stream".equals(fieldName)) { + deserializedDataImportSourcesEventHub.withStream(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataImportSourcesEventHub; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java index 2c9854c107fa..70d7c001c983 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java @@ -22,6 +22,11 @@ public class DataSourcesSpec implements JsonSerializable { */ private List performanceCounters; + /* + * The list of Open Telemetry performance counter data source configurations. + */ + private List performanceCountersOTel; + /* * The list of Windows Event Log data source configurations. */ @@ -47,6 +52,46 @@ public class DataSourcesSpec implements JsonSerializable { */ private List iisLogs; + /* + * The list of Windows Firewall logs source configurations. + */ + private List windowsFirewallLogs; + + /* + * The list of Prometheus forwarder data source configurations. + */ + private List prometheusForwarder; + + /* + * The list of platform telemetry configurations + */ + private List platformTelemetry; + + /* + * Specifications of pull based data sources + */ + private DataSourcesSpecDataImports dataImports; + + /* + * The list of Otel Logs data source configurations. + */ + private List otelLogs; + + /* + * The list of Otel traces data source configurations. + */ + private List otelTraces; + + /* + * The list of OTel metrics data source configurations. + */ + private List otelMetrics; + + /* + * The list of ETW providers data source configurations. + */ + private List etwProviders; + /** * Creates an instance of DataSourcesSpec class. */ @@ -73,6 +118,29 @@ public DataSourcesSpec withPerformanceCounters(List perfo return this; } + /** + * Get the performanceCountersOTel property: The list of Open Telemetry performance counter data source + * configurations. + * + * @return the performanceCountersOTel value. + */ + public List performanceCountersOTel() { + return this.performanceCountersOTel; + } + + /** + * Set the performanceCountersOTel property: The list of Open Telemetry performance counter data source + * configurations. + * + * @param performanceCountersOTel the performanceCountersOTel value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec + withPerformanceCountersOTel(List performanceCountersOTel) { + this.performanceCountersOTel = performanceCountersOTel; + return this; + } + /** * Get the windowsEventLogs property: The list of Windows Event Log data source configurations. * @@ -173,6 +241,166 @@ public DataSourcesSpec withIisLogs(List iisLogs) { return this; } + /** + * Get the windowsFirewallLogs property: The list of Windows Firewall logs source configurations. + * + * @return the windowsFirewallLogs value. + */ + public List windowsFirewallLogs() { + return this.windowsFirewallLogs; + } + + /** + * Set the windowsFirewallLogs property: The list of Windows Firewall logs source configurations. + * + * @param windowsFirewallLogs the windowsFirewallLogs value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withWindowsFirewallLogs(List windowsFirewallLogs) { + this.windowsFirewallLogs = windowsFirewallLogs; + return this; + } + + /** + * Get the prometheusForwarder property: The list of Prometheus forwarder data source configurations. + * + * @return the prometheusForwarder value. + */ + public List prometheusForwarder() { + return this.prometheusForwarder; + } + + /** + * Set the prometheusForwarder property: The list of Prometheus forwarder data source configurations. + * + * @param prometheusForwarder the prometheusForwarder value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withPrometheusForwarder(List prometheusForwarder) { + this.prometheusForwarder = prometheusForwarder; + return this; + } + + /** + * Get the platformTelemetry property: The list of platform telemetry configurations. + * + * @return the platformTelemetry value. + */ + public List platformTelemetry() { + return this.platformTelemetry; + } + + /** + * Set the platformTelemetry property: The list of platform telemetry configurations. + * + * @param platformTelemetry the platformTelemetry value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withPlatformTelemetry(List platformTelemetry) { + this.platformTelemetry = platformTelemetry; + return this; + } + + /** + * Get the dataImports property: Specifications of pull based data sources. + * + * @return the dataImports value. + */ + public DataSourcesSpecDataImports dataImports() { + return this.dataImports; + } + + /** + * Set the dataImports property: Specifications of pull based data sources. + * + * @param dataImports the dataImports value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withDataImports(DataSourcesSpecDataImports dataImports) { + this.dataImports = dataImports; + return this; + } + + /** + * Get the otelLogs property: The list of Otel Logs data source configurations. + * + * @return the otelLogs value. + */ + public List otelLogs() { + return this.otelLogs; + } + + /** + * Set the otelLogs property: The list of Otel Logs data source configurations. + * + * @param otelLogs the otelLogs value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withOtelLogs(List otelLogs) { + this.otelLogs = otelLogs; + return this; + } + + /** + * Get the otelTraces property: The list of Otel traces data source configurations. + * + * @return the otelTraces value. + */ + public List otelTraces() { + return this.otelTraces; + } + + /** + * Set the otelTraces property: The list of Otel traces data source configurations. + * + * @param otelTraces the otelTraces value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withOtelTraces(List otelTraces) { + this.otelTraces = otelTraces; + return this; + } + + /** + * Get the otelMetrics property: The list of OTel metrics data source configurations. + * + * @return the otelMetrics value. + */ + public List otelMetrics() { + return this.otelMetrics; + } + + /** + * Set the otelMetrics property: The list of OTel metrics data source configurations. + * + * @param otelMetrics the otelMetrics value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withOtelMetrics(List otelMetrics) { + this.otelMetrics = otelMetrics; + return this; + } + + /** + * Get the etwProviders property: The list of ETW providers data source configurations. + * + * @return the etwProviders value. + */ + public List etwProviders() { + return this.etwProviders; + } + + /** + * Set the etwProviders property: The list of ETW providers data source configurations. + * + * @param etwProviders the etwProviders value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withEtwProviders(List etwProviders) { + this.etwProviders = etwProviders; + return this; + } + /** * Validates the instance. * @@ -182,6 +410,9 @@ public void validate() { if (performanceCounters() != null) { performanceCounters().forEach(e -> e.validate()); } + if (performanceCountersOTel() != null) { + performanceCountersOTel().forEach(e -> e.validate()); + } if (windowsEventLogs() != null) { windowsEventLogs().forEach(e -> e.validate()); } @@ -197,6 +428,30 @@ public void validate() { if (iisLogs() != null) { iisLogs().forEach(e -> e.validate()); } + if (windowsFirewallLogs() != null) { + windowsFirewallLogs().forEach(e -> e.validate()); + } + if (prometheusForwarder() != null) { + prometheusForwarder().forEach(e -> e.validate()); + } + if (platformTelemetry() != null) { + platformTelemetry().forEach(e -> e.validate()); + } + if (dataImports() != null) { + dataImports().validate(); + } + if (otelLogs() != null) { + otelLogs().forEach(e -> e.validate()); + } + if (otelTraces() != null) { + otelTraces().forEach(e -> e.validate()); + } + if (otelMetrics() != null) { + otelMetrics().forEach(e -> e.validate()); + } + if (etwProviders() != null) { + etwProviders().forEach(e -> e.validate()); + } } /** @@ -207,12 +462,25 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("performanceCounters", this.performanceCounters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("performanceCountersOTel", this.performanceCountersOTel, + (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("windowsEventLogs", this.windowsEventLogs, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("syslog", this.syslog, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("logFiles", this.logFiles, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("iisLogs", this.iisLogs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("windowsFirewallLogs", this.windowsFirewallLogs, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("prometheusForwarder", this.prometheusForwarder, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("platformTelemetry", this.platformTelemetry, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dataImports", this.dataImports); + jsonWriter.writeArrayField("otelLogs", this.otelLogs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("otelTraces", this.otelTraces, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("otelMetrics", this.otelMetrics, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("etwProviders", this.etwProviders, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -235,6 +503,10 @@ public static DataSourcesSpec fromJson(JsonReader jsonReader) throws IOException List performanceCounters = reader.readArray(reader1 -> PerfCounterDataSource.fromJson(reader1)); deserializedDataSourcesSpec.performanceCounters = performanceCounters; + } else if ("performanceCountersOTel".equals(fieldName)) { + List performanceCountersOTel + = reader.readArray(reader1 -> PerformanceCountersOTelDataSource.fromJson(reader1)); + deserializedDataSourcesSpec.performanceCountersOTel = performanceCountersOTel; } else if ("windowsEventLogs".equals(fieldName)) { List windowsEventLogs = reader.readArray(reader1 -> WindowsEventLogDataSource.fromJson(reader1)); @@ -253,6 +525,36 @@ public static DataSourcesSpec fromJson(JsonReader jsonReader) throws IOException } else if ("iisLogs".equals(fieldName)) { List iisLogs = reader.readArray(reader1 -> IisLogsDataSource.fromJson(reader1)); deserializedDataSourcesSpec.iisLogs = iisLogs; + } else if ("windowsFirewallLogs".equals(fieldName)) { + List windowsFirewallLogs + = reader.readArray(reader1 -> WindowsFirewallLogsDataSource.fromJson(reader1)); + deserializedDataSourcesSpec.windowsFirewallLogs = windowsFirewallLogs; + } else if ("prometheusForwarder".equals(fieldName)) { + List prometheusForwarder + = reader.readArray(reader1 -> PrometheusForwarderDataSource.fromJson(reader1)); + deserializedDataSourcesSpec.prometheusForwarder = prometheusForwarder; + } else if ("platformTelemetry".equals(fieldName)) { + List platformTelemetry + = reader.readArray(reader1 -> PlatformTelemetryDataSource.fromJson(reader1)); + deserializedDataSourcesSpec.platformTelemetry = platformTelemetry; + } else if ("dataImports".equals(fieldName)) { + deserializedDataSourcesSpec.dataImports = DataSourcesSpecDataImports.fromJson(reader); + } else if ("otelLogs".equals(fieldName)) { + List otelLogs + = reader.readArray(reader1 -> OtelLogsDataSource.fromJson(reader1)); + deserializedDataSourcesSpec.otelLogs = otelLogs; + } else if ("otelTraces".equals(fieldName)) { + List otelTraces + = reader.readArray(reader1 -> OtelTracesDataSource.fromJson(reader1)); + deserializedDataSourcesSpec.otelTraces = otelTraces; + } else if ("otelMetrics".equals(fieldName)) { + List otelMetrics + = reader.readArray(reader1 -> OtelMetricsDataSource.fromJson(reader1)); + deserializedDataSourcesSpec.otelMetrics = otelMetrics; + } else if ("etwProviders".equals(fieldName)) { + List etwProviders + = reader.readArray(reader1 -> EtwProviderDataSource.fromJson(reader1)); + deserializedDataSourcesSpec.etwProviders = etwProviders; } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpecDataImports.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpecDataImports.java new file mode 100644 index 000000000000..f6ba25d9df6a --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpecDataImports.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifications of pull based data sources. + */ +@Fluent +public final class DataSourcesSpecDataImports extends DataImportSources { + /** + * Creates an instance of DataSourcesSpecDataImports class. + */ + public DataSourcesSpecDataImports() { + } + + /** + * {@inheritDoc} + */ + @Override + public DataSourcesSpecDataImports withEventHub(DataImportSourcesEventHub eventHub) { + super.withEventHub(eventHub); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (eventHub() != null) { + eventHub().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("eventHub", eventHub()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataSourcesSpecDataImports from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataSourcesSpecDataImports if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataSourcesSpecDataImports. + */ + public static DataSourcesSpecDataImports fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataSourcesSpecDataImports deserializedDataSourcesSpecDataImports = new DataSourcesSpecDataImports(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventHub".equals(fieldName)) { + deserializedDataSourcesSpecDataImports.withEventHub(DataImportSourcesEventHub.fromJson(reader)); + } else { + reader.skipChildren(); + } + } + + return deserializedDataSourcesSpecDataImports; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.java index 59815a90f176..e5d4fe3504c3 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.java @@ -22,11 +22,51 @@ public class DestinationsSpec implements JsonSerializable { */ private List logAnalytics; + /* + * List of monitoring account destinations. + */ + private List monitoringAccounts; + /* * Azure Monitor Metrics destination. */ private DestinationsSpecAzureMonitorMetrics azureMonitorMetrics; + /* + * List of Event Hubs destinations. + */ + private List eventHubs; + + /* + * List of Event Hubs Direct destinations. + */ + private List eventHubsDirect; + + /* + * List of Storage Blob Direct destinations. To be used only for sending data directly to store from the agent. + */ + private List storageBlobsDirect; + + /* + * List of Storage Table Direct destinations. + */ + private List storageTablesDirect; + + /* + * List of storage accounts destinations. + */ + private List storageAccounts; + + /* + * List of Microsoft Fabric destinations. + */ + private List microsoftFabric; + + /* + * List of Azure Data Explorer destinations. + */ + private List azureDataExplorer; + /** * Creates an instance of DestinationsSpec class. */ @@ -53,6 +93,26 @@ public DestinationsSpec withLogAnalytics(List logAnalyt return this; } + /** + * Get the monitoringAccounts property: List of monitoring account destinations. + * + * @return the monitoringAccounts value. + */ + public List monitoringAccounts() { + return this.monitoringAccounts; + } + + /** + * Set the monitoringAccounts property: List of monitoring account destinations. + * + * @param monitoringAccounts the monitoringAccounts value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withMonitoringAccounts(List monitoringAccounts) { + this.monitoringAccounts = monitoringAccounts; + return this; + } + /** * Get the azureMonitorMetrics property: Azure Monitor Metrics destination. * @@ -73,6 +133,148 @@ public DestinationsSpec withAzureMonitorMetrics(DestinationsSpecAzureMonitorMetr return this; } + /** + * Get the eventHubs property: List of Event Hubs destinations. + * + * @return the eventHubs value. + */ + public List eventHubs() { + return this.eventHubs; + } + + /** + * Set the eventHubs property: List of Event Hubs destinations. + * + * @param eventHubs the eventHubs value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withEventHubs(List eventHubs) { + this.eventHubs = eventHubs; + return this; + } + + /** + * Get the eventHubsDirect property: List of Event Hubs Direct destinations. + * + * @return the eventHubsDirect value. + */ + public List eventHubsDirect() { + return this.eventHubsDirect; + } + + /** + * Set the eventHubsDirect property: List of Event Hubs Direct destinations. + * + * @param eventHubsDirect the eventHubsDirect value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withEventHubsDirect(List eventHubsDirect) { + this.eventHubsDirect = eventHubsDirect; + return this; + } + + /** + * Get the storageBlobsDirect property: List of Storage Blob Direct destinations. To be used only for sending data + * directly to store from the agent. + * + * @return the storageBlobsDirect value. + */ + public List storageBlobsDirect() { + return this.storageBlobsDirect; + } + + /** + * Set the storageBlobsDirect property: List of Storage Blob Direct destinations. To be used only for sending data + * directly to store from the agent. + * + * @param storageBlobsDirect the storageBlobsDirect value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withStorageBlobsDirect(List storageBlobsDirect) { + this.storageBlobsDirect = storageBlobsDirect; + return this; + } + + /** + * Get the storageTablesDirect property: List of Storage Table Direct destinations. + * + * @return the storageTablesDirect value. + */ + public List storageTablesDirect() { + return this.storageTablesDirect; + } + + /** + * Set the storageTablesDirect property: List of Storage Table Direct destinations. + * + * @param storageTablesDirect the storageTablesDirect value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withStorageTablesDirect(List storageTablesDirect) { + this.storageTablesDirect = storageTablesDirect; + return this; + } + + /** + * Get the storageAccounts property: List of storage accounts destinations. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storageAccounts property: List of storage accounts destinations. + * + * @param storageAccounts the storageAccounts value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + + /** + * Get the microsoftFabric property: List of Microsoft Fabric destinations. + * + * @return the microsoftFabric value. + */ + public List microsoftFabric() { + return this.microsoftFabric; + } + + /** + * Set the microsoftFabric property: List of Microsoft Fabric destinations. + * + * @param microsoftFabric the microsoftFabric value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withMicrosoftFabric(List microsoftFabric) { + this.microsoftFabric = microsoftFabric; + return this; + } + + /** + * Get the azureDataExplorer property: List of Azure Data Explorer destinations. + * + * @return the azureDataExplorer value. + */ + public List azureDataExplorer() { + return this.azureDataExplorer; + } + + /** + * Set the azureDataExplorer property: List of Azure Data Explorer destinations. + * + * @param azureDataExplorer the azureDataExplorer value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withAzureDataExplorer(List azureDataExplorer) { + this.azureDataExplorer = azureDataExplorer; + return this; + } + /** * Validates the instance. * @@ -82,9 +284,33 @@ public void validate() { if (logAnalytics() != null) { logAnalytics().forEach(e -> e.validate()); } + if (monitoringAccounts() != null) { + monitoringAccounts().forEach(e -> e.validate()); + } if (azureMonitorMetrics() != null) { azureMonitorMetrics().validate(); } + if (eventHubs() != null) { + eventHubs().forEach(e -> e.validate()); + } + if (eventHubsDirect() != null) { + eventHubsDirect().forEach(e -> e.validate()); + } + if (storageBlobsDirect() != null) { + storageBlobsDirect().forEach(e -> e.validate()); + } + if (storageTablesDirect() != null) { + storageTablesDirect().forEach(e -> e.validate()); + } + if (storageAccounts() != null) { + storageAccounts().forEach(e -> e.validate()); + } + if (microsoftFabric() != null) { + microsoftFabric().forEach(e -> e.validate()); + } + if (azureDataExplorer() != null) { + azureDataExplorer().forEach(e -> e.validate()); + } } /** @@ -94,7 +320,22 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("logAnalytics", this.logAnalytics, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("monitoringAccounts", this.monitoringAccounts, + (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("azureMonitorMetrics", this.azureMonitorMetrics); + jsonWriter.writeArrayField("eventHubs", this.eventHubs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("eventHubsDirect", this.eventHubsDirect, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("storageBlobsDirect", this.storageBlobsDirect, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("storageTablesDirect", this.storageTablesDirect, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("storageAccounts", this.storageAccounts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("microsoftFabric", this.microsoftFabric, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("azureDataExplorer", this.azureDataExplorer, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -117,9 +358,41 @@ public static DestinationsSpec fromJson(JsonReader jsonReader) throws IOExceptio List logAnalytics = reader.readArray(reader1 -> LogAnalyticsDestination.fromJson(reader1)); deserializedDestinationsSpec.logAnalytics = logAnalytics; + } else if ("monitoringAccounts".equals(fieldName)) { + List monitoringAccounts + = reader.readArray(reader1 -> MonitoringAccountDestination.fromJson(reader1)); + deserializedDestinationsSpec.monitoringAccounts = monitoringAccounts; } else if ("azureMonitorMetrics".equals(fieldName)) { deserializedDestinationsSpec.azureMonitorMetrics = DestinationsSpecAzureMonitorMetrics.fromJson(reader); + } else if ("eventHubs".equals(fieldName)) { + List eventHubs + = reader.readArray(reader1 -> EventHubDestination.fromJson(reader1)); + deserializedDestinationsSpec.eventHubs = eventHubs; + } else if ("eventHubsDirect".equals(fieldName)) { + List eventHubsDirect + = reader.readArray(reader1 -> EventHubDirectDestination.fromJson(reader1)); + deserializedDestinationsSpec.eventHubsDirect = eventHubsDirect; + } else if ("storageBlobsDirect".equals(fieldName)) { + List storageBlobsDirect + = reader.readArray(reader1 -> StorageBlobDestination.fromJson(reader1)); + deserializedDestinationsSpec.storageBlobsDirect = storageBlobsDirect; + } else if ("storageTablesDirect".equals(fieldName)) { + List storageTablesDirect + = reader.readArray(reader1 -> StorageTableDestination.fromJson(reader1)); + deserializedDestinationsSpec.storageTablesDirect = storageTablesDirect; + } else if ("storageAccounts".equals(fieldName)) { + List storageAccounts + = reader.readArray(reader1 -> StorageBlobDestination.fromJson(reader1)); + deserializedDestinationsSpec.storageAccounts = storageAccounts; + } else if ("microsoftFabric".equals(fieldName)) { + List microsoftFabric + = reader.readArray(reader1 -> MicrosoftFabricDestination.fromJson(reader1)); + deserializedDestinationsSpec.microsoftFabric = microsoftFabric; + } else if ("azureDataExplorer".equals(fieldName)) { + List azureDataExplorer + = reader.readArray(reader1 -> AdxDestination.fromJson(reader1)); + deserializedDestinationsSpec.azureDataExplorer = azureDataExplorer; } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java index 7e4951e0d2bc..d57ff43d5272 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java @@ -37,7 +37,6 @@ public DestinationsSpecAzureMonitorMetrics withName(String name) { */ @Override public void validate() { - super.validate(); } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DirectDataSourcesSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DirectDataSourcesSpec.java new file mode 100644 index 000000000000..c94b2e47cbb8 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DirectDataSourcesSpec.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Specification of direct data sources that will be collected. + */ +@Fluent +public class DirectDataSourcesSpec implements JsonSerializable { + /* + * The list of OTel metrics data source configurations. + */ + private List otelMetrics; + + /* + * The list of OTel logs data source configurations. + */ + private List otelLogs; + + /* + * The list of OTel traces data source configurations. + */ + private List otelTraces; + + /** + * Creates an instance of DirectDataSourcesSpec class. + */ + public DirectDataSourcesSpec() { + } + + /** + * Get the otelMetrics property: The list of OTel metrics data source configurations. + * + * @return the otelMetrics value. + */ + public List otelMetrics() { + return this.otelMetrics; + } + + /** + * Set the otelMetrics property: The list of OTel metrics data source configurations. + * + * @param otelMetrics the otelMetrics value to set. + * @return the DirectDataSourcesSpec object itself. + */ + public DirectDataSourcesSpec withOtelMetrics(List otelMetrics) { + this.otelMetrics = otelMetrics; + return this; + } + + /** + * Get the otelLogs property: The list of OTel logs data source configurations. + * + * @return the otelLogs value. + */ + public List otelLogs() { + return this.otelLogs; + } + + /** + * Set the otelLogs property: The list of OTel logs data source configurations. + * + * @param otelLogs the otelLogs value to set. + * @return the DirectDataSourcesSpec object itself. + */ + public DirectDataSourcesSpec withOtelLogs(List otelLogs) { + this.otelLogs = otelLogs; + return this; + } + + /** + * Get the otelTraces property: The list of OTel traces data source configurations. + * + * @return the otelTraces value. + */ + public List otelTraces() { + return this.otelTraces; + } + + /** + * Set the otelTraces property: The list of OTel traces data source configurations. + * + * @param otelTraces the otelTraces value to set. + * @return the DirectDataSourcesSpec object itself. + */ + public DirectDataSourcesSpec withOtelTraces(List otelTraces) { + this.otelTraces = otelTraces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (otelMetrics() != null) { + otelMetrics().forEach(e -> e.validate()); + } + if (otelLogs() != null) { + otelLogs().forEach(e -> e.validate()); + } + if (otelTraces() != null) { + otelTraces().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("otelMetrics", this.otelMetrics, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("otelLogs", this.otelLogs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("otelTraces", this.otelTraces, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DirectDataSourcesSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DirectDataSourcesSpec if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DirectDataSourcesSpec. + */ + public static DirectDataSourcesSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DirectDataSourcesSpec deserializedDirectDataSourcesSpec = new DirectDataSourcesSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("otelMetrics".equals(fieldName)) { + List otelMetrics + = reader.readArray(reader1 -> OtelMetricsDirectDataSource.fromJson(reader1)); + deserializedDirectDataSourcesSpec.otelMetrics = otelMetrics; + } else if ("otelLogs".equals(fieldName)) { + List otelLogs + = reader.readArray(reader1 -> OtelLogsDirectDataSource.fromJson(reader1)); + deserializedDirectDataSourcesSpec.otelLogs = otelLogs; + } else if ("otelTraces".equals(fieldName)) { + List otelTraces + = reader.readArray(reader1 -> OtelTracesDirectDataSource.fromJson(reader1)); + deserializedDirectDataSourcesSpec.otelTraces = otelTraces; + } else { + reader.skipChildren(); + } + } + + return deserializedDirectDataSourcesSpec; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java index a76f6268d8ee..40e572a0b1a7 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java @@ -23,18 +23,19 @@ @Fluent public final class DynamicMetricCriteria extends MultiMetricCriteria { /* - * Specifies the type of threshold criteria + * Specifies the type of threshold criteria. Previously undocumented values might be returned */ private CriterionType criterionType = CriterionType.DYNAMIC_THRESHOLD_CRITERION; /* - * The operator used to compare the metric value against the threshold. + * The operator used to compare the metric value against the threshold. Previously undocumented values might be + * returned */ private DynamicThresholdOperator operator; /* * The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric - * series pattern. + * series pattern. Previously undocumented values might be returned */ private DynamicThresholdSensitivity alertSensitivity; @@ -56,7 +57,8 @@ public DynamicMetricCriteria() { } /** - * Get the criterionType property: Specifies the type of threshold criteria. + * Get the criterionType property: Specifies the type of threshold criteria. Previously undocumented values might be + * returned. * * @return the criterionType value. */ @@ -66,7 +68,8 @@ public CriterionType criterionType() { } /** - * Get the operator property: The operator used to compare the metric value against the threshold. + * Get the operator property: The operator used to compare the metric value against the threshold. Previously + * undocumented values might be returned. * * @return the operator value. */ @@ -75,7 +78,8 @@ public DynamicThresholdOperator operator() { } /** - * Set the operator property: The operator used to compare the metric value against the threshold. + * Set the operator property: The operator used to compare the metric value against the threshold. Previously + * undocumented values might be returned. * * @param operator the operator value to set. * @return the DynamicMetricCriteria object itself. @@ -87,7 +91,7 @@ public DynamicMetricCriteria withOperator(DynamicThresholdOperator operator) { /** * Get the alertSensitivity property: The extent of deviation required to trigger an alert. This will affect how - * tight the threshold is to the metric series pattern. + * tight the threshold is to the metric series pattern. Previously undocumented values might be returned. * * @return the alertSensitivity value. */ @@ -97,7 +101,7 @@ public DynamicThresholdSensitivity alertSensitivity() { /** * Set the alertSensitivity property: The extent of deviation required to trigger an alert. This will affect how - * tight the threshold is to the metric series pattern. + * tight the threshold is to the metric series pattern. Previously undocumented values might be returned. * * @param alertSensitivity the alertSensitivity value to set. * @return the DynamicMetricCriteria object itself. @@ -212,7 +216,6 @@ public DynamicMetricCriteria withSkipMetricValidation(Boolean skipMetricValidati */ @Override public void validate() { - super.validate(); if (operator() == null) { throw LOGGER.atError() .log(new IllegalArgumentException("Missing required property operator in model DynamicMetricCriteria")); @@ -229,6 +232,23 @@ public void validate() { } else { failingPeriods().validate(); } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model DynamicMetricCriteria")); + } + if (metricName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property metricName in model DynamicMetricCriteria")); + } + if (timeAggregation() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property timeAggregation in model DynamicMetricCriteria")); + } + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } } private static final ClientLogger LOGGER = new ClientLogger(DynamicMetricCriteria.class); diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicPromQLCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicPromQLCriteria.java new file mode 100644 index 000000000000..2a522557d92c --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicPromQLCriteria.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The criterion for dynamic prom query. + */ +@Fluent +public final class DynamicPromQLCriteria extends MultiPromQLCriteria { + /* + * Specifies the type of threshold criteria. Previously undocumented values might be returned + */ + private CriterionType criterionType = CriterionType.DYNAMIC_THRESHOLD_CRITERION; + + /* + * The operator used to compare the metric value against the threshold. Previously undocumented values might be + * returned + */ + private DynamicThresholdOperator operator; + + /* + * The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric + * series pattern. Previously undocumented values might be returned + */ + private DynamicThresholdSensitivity alertSensitivity; + + /* + * Use this option to set the date from which to start learning the metric historical data and calculate the dynamic + * thresholds (in ISO8601 format) + */ + private OffsetDateTime ignoreDataBefore; + + /** + * Creates an instance of DynamicPromQLCriteria class. + */ + public DynamicPromQLCriteria() { + } + + /** + * Get the criterionType property: Specifies the type of threshold criteria. Previously undocumented values might be + * returned. + * + * @return the criterionType value. + */ + @Override + public CriterionType criterionType() { + return this.criterionType; + } + + /** + * Get the operator property: The operator used to compare the metric value against the threshold. Previously + * undocumented values might be returned. + * + * @return the operator value. + */ + public DynamicThresholdOperator operator() { + return this.operator; + } + + /** + * Set the operator property: The operator used to compare the metric value against the threshold. Previously + * undocumented values might be returned. + * + * @param operator the operator value to set. + * @return the DynamicPromQLCriteria object itself. + */ + public DynamicPromQLCriteria withOperator(DynamicThresholdOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the alertSensitivity property: The extent of deviation required to trigger an alert. This will affect how + * tight the threshold is to the metric series pattern. Previously undocumented values might be returned. + * + * @return the alertSensitivity value. + */ + public DynamicThresholdSensitivity alertSensitivity() { + return this.alertSensitivity; + } + + /** + * Set the alertSensitivity property: The extent of deviation required to trigger an alert. This will affect how + * tight the threshold is to the metric series pattern. Previously undocumented values might be returned. + * + * @param alertSensitivity the alertSensitivity value to set. + * @return the DynamicPromQLCriteria object itself. + */ + public DynamicPromQLCriteria withAlertSensitivity(DynamicThresholdSensitivity alertSensitivity) { + this.alertSensitivity = alertSensitivity; + return this; + } + + /** + * Get the ignoreDataBefore property: Use this option to set the date from which to start learning the metric + * historical data and calculate the dynamic thresholds (in ISO8601 format). + * + * @return the ignoreDataBefore value. + */ + public OffsetDateTime ignoreDataBefore() { + return this.ignoreDataBefore; + } + + /** + * Set the ignoreDataBefore property: Use this option to set the date from which to start learning the metric + * historical data and calculate the dynamic thresholds (in ISO8601 format). + * + * @param ignoreDataBefore the ignoreDataBefore value to set. + * @return the DynamicPromQLCriteria object itself. + */ + public DynamicPromQLCriteria withIgnoreDataBefore(OffsetDateTime ignoreDataBefore) { + this.ignoreDataBefore = ignoreDataBefore; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DynamicPromQLCriteria withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DynamicPromQLCriteria withQuery(String query) { + super.withQuery(query); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property operator in model DynamicPromQLCriteria")); + } + if (alertSensitivity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property alertSensitivity in model DynamicPromQLCriteria")); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model DynamicPromQLCriteria")); + } + if (query() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property query in model DynamicPromQLCriteria")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DynamicPromQLCriteria.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("query", query()); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeStringField("alertSensitivity", + this.alertSensitivity == null ? null : this.alertSensitivity.toString()); + jsonWriter.writeStringField("criterionType", this.criterionType == null ? null : this.criterionType.toString()); + jsonWriter.writeStringField("ignoreDataBefore", + this.ignoreDataBefore == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.ignoreDataBefore)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamicPromQLCriteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamicPromQLCriteria if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DynamicPromQLCriteria. + */ + public static DynamicPromQLCriteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamicPromQLCriteria deserializedDynamicPromQLCriteria = new DynamicPromQLCriteria(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDynamicPromQLCriteria.withName(reader.getString()); + } else if ("query".equals(fieldName)) { + deserializedDynamicPromQLCriteria.withQuery(reader.getString()); + } else if ("operator".equals(fieldName)) { + deserializedDynamicPromQLCriteria.operator + = DynamicThresholdOperator.fromString(reader.getString()); + } else if ("alertSensitivity".equals(fieldName)) { + deserializedDynamicPromQLCriteria.alertSensitivity + = DynamicThresholdSensitivity.fromString(reader.getString()); + } else if ("criterionType".equals(fieldName)) { + deserializedDynamicPromQLCriteria.criterionType = CriterionType.fromString(reader.getString()); + } else if ("ignoreDataBefore".equals(fieldName)) { + deserializedDynamicPromQLCriteria.ignoreDataBefore = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamicPromQLCriteria; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdOperator.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdOperator.java index 50f6977af66c..9672add273dc 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdOperator.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdOperator.java @@ -8,7 +8,8 @@ import java.util.Collection; /** - * The operator used to compare the metric value against the threshold. + * The operator used to compare the metric value against the threshold. Previously undocumented values might be + * returned. */ public final class DynamicThresholdOperator extends ExpandableStringEnum { /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdSensitivity.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdSensitivity.java index 160f4c4d79f4..142daa63500e 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdSensitivity.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicThresholdSensitivity.java @@ -9,7 +9,7 @@ /** * The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric - * series pattern. + * series pattern. Previously undocumented values might be returned. */ public final class DynamicThresholdSensitivity extends ExpandableStringEnum { /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EndpointsSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EndpointsSpec.java new file mode 100644 index 000000000000..a6cf5f25aa33 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EndpointsSpec.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * This defines all the ingestion endpoints that can be used by this rule. + */ +@Immutable +public class EndpointsSpec implements JsonSerializable { + /* + * The ingestion endpoint for logs + */ + private String logsIngestion; + + /* + * The ingestion endpoint for metrics + */ + private String metricsIngestion; + + /** + * Creates an instance of EndpointsSpec class. + */ + public EndpointsSpec() { + } + + /** + * Get the logsIngestion property: The ingestion endpoint for logs. + * + * @return the logsIngestion value. + */ + public String logsIngestion() { + return this.logsIngestion; + } + + /** + * Set the logsIngestion property: The ingestion endpoint for logs. + * + * @param logsIngestion the logsIngestion value to set. + * @return the EndpointsSpec object itself. + */ + EndpointsSpec withLogsIngestion(String logsIngestion) { + this.logsIngestion = logsIngestion; + return this; + } + + /** + * Get the metricsIngestion property: The ingestion endpoint for metrics. + * + * @return the metricsIngestion value. + */ + public String metricsIngestion() { + return this.metricsIngestion; + } + + /** + * Set the metricsIngestion property: The ingestion endpoint for metrics. + * + * @param metricsIngestion the metricsIngestion value to set. + * @return the EndpointsSpec object itself. + */ + EndpointsSpec withMetricsIngestion(String metricsIngestion) { + this.metricsIngestion = metricsIngestion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointsSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointsSpec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointsSpec. + */ + public static EndpointsSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointsSpec deserializedEndpointsSpec = new EndpointsSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logsIngestion".equals(fieldName)) { + deserializedEndpointsSpec.logsIngestion = reader.getString(); + } else if ("metricsIngestion".equals(fieldName)) { + deserializedEndpointsSpec.metricsIngestion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointsSpec; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EnrichmentData.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EnrichmentData.java new file mode 100644 index 000000000000..79572820f089 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EnrichmentData.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * All the enrichment data sources referenced in data flows. + */ +@Fluent +public class EnrichmentData implements JsonSerializable { + /* + * All the storage blobs used as enrichment data sources + */ + private List storageBlobs; + + /** + * Creates an instance of EnrichmentData class. + */ + public EnrichmentData() { + } + + /** + * Get the storageBlobs property: All the storage blobs used as enrichment data sources. + * + * @return the storageBlobs value. + */ + public List storageBlobs() { + return this.storageBlobs; + } + + /** + * Set the storageBlobs property: All the storage blobs used as enrichment data sources. + * + * @param storageBlobs the storageBlobs value to set. + * @return the EnrichmentData object itself. + */ + public EnrichmentData withStorageBlobs(List storageBlobs) { + this.storageBlobs = storageBlobs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageBlobs() != null) { + storageBlobs().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("storageBlobs", this.storageBlobs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrichmentData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrichmentData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EnrichmentData. + */ + public static EnrichmentData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrichmentData deserializedEnrichmentData = new EnrichmentData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageBlobs".equals(fieldName)) { + List storageBlobs = reader.readArray(reader1 -> StorageBlob.fromJson(reader1)); + deserializedEnrichmentData.storageBlobs = storageBlobs; + } else { + reader.skipChildren(); + } + } + + return deserializedEnrichmentData; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EtwProviderDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EtwProviderDataSource.java new file mode 100644 index 000000000000..115b48bf3366 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EtwProviderDataSource.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Enables an ETW provider logs to be collected by this data collection rule. + */ +@Fluent +public final class EtwProviderDataSource implements JsonSerializable { + /* + * List of streams that this data source will be sent to + */ + private List streams; + + /* + * The provider GUID or class name for event source + */ + private String provider; + + /* + * Provider type specification: By Manifest GUID or by Event Source name + */ + private KnownEtwProviderType providerType; + + /* + * Minimal level of detail to be logged + */ + private KnownEtwProviderDataSourceLogLevel logLevel; + + /* + * Events Ids to collect + */ + private List eventIds; + + /* + * Event's membership in a set of event categories + */ + private String keyword; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of EtwProviderDataSource class. + */ + public EtwProviderDataSource() { + } + + /** + * Get the streams property: List of streams that this data source will be sent to. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams that this data source will be sent to. + * + * @param streams the streams value to set. + * @return the EtwProviderDataSource object itself. + */ + public EtwProviderDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the provider property: The provider GUID or class name for event source. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The provider GUID or class name for event source. + * + * @param provider the provider value to set. + * @return the EtwProviderDataSource object itself. + */ + public EtwProviderDataSource withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the providerType property: Provider type specification: By Manifest GUID or by Event Source name. + * + * @return the providerType value. + */ + public KnownEtwProviderType providerType() { + return this.providerType; + } + + /** + * Set the providerType property: Provider type specification: By Manifest GUID or by Event Source name. + * + * @param providerType the providerType value to set. + * @return the EtwProviderDataSource object itself. + */ + public EtwProviderDataSource withProviderType(KnownEtwProviderType providerType) { + this.providerType = providerType; + return this; + } + + /** + * Get the logLevel property: Minimal level of detail to be logged. + * + * @return the logLevel value. + */ + public KnownEtwProviderDataSourceLogLevel logLevel() { + return this.logLevel; + } + + /** + * Set the logLevel property: Minimal level of detail to be logged. + * + * @param logLevel the logLevel value to set. + * @return the EtwProviderDataSource object itself. + */ + public EtwProviderDataSource withLogLevel(KnownEtwProviderDataSourceLogLevel logLevel) { + this.logLevel = logLevel; + return this; + } + + /** + * Get the eventIds property: Events Ids to collect. + * + * @return the eventIds value. + */ + public List eventIds() { + return this.eventIds; + } + + /** + * Set the eventIds property: Events Ids to collect. + * + * @param eventIds the eventIds value to set. + * @return the EtwProviderDataSource object itself. + */ + public EtwProviderDataSource withEventIds(List eventIds) { + this.eventIds = eventIds; + return this; + } + + /** + * Get the keyword property: Event's membership in a set of event categories. + * + * @return the keyword value. + */ + public String keyword() { + return this.keyword; + } + + /** + * Set the keyword property: Event's membership in a set of event categories. + * + * @param keyword the keyword value to set. + * @return the EtwProviderDataSource object itself. + */ + public EtwProviderDataSource withKeyword(String keyword) { + this.keyword = keyword; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the EtwProviderDataSource object itself. + */ + public EtwProviderDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streams() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property streams in model EtwProviderDataSource")); + } + if (provider() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property provider in model EtwProviderDataSource")); + } + if (providerType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property providerType in model EtwProviderDataSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EtwProviderDataSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("providerType", this.providerType == null ? null : this.providerType.toString()); + jsonWriter.writeStringField("logLevel", this.logLevel == null ? null : this.logLevel.toString()); + jsonWriter.writeArrayField("eventIds", this.eventIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("keyword", this.keyword); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EtwProviderDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EtwProviderDataSource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EtwProviderDataSource. + */ + public static EtwProviderDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EtwProviderDataSource deserializedEtwProviderDataSource = new EtwProviderDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams = reader.readArray(reader1 -> reader1.getString()); + deserializedEtwProviderDataSource.streams = streams; + } else if ("provider".equals(fieldName)) { + deserializedEtwProviderDataSource.provider = reader.getString(); + } else if ("providerType".equals(fieldName)) { + deserializedEtwProviderDataSource.providerType + = KnownEtwProviderType.fromString(reader.getString()); + } else if ("logLevel".equals(fieldName)) { + deserializedEtwProviderDataSource.logLevel + = KnownEtwProviderDataSourceLogLevel.fromString(reader.getString()); + } else if ("eventIds".equals(fieldName)) { + List eventIds = reader.readArray(reader1 -> reader1.getString()); + deserializedEtwProviderDataSource.eventIds = eventIds; + } else if ("keyword".equals(fieldName)) { + deserializedEtwProviderDataSource.keyword = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEtwProviderDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEtwProviderDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventHubDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventHubDataSource.java new file mode 100644 index 000000000000..297f61435672 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventHubDataSource.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The EventHubDataSource model. + */ +@Fluent +public class EventHubDataSource implements JsonSerializable { + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /* + * Event Hub consumer group name + */ + private String consumerGroup; + + /* + * The stream to collect from EventHub + */ + private String stream; + + /** + * Creates an instance of EventHubDataSource class. + */ + public EventHubDataSource() { + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the EventHubDataSource object itself. + */ + public EventHubDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the consumerGroup property: Event Hub consumer group name. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: Event Hub consumer group name. + * + * @param consumerGroup the consumerGroup value to set. + * @return the EventHubDataSource object itself. + */ + public EventHubDataSource withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the stream property: The stream to collect from EventHub. + * + * @return the stream value. + */ + public String stream() { + return this.stream; + } + + /** + * Set the stream property: The stream to collect from EventHub. + * + * @param stream the stream value to set. + * @return the EventHubDataSource object itself. + */ + public EventHubDataSource withStream(String stream) { + this.stream = stream; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("consumerGroup", this.consumerGroup); + jsonWriter.writeStringField("stream", this.stream); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EventHubDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EventHubDataSource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EventHubDataSource. + */ + public static EventHubDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EventHubDataSource deserializedEventHubDataSource = new EventHubDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedEventHubDataSource.name = reader.getString(); + } else if ("consumerGroup".equals(fieldName)) { + deserializedEventHubDataSource.consumerGroup = reader.getString(); + } else if ("stream".equals(fieldName)) { + deserializedEventHubDataSource.stream = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEventHubDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventHubDestination.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventHubDestination.java new file mode 100644 index 000000000000..54cdf8767a2c --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventHubDestination.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The EventHubDestination model. + */ +@Fluent +public final class EventHubDestination implements JsonSerializable { + /* + * The resource ID of the event hub. + */ + private String eventHubResourceId; + + /* + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of EventHubDestination class. + */ + public EventHubDestination() { + } + + /** + * Get the eventHubResourceId property: The resource ID of the event hub. + * + * @return the eventHubResourceId value. + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the eventHubResourceId property: The resource ID of the event hub. + * + * @param eventHubResourceId the eventHubResourceId value to set. + * @return the EventHubDestination object itself. + */ + public EventHubDestination withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the EventHubDestination object itself. + */ + public EventHubDestination withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("eventHubResourceId", this.eventHubResourceId); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EventHubDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EventHubDestination if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EventHubDestination. + */ + public static EventHubDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EventHubDestination deserializedEventHubDestination = new EventHubDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventHubResourceId".equals(fieldName)) { + deserializedEventHubDestination.eventHubResourceId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEventHubDestination.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEventHubDestination; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventHubDirectDestination.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventHubDirectDestination.java new file mode 100644 index 000000000000..e1858ccbaeff --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EventHubDirectDestination.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The EventHubDirectDestination model. + */ +@Fluent +public final class EventHubDirectDestination implements JsonSerializable { + /* + * The resource ID of the event hub. + */ + private String eventHubResourceId; + + /* + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of EventHubDirectDestination class. + */ + public EventHubDirectDestination() { + } + + /** + * Get the eventHubResourceId property: The resource ID of the event hub. + * + * @return the eventHubResourceId value. + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the eventHubResourceId property: The resource ID of the event hub. + * + * @param eventHubResourceId the eventHubResourceId value to set. + * @return the EventHubDirectDestination object itself. + */ + public EventHubDirectDestination withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the EventHubDirectDestination object itself. + */ + public EventHubDirectDestination withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("eventHubResourceId", this.eventHubResourceId); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EventHubDirectDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EventHubDirectDestination if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EventHubDirectDestination. + */ + public static EventHubDirectDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EventHubDirectDestination deserializedEventHubDirectDestination = new EventHubDirectDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventHubResourceId".equals(fieldName)) { + deserializedEventHubDirectDestination.eventHubResourceId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEventHubDirectDestination.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEventHubDirectDestination; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java index 521a33101a21..b3d9ecdc3504 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java @@ -183,7 +183,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("extensionName", this.extensionName); jsonWriter.writeArrayField("streams", this.streams, (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeUntypedField("extensionSettings", this.extensionSettings); + if (this.extensionSettings != null) { + jsonWriter.writeUntypedField("extensionSettings", this.extensionSettings); + } jsonWriter.writeArrayField("inputDataSources", this.inputDataSources, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("name", this.name); diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/FailoverConfigurationSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/FailoverConfigurationSpec.java new file mode 100644 index 000000000000..803c55f7aa98 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/FailoverConfigurationSpec.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The FailoverConfigurationSpec model. + */ +@Fluent +public class FailoverConfigurationSpec implements JsonSerializable { + /* + * Active location where data flow will occur. + */ + private String activeLocation; + + /* + * Locations that are configured for failover. + */ + private List locations; + + /** + * Creates an instance of FailoverConfigurationSpec class. + */ + public FailoverConfigurationSpec() { + } + + /** + * Get the activeLocation property: Active location where data flow will occur. + * + * @return the activeLocation value. + */ + public String activeLocation() { + return this.activeLocation; + } + + /** + * Set the activeLocation property: Active location where data flow will occur. + * + * @param activeLocation the activeLocation value to set. + * @return the FailoverConfigurationSpec object itself. + */ + public FailoverConfigurationSpec withActiveLocation(String activeLocation) { + this.activeLocation = activeLocation; + return this; + } + + /** + * Get the locations property: Locations that are configured for failover. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: Locations that are configured for failover. + * + * @param locations the locations value to set. + * @return the FailoverConfigurationSpec object itself. + */ + public FailoverConfigurationSpec withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locations() != null) { + locations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("activeLocation", this.activeLocation); + jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FailoverConfigurationSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FailoverConfigurationSpec if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FailoverConfigurationSpec. + */ + public static FailoverConfigurationSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FailoverConfigurationSpec deserializedFailoverConfigurationSpec = new FailoverConfigurationSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activeLocation".equals(fieldName)) { + deserializedFailoverConfigurationSpec.activeLocation = reader.getString(); + } else if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> LocationSpec.fromJson(reader1)); + deserializedFailoverConfigurationSpec.locations = locations; + } else { + reader.skipChildren(); + } + } + + return deserializedFailoverConfigurationSpec; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Identity.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Identity.java new file mode 100644 index 000000000000..72d3097d3832 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Identity.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Identity for the resource. + */ +@Fluent +public final class Identity implements JsonSerializable { + /* + * The principal ID of resource identity. + */ + private String principalId; + + /* + * The tenant ID of resource. + */ + private String tenantId; + + /* + * Type of managed service identity. Previously undocumented values might be returned + */ + private IdentityType type; + + /* + * The list of user identities associated with the resource. The user identity dictionary key references will be + * Azure resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}'. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of Identity class. + */ + public Identity() { + } + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity. Previously undocumented values might be returned. + * + * @return the type value. + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity. Previously undocumented values might be returned. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be Azure resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be Azure resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model Identity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Identity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Identity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Identity if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Identity. + */ + public static Identity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Identity deserializedIdentity = new Identity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedIdentity.type = IdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserIdentityProperties.fromJson(reader1)); + deserializedIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedIdentity; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IdentityType.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IdentityType.java new file mode 100644 index 000000000000..b7c14b026352 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IdentityType.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +/** + * Type of managed service identity. + */ +public enum IdentityType { + /** + * Enum value SystemAssigned. + */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** + * Enum value UserAssigned. + */ + USER_ASSIGNED("UserAssigned"), + + /** + * Enum value None. + */ + NONE("None"), + + /** + * Enum value none. + */ + NONE_1("none"), + + /** + * Enum value systemAssigned. + */ + SYSTEM_ASSIGNED_1("systemAssigned"), + + /** + * Enum value userAssigned. + */ + USER_ASSIGNED_1("userAssigned"), + + /** + * Enum value SystemAssigned, UserAssigned. + */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"); + + /** + * The actual serialized value for a IdentityType instance. + */ + private final String value; + + IdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + public static IdentityType fromString(String value) { + if (value == null) { + return null; + } + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IisLogsDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IisLogsDataSource.java index 7d1bf96ae847..9ac855dd4847 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IisLogsDataSource.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IisLogsDataSource.java @@ -28,6 +28,11 @@ public final class IisLogsDataSource implements JsonSerializable logDirectories; + /* + * The KQL query to transform the data source. This is a deprecated property and will be removed in future versions. + */ + private String transformKql; + /* * A friendly name for the data source. * This name should be unique across all data sources (regardless of type) within the data collection rule. @@ -80,6 +85,28 @@ public IisLogsDataSource withLogDirectories(List logDirectories) { return this; } + /** + * Get the transformKql property: The KQL query to transform the data source. This is a deprecated property and will + * be removed in future versions. + * + * @return the transformKql value. + */ + public String transformKql() { + return this.transformKql; + } + + /** + * Set the transformKql property: The KQL query to transform the data source. This is a deprecated property and will + * be removed in future versions. + * + * @param transformKql the transformKql value to set. + * @return the IisLogsDataSource object itself. + */ + public IisLogsDataSource withTransformKql(String transformKql) { + this.transformKql = transformKql; + return this; + } + /** * Get the name property: A friendly name for the data source. * This name should be unique across all data sources (regardless of type) within the data collection rule. @@ -125,6 +152,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("streams", this.streams, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("logDirectories", this.logDirectories, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("transformKql", this.transformKql); jsonWriter.writeStringField("name", this.name); return jsonWriter.writeEndObject(); } @@ -151,6 +179,8 @@ public static IisLogsDataSource fromJson(JsonReader jsonReader) throws IOExcepti } else if ("logDirectories".equals(fieldName)) { List logDirectories = reader.readArray(reader1 -> reader1.getString()); deserializedIisLogsDataSource.logDirectories = logDirectories; + } else if ("transformKql".equals(fieldName)) { + deserializedIisLogsDataSource.transformKql = reader.getString(); } else if ("name".equals(fieldName)) { deserializedIisLogsDataSource.name = reader.getString(); } else { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IngestionQuotas.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IngestionQuotas.java new file mode 100644 index 000000000000..31de5e193494 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IngestionQuotas.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The IngestionQuotas model. + */ +@Fluent +public class IngestionQuotas implements JsonSerializable { + /* + * The logs property. + */ + private IngestionQuotasLogs logs; + + /** + * Creates an instance of IngestionQuotas class. + */ + public IngestionQuotas() { + } + + /** + * Get the logs property: The logs property. + * + * @return the logs value. + */ + public IngestionQuotasLogs logs() { + return this.logs; + } + + /** + * Set the logs property: The logs property. + * + * @param logs the logs value to set. + * @return the IngestionQuotas object itself. + */ + public IngestionQuotas withLogs(IngestionQuotasLogs logs) { + this.logs = logs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logs() != null) { + logs().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logs", this.logs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IngestionQuotas from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IngestionQuotas if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IngestionQuotas. + */ + public static IngestionQuotas fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IngestionQuotas deserializedIngestionQuotas = new IngestionQuotas(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logs".equals(fieldName)) { + deserializedIngestionQuotas.logs = IngestionQuotasLogs.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIngestionQuotas; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IngestionQuotasLogs.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IngestionQuotasLogs.java new file mode 100644 index 000000000000..93d9f54e1279 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/IngestionQuotasLogs.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The IngestionQuotasLogs model. + */ +@Fluent +public final class IngestionQuotasLogs extends LogsQuotaSpec { + /** + * Creates an instance of IngestionQuotasLogs class. + */ + public IngestionQuotasLogs() { + } + + /** + * {@inheritDoc} + */ + @Override + public IngestionQuotasLogs withMaxSizePerMinuteInGB(String maxSizePerMinuteInGB) { + super.withMaxSizePerMinuteInGB(maxSizePerMinuteInGB); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IngestionQuotasLogs withMaxRequestsPerMinute(String maxRequestsPerMinute) { + super.withMaxRequestsPerMinute(maxRequestsPerMinute); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("maxSizePerMinuteInGB", maxSizePerMinuteInGB()); + jsonWriter.writeStringField("maxRequestsPerMinute", maxRequestsPerMinute()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IngestionQuotasLogs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IngestionQuotasLogs if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IngestionQuotasLogs. + */ + public static IngestionQuotasLogs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IngestionQuotasLogs deserializedIngestionQuotasLogs = new IngestionQuotasLogs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxSizePerMinuteInGB".equals(fieldName)) { + deserializedIngestionQuotasLogs.withMaxSizePerMinuteInGB(reader.getString()); + } else if ("maxRequestsPerMinute".equals(fieldName)) { + deserializedIngestionQuotasLogs.withMaxRequestsPerMinute(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIngestionQuotasLogs; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownAgentSettingName.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownAgentSettingName.java new file mode 100644 index 000000000000..f5299a29bf27 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownAgentSettingName.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The name of the setting. + * Must be part of the list of supported settings. + */ +public final class KnownAgentSettingName extends ExpandableStringEnum { + /** + * Static value MaxDiskQuotaInMB for KnownAgentSettingName. + */ + public static final KnownAgentSettingName MAX_DISK_QUOTA_IN_MB = fromString("MaxDiskQuotaInMB"); + + /** + * Static value UseTimeReceivedForForwardedEvents for KnownAgentSettingName. + */ + public static final KnownAgentSettingName USE_TIME_RECEIVED_FOR_FORWARDED_EVENTS + = fromString("UseTimeReceivedForForwardedEvents"); + + /** + * Static value Tags for KnownAgentSettingName. + */ + public static final KnownAgentSettingName TAGS = fromString("Tags"); + + /** + * Creates a new instance of KnownAgentSettingName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownAgentSettingName() { + } + + /** + * Creates or finds a KnownAgentSettingName from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownAgentSettingName. + */ + public static KnownAgentSettingName fromString(String name) { + return fromString(name, KnownAgentSettingName.class); + } + + /** + * Gets known KnownAgentSettingName values. + * + * @return known KnownAgentSettingName values. + */ + public static Collection values() { + return values(KnownAgentSettingName.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java index 08c15dc6b7aa..a012f2806a0c 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java @@ -32,6 +32,11 @@ public final class KnownDataCollectionEndpointProvisioningState */ public static final KnownDataCollectionEndpointProvisioningState SUCCEEDED = fromString("Succeeded"); + /** + * Static value Canceled for KnownDataCollectionEndpointProvisioningState. + */ + public static final KnownDataCollectionEndpointProvisioningState CANCELED = fromString("Canceled"); + /** * Static value Failed for KnownDataCollectionEndpointProvisioningState. */ diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java index 9328ef7ce3f2..f2fbf7d8d495 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java @@ -32,6 +32,11 @@ public final class KnownDataCollectionRuleAssociationProvisioningState */ public static final KnownDataCollectionRuleAssociationProvisioningState SUCCEEDED = fromString("Succeeded"); + /** + * Static value Canceled for KnownDataCollectionRuleAssociationProvisioningState. + */ + public static final KnownDataCollectionRuleAssociationProvisioningState CANCELED = fromString("Canceled"); + /** * Static value Failed for KnownDataCollectionRuleAssociationProvisioningState. */ diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java index 26c4d11c2232..9c744e631842 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java @@ -32,6 +32,11 @@ public final class KnownDataCollectionRuleProvisioningState */ public static final KnownDataCollectionRuleProvisioningState SUCCEEDED = fromString("Succeeded"); + /** + * Static value Canceled for KnownDataCollectionRuleProvisioningState. + */ + public static final KnownDataCollectionRuleProvisioningState CANCELED = fromString("Canceled"); + /** * Static value Failed for KnownDataCollectionRuleProvisioningState. */ diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownEtwProviderDataSourceLogLevel.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownEtwProviderDataSourceLogLevel.java new file mode 100644 index 000000000000..ef6527e3104f --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownEtwProviderDataSourceLogLevel.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Minimal level of detail to be logged. + */ +public final class KnownEtwProviderDataSourceLogLevel extends ExpandableStringEnum { + /** + * Static value Critical for KnownEtwProviderDataSourceLogLevel. + */ + public static final KnownEtwProviderDataSourceLogLevel CRITICAL = fromString("Critical"); + + /** + * Static value Error for KnownEtwProviderDataSourceLogLevel. + */ + public static final KnownEtwProviderDataSourceLogLevel ERROR = fromString("Error"); + + /** + * Static value Warning for KnownEtwProviderDataSourceLogLevel. + */ + public static final KnownEtwProviderDataSourceLogLevel WARNING = fromString("Warning"); + + /** + * Static value Informational for KnownEtwProviderDataSourceLogLevel. + */ + public static final KnownEtwProviderDataSourceLogLevel INFORMATIONAL = fromString("Informational"); + + /** + * Static value Verbose for KnownEtwProviderDataSourceLogLevel. + */ + public static final KnownEtwProviderDataSourceLogLevel VERBOSE = fromString("Verbose"); + + /** + * Creates a new instance of KnownEtwProviderDataSourceLogLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownEtwProviderDataSourceLogLevel() { + } + + /** + * Creates or finds a KnownEtwProviderDataSourceLogLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownEtwProviderDataSourceLogLevel. + */ + public static KnownEtwProviderDataSourceLogLevel fromString(String name) { + return fromString(name, KnownEtwProviderDataSourceLogLevel.class); + } + + /** + * Gets known KnownEtwProviderDataSourceLogLevel values. + * + * @return known KnownEtwProviderDataSourceLogLevel values. + */ + public static Collection values() { + return values(KnownEtwProviderDataSourceLogLevel.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownEtwProviderType.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownEtwProviderType.java new file mode 100644 index 000000000000..6c61eaf6225b --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownEtwProviderType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provider type specification: By Manifest GUID or by Event Source name. + */ +public final class KnownEtwProviderType extends ExpandableStringEnum { + /** + * Static value EventSource for KnownEtwProviderType. + */ + public static final KnownEtwProviderType EVENT_SOURCE = fromString("EventSource"); + + /** + * Static value Manifest for KnownEtwProviderType. + */ + public static final KnownEtwProviderType MANIFEST = fromString("Manifest"); + + /** + * Creates a new instance of KnownEtwProviderType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownEtwProviderType() { + } + + /** + * Creates or finds a KnownEtwProviderType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownEtwProviderType. + */ + public static KnownEtwProviderType fromString(String name) { + return fromString(name, KnownEtwProviderType.class); + } + + /** + * Gets known KnownEtwProviderType values. + * + * @return known KnownEtwProviderType values. + */ + public static Collection values() { + return values(KnownEtwProviderType.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownLocationSpecProvisioningStatus.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownLocationSpecProvisioningStatus.java new file mode 100644 index 000000000000..405bbfb7eefe --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownLocationSpecProvisioningStatus.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The resource provisioning state in this location. + */ +public final class KnownLocationSpecProvisioningStatus + extends ExpandableStringEnum { + /** + * Static value Creating for KnownLocationSpecProvisioningStatus. + */ + public static final KnownLocationSpecProvisioningStatus CREATING = fromString("Creating"); + + /** + * Static value Updating for KnownLocationSpecProvisioningStatus. + */ + public static final KnownLocationSpecProvisioningStatus UPDATING = fromString("Updating"); + + /** + * Static value Deleting for KnownLocationSpecProvisioningStatus. + */ + public static final KnownLocationSpecProvisioningStatus DELETING = fromString("Deleting"); + + /** + * Static value Succeeded for KnownLocationSpecProvisioningStatus. + */ + public static final KnownLocationSpecProvisioningStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for KnownLocationSpecProvisioningStatus. + */ + public static final KnownLocationSpecProvisioningStatus CANCELED = fromString("Canceled"); + + /** + * Static value Failed for KnownLocationSpecProvisioningStatus. + */ + public static final KnownLocationSpecProvisioningStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of KnownLocationSpecProvisioningStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownLocationSpecProvisioningStatus() { + } + + /** + * Creates or finds a KnownLocationSpecProvisioningStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownLocationSpecProvisioningStatus. + */ + public static KnownLocationSpecProvisioningStatus fromString(String name) { + return fromString(name, KnownLocationSpecProvisioningStatus.class); + } + + /** + * Gets known KnownLocationSpecProvisioningStatus values. + * + * @return known KnownLocationSpecProvisioningStatus values. + */ + public static Collection values() { + return values(KnownLocationSpecProvisioningStatus.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownLogFilesDataSourceFormat.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownLogFilesDataSourceFormat.java index 9cf937944146..66d456702878 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownLogFilesDataSourceFormat.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownLogFilesDataSourceFormat.java @@ -11,6 +11,11 @@ * The data format of the log files. */ public final class KnownLogFilesDataSourceFormat extends ExpandableStringEnum { + /** + * Static value json for KnownLogFilesDataSourceFormat. + */ + public static final KnownLogFilesDataSourceFormat JSON = fromString("json"); + /** * Static value text for KnownLogFilesDataSourceFormat. */ diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelLogsDataSourceStreams.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelLogsDataSourceStreams.java new file mode 100644 index 000000000000..9e3f45429985 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelLogsDataSourceStreams.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for KnownOtelLogsDataSourceStreams. + */ +public final class KnownOtelLogsDataSourceStreams extends ExpandableStringEnum { + /** + * Static value Microsoft-OTel-Logs for KnownOtelLogsDataSourceStreams. + */ + public static final KnownOtelLogsDataSourceStreams MICROSOFT_OTEL_LOGS = fromString("Microsoft-OTel-Logs"); + + /** + * Creates a new instance of KnownOtelLogsDataSourceStreams value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownOtelLogsDataSourceStreams() { + } + + /** + * Creates or finds a KnownOtelLogsDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownOtelLogsDataSourceStreams. + */ + public static KnownOtelLogsDataSourceStreams fromString(String name) { + return fromString(name, KnownOtelLogsDataSourceStreams.class); + } + + /** + * Gets known KnownOtelLogsDataSourceStreams values. + * + * @return known KnownOtelLogsDataSourceStreams values. + */ + public static Collection values() { + return values(KnownOtelLogsDataSourceStreams.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelLogsDirectDataSourceStreams.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelLogsDirectDataSourceStreams.java new file mode 100644 index 000000000000..13504100d870 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelLogsDirectDataSourceStreams.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for KnownOtelLogsDirectDataSourceStreams. + */ +public final class KnownOtelLogsDirectDataSourceStreams + extends ExpandableStringEnum { + /** + * Static value Microsoft-OTel-Logs for KnownOtelLogsDirectDataSourceStreams. + */ + public static final KnownOtelLogsDirectDataSourceStreams MICROSOFT_OTEL_LOGS = fromString("Microsoft-OTel-Logs"); + + /** + * Creates a new instance of KnownOtelLogsDirectDataSourceStreams value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownOtelLogsDirectDataSourceStreams() { + } + + /** + * Creates or finds a KnownOtelLogsDirectDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownOtelLogsDirectDataSourceStreams. + */ + public static KnownOtelLogsDirectDataSourceStreams fromString(String name) { + return fromString(name, KnownOtelLogsDirectDataSourceStreams.class); + } + + /** + * Gets known KnownOtelLogsDirectDataSourceStreams values. + * + * @return known KnownOtelLogsDirectDataSourceStreams values. + */ + public static Collection values() { + return values(KnownOtelLogsDirectDataSourceStreams.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelTracesDataSourceStreams.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelTracesDataSourceStreams.java new file mode 100644 index 000000000000..0af765c0d1d4 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelTracesDataSourceStreams.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for KnownOtelTracesDataSourceStreams. + */ +public final class KnownOtelTracesDataSourceStreams extends ExpandableStringEnum { + /** + * Static value Microsoft-OTel-Traces-Spans for KnownOtelTracesDataSourceStreams. + */ + public static final KnownOtelTracesDataSourceStreams MICROSOFT_OTEL_TRACES_SPANS + = fromString("Microsoft-OTel-Traces-Spans"); + + /** + * Static value Microsoft-OTel-Traces-Events for KnownOtelTracesDataSourceStreams. + */ + public static final KnownOtelTracesDataSourceStreams MICROSOFT_OTEL_TRACES_EVENTS + = fromString("Microsoft-OTel-Traces-Events"); + + /** + * Static value Microsoft-OTel-Traces-Resources for KnownOtelTracesDataSourceStreams. + */ + public static final KnownOtelTracesDataSourceStreams MICROSOFT_OTEL_TRACES_RESOURCES + = fromString("Microsoft-OTel-Traces-Resources"); + + /** + * Creates a new instance of KnownOtelTracesDataSourceStreams value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownOtelTracesDataSourceStreams() { + } + + /** + * Creates or finds a KnownOtelTracesDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownOtelTracesDataSourceStreams. + */ + public static KnownOtelTracesDataSourceStreams fromString(String name) { + return fromString(name, KnownOtelTracesDataSourceStreams.class); + } + + /** + * Gets known KnownOtelTracesDataSourceStreams values. + * + * @return known KnownOtelTracesDataSourceStreams values. + */ + public static Collection values() { + return values(KnownOtelTracesDataSourceStreams.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelTracesDirectDataSourceStreams.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelTracesDirectDataSourceStreams.java new file mode 100644 index 000000000000..31b3182d3915 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownOtelTracesDirectDataSourceStreams.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for KnownOtelTracesDirectDataSourceStreams. + */ +public final class KnownOtelTracesDirectDataSourceStreams + extends ExpandableStringEnum { + /** + * Static value Microsoft-OTel-Traces-Spans for KnownOtelTracesDirectDataSourceStreams. + */ + public static final KnownOtelTracesDirectDataSourceStreams MICROSOFT_OTEL_TRACES_SPANS + = fromString("Microsoft-OTel-Traces-Spans"); + + /** + * Static value Microsoft-OTel-Traces-Events for KnownOtelTracesDirectDataSourceStreams. + */ + public static final KnownOtelTracesDirectDataSourceStreams MICROSOFT_OTEL_TRACES_EVENTS + = fromString("Microsoft-OTel-Traces-Events"); + + /** + * Static value Microsoft-OTel-Traces-Resources for KnownOtelTracesDirectDataSourceStreams. + */ + public static final KnownOtelTracesDirectDataSourceStreams MICROSOFT_OTEL_TRACES_RESOURCES + = fromString("Microsoft-OTel-Traces-Resources"); + + /** + * Creates a new instance of KnownOtelTracesDirectDataSourceStreams value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownOtelTracesDirectDataSourceStreams() { + } + + /** + * Creates or finds a KnownOtelTracesDirectDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownOtelTracesDirectDataSourceStreams. + */ + public static KnownOtelTracesDirectDataSourceStreams fromString(String name) { + return fromString(name, KnownOtelTracesDirectDataSourceStreams.class); + } + + /** + * Gets known KnownOtelTracesDirectDataSourceStreams values. + * + * @return known KnownOtelTracesDirectDataSourceStreams values. + */ + public static Collection values() { + return values(KnownOtelTracesDirectDataSourceStreams.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPerformanceCountersOTelDataSourceStreams.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPerformanceCountersOTelDataSourceStreams.java new file mode 100644 index 000000000000..e477caf61e8d --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPerformanceCountersOTelDataSourceStreams.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for KnownPerformanceCountersOTelDataSourceStreams. + */ +public final class KnownPerformanceCountersOTelDataSourceStreams + extends ExpandableStringEnum { + /** + * Static value Microsoft-OtelPerfMetrics for KnownPerformanceCountersOTelDataSourceStreams. + */ + public static final KnownPerformanceCountersOTelDataSourceStreams MICROSOFT_OTEL_PERF_METRICS + = fromString("Microsoft-OtelPerfMetrics"); + + /** + * Creates a new instance of KnownPerformanceCountersOTelDataSourceStreams value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownPerformanceCountersOTelDataSourceStreams() { + } + + /** + * Creates or finds a KnownPerformanceCountersOTelDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownPerformanceCountersOTelDataSourceStreams. + */ + public static KnownPerformanceCountersOTelDataSourceStreams fromString(String name) { + return fromString(name, KnownPerformanceCountersOTelDataSourceStreams.class); + } + + /** + * Gets known KnownPerformanceCountersOTelDataSourceStreams values. + * + * @return known KnownPerformanceCountersOTelDataSourceStreams values. + */ + public static Collection values() { + return values(KnownPerformanceCountersOTelDataSourceStreams.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPrometheusForwarderDataSourceStreams.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPrometheusForwarderDataSourceStreams.java new file mode 100644 index 000000000000..a1f8338722ec --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPrometheusForwarderDataSourceStreams.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for KnownPrometheusForwarderDataSourceStreams. + */ +public final class KnownPrometheusForwarderDataSourceStreams + extends ExpandableStringEnum { + /** + * Static value Microsoft-PrometheusMetrics for KnownPrometheusForwarderDataSourceStreams. + */ + public static final KnownPrometheusForwarderDataSourceStreams MICROSOFT_PROMETHEUS_METRICS + = fromString("Microsoft-PrometheusMetrics"); + + /** + * Creates a new instance of KnownPrometheusForwarderDataSourceStreams value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownPrometheusForwarderDataSourceStreams() { + } + + /** + * Creates or finds a KnownPrometheusForwarderDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownPrometheusForwarderDataSourceStreams. + */ + public static KnownPrometheusForwarderDataSourceStreams fromString(String name) { + return fromString(name, KnownPrometheusForwarderDataSourceStreams.class); + } + + /** + * Gets known KnownPrometheusForwarderDataSourceStreams values. + * + * @return known KnownPrometheusForwarderDataSourceStreams values. + */ + public static Collection values() { + return values(KnownPrometheusForwarderDataSourceStreams.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java index 98dcb530f07b..fd3c008277fe 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java @@ -21,6 +21,11 @@ public final class KnownPublicNetworkAccessOptions extends ExpandableStringEnum< */ public static final KnownPublicNetworkAccessOptions DISABLED = fromString("Disabled"); + /** + * Static value SecuredByPerimeter for KnownPublicNetworkAccessOptions. + */ + public static final KnownPublicNetworkAccessOptions SECURED_BY_PERIMETER = fromString("SecuredByPerimeter"); + /** * Creates a new instance of KnownPublicNetworkAccessOptions value. * diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownStorageBlobLookupType.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownStorageBlobLookupType.java new file mode 100644 index 000000000000..611457674234 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownStorageBlobLookupType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of lookup to perform on the blob. + */ +public final class KnownStorageBlobLookupType extends ExpandableStringEnum { + /** + * Static value String for KnownStorageBlobLookupType. + */ + public static final KnownStorageBlobLookupType STRING = fromString("String"); + + /** + * Static value Cidr for KnownStorageBlobLookupType. + */ + public static final KnownStorageBlobLookupType CIDR = fromString("Cidr"); + + /** + * Creates a new instance of KnownStorageBlobLookupType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownStorageBlobLookupType() { + } + + /** + * Creates or finds a KnownStorageBlobLookupType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownStorageBlobLookupType. + */ + public static KnownStorageBlobLookupType fromString(String name) { + return fromString(name, KnownStorageBlobLookupType.class); + } + + /** + * Gets known KnownStorageBlobLookupType values. + * + * @return known KnownStorageBlobLookupType values. + */ + public static Collection values() { + return values(KnownStorageBlobLookupType.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.java index cbcb39479be8..902a34b2306b 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.java @@ -12,64 +12,54 @@ */ public final class KnownSyslogDataSourceFacilityNames extends ExpandableStringEnum { /** - * Static value auth for KnownSyslogDataSourceFacilityNames. - */ - public static final KnownSyslogDataSourceFacilityNames AUTH = fromString("auth"); - - /** - * Static value authpriv for KnownSyslogDataSourceFacilityNames. - */ - public static final KnownSyslogDataSourceFacilityNames AUTHPRIV = fromString("authpriv"); - - /** - * Static value cron for KnownSyslogDataSourceFacilityNames. + * Static value * for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames CRON = fromString("cron"); + public static final KnownSyslogDataSourceFacilityNames ASTERISK = fromString("*"); /** - * Static value daemon for KnownSyslogDataSourceFacilityNames. + * Static value alert for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames DAEMON = fromString("daemon"); + public static final KnownSyslogDataSourceFacilityNames ALERT = fromString("alert"); /** - * Static value kern for KnownSyslogDataSourceFacilityNames. + * Static value audit for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames KERN = fromString("kern"); + public static final KnownSyslogDataSourceFacilityNames AUDIT = fromString("audit"); /** - * Static value lpr for KnownSyslogDataSourceFacilityNames. + * Static value auth for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames LPR = fromString("lpr"); + public static final KnownSyslogDataSourceFacilityNames AUTH = fromString("auth"); /** - * Static value mail for KnownSyslogDataSourceFacilityNames. + * Static value authpriv for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames MAIL = fromString("mail"); + public static final KnownSyslogDataSourceFacilityNames AUTHPRIV = fromString("authpriv"); /** - * Static value mark for KnownSyslogDataSourceFacilityNames. + * Static value clock for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames MARK = fromString("mark"); + public static final KnownSyslogDataSourceFacilityNames CLOCK = fromString("clock"); /** - * Static value news for KnownSyslogDataSourceFacilityNames. + * Static value cron for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames NEWS = fromString("news"); + public static final KnownSyslogDataSourceFacilityNames CRON = fromString("cron"); /** - * Static value syslog for KnownSyslogDataSourceFacilityNames. + * Static value daemon for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames SYSLOG = fromString("syslog"); + public static final KnownSyslogDataSourceFacilityNames DAEMON = fromString("daemon"); /** - * Static value user for KnownSyslogDataSourceFacilityNames. + * Static value ftp for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames USER = fromString("user"); + public static final KnownSyslogDataSourceFacilityNames FTP = fromString("ftp"); /** - * Static value uucp for KnownSyslogDataSourceFacilityNames. + * Static value kern for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames UUCP = fromString("uucp"); + public static final KnownSyslogDataSourceFacilityNames KERN = fromString("kern"); /** * Static value local0 for KnownSyslogDataSourceFacilityNames. @@ -112,9 +102,49 @@ public final class KnownSyslogDataSourceFacilityNames extends ExpandableStringEn public static final KnownSyslogDataSourceFacilityNames LOCAL7 = fromString("local7"); /** - * Static value * for KnownSyslogDataSourceFacilityNames. + * Static value lpr for KnownSyslogDataSourceFacilityNames. */ - public static final KnownSyslogDataSourceFacilityNames ASTERISK = fromString("*"); + public static final KnownSyslogDataSourceFacilityNames LPR = fromString("lpr"); + + /** + * Static value mail for KnownSyslogDataSourceFacilityNames. + */ + public static final KnownSyslogDataSourceFacilityNames MAIL = fromString("mail"); + + /** + * Static value mark for KnownSyslogDataSourceFacilityNames. + */ + public static final KnownSyslogDataSourceFacilityNames MARK = fromString("mark"); + + /** + * Static value news for KnownSyslogDataSourceFacilityNames. + */ + public static final KnownSyslogDataSourceFacilityNames NEWS = fromString("news"); + + /** + * Static value nopri for KnownSyslogDataSourceFacilityNames. + */ + public static final KnownSyslogDataSourceFacilityNames NOPRI = fromString("nopri"); + + /** + * Static value ntp for KnownSyslogDataSourceFacilityNames. + */ + public static final KnownSyslogDataSourceFacilityNames NTP = fromString("ntp"); + + /** + * Static value syslog for KnownSyslogDataSourceFacilityNames. + */ + public static final KnownSyslogDataSourceFacilityNames SYSLOG = fromString("syslog"); + + /** + * Static value user for KnownSyslogDataSourceFacilityNames. + */ + public static final KnownSyslogDataSourceFacilityNames USER = fromString("user"); + + /** + * Static value uucp for KnownSyslogDataSourceFacilityNames. + */ + public static final KnownSyslogDataSourceFacilityNames UUCP = fromString("uucp"); /** * Creates a new instance of KnownSyslogDataSourceFacilityNames value. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownWindowsFirewallLogsDataSourceProfileFilter.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownWindowsFirewallLogsDataSourceProfileFilter.java new file mode 100644 index 000000000000..be1aaaafd604 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownWindowsFirewallLogsDataSourceProfileFilter.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for KnownWindowsFirewallLogsDataSourceProfileFilter. + */ +public final class KnownWindowsFirewallLogsDataSourceProfileFilter + extends ExpandableStringEnum { + /** + * Static value Domain for KnownWindowsFirewallLogsDataSourceProfileFilter. + */ + public static final KnownWindowsFirewallLogsDataSourceProfileFilter DOMAIN = fromString("Domain"); + + /** + * Static value Private for KnownWindowsFirewallLogsDataSourceProfileFilter. + */ + public static final KnownWindowsFirewallLogsDataSourceProfileFilter PRIVATE = fromString("Private"); + + /** + * Static value Public for KnownWindowsFirewallLogsDataSourceProfileFilter. + */ + public static final KnownWindowsFirewallLogsDataSourceProfileFilter PUBLIC = fromString("Public"); + + /** + * Creates a new instance of KnownWindowsFirewallLogsDataSourceProfileFilter value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KnownWindowsFirewallLogsDataSourceProfileFilter() { + } + + /** + * Creates or finds a KnownWindowsFirewallLogsDataSourceProfileFilter from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownWindowsFirewallLogsDataSourceProfileFilter. + */ + public static KnownWindowsFirewallLogsDataSourceProfileFilter fromString(String name) { + return fromString(name, KnownWindowsFirewallLogsDataSourceProfileFilter.class); + } + + /** + * Gets known KnownWindowsFirewallLogsDataSourceProfileFilter values. + * + * @return known KnownWindowsFirewallLogsDataSourceProfileFilter values. + */ + public static Collection values() { + return values(KnownWindowsFirewallLogsDataSourceProfileFilter.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationSpec.java new file mode 100644 index 000000000000..e92bf5af53cb --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationSpec.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The LocationSpec model. + */ +@Fluent +public final class LocationSpec implements JsonSerializable { + /* + * Name of location. + */ + private String location; + + /* + * The resource provisioning state in this location. + */ + private KnownLocationSpecProvisioningStatus provisioningStatus; + + /** + * Creates an instance of LocationSpec class. + */ + public LocationSpec() { + } + + /** + * Get the location property: Name of location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Name of location. + * + * @param location the location value to set. + * @return the LocationSpec object itself. + */ + public LocationSpec withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the provisioningStatus property: The resource provisioning state in this location. + * + * @return the provisioningStatus value. + */ + public KnownLocationSpecProvisioningStatus provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Set the provisioningStatus property: The resource provisioning state in this location. + * + * @param provisioningStatus the provisioningStatus value to set. + * @return the LocationSpec object itself. + */ + public LocationSpec withProvisioningStatus(KnownLocationSpecProvisioningStatus provisioningStatus) { + this.provisioningStatus = provisioningStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("provisioningStatus", + this.provisioningStatus == null ? null : this.provisioningStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocationSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocationSpec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LocationSpec. + */ + public static LocationSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocationSpec deserializedLocationSpec = new LocationSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedLocationSpec.location = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedLocationSpec.provisioningStatus + = KnownLocationSpecProvisioningStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLocationSpec; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java index c1176cba339b..f8e793fe568a 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java @@ -111,7 +111,9 @@ public LocationThresholdRuleCondition withDataSource(RuleDataSource dataSource) */ @Override public void validate() { - super.validate(); + if (dataSource() != null) { + dataSource().validate(); + } } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFileSettingsText.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFileSettingsText.java index 3093bc1e6e23..b2b0e1676afe 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFileSettingsText.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFileSettingsText.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.monitor.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -38,9 +39,15 @@ public LogFileSettingsText() { */ @Override public void validate() { - super.validate(); + if (recordStartTimestampFormat() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property recordStartTimestampFormat in model LogFileSettingsText")); + } } + private static final ClientLogger LOGGER = new ClientLogger(LogFileSettingsText.class); + /** * {@inheritDoc} */ diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFilesDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFilesDataSource.java index bf7adf77ddda..d77f04d72986 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFilesDataSource.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFilesDataSource.java @@ -39,6 +39,11 @@ public final class LogFilesDataSource implements JsonSerializable writer.writeString(element)); jsonWriter.writeStringField("format", this.format == null ? null : this.format.toString()); jsonWriter.writeJsonField("settings", this.settings); + jsonWriter.writeStringField("transformKql", this.transformKql); jsonWriter.writeStringField("name", this.name); return jsonWriter.writeEndObject(); } @@ -222,6 +250,8 @@ public static LogFilesDataSource fromJson(JsonReader jsonReader) throws IOExcept = KnownLogFilesDataSourceFormat.fromString(reader.getString()); } else if ("settings".equals(fieldName)) { deserializedLogFilesDataSource.settings = LogFilesDataSourceSettings.fromJson(reader); + } else if ("transformKql".equals(fieldName)) { + deserializedLogFilesDataSource.transformKql = reader.getString(); } else if ("name".equals(fieldName)) { deserializedLogFilesDataSource.name = reader.getString(); } else { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFilesDataSourceSettings.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFilesDataSourceSettings.java index c056803f9ac4..11f3f2be9e95 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFilesDataSourceSettings.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogFilesDataSourceSettings.java @@ -37,7 +37,9 @@ public LogFilesDataSourceSettings withText(LogFileSettingsText text) { */ @Override public void validate() { - super.validate(); + if (text() != null) { + text().validate(); + } } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogsQuotaSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogsQuotaSpec.java new file mode 100644 index 000000000000..4fecfbab14c3 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogsQuotaSpec.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The LogsQuotaSpec model. + */ +@Fluent +public class LogsQuotaSpec implements JsonSerializable { + /* + * The maxSizePerMinuteInGB property. + */ + private String maxSizePerMinuteInGB; + + /* + * The maxRequestsPerMinute property. + */ + private String maxRequestsPerMinute; + + /** + * Creates an instance of LogsQuotaSpec class. + */ + public LogsQuotaSpec() { + } + + /** + * Get the maxSizePerMinuteInGB property: The maxSizePerMinuteInGB property. + * + * @return the maxSizePerMinuteInGB value. + */ + public String maxSizePerMinuteInGB() { + return this.maxSizePerMinuteInGB; + } + + /** + * Set the maxSizePerMinuteInGB property: The maxSizePerMinuteInGB property. + * + * @param maxSizePerMinuteInGB the maxSizePerMinuteInGB value to set. + * @return the LogsQuotaSpec object itself. + */ + public LogsQuotaSpec withMaxSizePerMinuteInGB(String maxSizePerMinuteInGB) { + this.maxSizePerMinuteInGB = maxSizePerMinuteInGB; + return this; + } + + /** + * Get the maxRequestsPerMinute property: The maxRequestsPerMinute property. + * + * @return the maxRequestsPerMinute value. + */ + public String maxRequestsPerMinute() { + return this.maxRequestsPerMinute; + } + + /** + * Set the maxRequestsPerMinute property: The maxRequestsPerMinute property. + * + * @param maxRequestsPerMinute the maxRequestsPerMinute value to set. + * @return the LogsQuotaSpec object itself. + */ + public LogsQuotaSpec withMaxRequestsPerMinute(String maxRequestsPerMinute) { + this.maxRequestsPerMinute = maxRequestsPerMinute; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("maxSizePerMinuteInGB", this.maxSizePerMinuteInGB); + jsonWriter.writeStringField("maxRequestsPerMinute", this.maxRequestsPerMinute); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsQuotaSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsQuotaSpec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsQuotaSpec. + */ + public static LogsQuotaSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsQuotaSpec deserializedLogsQuotaSpec = new LogsQuotaSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxSizePerMinuteInGB".equals(fieldName)) { + deserializedLogsQuotaSpec.maxSizePerMinuteInGB = reader.getString(); + } else if ("maxRequestsPerMinute".equals(fieldName)) { + deserializedLogsQuotaSpec.maxRequestsPerMinute = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsQuotaSpec; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagedServiceIdentity.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..60434a69e7e4 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagedServiceIdentity.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @param principalId the principalId value to set. + * @return the ManagedServiceIdentity object itself. + */ + ManagedServiceIdentity withPrincipalId(UUID principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @param tenantId the tenantId value to set. + * @return the ManagedServiceIdentity object itself. + */ + ManagedServiceIdentity withTenantId(UUID tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagedServiceIdentityType.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..4ac79b368f6b --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java index 38077d62c87a..0e65d6cc0453 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java @@ -87,10 +87,12 @@ public ManagementEventRuleCondition withDataSource(RuleDataSource dataSource) { */ @Override public void validate() { - super.validate(); if (aggregation() != null) { aggregation().validate(); } + if (dataSource() != null) { + dataSource().validate(); + } } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metadata.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metadata.java index 21db85c25324..de30220e3fef 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metadata.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metadata.java @@ -21,6 +21,16 @@ public class Metadata implements JsonSerializable { */ private String provisionedBy; + /* + * Resource Id of azure offering managing this resource on-behalf-of customer. + */ + private String provisionedByResourceId; + + /* + * Immutable Id of azure offering managing this resource on-behalf-of customer. + */ + private String provisionedByImmutableId; + /** * Creates an instance of Metadata class. */ @@ -47,6 +57,50 @@ Metadata withProvisionedBy(String provisionedBy) { return this; } + /** + * Get the provisionedByResourceId property: Resource Id of azure offering managing this resource on-behalf-of + * customer. + * + * @return the provisionedByResourceId value. + */ + public String provisionedByResourceId() { + return this.provisionedByResourceId; + } + + /** + * Set the provisionedByResourceId property: Resource Id of azure offering managing this resource on-behalf-of + * customer. + * + * @param provisionedByResourceId the provisionedByResourceId value to set. + * @return the Metadata object itself. + */ + Metadata withProvisionedByResourceId(String provisionedByResourceId) { + this.provisionedByResourceId = provisionedByResourceId; + return this; + } + + /** + * Get the provisionedByImmutableId property: Immutable Id of azure offering managing this resource on-behalf-of + * customer. + * + * @return the provisionedByImmutableId value. + */ + public String provisionedByImmutableId() { + return this.provisionedByImmutableId; + } + + /** + * Set the provisionedByImmutableId property: Immutable Id of azure offering managing this resource on-behalf-of + * customer. + * + * @param provisionedByImmutableId the provisionedByImmutableId value to set. + * @return the Metadata object itself. + */ + Metadata withProvisionedByImmutableId(String provisionedByImmutableId) { + this.provisionedByImmutableId = provisionedByImmutableId; + return this; + } + /** * Validates the instance. * @@ -81,6 +135,10 @@ public static Metadata fromJson(JsonReader jsonReader) throws IOException { if ("provisionedBy".equals(fieldName)) { deserializedMetadata.provisionedBy = reader.getString(); + } else if ("provisionedByResourceId".equals(fieldName)) { + deserializedMetadata.provisionedByResourceId = reader.getString(); + } else if ("provisionedByImmutableId".equals(fieldName)) { + deserializedMetadata.provisionedByImmutableId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAggregationType.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAggregationType.java new file mode 100644 index 000000000000..c89531827396 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAggregationType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * the aggregation type of the metric. + */ +public final class MetricAggregationType extends ExpandableStringEnum { + /** + * Static value None for MetricAggregationType. + */ + public static final MetricAggregationType NONE = fromString("None"); + + /** + * Static value Average for MetricAggregationType. + */ + public static final MetricAggregationType AVERAGE = fromString("Average"); + + /** + * Static value Count for MetricAggregationType. + */ + public static final MetricAggregationType COUNT = fromString("Count"); + + /** + * Static value Minimum for MetricAggregationType. + */ + public static final MetricAggregationType MINIMUM = fromString("Minimum"); + + /** + * Static value Maximum for MetricAggregationType. + */ + public static final MetricAggregationType MAXIMUM = fromString("Maximum"); + + /** + * Static value Total for MetricAggregationType. + */ + public static final MetricAggregationType TOTAL = fromString("Total"); + + /** + * Creates a new instance of MetricAggregationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetricAggregationType() { + } + + /** + * Creates or finds a MetricAggregationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricAggregationType. + */ + public static MetricAggregationType fromString(String name) { + return fromString(name, MetricAggregationType.class); + } + + /** + * Gets known MetricAggregationType values. + * + * @return known MetricAggregationType values. + */ + public static Collection values() { + return values(MetricAggregationType.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java index 09117f4ccee2..37bab22481c4 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java @@ -18,7 +18,7 @@ @Fluent public final class MetricAlertAction implements JsonSerializable { /* - * the id of the action group to use. + * The id of the action group to use. */ private String actionGroupId; @@ -35,7 +35,7 @@ public MetricAlertAction() { } /** - * Get the actionGroupId property: the id of the action group to use. + * Get the actionGroupId property: The id of the action group to use. * * @return the actionGroupId value. */ @@ -44,7 +44,7 @@ public String actionGroupId() { } /** - * Set the actionGroupId property: the id of the action group to use. + * Set the actionGroupId property: The id of the action group to use. * * @param actionGroupId the actionGroupId value to set. * @return the MetricAlertAction object itself. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCriteria.java index a75f343fbd95..86d9180fff78 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCriteria.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertCriteria.java @@ -19,7 +19,7 @@ @Fluent public class MetricAlertCriteria implements JsonSerializable { /* - * specifies the type of the alert criteria. + * Specifies the type of the alert criteria. Previously undocumented values might be returned */ private Odatatype odataType = Odatatype.fromString("MetricAlertCriteria"); @@ -35,7 +35,8 @@ public MetricAlertCriteria() { } /** - * Get the odataType property: specifies the type of the alert criteria. + * Get the odataType property: Specifies the type of the alert criteria. Previously undocumented values might be + * returned. * * @return the odataType value. */ @@ -117,6 +118,8 @@ public static MetricAlertCriteria fromJson(JsonReader jsonReader) throws IOExcep } else if ("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" .equals(discriminatorValue)) { return MetricAlertMultipleResourceMultipleMetricCriteria.fromJson(readerToUse.reset()); + } else if ("Microsoft.Azure.Monitor.PromQLCriteria".equals(discriminatorValue)) { + return PromQLCriteria.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertMultipleResourceMultipleMetricCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertMultipleResourceMultipleMetricCriteria.java index a08d35e748e1..f00fc9ed7fe3 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertMultipleResourceMultipleMetricCriteria.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertMultipleResourceMultipleMetricCriteria.java @@ -19,12 +19,12 @@ @Fluent public final class MetricAlertMultipleResourceMultipleMetricCriteria extends MetricAlertCriteria { /* - * specifies the type of the alert criteria. + * Specifies the type of the alert criteria. Previously undocumented values might be returned */ private Odatatype odataType = Odatatype.MICROSOFT_AZURE_MONITOR_MULTIPLE_RESOURCE_MULTIPLE_METRIC_CRITERIA; /* - * the list of multiple metric criteria for this 'all of' operation. + * The list of multiple metric criteria for this 'all of' operation. */ private List allOf; @@ -35,7 +35,8 @@ public MetricAlertMultipleResourceMultipleMetricCriteria() { } /** - * Get the odataType property: specifies the type of the alert criteria. + * Get the odataType property: Specifies the type of the alert criteria. Previously undocumented values might be + * returned. * * @return the odataType value. */ @@ -45,7 +46,7 @@ public Odatatype odataType() { } /** - * Get the allOf property: the list of multiple metric criteria for this 'all of' operation. + * Get the allOf property: The list of multiple metric criteria for this 'all of' operation. * * @return the allOf value. */ @@ -54,7 +55,7 @@ public List allOf() { } /** - * Set the allOf property: the list of multiple metric criteria for this 'all of' operation. + * Set the allOf property: The list of multiple metric criteria for this 'all of' operation. * * @param allOf the allOf value to set. * @return the MetricAlertMultipleResourceMultipleMetricCriteria object itself. @@ -71,7 +72,6 @@ public MetricAlertMultipleResourceMultipleMetricCriteria withAllOf(List e.validate()); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourceCollection.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourceCollection.java index cc139fa70650..f69030efc7b7 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourceCollection.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourceCollection.java @@ -19,7 +19,7 @@ @Fluent public final class MetricAlertResourceCollection implements JsonSerializable { /* - * the values for the alert rule resources. + * The values for the alert rule resources. */ private List value; @@ -30,7 +30,7 @@ public MetricAlertResourceCollection() { } /** - * Get the value property: the values for the alert rule resources. + * Get the value property: The values for the alert rule resources. * * @return the value value. */ @@ -39,7 +39,7 @@ public List value() { } /** - * Set the value property: the values for the alert rule resources. + * Set the value property: The values for the alert rule resources. * * @param value the value value to set. * @return the MetricAlertResourceCollection object itself. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java index a31fe146bc29..8ad56fb074cb 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java @@ -26,6 +26,11 @@ public final class MetricAlertResourcePatch implements JsonSerializable tags; + /* + * The identity of the resource. + */ + private Identity identity; + /* * The alert rule properties of the resource. */ @@ -57,6 +62,26 @@ public MetricAlertResourcePatch withTags(Map tags) { return this; } + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the MetricAlertResourcePatch object itself. + */ + public MetricAlertResourcePatch withIdentity(Identity identity) { + this.identity = identity; + return this; + } + /** * Get the innerProperties property: The alert rule properties of the resource. * @@ -67,7 +92,7 @@ private MetricAlertPropertiesPatch innerProperties() { } /** - * Get the description property: the description of the metric alert that will be included in the alert email. + * Get the description property: The description of the metric alert that will be included in the alert email. * * @return the description value. */ @@ -76,7 +101,7 @@ public String description() { } /** - * Set the description property: the description of the metric alert that will be included in the alert email. + * Set the description property: The description of the metric alert that will be included in the alert email. * * @param description the description value to set. * @return the MetricAlertResourcePatch object itself. @@ -113,7 +138,7 @@ public MetricAlertResourcePatch withSeverity(Integer severity) { } /** - * Get the enabled property: the flag that indicates whether the metric alert is enabled. + * Get the enabled property: The flag that indicates whether the metric alert is enabled. * * @return the enabled value. */ @@ -122,7 +147,7 @@ public Boolean enabled() { } /** - * Set the enabled property: the flag that indicates whether the metric alert is enabled. + * Set the enabled property: The flag that indicates whether the metric alert is enabled. * * @param enabled the enabled value to set. * @return the MetricAlertResourcePatch object itself. @@ -136,7 +161,7 @@ public MetricAlertResourcePatch withEnabled(Boolean enabled) { } /** - * Get the scopes property: the list of resource id's that this metric alert is scoped to. + * Get the scopes property: The list of resource id's that this metric alert is scoped to. * * @return the scopes value. */ @@ -145,7 +170,7 @@ public List scopes() { } /** - * Set the scopes property: the list of resource id's that this metric alert is scoped to. + * Set the scopes property: The list of resource id's that this metric alert is scoped to. * * @param scopes the scopes value to set. * @return the MetricAlertResourcePatch object itself. @@ -159,7 +184,7 @@ public MetricAlertResourcePatch withScopes(List scopes) { } /** - * Get the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration + * Get the evaluationFrequency property: How often the metric alert is evaluated represented in ISO 8601 duration * format. * * @return the evaluationFrequency value. @@ -169,7 +194,7 @@ public Duration evaluationFrequency() { } /** - * Set the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration + * Set the evaluationFrequency property: How often the metric alert is evaluated represented in ISO 8601 duration * format. * * @param evaluationFrequency the evaluationFrequency value to set. @@ -184,7 +209,7 @@ public MetricAlertResourcePatch withEvaluationFrequency(Duration evaluationFrequ } /** - * Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert + * Get the windowSize property: The period of time (in ISO 8601 duration format) that is used to monitor alert * activity based on the threshold. * * @return the windowSize value. @@ -194,7 +219,7 @@ public Duration windowSize() { } /** - * Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert + * Set the windowSize property: The period of time (in ISO 8601 duration format) that is used to monitor alert * activity based on the threshold. * * @param windowSize the windowSize value to set. @@ -209,7 +234,7 @@ public MetricAlertResourcePatch withWindowSize(Duration windowSize) { } /** - * Get the targetResourceType property: the resource type of the target resource(s) on which the alert is + * Get the targetResourceType property: The resource type of the target resource(s) on which the alert is * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. * * @return the targetResourceType value. @@ -219,7 +244,7 @@ public String targetResourceType() { } /** - * Set the targetResourceType property: the resource type of the target resource(s) on which the alert is + * Set the targetResourceType property: The resource type of the target resource(s) on which the alert is * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. * * @param targetResourceType the targetResourceType value to set. @@ -234,7 +259,7 @@ public MetricAlertResourcePatch withTargetResourceType(String targetResourceType } /** - * Get the targetResourceRegion property: the region of the target resource(s) on which the alert is + * Get the targetResourceRegion property: The region of the target resource(s) on which the alert is * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. * * @return the targetResourceRegion value. @@ -244,7 +269,7 @@ public String targetResourceRegion() { } /** - * Set the targetResourceRegion property: the region of the target resource(s) on which the alert is + * Set the targetResourceRegion property: The region of the target resource(s) on which the alert is * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. * * @param targetResourceRegion the targetResourceRegion value to set. @@ -259,7 +284,7 @@ public MetricAlertResourcePatch withTargetResourceRegion(String targetResourceRe } /** - * Get the criteria property: defines the specific alert criteria information. + * Get the criteria property: Defines the specific alert criteria information. * * @return the criteria value. */ @@ -268,7 +293,7 @@ public MetricAlertCriteria criteria() { } /** - * Set the criteria property: defines the specific alert criteria information. + * Set the criteria property: Defines the specific alert criteria information. * * @param criteria the criteria value to set. * @return the MetricAlertResourcePatch object itself. @@ -282,7 +307,7 @@ public MetricAlertResourcePatch withCriteria(MetricAlertCriteria criteria) { } /** - * Get the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The + * Get the autoMitigate property: The flag that indicates whether the alert should be auto resolved or not. The * default is true. * * @return the autoMitigate value. @@ -292,7 +317,7 @@ public Boolean autoMitigate() { } /** - * Set the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The + * Set the autoMitigate property: The flag that indicates whether the alert should be auto resolved or not. The * default is true. * * @param autoMitigate the autoMitigate value to set. @@ -307,7 +332,32 @@ public MetricAlertResourcePatch withAutoMitigate(Boolean autoMitigate) { } /** - * Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an + * Get the resolveConfiguration property: The configuration for how the alert is resolved. Applicable for + * PromQLCriteria. + * + * @return the resolveConfiguration value. + */ + public ResolveConfiguration resolveConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().resolveConfiguration(); + } + + /** + * Set the resolveConfiguration property: The configuration for how the alert is resolved. Applicable for + * PromQLCriteria. + * + * @param resolveConfiguration the resolveConfiguration value to set. + * @return the MetricAlertResourcePatch object itself. + */ + public MetricAlertResourcePatch withResolveConfiguration(ResolveConfiguration resolveConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new MetricAlertPropertiesPatch(); + } + this.innerProperties().withResolveConfiguration(resolveConfiguration); + return this; + } + + /** + * Get the actions property: The array of actions that are performed when the alert rule becomes active, and when an * alert condition is resolved. * * @return the actions value. @@ -317,7 +367,7 @@ public List actions() { } /** - * Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an + * Set the actions property: The array of actions that are performed when the alert rule becomes active, and when an * alert condition is resolved. * * @param actions the actions value to set. @@ -341,7 +391,7 @@ public OffsetDateTime lastUpdatedTime() { } /** - * Get the isMigrated property: the value indicating whether this alert rule is migrated. + * Get the isMigrated property: The value indicating whether this alert rule is migrated. * * @return the isMigrated value. */ @@ -349,12 +399,61 @@ public Boolean isMigrated() { return this.innerProperties() == null ? null : this.innerProperties().isMigrated(); } + /** + * Get the customProperties property: The properties of an alert payload. + * + * @return the customProperties value. + */ + public Map customProperties() { + return this.innerProperties() == null ? null : this.innerProperties().customProperties(); + } + + /** + * Set the customProperties property: The properties of an alert payload. + * + * @param customProperties the customProperties value to set. + * @return the MetricAlertResourcePatch object itself. + */ + public MetricAlertResourcePatch withCustomProperties(Map customProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new MetricAlertPropertiesPatch(); + } + this.innerProperties().withCustomProperties(customProperties); + return this; + } + + /** + * Get the actionProperties property: The properties of an action properties. + * + * @return the actionProperties value. + */ + public Map actionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().actionProperties(); + } + + /** + * Set the actionProperties property: The properties of an action properties. + * + * @param actionProperties the actionProperties value to set. + * @return the MetricAlertResourcePatch object itself. + */ + public MetricAlertResourcePatch withActionProperties(Map actionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new MetricAlertPropertiesPatch(); + } + this.innerProperties().withActionProperties(actionProperties); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } @@ -367,6 +466,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -389,6 +489,8 @@ public static MetricAlertResourcePatch fromJson(JsonReader jsonReader) throws IO if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedMetricAlertResourcePatch.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedMetricAlertResourcePatch.identity = Identity.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedMetricAlertResourcePatch.innerProperties = MetricAlertPropertiesPatch.fromJson(reader); } else { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertSingleResourceMultipleMetricCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertSingleResourceMultipleMetricCriteria.java index d0c5cf069ad4..5c313f7076fb 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertSingleResourceMultipleMetricCriteria.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertSingleResourceMultipleMetricCriteria.java @@ -19,7 +19,7 @@ @Fluent public final class MetricAlertSingleResourceMultipleMetricCriteria extends MetricAlertCriteria { /* - * specifies the type of the alert criteria. + * Specifies the type of the alert criteria. Previously undocumented values might be returned */ private Odatatype odataType = Odatatype.MICROSOFT_AZURE_MONITOR_SINGLE_RESOURCE_MULTIPLE_METRIC_CRITERIA; @@ -35,7 +35,8 @@ public MetricAlertSingleResourceMultipleMetricCriteria() { } /** - * Get the odataType property: specifies the type of the alert criteria. + * Get the odataType property: Specifies the type of the alert criteria. Previously undocumented values might be + * returned. * * @return the odataType value. */ @@ -71,7 +72,6 @@ public MetricAlertSingleResourceMultipleMetricCriteria withAllOf(List e.validate()); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatusProperties.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatusProperties.java index 31ca73a6a07e..e65121161306 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatusProperties.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertStatusProperties.java @@ -26,7 +26,7 @@ public final class MetricAlertStatusProperties implements JsonSerializable dimensions; /* - * status value + * Status value */ private String status; @@ -62,7 +62,7 @@ public MetricAlertStatusProperties withDimensions(Map dimensions } /** - * Get the status property: status value. + * Get the status property: Status value. * * @return the status value. */ @@ -71,7 +71,7 @@ public String status() { } /** - * Set the status property: status value. + * Set the status property: Status value. * * @param status the status value to set. * @return the MetricAlertStatusProperties object itself. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java index 814594bc12d1..5be4906bddb7 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java @@ -20,17 +20,17 @@ @Fluent public final class MetricCriteria extends MultiMetricCriteria { /* - * Specifies the type of threshold criteria + * Specifies the type of threshold criteria. Previously undocumented values might be returned */ private CriterionType criterionType = CriterionType.STATIC_THRESHOLD_CRITERION; /* - * the criteria operator. + * The criteria operator. Previously undocumented values might be returned */ private Operator operator; /* - * the criteria threshold value that activates the alert. + * The criteria threshold value that activates the alert. */ private double threshold; @@ -41,7 +41,8 @@ public MetricCriteria() { } /** - * Get the criterionType property: Specifies the type of threshold criteria. + * Get the criterionType property: Specifies the type of threshold criteria. Previously undocumented values might be + * returned. * * @return the criterionType value. */ @@ -51,7 +52,7 @@ public CriterionType criterionType() { } /** - * Get the operator property: the criteria operator. + * Get the operator property: The criteria operator. Previously undocumented values might be returned. * * @return the operator value. */ @@ -60,7 +61,7 @@ public Operator operator() { } /** - * Set the operator property: the criteria operator. + * Set the operator property: The criteria operator. Previously undocumented values might be returned. * * @param operator the operator value to set. * @return the MetricCriteria object itself. @@ -71,7 +72,7 @@ public MetricCriteria withOperator(Operator operator) { } /** - * Get the threshold property: the criteria threshold value that activates the alert. + * Get the threshold property: The criteria threshold value that activates the alert. * * @return the threshold value. */ @@ -80,7 +81,7 @@ public double threshold() { } /** - * Set the threshold property: the criteria threshold value that activates the alert. + * Set the threshold property: The criteria threshold value that activates the alert. * * @param threshold the threshold value to set. * @return the MetricCriteria object itself. @@ -151,11 +152,25 @@ public MetricCriteria withSkipMetricValidation(Boolean skipMetricValidation) { */ @Override public void validate() { - super.validate(); if (operator() == null) { throw LOGGER.atError() .log(new IllegalArgumentException("Missing required property operator in model MetricCriteria")); } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model MetricCriteria")); + } + if (metricName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property metricName in model MetricCriteria")); + } + if (timeAggregation() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property timeAggregation in model MetricCriteria")); + } + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } } private static final ClientLogger LOGGER = new ClientLogger(MetricCriteria.class); diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDimension.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDimension.java index 294579029be7..eb78cf3fd740 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDimension.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricDimension.java @@ -24,12 +24,12 @@ public final class MetricDimension implements JsonSerializable private String name; /* - * the dimension operator. Only 'Include' and 'Exclude' are supported + * The dimension operator. Only 'Include' and 'Exclude' are supported */ private String operator; /* - * list of dimension values. + * List of dimension values. */ private List values; @@ -60,7 +60,7 @@ public MetricDimension withName(String name) { } /** - * Get the operator property: the dimension operator. Only 'Include' and 'Exclude' are supported. + * Get the operator property: The dimension operator. Only 'Include' and 'Exclude' are supported. * * @return the operator value. */ @@ -69,7 +69,7 @@ public String operator() { } /** - * Set the operator property: the dimension operator. Only 'Include' and 'Exclude' are supported. + * Set the operator property: The dimension operator. Only 'Include' and 'Exclude' are supported. * * @param operator the operator value to set. * @return the MetricDimension object itself. @@ -80,7 +80,7 @@ public MetricDimension withOperator(String operator) { } /** - * Get the values property: list of dimension values. + * Get the values property: List of dimension values. * * @return the values value. */ @@ -89,7 +89,7 @@ public List values() { } /** - * Set the values property: list of dimension values. + * Set the values property: List of dimension values. * * @param values the values value to set. * @return the MetricDimension object itself. diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricResultType.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricResultType.java new file mode 100644 index 000000000000..34bf05ff1882 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricResultType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for + * details. + */ +public final class MetricResultType extends ExpandableStringEnum { + /** + * Static value Data for MetricResultType. + */ + public static final MetricResultType DATA = fromString("Data"); + + /** + * Static value Metadata for MetricResultType. + */ + public static final MetricResultType METADATA = fromString("Metadata"); + + /** + * Creates a new instance of MetricResultType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetricResultType() { + } + + /** + * Creates or finds a MetricResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricResultType. + */ + public static MetricResultType fromString(String name) { + return fromString(name, MetricResultType.class); + } + + /** + * Gets known MetricResultType values. + * + * @return known MetricResultType values. + */ + public static Collection values() { + return values(MetricResultType.class); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricsIngestionEndpointSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricsIngestionEndpointSpec.java new file mode 100644 index 000000000000..c968253ad2c7 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricsIngestionEndpointSpec.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of the endpoint used for ingesting metrics. + */ +@Immutable +public class MetricsIngestionEndpointSpec implements JsonSerializable { + /* + * The endpoint. This property is READ-ONLY. + */ + private String endpoint; + + /** + * Creates an instance of MetricsIngestionEndpointSpec class. + */ + public MetricsIngestionEndpointSpec() { + } + + /** + * Get the endpoint property: The endpoint. This property is READ-ONLY. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: The endpoint. This property is READ-ONLY. + * + * @param endpoint the endpoint value to set. + * @return the MetricsIngestionEndpointSpec object itself. + */ + MetricsIngestionEndpointSpec withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsIngestionEndpointSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsIngestionEndpointSpec if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricsIngestionEndpointSpec. + */ + public static MetricsIngestionEndpointSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsIngestionEndpointSpec deserializedMetricsIngestionEndpointSpec = new MetricsIngestionEndpointSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoint".equals(fieldName)) { + deserializedMetricsIngestionEndpointSpec.endpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsIngestionEndpointSpec; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MicrosoftFabricDestination.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MicrosoftFabricDestination.java new file mode 100644 index 000000000000..fee3a1f8e4c8 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MicrosoftFabricDestination.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Microsoft Fabric destination (non-Azure). + */ +@Fluent +public final class MicrosoftFabricDestination implements JsonSerializable { + /* + * The tenant id of the Microsoft Fabric resource. + */ + private String tenantId; + + /* + * The artifact id of the Microsoft Fabric resource. + */ + private String artifactId; + + /* + * The name of the database to which data will be ingested. + */ + private String databaseName; + + /* + * The ingestion uri of the Microsoft Fabric resource. + */ + private String ingestionUri; + + /* + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of MicrosoftFabricDestination class. + */ + public MicrosoftFabricDestination() { + } + + /** + * Get the tenantId property: The tenant id of the Microsoft Fabric resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant id of the Microsoft Fabric resource. + * + * @param tenantId the tenantId value to set. + * @return the MicrosoftFabricDestination object itself. + */ + public MicrosoftFabricDestination withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the artifactId property: The artifact id of the Microsoft Fabric resource. + * + * @return the artifactId value. + */ + public String artifactId() { + return this.artifactId; + } + + /** + * Set the artifactId property: The artifact id of the Microsoft Fabric resource. + * + * @param artifactId the artifactId value to set. + * @return the MicrosoftFabricDestination object itself. + */ + public MicrosoftFabricDestination withArtifactId(String artifactId) { + this.artifactId = artifactId; + return this; + } + + /** + * Get the databaseName property: The name of the database to which data will be ingested. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The name of the database to which data will be ingested. + * + * @param databaseName the databaseName value to set. + * @return the MicrosoftFabricDestination object itself. + */ + public MicrosoftFabricDestination withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the ingestionUri property: The ingestion uri of the Microsoft Fabric resource. + * + * @return the ingestionUri value. + */ + public String ingestionUri() { + return this.ingestionUri; + } + + /** + * Set the ingestionUri property: The ingestion uri of the Microsoft Fabric resource. + * + * @param ingestionUri the ingestionUri value to set. + * @return the MicrosoftFabricDestination object itself. + */ + public MicrosoftFabricDestination withIngestionUri(String ingestionUri) { + this.ingestionUri = ingestionUri; + return this; + } + + /** + * Get the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the MicrosoftFabricDestination object itself. + */ + public MicrosoftFabricDestination withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("artifactId", this.artifactId); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("ingestionUri", this.ingestionUri); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftFabricDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftFabricDestination if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MicrosoftFabricDestination. + */ + public static MicrosoftFabricDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftFabricDestination deserializedMicrosoftFabricDestination = new MicrosoftFabricDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMicrosoftFabricDestination.tenantId = reader.getString(); + } else if ("artifactId".equals(fieldName)) { + deserializedMicrosoftFabricDestination.artifactId = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedMicrosoftFabricDestination.databaseName = reader.getString(); + } else if ("ingestionUri".equals(fieldName)) { + deserializedMicrosoftFabricDestination.ingestionUri = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftFabricDestination.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMicrosoftFabricDestination; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MonitoringAccountDestination.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MonitoringAccountDestination.java new file mode 100644 index 000000000000..889a41ad6de1 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MonitoringAccountDestination.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Monitoring account destination. + */ +@Fluent +public final class MonitoringAccountDestination implements JsonSerializable { + /* + * The resource ID of the monitoring account. + */ + private String accountResourceId; + + /* + * The immutable ID of the account. + */ + private String accountId; + + /* + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of MonitoringAccountDestination class. + */ + public MonitoringAccountDestination() { + } + + /** + * Get the accountResourceId property: The resource ID of the monitoring account. + * + * @return the accountResourceId value. + */ + public String accountResourceId() { + return this.accountResourceId; + } + + /** + * Set the accountResourceId property: The resource ID of the monitoring account. + * + * @param accountResourceId the accountResourceId value to set. + * @return the MonitoringAccountDestination object itself. + */ + public MonitoringAccountDestination withAccountResourceId(String accountResourceId) { + this.accountResourceId = accountResourceId; + return this; + } + + /** + * Get the accountId property: The immutable ID of the account. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Get the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the MonitoringAccountDestination object itself. + */ + public MonitoringAccountDestination withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountResourceId", this.accountResourceId); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringAccountDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringAccountDestination if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitoringAccountDestination. + */ + public static MonitoringAccountDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringAccountDestination deserializedMonitoringAccountDestination = new MonitoringAccountDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountResourceId".equals(fieldName)) { + deserializedMonitoringAccountDestination.accountResourceId = reader.getString(); + } else if ("accountId".equals(fieldName)) { + deserializedMonitoringAccountDestination.accountId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMonitoringAccountDestination.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringAccountDestination; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java index 4959eb9b9591..a86d23790d98 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java @@ -21,7 +21,7 @@ @Fluent public class MultiMetricCriteria implements JsonSerializable { /* - * Specifies the type of threshold criteria + * Specifies the type of threshold criteria. Previously undocumented values might be returned */ private CriterionType criterionType = CriterionType.fromString("MultiMetricCriteria"); @@ -41,7 +41,7 @@ public class MultiMetricCriteria implements JsonSerializable { + /* + * Specifies the type of threshold criteria. Previously undocumented values might be returned + */ + private CriterionType criterionType = CriterionType.fromString("MultiPromQLCriteria"); + + /* + * Name of the criteria. + */ + private String name; + + /* + * The query used to evaluate the alert rule + */ + private String query; + + /** + * Creates an instance of MultiPromQLCriteria class. + */ + public MultiPromQLCriteria() { + } + + /** + * Get the criterionType property: Specifies the type of threshold criteria. Previously undocumented values might be + * returned. + * + * @return the criterionType value. + */ + public CriterionType criterionType() { + return this.criterionType; + } + + /** + * Get the name property: Name of the criteria. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the criteria. + * + * @param name the name value to set. + * @return the MultiPromQLCriteria object itself. + */ + public MultiPromQLCriteria withName(String name) { + this.name = name; + return this; + } + + /** + * Get the query property: The query used to evaluate the alert rule. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query used to evaluate the alert rule. + * + * @param query the query value to set. + * @return the MultiPromQLCriteria object itself. + */ + public MultiPromQLCriteria withQuery(String query) { + this.query = query; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model MultiPromQLCriteria")); + } + if (query() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property query in model MultiPromQLCriteria")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MultiPromQLCriteria.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("query", this.query); + jsonWriter.writeStringField("criterionType", this.criterionType == null ? null : this.criterionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MultiPromQLCriteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MultiPromQLCriteria if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MultiPromQLCriteria. + */ + public static MultiPromQLCriteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("criterionType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("StaticThresholdCriterion".equals(discriminatorValue)) { + return StaticPromQLCriteria.fromJson(readerToUse.reset()); + } else if ("DynamicThresholdCriterion".equals(discriminatorValue)) { + return DynamicPromQLCriteria.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MultiPromQLCriteria fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MultiPromQLCriteria deserializedMultiPromQLCriteria = new MultiPromQLCriteria(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMultiPromQLCriteria.name = reader.getString(); + } else if ("query".equals(fieldName)) { + deserializedMultiPromQLCriteria.query = reader.getString(); + } else if ("criterionType".equals(fieldName)) { + deserializedMultiPromQLCriteria.criterionType = CriterionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMultiPromQLCriteria; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Odatatype.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Odatatype.java index 12975d0a3de0..5c6b62155724 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Odatatype.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Odatatype.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * specifies the type of the alert criteria. + * Specifies the type of the alert criteria. Previously undocumented values might be returned. */ public final class Odatatype extends ExpandableStringEnum { /** @@ -29,6 +29,12 @@ public final class Odatatype extends ExpandableStringEnum { public static final Odatatype MICROSOFT_AZURE_MONITOR_WEBTEST_LOCATION_AVAILABILITY_CRITERIA = fromString("Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"); + /** + * Static value Microsoft.Azure.Monitor.PromQLCriteria for Odatatype. + */ + public static final Odatatype MICROSOFT_AZURE_MONITOR_PROM_QLCRITERIA + = fromString("Microsoft.Azure.Monitor.PromQLCriteria"); + /** * Creates a new instance of Odatatype value. * diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operator.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operator.java index be5a68b2f515..e2a210b0d6f5 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operator.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Operator.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * the criteria operator. + * The criteria operator. Previously undocumented values might be returned. */ public final class Operator extends ExpandableStringEnum { /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelDataSourceResourceAttributeRouting.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelDataSourceResourceAttributeRouting.java new file mode 100644 index 000000000000..c0474c365786 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelDataSourceResourceAttributeRouting.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Enables OTLP (logs, traces, and metrics) payload routing. + */ +@Fluent +public class OtelDataSourceResourceAttributeRouting + implements JsonSerializable { + /* + * The name of the resource attribute to match. + */ + private String attributeName; + + /* + * The value of the resource attribute to match. + */ + private String attributeValue; + + /** + * Creates an instance of OtelDataSourceResourceAttributeRouting class. + */ + public OtelDataSourceResourceAttributeRouting() { + } + + /** + * Get the attributeName property: The name of the resource attribute to match. + * + * @return the attributeName value. + */ + public String attributeName() { + return this.attributeName; + } + + /** + * Set the attributeName property: The name of the resource attribute to match. + * + * @param attributeName the attributeName value to set. + * @return the OtelDataSourceResourceAttributeRouting object itself. + */ + public OtelDataSourceResourceAttributeRouting withAttributeName(String attributeName) { + this.attributeName = attributeName; + return this; + } + + /** + * Get the attributeValue property: The value of the resource attribute to match. + * + * @return the attributeValue value. + */ + public String attributeValue() { + return this.attributeValue; + } + + /** + * Set the attributeValue property: The value of the resource attribute to match. + * + * @param attributeValue the attributeValue value to set. + * @return the OtelDataSourceResourceAttributeRouting object itself. + */ + public OtelDataSourceResourceAttributeRouting withAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeName", this.attributeName); + jsonWriter.writeStringField("attributeValue", this.attributeValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelDataSourceResourceAttributeRouting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelDataSourceResourceAttributeRouting if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OtelDataSourceResourceAttributeRouting. + */ + public static OtelDataSourceResourceAttributeRouting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelDataSourceResourceAttributeRouting deserializedOtelDataSourceResourceAttributeRouting + = new OtelDataSourceResourceAttributeRouting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeName".equals(fieldName)) { + deserializedOtelDataSourceResourceAttributeRouting.attributeName = reader.getString(); + } else if ("attributeValue".equals(fieldName)) { + deserializedOtelDataSourceResourceAttributeRouting.attributeValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelDataSourceResourceAttributeRouting; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelLogsDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelLogsDataSource.java new file mode 100644 index 000000000000..28d4a0940ead --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelLogsDataSource.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Enables Otel logs to be collected by this data collection rule. + */ +@Fluent +public final class OtelLogsDataSource implements JsonSerializable { + /* + * List of streams that this data source will be sent to. + */ + private List streams; + + /* + * Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according + * to matching resource attribute. + */ + private OtelLogsDataSourceResourceAttributeRouting resourceAttributeRouting; + + /* + * Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for + * further enrichment. + */ + private List enrichWithResourceAttributes; + + /* + * Specifies the reference alias to enrich the telemetry signal with. + */ + private String enrichWithReference; + + /* + * Specifies whether to replace the default resourceId in the log record with the resourceId of the referenced + * resource being used for enrichment. + */ + private Boolean replaceResourceIdWithReference; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of OtelLogsDataSource class. + */ + public OtelLogsDataSource() { + } + + /** + * Get the streams property: List of streams that this data source will be sent to. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams that this data source will be sent to. + * + * @param streams the streams value to set. + * @return the OtelLogsDataSource object itself. + */ + public OtelLogsDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the resourceAttributeRouting property: Specifies the routing policy based on OTLP payload resource attributes + * to route subset of the payload according to matching resource attribute. + * + * @return the resourceAttributeRouting value. + */ + public OtelLogsDataSourceResourceAttributeRouting resourceAttributeRouting() { + return this.resourceAttributeRouting; + } + + /** + * Set the resourceAttributeRouting property: Specifies the routing policy based on OTLP payload resource attributes + * to route subset of the payload according to matching resource attribute. + * + * @param resourceAttributeRouting the resourceAttributeRouting value to set. + * @return the OtelLogsDataSource object itself. + */ + public OtelLogsDataSource + withResourceAttributeRouting(OtelLogsDataSourceResourceAttributeRouting resourceAttributeRouting) { + this.resourceAttributeRouting = resourceAttributeRouting; + return this; + } + + /** + * Get the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @return the enrichWithResourceAttributes value. + */ + public List enrichWithResourceAttributes() { + return this.enrichWithResourceAttributes; + } + + /** + * Set the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @param enrichWithResourceAttributes the enrichWithResourceAttributes value to set. + * @return the OtelLogsDataSource object itself. + */ + public OtelLogsDataSource withEnrichWithResourceAttributes(List enrichWithResourceAttributes) { + this.enrichWithResourceAttributes = enrichWithResourceAttributes; + return this; + } + + /** + * Get the enrichWithReference property: Specifies the reference alias to enrich the telemetry signal with. + * + * @return the enrichWithReference value. + */ + public String enrichWithReference() { + return this.enrichWithReference; + } + + /** + * Set the enrichWithReference property: Specifies the reference alias to enrich the telemetry signal with. + * + * @param enrichWithReference the enrichWithReference value to set. + * @return the OtelLogsDataSource object itself. + */ + public OtelLogsDataSource withEnrichWithReference(String enrichWithReference) { + this.enrichWithReference = enrichWithReference; + return this; + } + + /** + * Get the replaceResourceIdWithReference property: Specifies whether to replace the default resourceId in the log + * record with the resourceId of the referenced resource being used for enrichment. + * + * @return the replaceResourceIdWithReference value. + */ + public Boolean replaceResourceIdWithReference() { + return this.replaceResourceIdWithReference; + } + + /** + * Set the replaceResourceIdWithReference property: Specifies whether to replace the default resourceId in the log + * record with the resourceId of the referenced resource being used for enrichment. + * + * @param replaceResourceIdWithReference the replaceResourceIdWithReference value to set. + * @return the OtelLogsDataSource object itself. + */ + public OtelLogsDataSource withReplaceResourceIdWithReference(Boolean replaceResourceIdWithReference) { + this.replaceResourceIdWithReference = replaceResourceIdWithReference; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the OtelLogsDataSource object itself. + */ + public OtelLogsDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streams() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property streams in model OtelLogsDataSource")); + } + if (resourceAttributeRouting() != null) { + resourceAttributeRouting().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OtelLogsDataSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("resourceAttributeRouting", this.resourceAttributeRouting); + jsonWriter.writeArrayField("enrichWithResourceAttributes", this.enrichWithResourceAttributes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("enrichWithReference", this.enrichWithReference); + jsonWriter.writeBooleanField("replaceResourceIdWithReference", this.replaceResourceIdWithReference); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelLogsDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelLogsDataSource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OtelLogsDataSource. + */ + public static OtelLogsDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelLogsDataSource deserializedOtelLogsDataSource = new OtelLogsDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams + = reader.readArray(reader1 -> KnownOtelLogsDataSourceStreams.fromString(reader1.getString())); + deserializedOtelLogsDataSource.streams = streams; + } else if ("resourceAttributeRouting".equals(fieldName)) { + deserializedOtelLogsDataSource.resourceAttributeRouting + = OtelLogsDataSourceResourceAttributeRouting.fromJson(reader); + } else if ("enrichWithResourceAttributes".equals(fieldName)) { + List enrichWithResourceAttributes = reader.readArray(reader1 -> reader1.getString()); + deserializedOtelLogsDataSource.enrichWithResourceAttributes = enrichWithResourceAttributes; + } else if ("enrichWithReference".equals(fieldName)) { + deserializedOtelLogsDataSource.enrichWithReference = reader.getString(); + } else if ("replaceResourceIdWithReference".equals(fieldName)) { + deserializedOtelLogsDataSource.replaceResourceIdWithReference + = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedOtelLogsDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelLogsDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelLogsDataSourceResourceAttributeRouting.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelLogsDataSourceResourceAttributeRouting.java new file mode 100644 index 000000000000..c7cc31879475 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelLogsDataSourceResourceAttributeRouting.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according to + * matching resource attribute. + */ +@Fluent +public final class OtelLogsDataSourceResourceAttributeRouting extends OtelDataSourceResourceAttributeRouting { + /** + * Creates an instance of OtelLogsDataSourceResourceAttributeRouting class. + */ + public OtelLogsDataSourceResourceAttributeRouting() { + } + + /** + * {@inheritDoc} + */ + @Override + public OtelLogsDataSourceResourceAttributeRouting withAttributeName(String attributeName) { + super.withAttributeName(attributeName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OtelLogsDataSourceResourceAttributeRouting withAttributeValue(String attributeValue) { + super.withAttributeValue(attributeValue); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeName", attributeName()); + jsonWriter.writeStringField("attributeValue", attributeValue()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelLogsDataSourceResourceAttributeRouting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelLogsDataSourceResourceAttributeRouting if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OtelLogsDataSourceResourceAttributeRouting. + */ + public static OtelLogsDataSourceResourceAttributeRouting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelLogsDataSourceResourceAttributeRouting deserializedOtelLogsDataSourceResourceAttributeRouting + = new OtelLogsDataSourceResourceAttributeRouting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeName".equals(fieldName)) { + deserializedOtelLogsDataSourceResourceAttributeRouting.withAttributeName(reader.getString()); + } else if ("attributeValue".equals(fieldName)) { + deserializedOtelLogsDataSourceResourceAttributeRouting.withAttributeValue(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelLogsDataSourceResourceAttributeRouting; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelLogsDirectDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelLogsDirectDataSource.java new file mode 100644 index 000000000000..fc297c48f49b --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelLogsDirectDataSource.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The OtelLogsDirectDataSource model. + */ +@Fluent +public final class OtelLogsDirectDataSource implements JsonSerializable { + /* + * List of streams that this data source will be sent to. + */ + private List streams; + + /* + * Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for + * further enrichment. + */ + private List enrichWithResourceAttributes; + + /* + * Specifies the reference to enrich the telemetry signal with. + */ + private String enrichWithReference; + + /* + * Specifies whether to replace the default resourceId in the log record with the resourceId of the referenced + * resource being used for enrichment. + */ + private Boolean replaceResourceIdWithReference; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of OtelLogsDirectDataSource class. + */ + public OtelLogsDirectDataSource() { + } + + /** + * Get the streams property: List of streams that this data source will be sent to. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams that this data source will be sent to. + * + * @param streams the streams value to set. + * @return the OtelLogsDirectDataSource object itself. + */ + public OtelLogsDirectDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @return the enrichWithResourceAttributes value. + */ + public List enrichWithResourceAttributes() { + return this.enrichWithResourceAttributes; + } + + /** + * Set the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @param enrichWithResourceAttributes the enrichWithResourceAttributes value to set. + * @return the OtelLogsDirectDataSource object itself. + */ + public OtelLogsDirectDataSource withEnrichWithResourceAttributes(List enrichWithResourceAttributes) { + this.enrichWithResourceAttributes = enrichWithResourceAttributes; + return this; + } + + /** + * Get the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @return the enrichWithReference value. + */ + public String enrichWithReference() { + return this.enrichWithReference; + } + + /** + * Set the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @param enrichWithReference the enrichWithReference value to set. + * @return the OtelLogsDirectDataSource object itself. + */ + public OtelLogsDirectDataSource withEnrichWithReference(String enrichWithReference) { + this.enrichWithReference = enrichWithReference; + return this; + } + + /** + * Get the replaceResourceIdWithReference property: Specifies whether to replace the default resourceId in the log + * record with the resourceId of the referenced resource being used for enrichment. + * + * @return the replaceResourceIdWithReference value. + */ + public Boolean replaceResourceIdWithReference() { + return this.replaceResourceIdWithReference; + } + + /** + * Set the replaceResourceIdWithReference property: Specifies whether to replace the default resourceId in the log + * record with the resourceId of the referenced resource being used for enrichment. + * + * @param replaceResourceIdWithReference the replaceResourceIdWithReference value to set. + * @return the OtelLogsDirectDataSource object itself. + */ + public OtelLogsDirectDataSource withReplaceResourceIdWithReference(Boolean replaceResourceIdWithReference) { + this.replaceResourceIdWithReference = replaceResourceIdWithReference; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the OtelLogsDirectDataSource object itself. + */ + public OtelLogsDirectDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streams() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property streams in model OtelLogsDirectDataSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OtelLogsDirectDataSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("enrichWithResourceAttributes", this.enrichWithResourceAttributes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("enrichWithReference", this.enrichWithReference); + jsonWriter.writeBooleanField("replaceResourceIdWithReference", this.replaceResourceIdWithReference); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelLogsDirectDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelLogsDirectDataSource if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OtelLogsDirectDataSource. + */ + public static OtelLogsDirectDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelLogsDirectDataSource deserializedOtelLogsDirectDataSource = new OtelLogsDirectDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams = reader + .readArray(reader1 -> KnownOtelLogsDirectDataSourceStreams.fromString(reader1.getString())); + deserializedOtelLogsDirectDataSource.streams = streams; + } else if ("enrichWithResourceAttributes".equals(fieldName)) { + List enrichWithResourceAttributes = reader.readArray(reader1 -> reader1.getString()); + deserializedOtelLogsDirectDataSource.enrichWithResourceAttributes = enrichWithResourceAttributes; + } else if ("enrichWithReference".equals(fieldName)) { + deserializedOtelLogsDirectDataSource.enrichWithReference = reader.getString(); + } else if ("replaceResourceIdWithReference".equals(fieldName)) { + deserializedOtelLogsDirectDataSource.replaceResourceIdWithReference + = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedOtelLogsDirectDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelLogsDirectDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelMetricsDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelMetricsDataSource.java new file mode 100644 index 000000000000..06b7fc8ac654 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelMetricsDataSource.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of OTel metrics configuration. + */ +@Fluent +public final class OtelMetricsDataSource implements JsonSerializable { + /* + * List of streams that this data source will be sent to. + */ + private List streams; + + /* + * Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according + * to matching resource attribute. + */ + private OtelMetricsDataSourceResourceAttributeRouting resourceAttributeRouting; + + /* + * Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for + * further enrichment. + */ + private List enrichWithResourceAttributes; + + /* + * Specifies the reference to enrich the telemetry signal with. + */ + private String enrichWithReference; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of OtelMetricsDataSource class. + */ + public OtelMetricsDataSource() { + } + + /** + * Get the streams property: List of streams that this data source will be sent to. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams that this data source will be sent to. + * + * @param streams the streams value to set. + * @return the OtelMetricsDataSource object itself. + */ + public OtelMetricsDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the resourceAttributeRouting property: Specifies the routing policy based on OTLP payload resource attributes + * to route subset of the payload according to matching resource attribute. + * + * @return the resourceAttributeRouting value. + */ + public OtelMetricsDataSourceResourceAttributeRouting resourceAttributeRouting() { + return this.resourceAttributeRouting; + } + + /** + * Set the resourceAttributeRouting property: Specifies the routing policy based on OTLP payload resource attributes + * to route subset of the payload according to matching resource attribute. + * + * @param resourceAttributeRouting the resourceAttributeRouting value to set. + * @return the OtelMetricsDataSource object itself. + */ + public OtelMetricsDataSource + withResourceAttributeRouting(OtelMetricsDataSourceResourceAttributeRouting resourceAttributeRouting) { + this.resourceAttributeRouting = resourceAttributeRouting; + return this; + } + + /** + * Get the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @return the enrichWithResourceAttributes value. + */ + public List enrichWithResourceAttributes() { + return this.enrichWithResourceAttributes; + } + + /** + * Set the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @param enrichWithResourceAttributes the enrichWithResourceAttributes value to set. + * @return the OtelMetricsDataSource object itself. + */ + public OtelMetricsDataSource withEnrichWithResourceAttributes(List enrichWithResourceAttributes) { + this.enrichWithResourceAttributes = enrichWithResourceAttributes; + return this; + } + + /** + * Get the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @return the enrichWithReference value. + */ + public String enrichWithReference() { + return this.enrichWithReference; + } + + /** + * Set the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @param enrichWithReference the enrichWithReference value to set. + * @return the OtelMetricsDataSource object itself. + */ + public OtelMetricsDataSource withEnrichWithReference(String enrichWithReference) { + this.enrichWithReference = enrichWithReference; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the OtelMetricsDataSource object itself. + */ + public OtelMetricsDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streams() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property streams in model OtelMetricsDataSource")); + } + if (resourceAttributeRouting() != null) { + resourceAttributeRouting().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OtelMetricsDataSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("resourceAttributeRouting", this.resourceAttributeRouting); + jsonWriter.writeArrayField("enrichWithResourceAttributes", this.enrichWithResourceAttributes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("enrichWithReference", this.enrichWithReference); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelMetricsDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelMetricsDataSource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OtelMetricsDataSource. + */ + public static OtelMetricsDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelMetricsDataSource deserializedOtelMetricsDataSource = new OtelMetricsDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams = reader.readArray(reader1 -> reader1.getString()); + deserializedOtelMetricsDataSource.streams = streams; + } else if ("resourceAttributeRouting".equals(fieldName)) { + deserializedOtelMetricsDataSource.resourceAttributeRouting + = OtelMetricsDataSourceResourceAttributeRouting.fromJson(reader); + } else if ("enrichWithResourceAttributes".equals(fieldName)) { + List enrichWithResourceAttributes = reader.readArray(reader1 -> reader1.getString()); + deserializedOtelMetricsDataSource.enrichWithResourceAttributes = enrichWithResourceAttributes; + } else if ("enrichWithReference".equals(fieldName)) { + deserializedOtelMetricsDataSource.enrichWithReference = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOtelMetricsDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelMetricsDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelMetricsDataSourceResourceAttributeRouting.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelMetricsDataSourceResourceAttributeRouting.java new file mode 100644 index 000000000000..23127a86959e --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelMetricsDataSourceResourceAttributeRouting.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according to + * matching resource attribute. + */ +@Fluent +public final class OtelMetricsDataSourceResourceAttributeRouting extends OtelDataSourceResourceAttributeRouting { + /** + * Creates an instance of OtelMetricsDataSourceResourceAttributeRouting class. + */ + public OtelMetricsDataSourceResourceAttributeRouting() { + } + + /** + * {@inheritDoc} + */ + @Override + public OtelMetricsDataSourceResourceAttributeRouting withAttributeName(String attributeName) { + super.withAttributeName(attributeName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OtelMetricsDataSourceResourceAttributeRouting withAttributeValue(String attributeValue) { + super.withAttributeValue(attributeValue); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeName", attributeName()); + jsonWriter.writeStringField("attributeValue", attributeValue()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelMetricsDataSourceResourceAttributeRouting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelMetricsDataSourceResourceAttributeRouting if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OtelMetricsDataSourceResourceAttributeRouting. + */ + public static OtelMetricsDataSourceResourceAttributeRouting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelMetricsDataSourceResourceAttributeRouting deserializedOtelMetricsDataSourceResourceAttributeRouting + = new OtelMetricsDataSourceResourceAttributeRouting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeName".equals(fieldName)) { + deserializedOtelMetricsDataSourceResourceAttributeRouting.withAttributeName(reader.getString()); + } else if ("attributeValue".equals(fieldName)) { + deserializedOtelMetricsDataSourceResourceAttributeRouting.withAttributeValue(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelMetricsDataSourceResourceAttributeRouting; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelMetricsDirectDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelMetricsDirectDataSource.java new file mode 100644 index 000000000000..3f8ab6f79f1f --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelMetricsDirectDataSource.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of OTel metrics configuration. + */ +@Fluent +public final class OtelMetricsDirectDataSource implements JsonSerializable { + /* + * List of streams that this data source will be sent to. + */ + private List streams; + + /* + * Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for + * further enrichment. + */ + private List enrichWithResourceAttributes; + + /* + * Specifies the reference to enrich the telemetry signal with. + */ + private String enrichWithReference; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of OtelMetricsDirectDataSource class. + */ + public OtelMetricsDirectDataSource() { + } + + /** + * Get the streams property: List of streams that this data source will be sent to. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams that this data source will be sent to. + * + * @param streams the streams value to set. + * @return the OtelMetricsDirectDataSource object itself. + */ + public OtelMetricsDirectDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @return the enrichWithResourceAttributes value. + */ + public List enrichWithResourceAttributes() { + return this.enrichWithResourceAttributes; + } + + /** + * Set the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @param enrichWithResourceAttributes the enrichWithResourceAttributes value to set. + * @return the OtelMetricsDirectDataSource object itself. + */ + public OtelMetricsDirectDataSource withEnrichWithResourceAttributes(List enrichWithResourceAttributes) { + this.enrichWithResourceAttributes = enrichWithResourceAttributes; + return this; + } + + /** + * Get the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @return the enrichWithReference value. + */ + public String enrichWithReference() { + return this.enrichWithReference; + } + + /** + * Set the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @param enrichWithReference the enrichWithReference value to set. + * @return the OtelMetricsDirectDataSource object itself. + */ + public OtelMetricsDirectDataSource withEnrichWithReference(String enrichWithReference) { + this.enrichWithReference = enrichWithReference; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the OtelMetricsDirectDataSource object itself. + */ + public OtelMetricsDirectDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streams() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property streams in model OtelMetricsDirectDataSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OtelMetricsDirectDataSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("enrichWithResourceAttributes", this.enrichWithResourceAttributes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("enrichWithReference", this.enrichWithReference); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelMetricsDirectDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelMetricsDirectDataSource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OtelMetricsDirectDataSource. + */ + public static OtelMetricsDirectDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelMetricsDirectDataSource deserializedOtelMetricsDirectDataSource = new OtelMetricsDirectDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams = reader.readArray(reader1 -> reader1.getString()); + deserializedOtelMetricsDirectDataSource.streams = streams; + } else if ("enrichWithResourceAttributes".equals(fieldName)) { + List enrichWithResourceAttributes = reader.readArray(reader1 -> reader1.getString()); + deserializedOtelMetricsDirectDataSource.enrichWithResourceAttributes = enrichWithResourceAttributes; + } else if ("enrichWithReference".equals(fieldName)) { + deserializedOtelMetricsDirectDataSource.enrichWithReference = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOtelMetricsDirectDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelMetricsDirectDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelTracesDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelTracesDataSource.java new file mode 100644 index 000000000000..806074d56e9e --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelTracesDataSource.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Enables Otel Traces to be collected by this data collection rule. + */ +@Fluent +public final class OtelTracesDataSource implements JsonSerializable { + /* + * List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will + * be sent to. + */ + private List streams; + + /* + * Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according + * to matching resource attribute. + */ + private OtelTracesDataSourceResourceAttributeRouting resourceAttributeRouting; + + /* + * Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for + * further enrichment. + */ + private List enrichWithResourceAttributes; + + /* + * Specifies the reference to enrich the telemetry signal with. + */ + private String enrichWithReference; + + /* + * Specifies whether to replace the default resourceId in the log record with the resourceId of the referenced + * resource being used for enrichment. + */ + private Boolean replaceResourceIdWithReference; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of OtelTracesDataSource class. + */ + public OtelTracesDataSource() { + } + + /** + * Get the streams property: List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will + * be sent to. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will + * be sent to. + * + * @param streams the streams value to set. + * @return the OtelTracesDataSource object itself. + */ + public OtelTracesDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the resourceAttributeRouting property: Specifies the routing policy based on OTLP payload resource attributes + * to route subset of the payload according to matching resource attribute. + * + * @return the resourceAttributeRouting value. + */ + public OtelTracesDataSourceResourceAttributeRouting resourceAttributeRouting() { + return this.resourceAttributeRouting; + } + + /** + * Set the resourceAttributeRouting property: Specifies the routing policy based on OTLP payload resource attributes + * to route subset of the payload according to matching resource attribute. + * + * @param resourceAttributeRouting the resourceAttributeRouting value to set. + * @return the OtelTracesDataSource object itself. + */ + public OtelTracesDataSource + withResourceAttributeRouting(OtelTracesDataSourceResourceAttributeRouting resourceAttributeRouting) { + this.resourceAttributeRouting = resourceAttributeRouting; + return this; + } + + /** + * Get the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @return the enrichWithResourceAttributes value. + */ + public List enrichWithResourceAttributes() { + return this.enrichWithResourceAttributes; + } + + /** + * Set the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @param enrichWithResourceAttributes the enrichWithResourceAttributes value to set. + * @return the OtelTracesDataSource object itself. + */ + public OtelTracesDataSource withEnrichWithResourceAttributes(List enrichWithResourceAttributes) { + this.enrichWithResourceAttributes = enrichWithResourceAttributes; + return this; + } + + /** + * Get the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @return the enrichWithReference value. + */ + public String enrichWithReference() { + return this.enrichWithReference; + } + + /** + * Set the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @param enrichWithReference the enrichWithReference value to set. + * @return the OtelTracesDataSource object itself. + */ + public OtelTracesDataSource withEnrichWithReference(String enrichWithReference) { + this.enrichWithReference = enrichWithReference; + return this; + } + + /** + * Get the replaceResourceIdWithReference property: Specifies whether to replace the default resourceId in the log + * record with the resourceId of the referenced resource being used for enrichment. + * + * @return the replaceResourceIdWithReference value. + */ + public Boolean replaceResourceIdWithReference() { + return this.replaceResourceIdWithReference; + } + + /** + * Set the replaceResourceIdWithReference property: Specifies whether to replace the default resourceId in the log + * record with the resourceId of the referenced resource being used for enrichment. + * + * @param replaceResourceIdWithReference the replaceResourceIdWithReference value to set. + * @return the OtelTracesDataSource object itself. + */ + public OtelTracesDataSource withReplaceResourceIdWithReference(Boolean replaceResourceIdWithReference) { + this.replaceResourceIdWithReference = replaceResourceIdWithReference; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the OtelTracesDataSource object itself. + */ + public OtelTracesDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streams() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property streams in model OtelTracesDataSource")); + } + if (resourceAttributeRouting() != null) { + resourceAttributeRouting().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OtelTracesDataSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("resourceAttributeRouting", this.resourceAttributeRouting); + jsonWriter.writeArrayField("enrichWithResourceAttributes", this.enrichWithResourceAttributes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("enrichWithReference", this.enrichWithReference); + jsonWriter.writeBooleanField("replaceResourceIdWithReference", this.replaceResourceIdWithReference); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelTracesDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelTracesDataSource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OtelTracesDataSource. + */ + public static OtelTracesDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelTracesDataSource deserializedOtelTracesDataSource = new OtelTracesDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams + = reader.readArray(reader1 -> KnownOtelTracesDataSourceStreams.fromString(reader1.getString())); + deserializedOtelTracesDataSource.streams = streams; + } else if ("resourceAttributeRouting".equals(fieldName)) { + deserializedOtelTracesDataSource.resourceAttributeRouting + = OtelTracesDataSourceResourceAttributeRouting.fromJson(reader); + } else if ("enrichWithResourceAttributes".equals(fieldName)) { + List enrichWithResourceAttributes = reader.readArray(reader1 -> reader1.getString()); + deserializedOtelTracesDataSource.enrichWithResourceAttributes = enrichWithResourceAttributes; + } else if ("enrichWithReference".equals(fieldName)) { + deserializedOtelTracesDataSource.enrichWithReference = reader.getString(); + } else if ("replaceResourceIdWithReference".equals(fieldName)) { + deserializedOtelTracesDataSource.replaceResourceIdWithReference + = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedOtelTracesDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelTracesDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelTracesDataSourceResourceAttributeRouting.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelTracesDataSourceResourceAttributeRouting.java new file mode 100644 index 000000000000..2e0cd7e61092 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelTracesDataSourceResourceAttributeRouting.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according to + * matching resource attribute. + */ +@Fluent +public final class OtelTracesDataSourceResourceAttributeRouting extends OtelDataSourceResourceAttributeRouting { + /** + * Creates an instance of OtelTracesDataSourceResourceAttributeRouting class. + */ + public OtelTracesDataSourceResourceAttributeRouting() { + } + + /** + * {@inheritDoc} + */ + @Override + public OtelTracesDataSourceResourceAttributeRouting withAttributeName(String attributeName) { + super.withAttributeName(attributeName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OtelTracesDataSourceResourceAttributeRouting withAttributeValue(String attributeValue) { + super.withAttributeValue(attributeValue); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeName", attributeName()); + jsonWriter.writeStringField("attributeValue", attributeValue()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelTracesDataSourceResourceAttributeRouting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelTracesDataSourceResourceAttributeRouting if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OtelTracesDataSourceResourceAttributeRouting. + */ + public static OtelTracesDataSourceResourceAttributeRouting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelTracesDataSourceResourceAttributeRouting deserializedOtelTracesDataSourceResourceAttributeRouting + = new OtelTracesDataSourceResourceAttributeRouting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeName".equals(fieldName)) { + deserializedOtelTracesDataSourceResourceAttributeRouting.withAttributeName(reader.getString()); + } else if ("attributeValue".equals(fieldName)) { + deserializedOtelTracesDataSourceResourceAttributeRouting.withAttributeValue(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelTracesDataSourceResourceAttributeRouting; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelTracesDirectDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelTracesDirectDataSource.java new file mode 100644 index 000000000000..08fa2df0b28c --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/OtelTracesDirectDataSource.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Enables Otel Traces to be collected by this data collection rule. + */ +@Fluent +public final class OtelTracesDirectDataSource implements JsonSerializable { + /* + * List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will + * be sent to. + */ + private List streams; + + /* + * Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for + * further enrichment. + */ + private List enrichWithResourceAttributes; + + /* + * Specifies the reference to enrich the telemetry signal with. + */ + private String enrichWithReference; + + /* + * Specifies whether to replace the default resourceId in the log record with the resourceId of the referenced + * resource being used for enrichment. + */ + private Boolean replaceResourceIdWithReference; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of OtelTracesDirectDataSource class. + */ + public OtelTracesDirectDataSource() { + } + + /** + * Get the streams property: List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will + * be sent to. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will + * be sent to. + * + * @param streams the streams value to set. + * @return the OtelTracesDirectDataSource object itself. + */ + public OtelTracesDirectDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @return the enrichWithResourceAttributes value. + */ + public List enrichWithResourceAttributes() { + return this.enrichWithResourceAttributes; + } + + /** + * Set the enrichWithResourceAttributes property: Specifies the list of resource attributes that need to be added as + * labels/dimensions to the telemetry data for further enrichment. + * + * @param enrichWithResourceAttributes the enrichWithResourceAttributes value to set. + * @return the OtelTracesDirectDataSource object itself. + */ + public OtelTracesDirectDataSource withEnrichWithResourceAttributes(List enrichWithResourceAttributes) { + this.enrichWithResourceAttributes = enrichWithResourceAttributes; + return this; + } + + /** + * Get the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @return the enrichWithReference value. + */ + public String enrichWithReference() { + return this.enrichWithReference; + } + + /** + * Set the enrichWithReference property: Specifies the reference to enrich the telemetry signal with. + * + * @param enrichWithReference the enrichWithReference value to set. + * @return the OtelTracesDirectDataSource object itself. + */ + public OtelTracesDirectDataSource withEnrichWithReference(String enrichWithReference) { + this.enrichWithReference = enrichWithReference; + return this; + } + + /** + * Get the replaceResourceIdWithReference property: Specifies whether to replace the default resourceId in the log + * record with the resourceId of the referenced resource being used for enrichment. + * + * @return the replaceResourceIdWithReference value. + */ + public Boolean replaceResourceIdWithReference() { + return this.replaceResourceIdWithReference; + } + + /** + * Set the replaceResourceIdWithReference property: Specifies whether to replace the default resourceId in the log + * record with the resourceId of the referenced resource being used for enrichment. + * + * @param replaceResourceIdWithReference the replaceResourceIdWithReference value to set. + * @return the OtelTracesDirectDataSource object itself. + */ + public OtelTracesDirectDataSource withReplaceResourceIdWithReference(Boolean replaceResourceIdWithReference) { + this.replaceResourceIdWithReference = replaceResourceIdWithReference; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the OtelTracesDirectDataSource object itself. + */ + public OtelTracesDirectDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streams() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property streams in model OtelTracesDirectDataSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OtelTracesDirectDataSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("enrichWithResourceAttributes", this.enrichWithResourceAttributes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("enrichWithReference", this.enrichWithReference); + jsonWriter.writeBooleanField("replaceResourceIdWithReference", this.replaceResourceIdWithReference); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtelTracesDirectDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtelTracesDirectDataSource if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OtelTracesDirectDataSource. + */ + public static OtelTracesDirectDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtelTracesDirectDataSource deserializedOtelTracesDirectDataSource = new OtelTracesDirectDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams = reader + .readArray(reader1 -> KnownOtelTracesDirectDataSourceStreams.fromString(reader1.getString())); + deserializedOtelTracesDirectDataSource.streams = streams; + } else if ("enrichWithResourceAttributes".equals(fieldName)) { + List enrichWithResourceAttributes = reader.readArray(reader1 -> reader1.getString()); + deserializedOtelTracesDirectDataSource.enrichWithResourceAttributes = enrichWithResourceAttributes; + } else if ("enrichWithReference".equals(fieldName)) { + deserializedOtelTracesDirectDataSource.enrichWithReference = reader.getString(); + } else if ("replaceResourceIdWithReference".equals(fieldName)) { + deserializedOtelTracesDirectDataSource.replaceResourceIdWithReference + = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedOtelTracesDirectDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOtelTracesDirectDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.java index f82d0248d70b..3f0da20aa06e 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.java @@ -38,6 +38,11 @@ public final class PerfCounterDataSource implements JsonSerializable counterSpecifiers; + /* + * The KQL query to transform the data source. This is a deprecated property and will be removed in future versions. + */ + private String transformKql; + /* * A friendly name for the data source. * This name should be unique across all data sources (regardless of type) within the data collection rule. @@ -120,6 +125,28 @@ public PerfCounterDataSource withCounterSpecifiers(List counterSpecifier return this; } + /** + * Get the transformKql property: The KQL query to transform the data source. This is a deprecated property and will + * be removed in future versions. + * + * @return the transformKql value. + */ + public String transformKql() { + return this.transformKql; + } + + /** + * Set the transformKql property: The KQL query to transform the data source. This is a deprecated property and will + * be removed in future versions. + * + * @param transformKql the transformKql value to set. + * @return the PerfCounterDataSource object itself. + */ + public PerfCounterDataSource withTransformKql(String transformKql) { + this.transformKql = transformKql; + return this; + } + /** * Get the name property: A friendly name for the data source. * This name should be unique across all data sources (regardless of type) within the data collection rule. @@ -161,6 +188,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("samplingFrequencyInSeconds", this.samplingFrequencyInSeconds); jsonWriter.writeArrayField("counterSpecifiers", this.counterSpecifiers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("transformKql", this.transformKql); jsonWriter.writeStringField("name", this.name); return jsonWriter.writeEndObject(); } @@ -190,6 +218,8 @@ public static PerfCounterDataSource fromJson(JsonReader jsonReader) throws IOExc } else if ("counterSpecifiers".equals(fieldName)) { List counterSpecifiers = reader.readArray(reader1 -> reader1.getString()); deserializedPerfCounterDataSource.counterSpecifiers = counterSpecifiers; + } else if ("transformKql".equals(fieldName)) { + deserializedPerfCounterDataSource.transformKql = reader.getString(); } else if ("name".equals(fieldName)) { deserializedPerfCounterDataSource.name = reader.getString(); } else { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerformanceCountersOTelDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerformanceCountersOTelDataSource.java new file mode 100644 index 000000000000..e454fcbaff5a --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerformanceCountersOTelDataSource.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of which Open Telemetry performance counters will be collected and how they will be collected by this data + * collection rule. + * Collected from both Windows and Linux machines where the counter is present. + */ +@Fluent +public final class PerformanceCountersOTelDataSource implements JsonSerializable { + /* + * List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will + * be sent to. + */ + private List streams; + + /* + * The number of seconds between consecutive counter measurements (samples). + */ + private Integer samplingFrequencyInSeconds; + + /* + * A list of specifier names of the performance counters you want to collect. + */ + private List counterSpecifiers; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of PerformanceCountersOTelDataSource class. + */ + public PerformanceCountersOTelDataSource() { + } + + /** + * Get the streams property: List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will + * be sent to. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams that this data source will be sent to. + * A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will + * be sent to. + * + * @param streams the streams value to set. + * @return the PerformanceCountersOTelDataSource object itself. + */ + public PerformanceCountersOTelDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the samplingFrequencyInSeconds property: The number of seconds between consecutive counter measurements + * (samples). + * + * @return the samplingFrequencyInSeconds value. + */ + public Integer samplingFrequencyInSeconds() { + return this.samplingFrequencyInSeconds; + } + + /** + * Set the samplingFrequencyInSeconds property: The number of seconds between consecutive counter measurements + * (samples). + * + * @param samplingFrequencyInSeconds the samplingFrequencyInSeconds value to set. + * @return the PerformanceCountersOTelDataSource object itself. + */ + public PerformanceCountersOTelDataSource withSamplingFrequencyInSeconds(Integer samplingFrequencyInSeconds) { + this.samplingFrequencyInSeconds = samplingFrequencyInSeconds; + return this; + } + + /** + * Get the counterSpecifiers property: A list of specifier names of the performance counters you want to collect. + * + * @return the counterSpecifiers value. + */ + public List counterSpecifiers() { + return this.counterSpecifiers; + } + + /** + * Set the counterSpecifiers property: A list of specifier names of the performance counters you want to collect. + * + * @param counterSpecifiers the counterSpecifiers value to set. + * @return the PerformanceCountersOTelDataSource object itself. + */ + public PerformanceCountersOTelDataSource withCounterSpecifiers(List counterSpecifiers) { + this.counterSpecifiers = counterSpecifiers; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the PerformanceCountersOTelDataSource object itself. + */ + public PerformanceCountersOTelDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeNumberField("samplingFrequencyInSeconds", this.samplingFrequencyInSeconds); + jsonWriter.writeArrayField("counterSpecifiers", this.counterSpecifiers, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PerformanceCountersOTelDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PerformanceCountersOTelDataSource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PerformanceCountersOTelDataSource. + */ + public static PerformanceCountersOTelDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PerformanceCountersOTelDataSource deserializedPerformanceCountersOTelDataSource + = new PerformanceCountersOTelDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams = reader.readArray( + reader1 -> KnownPerformanceCountersOTelDataSourceStreams.fromString(reader1.getString())); + deserializedPerformanceCountersOTelDataSource.streams = streams; + } else if ("samplingFrequencyInSeconds".equals(fieldName)) { + deserializedPerformanceCountersOTelDataSource.samplingFrequencyInSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("counterSpecifiers".equals(fieldName)) { + List counterSpecifiers = reader.readArray(reader1 -> reader1.getString()); + deserializedPerformanceCountersOTelDataSource.counterSpecifiers = counterSpecifiers; + } else if ("name".equals(fieldName)) { + deserializedPerformanceCountersOTelDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPerformanceCountersOTelDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PlatformTelemetryDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PlatformTelemetryDataSource.java new file mode 100644 index 000000000000..cd5fa3e85cb4 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PlatformTelemetryDataSource.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of platform telemetry data source configuration. + */ +@Fluent +public final class PlatformTelemetryDataSource implements JsonSerializable { + /* + * List of platform telemetry streams to collect + */ + private List streams; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of PlatformTelemetryDataSource class. + */ + public PlatformTelemetryDataSource() { + } + + /** + * Get the streams property: List of platform telemetry streams to collect. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of platform telemetry streams to collect. + * + * @param streams the streams value to set. + * @return the PlatformTelemetryDataSource object itself. + */ + public PlatformTelemetryDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the PlatformTelemetryDataSource object itself. + */ + public PlatformTelemetryDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streams() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property streams in model PlatformTelemetryDataSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PlatformTelemetryDataSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlatformTelemetryDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlatformTelemetryDataSource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PlatformTelemetryDataSource. + */ + public static PlatformTelemetryDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlatformTelemetryDataSource deserializedPlatformTelemetryDataSource = new PlatformTelemetryDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams = reader.readArray(reader1 -> reader1.getString()); + deserializedPlatformTelemetryDataSource.streams = streams; + } else if ("name".equals(fieldName)) { + deserializedPlatformTelemetryDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPlatformTelemetryDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkScopedResource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkScopedResource.java new file mode 100644 index 000000000000..81f7b204e054 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkScopedResource.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The PrivateLinkScopedResource model. + */ +@Fluent +public final class PrivateLinkScopedResource implements JsonSerializable { + /* + * The resourceId of the Azure Monitor Private Link Scope Scoped Resource through which this DCE is associated with + * a Azure Monitor Private Link Scope. + */ + private String resourceId; + + /* + * The immutableId of the Azure Monitor Private Link Scope Resource to which the association is. + */ + private String scopeId; + + /** + * Creates an instance of PrivateLinkScopedResource class. + */ + public PrivateLinkScopedResource() { + } + + /** + * Get the resourceId property: The resourceId of the Azure Monitor Private Link Scope Scoped Resource through which + * this DCE is associated with a Azure Monitor Private Link Scope. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resourceId of the Azure Monitor Private Link Scope Scoped Resource through which + * this DCE is associated with a Azure Monitor Private Link Scope. + * + * @param resourceId the resourceId value to set. + * @return the PrivateLinkScopedResource object itself. + */ + public PrivateLinkScopedResource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the scopeId property: The immutableId of the Azure Monitor Private Link Scope Resource to which the + * association is. + * + * @return the scopeId value. + */ + public String scopeId() { + return this.scopeId; + } + + /** + * Set the scopeId property: The immutableId of the Azure Monitor Private Link Scope Resource to which the + * association is. + * + * @param scopeId the scopeId value to set. + * @return the PrivateLinkScopedResource object itself. + */ + public PrivateLinkScopedResource withScopeId(String scopeId) { + this.scopeId = scopeId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("scopeId", this.scopeId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkScopedResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkScopedResource if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkScopedResource. + */ + public static PrivateLinkScopedResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkScopedResource deserializedPrivateLinkScopedResource = new PrivateLinkScopedResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedPrivateLinkScopedResource.resourceId = reader.getString(); + } else if ("scopeId".equals(fieldName)) { + deserializedPrivateLinkScopedResource.scopeId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkScopedResource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PromQLCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PromQLCriteria.java new file mode 100644 index 000000000000..0d848d874701 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PromQLCriteria.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Specifies the PromQL criteria for the metric alert resource. + */ +@Fluent +public final class PromQLCriteria extends MetricAlertCriteria { + /* + * Specifies the type of the alert criteria. Previously undocumented values might be returned + */ + private Odatatype odataType = Odatatype.MICROSOFT_AZURE_MONITOR_PROM_QLCRITERIA; + + /* + * Configuration for failing periods in query-based alerts. + */ + private QueryFailingPeriods failingPeriods; + + /* + * The list of promQL criteria. Alert will be raised when all conditions are met. + */ + private List allOf; + + /** + * Creates an instance of PromQLCriteria class. + */ + public PromQLCriteria() { + } + + /** + * Get the odataType property: Specifies the type of the alert criteria. Previously undocumented values might be + * returned. + * + * @return the odataType value. + */ + @Override + public Odatatype odataType() { + return this.odataType; + } + + /** + * Get the failingPeriods property: Configuration for failing periods in query-based alerts. + * + * @return the failingPeriods value. + */ + public QueryFailingPeriods failingPeriods() { + return this.failingPeriods; + } + + /** + * Set the failingPeriods property: Configuration for failing periods in query-based alerts. + * + * @param failingPeriods the failingPeriods value to set. + * @return the PromQLCriteria object itself. + */ + public PromQLCriteria withFailingPeriods(QueryFailingPeriods failingPeriods) { + this.failingPeriods = failingPeriods; + return this; + } + + /** + * Get the allOf property: The list of promQL criteria. Alert will be raised when all conditions are met. + * + * @return the allOf value. + */ + public List allOf() { + return this.allOf; + } + + /** + * Set the allOf property: The list of promQL criteria. Alert will be raised when all conditions are met. + * + * @param allOf the allOf value to set. + * @return the PromQLCriteria object itself. + */ + public PromQLCriteria withAllOf(List allOf) { + this.allOf = allOf; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (failingPeriods() != null) { + failingPeriods().validate(); + } + if (allOf() != null) { + allOf().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("odata.type", this.odataType == null ? null : this.odataType.toString()); + jsonWriter.writeJsonField("failingPeriods", this.failingPeriods); + jsonWriter.writeArrayField("allOf", this.allOf, (writer, element) -> writer.writeJson(element)); + if (additionalProperties() != null) { + for (Map.Entry additionalProperty : additionalProperties().entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PromQLCriteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PromQLCriteria if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PromQLCriteria. + */ + public static PromQLCriteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PromQLCriteria deserializedPromQLCriteria = new PromQLCriteria(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("odata.type".equals(fieldName)) { + deserializedPromQLCriteria.odataType = Odatatype.fromString(reader.getString()); + } else if ("failingPeriods".equals(fieldName)) { + deserializedPromQLCriteria.failingPeriods = QueryFailingPeriods.fromJson(reader); + } else if ("allOf".equals(fieldName)) { + List allOf + = reader.readArray(reader1 -> MultiPromQLCriteria.fromJson(reader1)); + deserializedPromQLCriteria.allOf = allOf; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedPromQLCriteria.withAdditionalProperties(additionalProperties); + + return deserializedPromQLCriteria; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrometheusForwarderDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrometheusForwarderDataSource.java new file mode 100644 index 000000000000..e1e32d2e112e --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrometheusForwarderDataSource.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of Prometheus metrics forwarding configuration. + */ +@Fluent +public final class PrometheusForwarderDataSource implements JsonSerializable { + /* + * List of streams that this data source will be sent to. + */ + private List streams; + + /* + * The list of label inclusion filters in the form of label "name-value" pairs. + * Currently only one label is supported: 'microsoft_metrics_include_label'. + * Label values are matched case-insensitively. + */ + private Map labelIncludeFilter; + + /* + * Custom VM Scrape Config that defines scrape jobs + */ + private List customVMScrapeConfig; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of PrometheusForwarderDataSource class. + */ + public PrometheusForwarderDataSource() { + } + + /** + * Get the streams property: List of streams that this data source will be sent to. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams that this data source will be sent to. + * + * @param streams the streams value to set. + * @return the PrometheusForwarderDataSource object itself. + */ + public PrometheusForwarderDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the labelIncludeFilter property: The list of label inclusion filters in the form of label "name-value" pairs. + * Currently only one label is supported: 'microsoft_metrics_include_label'. + * Label values are matched case-insensitively. + * + * @return the labelIncludeFilter value. + */ + public Map labelIncludeFilter() { + return this.labelIncludeFilter; + } + + /** + * Set the labelIncludeFilter property: The list of label inclusion filters in the form of label "name-value" pairs. + * Currently only one label is supported: 'microsoft_metrics_include_label'. + * Label values are matched case-insensitively. + * + * @param labelIncludeFilter the labelIncludeFilter value to set. + * @return the PrometheusForwarderDataSource object itself. + */ + public PrometheusForwarderDataSource withLabelIncludeFilter(Map labelIncludeFilter) { + this.labelIncludeFilter = labelIncludeFilter; + return this; + } + + /** + * Get the customVMScrapeConfig property: Custom VM Scrape Config that defines scrape jobs. + * + * @return the customVMScrapeConfig value. + */ + public List customVMScrapeConfig() { + return this.customVMScrapeConfig; + } + + /** + * Set the customVMScrapeConfig property: Custom VM Scrape Config that defines scrape jobs. + * + * @param customVMScrapeConfig the customVMScrapeConfig value to set. + * @return the PrometheusForwarderDataSource object itself. + */ + public PrometheusForwarderDataSource withCustomVMScrapeConfig(List customVMScrapeConfig) { + this.customVMScrapeConfig = customVMScrapeConfig; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the PrometheusForwarderDataSource object itself. + */ + public PrometheusForwarderDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeMapField("labelIncludeFilter", this.labelIncludeFilter, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("customVMScrapeConfig", this.customVMScrapeConfig, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrometheusForwarderDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrometheusForwarderDataSource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrometheusForwarderDataSource. + */ + public static PrometheusForwarderDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrometheusForwarderDataSource deserializedPrometheusForwarderDataSource + = new PrometheusForwarderDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams = reader.readArray( + reader1 -> KnownPrometheusForwarderDataSourceStreams.fromString(reader1.getString())); + deserializedPrometheusForwarderDataSource.streams = streams; + } else if ("labelIncludeFilter".equals(fieldName)) { + Map labelIncludeFilter = reader.readMap(reader1 -> reader1.getString()); + deserializedPrometheusForwarderDataSource.labelIncludeFilter = labelIncludeFilter; + } else if ("customVMScrapeConfig".equals(fieldName)) { + List customVMScrapeConfig = reader.readArray(reader1 -> reader1.readUntyped()); + deserializedPrometheusForwarderDataSource.customVMScrapeConfig = customVMScrapeConfig; + } else if ("name".equals(fieldName)) { + deserializedPrometheusForwarderDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrometheusForwarderDataSource; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/QueryFailingPeriods.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/QueryFailingPeriods.java new file mode 100644 index 000000000000..f5ecd7c8ad11 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/QueryFailingPeriods.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * Configuration for failing periods in query-based alerts. + */ +@Fluent +public final class QueryFailingPeriods implements JsonSerializable { + /* + * The amount of time (in ISO 8601 duration format) alert must be active before firing. + */ + private Duration forProperty; + + /** + * Creates an instance of QueryFailingPeriods class. + */ + public QueryFailingPeriods() { + } + + /** + * Get the forProperty property: The amount of time (in ISO 8601 duration format) alert must be active before + * firing. + * + * @return the forProperty value. + */ + public Duration forProperty() { + return this.forProperty; + } + + /** + * Set the forProperty property: The amount of time (in ISO 8601 duration format) alert must be active before + * firing. + * + * @param forProperty the forProperty value to set. + * @return the QueryFailingPeriods object itself. + */ + public QueryFailingPeriods withForProperty(Duration forProperty) { + this.forProperty = forProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (forProperty() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property forProperty in model QueryFailingPeriods")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(QueryFailingPeriods.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("for", CoreUtils.durationToStringWithDays(this.forProperty)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryFailingPeriods from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryFailingPeriods if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the QueryFailingPeriods. + */ + public static QueryFailingPeriods fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryFailingPeriods deserializedQueryFailingPeriods = new QueryFailingPeriods(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("for".equals(fieldName)) { + deserializedQueryFailingPeriods.forProperty + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedQueryFailingPeriods; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ReferencesSpec.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ReferencesSpec.java new file mode 100644 index 000000000000..ed77092656ab --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ReferencesSpec.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * This section defines all the references that may be used in other sections of the DCR. + */ +@Fluent +public class ReferencesSpec implements JsonSerializable { + /* + * All the enrichment data sources referenced in data flows + */ + private ReferencesSpecEnrichmentData enrichmentData; + + /* + * Application Insights references to be used on OTel metrics/logs enrichment + */ + private List applicationInsights; + + /** + * Creates an instance of ReferencesSpec class. + */ + public ReferencesSpec() { + } + + /** + * Get the enrichmentData property: All the enrichment data sources referenced in data flows. + * + * @return the enrichmentData value. + */ + public ReferencesSpecEnrichmentData enrichmentData() { + return this.enrichmentData; + } + + /** + * Set the enrichmentData property: All the enrichment data sources referenced in data flows. + * + * @param enrichmentData the enrichmentData value to set. + * @return the ReferencesSpec object itself. + */ + public ReferencesSpec withEnrichmentData(ReferencesSpecEnrichmentData enrichmentData) { + this.enrichmentData = enrichmentData; + return this; + } + + /** + * Get the applicationInsights property: Application Insights references to be used on OTel metrics/logs enrichment. + * + * @return the applicationInsights value. + */ + public List applicationInsights() { + return this.applicationInsights; + } + + /** + * Set the applicationInsights property: Application Insights references to be used on OTel metrics/logs enrichment. + * + * @param applicationInsights the applicationInsights value to set. + * @return the ReferencesSpec object itself. + */ + public ReferencesSpec withApplicationInsights(List applicationInsights) { + this.applicationInsights = applicationInsights; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (enrichmentData() != null) { + enrichmentData().validate(); + } + if (applicationInsights() != null) { + applicationInsights().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("enrichmentData", this.enrichmentData); + jsonWriter.writeArrayField("applicationInsights", this.applicationInsights, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReferencesSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReferencesSpec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReferencesSpec. + */ + public static ReferencesSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReferencesSpec deserializedReferencesSpec = new ReferencesSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enrichmentData".equals(fieldName)) { + deserializedReferencesSpec.enrichmentData = ReferencesSpecEnrichmentData.fromJson(reader); + } else if ("applicationInsights".equals(fieldName)) { + List applicationInsights + = reader.readArray(reader1 -> ApplicationInsights.fromJson(reader1)); + deserializedReferencesSpec.applicationInsights = applicationInsights; + } else { + reader.skipChildren(); + } + } + + return deserializedReferencesSpec; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ReferencesSpecEnrichmentData.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ReferencesSpecEnrichmentData.java new file mode 100644 index 000000000000..6fa824ccf77f --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ReferencesSpecEnrichmentData.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * All the enrichment data sources referenced in data flows. + */ +@Fluent +public final class ReferencesSpecEnrichmentData extends EnrichmentData { + /** + * Creates an instance of ReferencesSpecEnrichmentData class. + */ + public ReferencesSpecEnrichmentData() { + } + + /** + * {@inheritDoc} + */ + @Override + public ReferencesSpecEnrichmentData withStorageBlobs(List storageBlobs) { + super.withStorageBlobs(storageBlobs); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (storageBlobs() != null) { + storageBlobs().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("storageBlobs", storageBlobs(), (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReferencesSpecEnrichmentData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReferencesSpecEnrichmentData if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReferencesSpecEnrichmentData. + */ + public static ReferencesSpecEnrichmentData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReferencesSpecEnrichmentData deserializedReferencesSpecEnrichmentData = new ReferencesSpecEnrichmentData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageBlobs".equals(fieldName)) { + List storageBlobs = reader.readArray(reader1 -> StorageBlob.fromJson(reader1)); + deserializedReferencesSpecEnrichmentData.withStorageBlobs(storageBlobs); + } else { + reader.skipChildren(); + } + } + + return deserializedReferencesSpecEnrichmentData; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResolveConfiguration.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResolveConfiguration.java new file mode 100644 index 000000000000..4cb237a55a5e --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResolveConfiguration.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * The ResolveConfiguration model. + */ +@Fluent +public final class ResolveConfiguration implements JsonSerializable { + /* + * Indicates whether the alert should be auto resolved + */ + private boolean autoResolved; + + /* + * The time (in ISO 8601 duration format) after which the alert should be auto resolved + */ + private Duration timeToResolve; + + /** + * Creates an instance of ResolveConfiguration class. + */ + public ResolveConfiguration() { + } + + /** + * Get the autoResolved property: Indicates whether the alert should be auto resolved. + * + * @return the autoResolved value. + */ + public boolean autoResolved() { + return this.autoResolved; + } + + /** + * Set the autoResolved property: Indicates whether the alert should be auto resolved. + * + * @param autoResolved the autoResolved value to set. + * @return the ResolveConfiguration object itself. + */ + public ResolveConfiguration withAutoResolved(boolean autoResolved) { + this.autoResolved = autoResolved; + return this; + } + + /** + * Get the timeToResolve property: The time (in ISO 8601 duration format) after which the alert should be auto + * resolved. + * + * @return the timeToResolve value. + */ + public Duration timeToResolve() { + return this.timeToResolve; + } + + /** + * Set the timeToResolve property: The time (in ISO 8601 duration format) after which the alert should be auto + * resolved. + * + * @param timeToResolve the timeToResolve value to set. + * @return the ResolveConfiguration object itself. + */ + public ResolveConfiguration withTimeToResolve(Duration timeToResolve) { + this.timeToResolve = timeToResolve; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("autoResolved", this.autoResolved); + jsonWriter.writeStringField("timeToResolve", CoreUtils.durationToStringWithDays(this.timeToResolve)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResolveConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResolveConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResolveConfiguration. + */ + public static ResolveConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResolveConfiguration deserializedResolveConfiguration = new ResolveConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoResolved".equals(fieldName)) { + deserializedResolveConfiguration.autoResolved = reader.getBoolean(); + } else if ("timeToResolve".equals(fieldName)) { + deserializedResolveConfiguration.timeToResolve + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedResolveConfiguration; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.java index 09a8dcad7445..06b0f9052120 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.java @@ -22,6 +22,11 @@ public final class ResourceForUpdate implements JsonSerializable tags; + /* + * Managed Service Identity. + */ + private ResourceForUpdateIdentity identity; + /** * Creates an instance of ResourceForUpdate class. */ @@ -48,12 +53,35 @@ public ResourceForUpdate withTags(Map tags) { return this; } + /** + * Get the identity property: Managed Service Identity. + * + * @return the identity value. + */ + public ResourceForUpdateIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed Service Identity. + * + * @param identity the identity value to set. + * @return the ResourceForUpdate object itself. + */ + public ResourceForUpdate withIdentity(ResourceForUpdateIdentity identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } } /** @@ -63,6 +91,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -84,6 +113,8 @@ public static ResourceForUpdate fromJson(JsonReader jsonReader) throws IOExcepti if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedResourceForUpdate.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedResourceForUpdate.identity = ResourceForUpdateIdentity.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdateIdentity.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdateIdentity.java new file mode 100644 index 000000000000..4fca97c7bae6 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdateIdentity.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed Service Identity. + */ +@Fluent +public final class ResourceForUpdateIdentity extends ManagedServiceIdentity { + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /** + * Creates an instance of ResourceForUpdateIdentity class. + */ + public ResourceForUpdateIdentity() { + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + @Override + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + @Override + public UUID principalId() { + return this.principalId; + } + + /** + * {@inheritDoc} + */ + @Override + public ResourceForUpdateIdentity withType(ManagedServiceIdentityType type) { + super.withType(type); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ResourceForUpdateIdentity + withUserAssignedIdentities(Map userAssignedIdentities) { + super.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ResourceForUpdateIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceForUpdateIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + jsonWriter.writeMapField("userAssignedIdentities", userAssignedIdentities(), + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceForUpdateIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceForUpdateIdentity if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceForUpdateIdentity. + */ + public static ResourceForUpdateIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceForUpdateIdentity deserializedResourceForUpdateIdentity = new ResourceForUpdateIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedResourceForUpdateIdentity + .withType(ManagedServiceIdentityType.fromString(reader.getString())); + } else if ("principalId".equals(fieldName)) { + deserializedResourceForUpdateIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedResourceForUpdateIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedResourceForUpdateIdentity.withUserAssignedIdentities(userAssignedIdentities); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceForUpdateIdentity; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleEmailAction.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleEmailAction.java index 2ce91a46a1e5..5fb0775bdd52 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleEmailAction.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleEmailAction.java @@ -101,7 +101,6 @@ public RuleEmailAction withCustomEmails(List customEmails) { */ @Override public void validate() { - super.validate(); } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java index 5e403d04bf9f..ed62ac87f849 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java @@ -310,7 +310,6 @@ public RuleManagementEventDataSource withMetricNamespace(String metricNamespace) */ @Override public void validate() { - super.validate(); if (claims() != null) { claims().validate(); } diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java index fce7c3a28ab8..371581b103dc 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java @@ -106,7 +106,6 @@ public RuleMetricDataSource withMetricNamespace(String metricNamespace) { */ @Override public void validate() { - super.validate(); } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleResolveConfiguration.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleResolveConfiguration.java new file mode 100644 index 000000000000..6c988221363a --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleResolveConfiguration.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * TBD. Relevant only for rules of the kind LogAlert. + */ +@Fluent +public final class RuleResolveConfiguration implements JsonSerializable { + /* + * The flag that indicates whether or not to auto resolve a fired alert. + */ + private Boolean autoResolved; + + /* + * The duration a rule must evaluate as healthy before the fired alert is automatically resolved represented in ISO + * 8601 duration format. + */ + private Duration timeToResolve; + + /** + * Creates an instance of RuleResolveConfiguration class. + */ + public RuleResolveConfiguration() { + } + + /** + * Get the autoResolved property: The flag that indicates whether or not to auto resolve a fired alert. + * + * @return the autoResolved value. + */ + public Boolean autoResolved() { + return this.autoResolved; + } + + /** + * Set the autoResolved property: The flag that indicates whether or not to auto resolve a fired alert. + * + * @param autoResolved the autoResolved value to set. + * @return the RuleResolveConfiguration object itself. + */ + public RuleResolveConfiguration withAutoResolved(Boolean autoResolved) { + this.autoResolved = autoResolved; + return this; + } + + /** + * Get the timeToResolve property: The duration a rule must evaluate as healthy before the fired alert is + * automatically resolved represented in ISO 8601 duration format. + * + * @return the timeToResolve value. + */ + public Duration timeToResolve() { + return this.timeToResolve; + } + + /** + * Set the timeToResolve property: The duration a rule must evaluate as healthy before the fired alert is + * automatically resolved represented in ISO 8601 duration format. + * + * @param timeToResolve the timeToResolve value to set. + * @return the RuleResolveConfiguration object itself. + */ + public RuleResolveConfiguration withTimeToResolve(Duration timeToResolve) { + this.timeToResolve = timeToResolve; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("autoResolved", this.autoResolved); + jsonWriter.writeStringField("timeToResolve", CoreUtils.durationToStringWithDays(this.timeToResolve)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleResolveConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleResolveConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleResolveConfiguration. + */ + public static RuleResolveConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleResolveConfiguration deserializedRuleResolveConfiguration = new RuleResolveConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoResolved".equals(fieldName)) { + deserializedRuleResolveConfiguration.autoResolved = reader.getNullable(JsonReader::getBoolean); + } else if ("timeToResolve".equals(fieldName)) { + deserializedRuleResolveConfiguration.timeToResolve + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleResolveConfiguration; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleWebhookAction.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleWebhookAction.java index 8af209c5141a..b89242105bc6 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleWebhookAction.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleWebhookAction.java @@ -99,7 +99,6 @@ public RuleWebhookAction withProperties(Map properties) { */ @Override public void validate() { - super.validate(); } /** diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScheduledQueryRuleResourcePatch.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScheduledQueryRuleResourcePatch.java index 0ce334828901..ef0794222de5 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScheduledQueryRuleResourcePatch.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScheduledQueryRuleResourcePatch.java @@ -20,6 +20,11 @@ */ @Fluent public final class ScheduledQueryRuleResourcePatch implements JsonSerializable { + /* + * The identity of the resource. + */ + private Identity identity; + /* * Resource tags */ @@ -36,6 +41,26 @@ public final class ScheduledQueryRuleResourcePatch implements JsonSerializable writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); @@ -503,7 +557,9 @@ public static ScheduledQueryRuleResourcePatch fromJson(JsonReader jsonReader) th String fieldName = reader.getFieldName(); reader.nextToken(); - if ("tags".equals(fieldName)) { + if ("identity".equals(fieldName)) { + deserializedScheduledQueryRuleResourcePatch.identity = Identity.fromJson(reader); + } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedScheduledQueryRuleResourcePatch.tags = tags; } else if ("properties".equals(fieldName)) { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Sku.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Sku.java new file mode 100644 index 000000000000..cc8fcd1fe328 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Sku.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource model definition representing SKU. + */ +@Fluent +public class Sku implements JsonSerializable { + /* + * The name of the SKU. E.g. P3. It is typically a letter+number code + */ + private String name; + + /* + * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is + * not required on a PUT. + */ + private SkuTier tier; + + /* + * The SKU size. When the name field is the combination of tier and some other value, this would be the standalone + * code. + */ + private String size; + + /* + * If the service has different generations of hardware, for the same SKU, then that can be captured here. + */ + private String family; + + /* + * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible + * for the resource this may be omitted. + */ + private Integer capacity; + + /** + * Creates an instance of Sku class. + */ + public Sku() { + } + + /** + * Get the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @param size the size value to set. + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @param family the family value to set. + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeStringField("family", this.family); + jsonWriter.writeNumberField("capacity", this.capacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedSku.tier = SkuTier.fromString(reader.getString()); + } else if ("size".equals(fieldName)) { + deserializedSku.size = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedSku.family = reader.getString(); + } else if ("capacity".equals(fieldName)) { + deserializedSku.capacity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SkuTier.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SkuTier.java new file mode 100644 index 000000000000..57ba077491a9 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SkuTier.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +/** + * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not + * required on a PUT. + */ +public enum SkuTier { + /** + * Enum value Free. + */ + FREE("Free"), + + /** + * Enum value Basic. + */ + BASIC("Basic"), + + /** + * Enum value Standard. + */ + STANDARD("Standard"), + + /** + * Enum value Premium. + */ + PREMIUM("Premium"); + + /** + * The actual serialized value for a SkuTier instance. + */ + private final String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + public static SkuTier fromString(String value) { + if (value == null) { + return null; + } + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StaticPromQLCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StaticPromQLCriteria.java new file mode 100644 index 000000000000..d088c68487ee --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StaticPromQLCriteria.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The criterion for static prom query. + */ +@Fluent +public final class StaticPromQLCriteria extends MultiPromQLCriteria { + /* + * Specifies the type of threshold criteria. Previously undocumented values might be returned + */ + private CriterionType criterionType = CriterionType.STATIC_THRESHOLD_CRITERION; + + /** + * Creates an instance of StaticPromQLCriteria class. + */ + public StaticPromQLCriteria() { + } + + /** + * Get the criterionType property: Specifies the type of threshold criteria. Previously undocumented values might be + * returned. + * + * @return the criterionType value. + */ + @Override + public CriterionType criterionType() { + return this.criterionType; + } + + /** + * {@inheritDoc} + */ + @Override + public StaticPromQLCriteria withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public StaticPromQLCriteria withQuery(String query) { + super.withQuery(query); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model StaticPromQLCriteria")); + } + if (query() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property query in model StaticPromQLCriteria")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StaticPromQLCriteria.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("query", query()); + jsonWriter.writeStringField("criterionType", this.criterionType == null ? null : this.criterionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StaticPromQLCriteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StaticPromQLCriteria if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StaticPromQLCriteria. + */ + public static StaticPromQLCriteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StaticPromQLCriteria deserializedStaticPromQLCriteria = new StaticPromQLCriteria(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedStaticPromQLCriteria.withName(reader.getString()); + } else if ("query".equals(fieldName)) { + deserializedStaticPromQLCriteria.withQuery(reader.getString()); + } else if ("criterionType".equals(fieldName)) { + deserializedStaticPromQLCriteria.criterionType = CriterionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStaticPromQLCriteria; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StorageBlob.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StorageBlob.java new file mode 100644 index 000000000000..b0e019398f44 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StorageBlob.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The StorageBlob model. + */ +@Fluent +public final class StorageBlob implements JsonSerializable { + /* + * Resource Id of the storage account that hosts the blob + */ + private String resourceId; + + /* + * Url of the storage blob + */ + private String blobUrl; + + /* + * The type of lookup to perform on the blob + */ + private KnownStorageBlobLookupType lookupType; + + /* + * The name of the enrichment data source used as an alias when referencing this data source in data flows + */ + private String name; + + /** + * Creates an instance of StorageBlob class. + */ + public StorageBlob() { + } + + /** + * Get the resourceId property: Resource Id of the storage account that hosts the blob. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id of the storage account that hosts the blob. + * + * @param resourceId the resourceId value to set. + * @return the StorageBlob object itself. + */ + public StorageBlob withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the blobUrl property: Url of the storage blob. + * + * @return the blobUrl value. + */ + public String blobUrl() { + return this.blobUrl; + } + + /** + * Set the blobUrl property: Url of the storage blob. + * + * @param blobUrl the blobUrl value to set. + * @return the StorageBlob object itself. + */ + public StorageBlob withBlobUrl(String blobUrl) { + this.blobUrl = blobUrl; + return this; + } + + /** + * Get the lookupType property: The type of lookup to perform on the blob. + * + * @return the lookupType value. + */ + public KnownStorageBlobLookupType lookupType() { + return this.lookupType; + } + + /** + * Set the lookupType property: The type of lookup to perform on the blob. + * + * @param lookupType the lookupType value to set. + * @return the StorageBlob object itself. + */ + public StorageBlob withLookupType(KnownStorageBlobLookupType lookupType) { + this.lookupType = lookupType; + return this; + } + + /** + * Get the name property: The name of the enrichment data source used as an alias when referencing this data source + * in data flows. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the enrichment data source used as an alias when referencing this data source + * in data flows. + * + * @param name the name value to set. + * @return the StorageBlob object itself. + */ + public StorageBlob withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("blobUrl", this.blobUrl); + jsonWriter.writeStringField("lookupType", this.lookupType == null ? null : this.lookupType.toString()); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageBlob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageBlob if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageBlob. + */ + public static StorageBlob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageBlob deserializedStorageBlob = new StorageBlob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedStorageBlob.resourceId = reader.getString(); + } else if ("blobUrl".equals(fieldName)) { + deserializedStorageBlob.blobUrl = reader.getString(); + } else if ("lookupType".equals(fieldName)) { + deserializedStorageBlob.lookupType = KnownStorageBlobLookupType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedStorageBlob.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageBlob; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StorageBlobDestination.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StorageBlobDestination.java new file mode 100644 index 000000000000..9a9387eeeb1c --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StorageBlobDestination.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The StorageBlobDestination model. + */ +@Fluent +public final class StorageBlobDestination implements JsonSerializable { + /* + * The container name of the Storage Blob. + */ + private String containerName; + + /* + * The resource ID of the storage account. + */ + private String storageAccountResourceId; + + /* + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of StorageBlobDestination class. + */ + public StorageBlobDestination() { + } + + /** + * Get the containerName property: The container name of the Storage Blob. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The container name of the Storage Blob. + * + * @param containerName the containerName value to set. + * @return the StorageBlobDestination object itself. + */ + public StorageBlobDestination withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the storageAccountResourceId property: The resource ID of the storage account. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: The resource ID of the storage account. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the StorageBlobDestination object itself. + */ + public StorageBlobDestination withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the StorageBlobDestination object itself. + */ + public StorageBlobDestination withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("storageAccountResourceId", this.storageAccountResourceId); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageBlobDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageBlobDestination if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageBlobDestination. + */ + public static StorageBlobDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageBlobDestination deserializedStorageBlobDestination = new StorageBlobDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerName".equals(fieldName)) { + deserializedStorageBlobDestination.containerName = reader.getString(); + } else if ("storageAccountResourceId".equals(fieldName)) { + deserializedStorageBlobDestination.storageAccountResourceId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageBlobDestination.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageBlobDestination; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StorageTableDestination.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StorageTableDestination.java new file mode 100644 index 000000000000..f9818807c344 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/StorageTableDestination.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The StorageTableDestination model. + */ +@Fluent +public final class StorageTableDestination implements JsonSerializable { + /* + * The name of the Storage Table. + */ + private String tableName; + + /* + * The resource ID of the storage account. + */ + private String storageAccountResourceId; + + /* + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of StorageTableDestination class. + */ + public StorageTableDestination() { + } + + /** + * Get the tableName property: The name of the Storage Table. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: The name of the Storage Table. + * + * @param tableName the tableName value to set. + * @return the StorageTableDestination object itself. + */ + public StorageTableDestination withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the storageAccountResourceId property: The resource ID of the storage account. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: The resource ID of the storage account. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the StorageTableDestination object itself. + */ + public StorageTableDestination withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the StorageTableDestination object itself. + */ + public StorageTableDestination withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tableName", this.tableName); + jsonWriter.writeStringField("storageAccountResourceId", this.storageAccountResourceId); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTableDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTableDestination if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageTableDestination. + */ + public static StorageTableDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTableDestination deserializedStorageTableDestination = new StorageTableDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tableName".equals(fieldName)) { + deserializedStorageTableDestination.tableName = reader.getString(); + } else if ("storageAccountResourceId".equals(fieldName)) { + deserializedStorageTableDestination.storageAccountResourceId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageTableDestination.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTableDestination; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SubscriptionScopeMetricDefinitionCollection.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SubscriptionScopeMetricDefinitionCollection.java new file mode 100644 index 000000000000..93d4dec2e1de --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SubscriptionScopeMetricDefinitionCollection.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.monitor.fluent.models.SubscriptionScopeMetricDefinitionInner; +import java.io.IOException; +import java.util.List; + +/** + * Represents collection of metric definitions. + */ +@Fluent +public final class SubscriptionScopeMetricDefinitionCollection + implements JsonSerializable { + /* + * The values for the metric definitions. + */ + private List value; + + /** + * Creates an instance of SubscriptionScopeMetricDefinitionCollection class. + */ + public SubscriptionScopeMetricDefinitionCollection() { + } + + /** + * Get the value property: The values for the metric definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The values for the metric definitions. + * + * @param value the value value to set. + * @return the SubscriptionScopeMetricDefinitionCollection object itself. + */ + public SubscriptionScopeMetricDefinitionCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SubscriptionScopeMetricDefinitionCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionScopeMetricDefinitionCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionScopeMetricDefinitionCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionScopeMetricDefinitionCollection if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SubscriptionScopeMetricDefinitionCollection. + */ + public static SubscriptionScopeMetricDefinitionCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionScopeMetricDefinitionCollection deserializedSubscriptionScopeMetricDefinitionCollection + = new SubscriptionScopeMetricDefinitionCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SubscriptionScopeMetricDefinitionInner.fromJson(reader1)); + deserializedSubscriptionScopeMetricDefinitionCollection.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionScopeMetricDefinitionCollection; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SubscriptionScopeMetricsRequestBodyParameters.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SubscriptionScopeMetricsRequestBodyParameters.java new file mode 100644 index 000000000000..77d7b39a7136 --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SubscriptionScopeMetricsRequestBodyParameters.java @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * Query parameters can also be specified in the body, specifying the same parameter in both the body and query + * parameters will result in an error. + */ +@Fluent +public final class SubscriptionScopeMetricsRequestBodyParameters + implements JsonSerializable { + /* + * The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. + */ + private String timespan; + + /* + * The interval (i.e. timegrain) of the query. + */ + private Duration interval; + + /* + * The names of the metrics (comma separated) to retrieve. + */ + private String metricNames; + + /* + * The list of aggregation types (comma separated) to retrieve. + */ + private String aggregation; + + /* + * The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B + * and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B + * eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = + * ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- + * Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- + * Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + */ + private String filter; + + /* + * The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + */ + private Integer top; + + /* + * The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + */ + private String orderBy; + + /* + * Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like + * 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify + * 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + */ + private String rollUpBy; + + /* + * Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description + * for details. + */ + private MetricResultType resultType; + + /* + * Metric namespace where the metrics you want reside. + */ + private String metricNamespace; + + /* + * When set to true, if the timespan passed in is not supported by this metric, the API will return the result using + * the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults + * to false. + */ + private Boolean autoAdjustTimegrain; + + /* + * When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for + * invalid filter parameters. Defaults to true. + */ + private Boolean validateDimensions; + + /** + * Creates an instance of SubscriptionScopeMetricsRequestBodyParameters class. + */ + public SubscriptionScopeMetricsRequestBodyParameters() { + } + + /** + * Get the timespan property: The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * + * @return the timespan value. + */ + public String timespan() { + return this.timespan; + } + + /** + * Set the timespan property: The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * + * @param timespan the timespan value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withTimespan(String timespan) { + this.timespan = timespan; + return this; + } + + /** + * Get the interval property: The interval (i.e. timegrain) of the query. + * + * @return the interval value. + */ + public Duration interval() { + return this.interval; + } + + /** + * Set the interval property: The interval (i.e. timegrain) of the query. + * + * @param interval the interval value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withInterval(Duration interval) { + this.interval = interval; + return this; + } + + /** + * Get the metricNames property: The names of the metrics (comma separated) to retrieve. + * + * @return the metricNames value. + */ + public String metricNames() { + return this.metricNames; + } + + /** + * Set the metricNames property: The names of the metrics (comma separated) to retrieve. + * + * @param metricNames the metricNames value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withMetricNames(String metricNames) { + this.metricNames = metricNames; + return this; + } + + /** + * Get the aggregation property: The list of aggregation types (comma separated) to retrieve. + * + * @return the aggregation value. + */ + public String aggregation() { + return this.aggregation; + } + + /** + * Set the aggregation property: The list of aggregation types (comma separated) to retrieve. + * + * @param aggregation the aggregation value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withAggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * Get the filter property: The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * + * @return the filter value. + */ + public String filter() { + return this.filter; + } + + /** + * Set the filter property: The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * + * @param filter the filter value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the top property: The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * + * @return the top value. + */ + public Integer top() { + return this.top; + } + + /** + * Set the top property: The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * + * @param top the top value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withTop(Integer top) { + this.top = top; + return this; + } + + /** + * Get the orderBy property: The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * + * @return the orderBy value. + */ + public String orderBy() { + return this.orderBy; + } + + /** + * Set the orderBy property: The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * + * @param orderBy the orderBy value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + /** + * Get the rollUpBy property: Dimension name(s) to rollup results by. For example if you only want to see metric + * values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each + * city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * + * @return the rollUpBy value. + */ + public String rollUpBy() { + return this.rollUpBy; + } + + /** + * Set the rollUpBy property: Dimension name(s) to rollup results by. For example if you only want to see metric + * values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each + * city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * + * @param rollUpBy the rollUpBy value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withRollUpBy(String rollUpBy) { + this.rollUpBy = rollUpBy; + return this; + } + + /** + * Get the resultType property: Reduces the set of data collected. The syntax allowed depends on the operation. See + * the operation's description for details. + * + * @return the resultType value. + */ + public MetricResultType resultType() { + return this.resultType; + } + + /** + * Set the resultType property: Reduces the set of data collected. The syntax allowed depends on the operation. See + * the operation's description for details. + * + * @param resultType the resultType value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withResultType(MetricResultType resultType) { + this.resultType = resultType; + return this; + } + + /** + * Get the metricNamespace property: Metric namespace where the metrics you want reside. + * + * @return the metricNamespace value. + */ + public String metricNamespace() { + return this.metricNamespace; + } + + /** + * Set the metricNamespace property: Metric namespace where the metrics you want reside. + * + * @param metricNamespace the metricNamespace value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withMetricNamespace(String metricNamespace) { + this.metricNamespace = metricNamespace; + return this; + } + + /** + * Get the autoAdjustTimegrain property: When set to true, if the timespan passed in is not supported by this + * metric, the API will return the result using the closest supported timespan. When set to false, an error is + * returned for invalid timespan parameters. Defaults to false. + * + * @return the autoAdjustTimegrain value. + */ + public Boolean autoAdjustTimegrain() { + return this.autoAdjustTimegrain; + } + + /** + * Set the autoAdjustTimegrain property: When set to true, if the timespan passed in is not supported by this + * metric, the API will return the result using the closest supported timespan. When set to false, an error is + * returned for invalid timespan parameters. Defaults to false. + * + * @param autoAdjustTimegrain the autoAdjustTimegrain value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withAutoAdjustTimegrain(Boolean autoAdjustTimegrain) { + this.autoAdjustTimegrain = autoAdjustTimegrain; + return this; + } + + /** + * Get the validateDimensions property: When set to false, invalid filter parameter values will be ignored. When set + * to true, an error is returned for invalid filter parameters. Defaults to true. + * + * @return the validateDimensions value. + */ + public Boolean validateDimensions() { + return this.validateDimensions; + } + + /** + * Set the validateDimensions property: When set to false, invalid filter parameter values will be ignored. When set + * to true, an error is returned for invalid filter parameters. Defaults to true. + * + * @param validateDimensions the validateDimensions value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters withValidateDimensions(Boolean validateDimensions) { + this.validateDimensions = validateDimensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timespan", this.timespan); + jsonWriter.writeStringField("interval", CoreUtils.durationToStringWithDays(this.interval)); + jsonWriter.writeStringField("metricNames", this.metricNames); + jsonWriter.writeStringField("aggregation", this.aggregation); + jsonWriter.writeStringField("filter", this.filter); + jsonWriter.writeNumberField("top", this.top); + jsonWriter.writeStringField("orderBy", this.orderBy); + jsonWriter.writeStringField("rollUpBy", this.rollUpBy); + jsonWriter.writeStringField("resultType", this.resultType == null ? null : this.resultType.toString()); + jsonWriter.writeStringField("metricNamespace", this.metricNamespace); + jsonWriter.writeBooleanField("autoAdjustTimegrain", this.autoAdjustTimegrain); + jsonWriter.writeBooleanField("validateDimensions", this.validateDimensions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionScopeMetricsRequestBodyParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionScopeMetricsRequestBodyParameters if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubscriptionScopeMetricsRequestBodyParameters. + */ + public static SubscriptionScopeMetricsRequestBodyParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionScopeMetricsRequestBodyParameters deserializedSubscriptionScopeMetricsRequestBodyParameters + = new SubscriptionScopeMetricsRequestBodyParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timespan".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.timespan = reader.getString(); + } else if ("interval".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.interval + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("metricNames".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.metricNames = reader.getString(); + } else if ("aggregation".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.aggregation = reader.getString(); + } else if ("filter".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.filter = reader.getString(); + } else if ("top".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.top + = reader.getNullable(JsonReader::getInt); + } else if ("orderBy".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.orderBy = reader.getString(); + } else if ("rollUpBy".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.rollUpBy = reader.getString(); + } else if ("resultType".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.resultType + = MetricResultType.fromString(reader.getString()); + } else if ("metricNamespace".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.metricNamespace = reader.getString(); + } else if ("autoAdjustTimegrain".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.autoAdjustTimegrain + = reader.getNullable(JsonReader::getBoolean); + } else if ("validateDimensions".equals(fieldName)) { + deserializedSubscriptionScopeMetricsRequestBodyParameters.validateDimensions + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionScopeMetricsRequestBodyParameters; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java index 00b632d80331..76d0b3cc0ca9 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java @@ -35,6 +35,11 @@ public final class SyslogDataSource implements JsonSerializable logLevels; + /* + * The KQL query to transform the data source. This is a deprecated property and will be removed in future versions. + */ + private String transformKql; + /* * A friendly name for the data source. * This name should be unique across all data sources (regardless of type) within the data collection rule. @@ -111,6 +116,28 @@ public SyslogDataSource withLogLevels(List logLe return this; } + /** + * Get the transformKql property: The KQL query to transform the data source. This is a deprecated property and will + * be removed in future versions. + * + * @return the transformKql value. + */ + public String transformKql() { + return this.transformKql; + } + + /** + * Set the transformKql property: The KQL query to transform the data source. This is a deprecated property and will + * be removed in future versions. + * + * @param transformKql the transformKql value to set. + * @return the SyslogDataSource object itself. + */ + public SyslogDataSource withTransformKql(String transformKql) { + this.transformKql = transformKql; + return this; + } + /** * Get the name property: A friendly name for the data source. * This name should be unique across all data sources (regardless of type) within the data collection rule. @@ -153,6 +180,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { (writer, element) -> writer.writeString(element == null ? null : element.toString())); jsonWriter.writeArrayField("logLevels", this.logLevels, (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("transformKql", this.transformKql); jsonWriter.writeStringField("name", this.name); return jsonWriter.writeEndObject(); } @@ -184,6 +212,8 @@ public static SyslogDataSource fromJson(JsonReader jsonReader) throws IOExceptio List logLevels = reader.readArray(reader1 -> KnownSyslogDataSourceLogLevels.fromString(reader1.getString())); deserializedSyslogDataSource.logLevels = logLevels; + } else if ("transformKql".equals(fieldName)) { + deserializedSyslogDataSource.transformKql = reader.getString(); } else if ("name".equals(fieldName)) { deserializedSyslogDataSource.name = reader.getString(); } else { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java index 86f68da5be67..9a1f258bbe5a 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java @@ -165,12 +165,14 @@ public ThresholdRuleCondition withDataSource(RuleDataSource dataSource) { */ @Override public void validate() { - super.validate(); if (operator() == null) { throw LOGGER.atError() .log( new IllegalArgumentException("Missing required property operator in model ThresholdRuleCondition")); } + if (dataSource() != null) { + dataSource().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(ThresholdRuleCondition.class); diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/UserAssignedIdentity.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..fe8708a371dc --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/UserAssignedIdentity.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/UserIdentityProperties.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/UserIdentityProperties.java new file mode 100644 index 000000000000..9fc6dd0a7fda --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/UserIdentityProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the user assigned identity. + */ +@Immutable +public final class UserIdentityProperties implements JsonSerializable { + /* + * The principal ID of resource identity. + */ + private String principalId; + + /* + * The client ID of resource identity. + */ + private String clientId; + + /** + * Creates an instance of UserIdentityProperties class. + */ + public UserIdentityProperties() { + } + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of resource identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserIdentityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserIdentityProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserIdentityProperties. + */ + public static UserIdentityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserIdentityProperties deserializedUserIdentityProperties = new UserIdentityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserIdentityProperties.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserIdentityProperties.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserIdentityProperties; + }); + } +} diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebtestLocationAvailabilityCriteria.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebtestLocationAvailabilityCriteria.java index 19cbe0077615..048a580dd54d 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebtestLocationAvailabilityCriteria.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebtestLocationAvailabilityCriteria.java @@ -19,7 +19,7 @@ @Fluent public final class WebtestLocationAvailabilityCriteria extends MetricAlertCriteria { /* - * specifies the type of the alert criteria. + * Specifies the type of the alert criteria. Previously undocumented values might be returned */ private Odatatype odataType = Odatatype.MICROSOFT_AZURE_MONITOR_WEBTEST_LOCATION_AVAILABILITY_CRITERIA; @@ -45,7 +45,8 @@ public WebtestLocationAvailabilityCriteria() { } /** - * Get the odataType property: specifies the type of the alert criteria. + * Get the odataType property: Specifies the type of the alert criteria. Previously undocumented values might be + * returned. * * @return the odataType value. */ @@ -121,7 +122,6 @@ public WebtestLocationAvailabilityCriteria withFailedLocationCount(float failedL */ @Override public void validate() { - super.validate(); if (webTestId() == null) { throw LOGGER.atError() .log(new IllegalArgumentException( diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java index 17a3d450b5bc..9477b05cf67d 100644 --- a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java @@ -30,6 +30,11 @@ public final class WindowsEventLogDataSource implements JsonSerializable xPathQueries; + /* + * The KQL query to transform the data source. This is a deprecated property and will be removed in future versions. + */ + private String transformKql; + /* * A friendly name for the data source. * This name should be unique across all data sources (regardless of type) within the data collection rule. @@ -86,6 +91,28 @@ public WindowsEventLogDataSource withXPathQueries(List xPathQueries) { return this; } + /** + * Get the transformKql property: The KQL query to transform the data source. This is a deprecated property and will + * be removed in future versions. + * + * @return the transformKql value. + */ + public String transformKql() { + return this.transformKql; + } + + /** + * Set the transformKql property: The KQL query to transform the data source. This is a deprecated property and will + * be removed in future versions. + * + * @param transformKql the transformKql value to set. + * @return the WindowsEventLogDataSource object itself. + */ + public WindowsEventLogDataSource withTransformKql(String transformKql) { + this.transformKql = transformKql; + return this; + } + /** * Get the name property: A friendly name for the data source. * This name should be unique across all data sources (regardless of type) within the data collection rule. @@ -125,6 +152,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("streams", this.streams, (writer, element) -> writer.writeString(element == null ? null : element.toString())); jsonWriter.writeArrayField("xPathQueries", this.xPathQueries, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("transformKql", this.transformKql); jsonWriter.writeStringField("name", this.name); return jsonWriter.writeEndObject(); } @@ -151,6 +179,8 @@ public static WindowsEventLogDataSource fromJson(JsonReader jsonReader) throws I } else if ("xPathQueries".equals(fieldName)) { List xPathQueries = reader.readArray(reader1 -> reader1.getString()); deserializedWindowsEventLogDataSource.xPathQueries = xPathQueries; + } else if ("transformKql".equals(fieldName)) { + deserializedWindowsEventLogDataSource.transformKql = reader.getString(); } else if ("name".equals(fieldName)) { deserializedWindowsEventLogDataSource.name = reader.getString(); } else { diff --git a/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsFirewallLogsDataSource.java b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsFirewallLogsDataSource.java new file mode 100644 index 000000000000..54ef7e88bd8b --- /dev/null +++ b/sdk/monitor/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsFirewallLogsDataSource.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Enables Firewall logs to be collected by this data collection rule. + */ +@Fluent +public final class WindowsFirewallLogsDataSource implements JsonSerializable { + /* + * Firewall logs streams + */ + private List streams; + + /* + * Firewall logs profile filter + */ + private List profileFilter; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + */ + private String name; + + /** + * Creates an instance of WindowsFirewallLogsDataSource class. + */ + public WindowsFirewallLogsDataSource() { + } + + /** + * Get the streams property: Firewall logs streams. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: Firewall logs streams. + * + * @param streams the streams value to set. + * @return the WindowsFirewallLogsDataSource object itself. + */ + public WindowsFirewallLogsDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the profileFilter property: Firewall logs profile filter. + * + * @return the profileFilter value. + */ + public List profileFilter() { + return this.profileFilter; + } + + /** + * Set the profileFilter property: Firewall logs profile filter. + * + * @param profileFilter the profileFilter value to set. + * @return the WindowsFirewallLogsDataSource object itself. + */ + public WindowsFirewallLogsDataSource + withProfileFilter(List profileFilter) { + this.profileFilter = profileFilter; + return this; + } + + /** + * Get the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) within the data collection rule. + * + * @param name the name value to set. + * @return the WindowsFirewallLogsDataSource object itself. + */ + public WindowsFirewallLogsDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streams() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property streams in model WindowsFirewallLogsDataSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WindowsFirewallLogsDataSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("streams", this.streams, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("profileFilter", this.profileFilter, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WindowsFirewallLogsDataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WindowsFirewallLogsDataSource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WindowsFirewallLogsDataSource. + */ + public static WindowsFirewallLogsDataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WindowsFirewallLogsDataSource deserializedWindowsFirewallLogsDataSource + = new WindowsFirewallLogsDataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streams".equals(fieldName)) { + List streams = reader.readArray(reader1 -> reader1.getString()); + deserializedWindowsFirewallLogsDataSource.streams = streams; + } else if ("profileFilter".equals(fieldName)) { + List profileFilter = reader.readArray( + reader1 -> KnownWindowsFirewallLogsDataSourceProfileFilter.fromString(reader1.getString())); + deserializedWindowsFirewallLogsDataSource.profileFilter = profileFilter; + } else if ("name".equals(fieldName)) { + deserializedWindowsFirewallLogsDataSource.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWindowsFirewallLogsDataSource; + }); + } +} diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json index 4543cc7604b5..6ad24c16131f 100644 --- a/sdk/resourcemanager/api-specs.json +++ b/sdk/resourcemanager/api-specs.json @@ -162,8 +162,7 @@ "dir": "../monitor/azure-resourcemanager-monitor", "source": "specification/monitor/resource-manager/readme.md", "package": "com.azure.resourcemanager.monitor", - "args": "--tag=package-composite-v1 --modelerfour.lenient-model-deduplication=true --add-inner=AutoscaleProfile,ScaleRule,LocalizableString,DiagnosticSettingsCategoryResourceCollection --rename-model=MetricUnit:Unit --enable-sync-stack=false", - "note": "Use commit c0f92082a788895368a738a9200e24971157d7ca, and remove Swagger from Microsoft.Monitor" + "args": "--tag=package-composite-v1-java --modelerfour.lenient-model-deduplication=true --add-inner=AutoscaleProfile,ScaleRule,LocalizableString,DiagnosticSettingsCategoryResourceCollection --rename-model=MetricUnit:Unit,IdentityAutoGenerated:Identity,UserIdentityPropertiesAutoGenerated:UserIdentityProperties --enable-sync-stack=false" }, "monitor-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-monitor", diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/DataCollectionRuleAssociationsListByRuleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/DataCollectionRuleAssociationsListByRuleSamples.java index 53b29e7c9579..f8191da5d96c 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/DataCollectionRuleAssociationsListByRuleSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/DataCollectionRuleAssociationsListByRuleSamples.java @@ -24,6 +24,6 @@ public final class DataCollectionRuleAssociationsListByRuleSamples { .manager() .serviceClient() .getDataCollectionRuleAssociations() - .listByRule("myResourceGroup", "myCollectionRule", com.azure.core.util.Context.NONE); + .listByRule("myResourceGroup", "myCollectionRule"); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/DataCollectionRulesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/DataCollectionRulesDeleteSamples.java index 72c67ff3f519..592d7c89c2ed 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/DataCollectionRulesDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/DataCollectionRulesDeleteSamples.java @@ -23,6 +23,6 @@ public static void deleteDataCollectionRule(com.azure.resourcemanager.AzureResou .manager() .serviceClient() .getDataCollectionRules() - .deleteWithResponse("myResourceGroup", "myCollectionRule", com.azure.core.util.Context.NONE); + .delete("myResourceGroup", "myCollectionRule"); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/MetricsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/MetricsListSamples.java deleted file mode 100644 index dcde94046b5c..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/monitor/generated/MetricsListSamples.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.monitor.generated; - -import com.azure.resourcemanager.monitor.models.ResultType; -import java.time.Duration; - -/** - * Samples for Metrics List. - */ -public final class MetricsListSamples { - /* - * x-ms-original-file: - * specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json - */ - /** - * Sample code: Get Metric for data. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void getMetricForData(com.azure.resourcemanager.AzureResourceManager azure) { - azure.diagnosticSettings() - .manager() - .serviceClient() - .getMetrics() - .listWithResponse( - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default", - "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", Duration.parse("PT1M"), null, "Average,count", 3, - "Average asc", "BlobType eq '*'", null, "Microsoft.Storage/storageAccounts/blobServices", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json - */ - /** - * Sample code: Get Metric for metadata. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void getMetricForMetadata(com.azure.resourcemanager.AzureResourceManager azure) { - azure.diagnosticSettings() - .manager() - .serviceClient() - .getMetrics() - .listWithResponse( - "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default", - "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z", Duration.parse("PT1M"), null, "Average,count", 3, - "Average asc", "BlobType eq '*'", ResultType.fromString("metadata"), - "Microsoft.Storage/storageAccounts/blobServices", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json - */ - /** - * Sample code: Get Metric with error. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void getMetricWithError(com.azure.resourcemanager.AzureResourceManager azure) { - azure.diagnosticSettings() - .manager() - .serviceClient() - .getMetrics() - .listWithResponse( - "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo", - "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z", Duration.parse("FULL"), "MongoRequestsCount,MongoRequests", - "average", null, null, null, null, "microsoft.documentdb/databaseaccounts", - com.azure.core.util.Context.NONE); - } -}