diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json index 2f21ef0d5213..b34199ad3cfc 100644 --- a/sdk/resourcemanager/api-specs.json +++ b/sdk/resourcemanager/api-specs.json @@ -210,7 +210,7 @@ "dir": "azure-resourcemanager-monitor", "source": "specification/monitor/resource-manager/readme.md", "package": "com.azure.resourcemanager.monitor", - "args": "--payload-flattening-threshold=1 --tag=package-2019-06 --add-inner=AutoscaleProfile,ScaleRule,LocalizableString" + "args": "--payload-flattening-threshold=1 --tag=package-2021-04 --add-inner=AutoscaleProfile,ScaleRule,LocalizableString --rename-model=MetricUnit:Unit" }, "network": { "dir": "azure-resourcemanager-network", diff --git a/sdk/resourcemanager/azure-resourcemanager-containerservice/pom.xml b/sdk/resourcemanager/azure-resourcemanager-containerservice/pom.xml index 96a91183248e..ee6b0466b502 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerservice/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-containerservice/pom.xml @@ -148,8 +148,6 @@ revapi-maven-plugin 0.11.2 - true - diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-monitor/CHANGELOG.md index 0803327b4fa5..064db6d50903 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/CHANGELOG.md @@ -2,6 +2,14 @@ ## 2.7.0-beta.1 (Unreleased) +### Dependency Updates + +- Updated `api-version` to `2021-04-01`. + +### Breaking Changes + +- Class `AggregationType` is renamed to `AggregationTypeEnum`. +- Enum `Unit` changed to subclass of `ExpandableStringEnum`. ## 2.6.0 (2021-06-18) diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/pom.xml b/sdk/resourcemanager/azure-resourcemanager-monitor/pom.xml index 5b29e9aba237..62ebacdcb351 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/pom.xml @@ -178,6 +178,8 @@ revapi-maven-plugin 0.11.2 + true + diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActionGroupsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActionGroupsClient.java index f951e12c33d7..d03712cb3838 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActionGroupsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActionGroupsClient.java @@ -27,7 +27,7 @@ public interface ActionGroupsClient * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroup An action group resource. + * @param actionGroup The action group to create or use for the update. * @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. @@ -42,7 +42,7 @@ Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroup An action group resource. + * @param actionGroup The action group to create or use for the update. * @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. @@ -57,7 +57,7 @@ Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroup An action group resource. + * @param actionGroup The action group to create or use for the update. * @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. @@ -72,7 +72,7 @@ ActionGroupResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroup An action group resource. + * @param actionGroup The action group to create or use for the update. * @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. @@ -195,7 +195,7 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroupPatch An action group object for the body of patch operations. + * @param actionGroupPatch Parameters supplied to the 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. @@ -210,7 +210,7 @@ Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroupPatch An action group object for the body of patch operations. + * @param actionGroupPatch Parameters supplied to the 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. @@ -225,7 +225,7 @@ Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroupPatch An action group object for the body of patch operations. + * @param actionGroupPatch Parameters supplied to the 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. @@ -240,7 +240,7 @@ ActionGroupResourceInner update( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroupPatch An action group object for the body of patch operations. + * @param actionGroupPatch Parameters supplied to the operation. * @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/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogAlertsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogAlertsClient.java index db739fac4855..95b791192613 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogAlertsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogAlertsClient.java @@ -27,7 +27,7 @@ public interface ActivityLogAlertsClient * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert An activity log alert resource. + * @param activityLogAlert The activity log alert to create or use for the update. * @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. @@ -42,7 +42,7 @@ Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert An activity log alert resource. + * @param activityLogAlert The activity log alert to create or use for the update. * @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. @@ -57,7 +57,7 @@ Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert An activity log alert resource. + * @param activityLogAlert The activity log alert to create or use for the update. * @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. @@ -72,7 +72,7 @@ ActivityLogAlertResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert An activity log alert resource. + * @param activityLogAlert The activity log alert to create or use for the update. * @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. @@ -198,7 +198,7 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch An activity log alert object for the body of patch operations. + * @param activityLogAlertPatch Parameters supplied to the 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. @@ -213,7 +213,7 @@ Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch An activity log alert object for the body of patch operations. + * @param activityLogAlertPatch Parameters supplied to the 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. @@ -228,7 +228,7 @@ Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch An activity log alert object for the body of patch operations. + * @param activityLogAlertPatch Parameters supplied to the 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. @@ -243,7 +243,7 @@ ActivityLogAlertResourceInner update( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch An activity log alert object for the body of patch operations. + * @param activityLogAlertPatch Parameters supplied to the operation. * @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/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogsClient.java index f9ea72cf34c5..ce9655360166 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ActivityLogsClient.java @@ -82,19 +82,13 @@ public interface ActivityLogsClient { * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other * syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @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 events. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, String select, Context context); + PagedIterable list(String filter); /** * Provides the list of records from the activity logs. @@ -112,11 +106,17 @@ public interface ActivityLogsClient { * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other * syntax is allowed. + * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma + * separated list of property names to be returned. Possible values are: *authorization*, *claims*, + * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, + * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, + * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. + * @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 events. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter); + PagedIterable list(String filter, String select, Context context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRulesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRulesClient.java index 2eb0a6243189..fc1bcf282920 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRulesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AlertRulesClient.java @@ -27,7 +27,7 @@ public interface AlertRulesClient * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The alert rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -42,7 +42,7 @@ Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The alert rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -57,7 +57,7 @@ Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The alert rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -71,7 +71,7 @@ Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The alert rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -194,7 +194,7 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param alertRulesResource The alert rule object for patch operations. + * @param alertRulesResource Parameters supplied to the 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. @@ -209,7 +209,7 @@ Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param alertRulesResource The alert rule object for patch operations. + * @param alertRulesResource Parameters supplied to the 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. @@ -224,7 +224,7 @@ Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param alertRulesResource The alert rule object for patch operations. + * @param alertRulesResource Parameters supplied to the 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. @@ -238,7 +238,7 @@ Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param alertRulesResource The alert rule object for patch operations. + * @param alertRulesResource Parameters supplied to the operation. * @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/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AutoscaleSettingsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AutoscaleSettingsClient.java index 713f9f21b194..5b12805a43ed 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AutoscaleSettingsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/AutoscaleSettingsClient.java @@ -64,7 +64,7 @@ public interface AutoscaleSettingsClient * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param parameters The autoscale setting resource. + * @param parameters Parameters supplied to the 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. @@ -79,7 +79,7 @@ Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param parameters The autoscale setting resource. + * @param parameters Parameters supplied to the 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. @@ -94,7 +94,7 @@ Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param parameters The autoscale setting resource. + * @param parameters Parameters supplied to the 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. @@ -109,7 +109,7 @@ AutoscaleSettingResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param parameters The autoscale setting resource. + * @param parameters Parameters supplied to the operation. * @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. @@ -235,7 +235,7 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource The autoscale setting object for patch operations. + * @param autoscaleSettingResource Parameters supplied to the 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. @@ -250,7 +250,7 @@ Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource The autoscale setting object for patch operations. + * @param autoscaleSettingResource Parameters supplied to the 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. @@ -265,7 +265,7 @@ Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource The autoscale setting object for patch operations. + * @param autoscaleSettingResource Parameters supplied to the 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. @@ -280,7 +280,7 @@ AutoscaleSettingResourceInner update( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource The autoscale setting object for patch operations. + * @param autoscaleSettingResource Parameters supplied to the operation. * @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/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java index 3f8869bb86dc..891060656f48 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/BaselinesClient.java @@ -19,21 +19,24 @@ public interface BaselinesClient { * **Lists the metric baseline values for a resource**. * * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. + * @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 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 aggregation The list of aggregation types (comma separated) to retrieve. * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @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 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 resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -68,21 +71,36 @@ PagedFlux listAsync( * **Lists the metric baseline values for a resource**. * * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. + * @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 list of metric baselines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * **Lists the metric baseline values for a resource**. + * + * @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 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 aggregation The list of aggregation types (comma separated) to retrieve. * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @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 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 resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -102,16 +120,4 @@ PagedIterable list( String filter, ResultType resultType, Context context); - - /** - * **Lists the metric baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. - * @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 list of metric baselines. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionEndpointsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionEndpointsClient.java new file mode 100644 index 000000000000..787d0abe1049 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionEndpointsClient.java @@ -0,0 +1,348 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.monitor.fluent.models.DataCollectionEndpointResourceInner; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataCollectionEndpointsClient. */ +public interface DataCollectionEndpointsClient + extends InnerSupportsGet, + InnerSupportsListing, + InnerSupportsDelete { + /** + * Lists all data collection endpoints in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * Lists all data collection endpoints in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all data collection endpoints in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all data collection endpoints in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * Lists all data collection endpoints in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all data collection endpoints in the specified subscription. + * + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Returns the specified data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dataCollectionEndpointName); + + /** + * Returns the specified data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync( + String resourceGroupName, String dataCollectionEndpointName); + + /** + * Returns the specified data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataCollectionEndpointResourceInner getByResourceGroup(String resourceGroupName, String dataCollectionEndpointName); + + /** + * Returns the specified data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String dataCollectionEndpointName, Context context); + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync( + String resourceGroupName, String dataCollectionEndpointName, DataCollectionEndpointResourceInner body); + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync( + String resourceGroupName, String dataCollectionEndpointName, DataCollectionEndpointResourceInner body); + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String dataCollectionEndpointName); + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataCollectionEndpointResourceInner create(String resourceGroupName, String dataCollectionEndpointName); + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String dataCollectionEndpointName, + DataCollectionEndpointResourceInner body, + Context context); + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync( + String resourceGroupName, String dataCollectionEndpointName, Map tags); + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync( + String resourceGroupName, String dataCollectionEndpointName, Map tags); + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String dataCollectionEndpointName); + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataCollectionEndpointResourceInner update(String resourceGroupName, String dataCollectionEndpointName); + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String dataCollectionEndpointName, Map tags, Context context); + + /** + * Deletes a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionEndpointName); + + /** + * Deletes a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String dataCollectionEndpointName); + + /** + * Deletes a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataCollectionEndpointName); + + /** + * Deletes a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String dataCollectionEndpointName, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java new file mode 100644 index 000000000000..de8848563c01 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRuleAssociationsClient.java @@ -0,0 +1,281 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleAssociationProxyOnlyResourceInner; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataCollectionRuleAssociationsClient. */ +public interface DataCollectionRuleAssociationsClient extends InnerSupportsDelete { + /** + * Lists associations for the specified resource. + * + * @param resourceUri The identifier of the resource. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceAsync(String resourceUri); + + /** + * Lists associations for the specified resource. + * + * @param resourceUri The identifier of the resource. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResource(String resourceUri); + + /** + * Lists associations for the specified resource. + * + * @param resourceUri The identifier of the resource. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + 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. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByRuleAsync( + String resourceGroupName, String dataCollectionRuleName); + + /** + * 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. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRule( + String resourceGroupName, String dataCollectionRuleName); + + /** + * 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 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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRule( + String resourceGroupName, String dataCollectionRuleName, Context context); + + /** + * Returns the specified association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync( + String resourceUri, String associationName); + + /** + * Returns the specified association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceUri, String associationName); + + /** + * Returns the specified association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataCollectionRuleAssociationProxyOnlyResourceInner get(String resourceUri, String associationName); + + /** + * Returns the specified association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceUri, String associationName, Context context); + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param body The payload. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync( + String resourceUri, String associationName, DataCollectionRuleAssociationProxyOnlyResourceInner body); + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param body The payload. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync( + String resourceUri, String associationName, DataCollectionRuleAssociationProxyOnlyResourceInner body); + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceUri, String associationName); + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataCollectionRuleAssociationProxyOnlyResourceInner create(String resourceUri, String associationName); + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param body The payload. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceUri, + String associationName, + DataCollectionRuleAssociationProxyOnlyResourceInner body, + Context context); + + /** + * Deletes an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceUri, String associationName); + + /** + * Deletes an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceUri, String associationName); + + /** + * Deletes an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri, String associationName); + + /** + * Deletes an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceUri, String associationName, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java new file mode 100644 index 000000000000..35e7ab09e4bd --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DataCollectionRulesClient.java @@ -0,0 +1,345 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleResourceInner; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataCollectionRulesClient. */ +public interface DataCollectionRulesClient + extends InnerSupportsGet, + InnerSupportsListing, + InnerSupportsDelete { + /** + * Lists all data collection rules in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * Lists all data collection rules in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all data collection rules in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all data collection rules in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * Lists all data collection rules in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all data collection rules in the specified subscription. + * + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Returns 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dataCollectionRuleName); + + /** + * Returns 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync( + String resourceGroupName, String dataCollectionRuleName); + + /** + * Returns 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataCollectionRuleResourceInner getByResourceGroup(String resourceGroupName, String dataCollectionRuleName); + + /** + * Returns 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 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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String dataCollectionRuleName, Context context); + + /** + * Creates or updates a 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 body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync( + String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner body); + + /** + * Creates or updates a 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 body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync( + String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner body); + + /** + * Creates or updates a 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String dataCollectionRuleName); + + /** + * Creates or updates a 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataCollectionRuleResourceInner create(String resourceGroupName, String dataCollectionRuleName); + + /** + * Creates or updates a 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 body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner body, Context context); + + /** + * Updates part of a 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 tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync( + String resourceGroupName, String dataCollectionRuleName, Map tags); + + /** + * Updates part of a 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 tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync( + String resourceGroupName, String dataCollectionRuleName, Map tags); + + /** + * Updates part of a 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String dataCollectionRuleName); + + /** + * Updates part of a 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataCollectionRuleResourceInner update(String resourceGroupName, String dataCollectionRuleName); + + /** + * Updates part of a 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 tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String dataCollectionRuleName, Map tags, Context context); + + /** + * Deletes a 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. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionRuleName); + + /** + * Deletes a 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. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String dataCollectionRuleName); + + /** + * Deletes a 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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataCollectionRuleName); + + /** + * Deletes a 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String dataCollectionRuleName, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsClient.java index c0eb4947a251..be23589c549f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/DiagnosticSettingsClient.java @@ -73,7 +73,7 @@ public interface DiagnosticSettingsClient extends InnerSupportsDelete { * * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. - * @param parameters The diagnostic setting resource. + * @param parameters Parameters supplied to the 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. @@ -88,7 +88,7 @@ Mono> createOrUpdateWithResponseAsync( * * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. - * @param parameters The diagnostic setting resource. + * @param parameters Parameters supplied to the 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. @@ -103,7 +103,7 @@ Mono createOrUpdateAsync( * * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. - * @param parameters The diagnostic setting resource. + * @param parameters Parameters supplied to the 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. @@ -118,7 +118,7 @@ DiagnosticSettingsResourceInner createOrUpdate( * * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. - * @param parameters The diagnostic setting resource. + * @param parameters Parameters supplied to the operation. * @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/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/LogProfilesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/LogProfilesClient.java index 9212cd5eb2ea..7a00312a9ca6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/LogProfilesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/LogProfilesClient.java @@ -117,7 +117,7 @@ public interface LogProfilesClient { * Create or update a log profile in Azure Monitoring REST API. * * @param logProfileName The name of the log profile. - * @param parameters The log profile resource. + * @param parameters Parameters supplied to the 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. @@ -131,7 +131,7 @@ Mono> createOrUpdateWithResponseAsync( * Create or update a log profile in Azure Monitoring REST API. * * @param logProfileName The name of the log profile. - * @param parameters The log profile resource. + * @param parameters Parameters supplied to the 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. @@ -144,7 +144,7 @@ Mono> createOrUpdateWithResponseAsync( * Create or update a log profile in Azure Monitoring REST API. * * @param logProfileName The name of the log profile. - * @param parameters The log profile resource. + * @param parameters Parameters supplied to the 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. @@ -157,7 +157,7 @@ Mono> createOrUpdateWithResponseAsync( * Create or update a log profile in Azure Monitoring REST API. * * @param logProfileName The name of the log profile. - * @param parameters The log profile resource. + * @param parameters Parameters supplied to the operation. * @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. @@ -172,7 +172,7 @@ Response createOrUpdateWithResponse( * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * * @param logProfileName The name of the log profile. - * @param logProfilesResource The log profile resource for patch operations. + * @param logProfilesResource Parameters supplied to the 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. @@ -186,7 +186,7 @@ Mono> updateWithResponseAsync( * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * * @param logProfileName The name of the log profile. - * @param logProfilesResource The log profile resource for patch operations. + * @param logProfilesResource Parameters supplied to the 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. @@ -199,7 +199,7 @@ Mono> updateWithResponseAsync( * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * * @param logProfileName The name of the log profile. - * @param logProfilesResource The log profile resource for patch operations. + * @param logProfilesResource Parameters supplied to the 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. @@ -212,7 +212,7 @@ Mono> updateWithResponseAsync( * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * * @param logProfileName The name of the log profile. - * @param logProfilesResource The log profile resource for patch operations. + * @param logProfilesResource Parameters supplied to the operation. * @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/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsClient.java index 5f77564f73c0..97ecddf3030a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricAlertsClient.java @@ -151,7 +151,7 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -166,7 +166,7 @@ Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -181,7 +181,7 @@ Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -196,7 +196,7 @@ MetricAlertResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -212,7 +212,7 @@ Response createOrUpdateWithResponse( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -227,7 +227,7 @@ Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -242,7 +242,7 @@ Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -256,7 +256,7 @@ Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource for patch operations. + * @param parameters The parameters of the rule to update. * @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/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricBaselinesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricBaselinesClient.java deleted file mode 100644 index d403309a74e6..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricBaselinesClient.java +++ /dev/null @@ -1,208 +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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.monitor.fluent.models.BaselineResponseInner; -import com.azure.resourcemanager.monitor.fluent.models.CalculateBaselineResponseInner; -import com.azure.resourcemanager.monitor.models.ResultType; -import com.azure.resourcemanager.monitor.models.TimeSeriesInformation; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricBaselinesClient. */ -public interface MetricBaselinesClient { - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 aggregation The aggregation type of the metric to retrieve the baseline for. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceUri, - String metricName, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - ResultType resultType); - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 aggregation The aggregation type of the metric to retrieve the baseline for. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceUri, - String metricName, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - ResultType resultType); - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceUri, String metricName); - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BaselineResponseInner get(String resourceUri, String metricName); - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 aggregation The aggregation type of the metric to retrieve the baseline for. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceUri, - String metricName, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - ResultType resultType, - Context context); - - /** - * **Lists the baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param timeSeriesInformation The time series info needed for calculating the baseline. - * @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 calculate baseline call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> calculateBaselineWithResponseAsync( - String resourceUri, TimeSeriesInformation timeSeriesInformation); - - /** - * **Lists the baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param timeSeriesInformation The time series info needed for calculating the baseline. - * @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 calculate baseline call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono calculateBaselineAsync( - String resourceUri, TimeSeriesInformation timeSeriesInformation); - - /** - * **Lists the baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param timeSeriesInformation The time series info needed for calculating the baseline. - * @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 calculate baseline call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CalculateBaselineResponseInner calculateBaseline(String resourceUri, TimeSeriesInformation timeSeriesInformation); - - /** - * **Lists the baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param timeSeriesInformation The time series info needed for calculating the baseline. - * @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 calculate baseline call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response calculateBaselineWithResponse( - String resourceUri, TimeSeriesInformation timeSeriesInformation, Context context); -} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java index 2fe17b690ca3..3901d8b31afc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricDefinitionsClient.java @@ -42,25 +42,25 @@ 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 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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri, String metricnamespace, Context context); + 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 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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); + PagedIterable list(String resourceUri, String metricnamespace, Context context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricNamespacesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricNamespacesClient.java index 99a7716a995f..1759df705267 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricNamespacesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricNamespacesClient.java @@ -42,25 +42,25 @@ public interface MetricNamespacesClient { * Lists the metric namespaces for the resource. * * @param resourceUri The identifier of the resource. - * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. - * @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 namespaces. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri, String startTime, Context context); + PagedIterable list(String resourceUri); /** * Lists the metric namespaces for the resource. * * @param resourceUri The identifier of the resource. + * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. + * @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 namespaces. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); + PagedIterable list(String resourceUri, String startTime, Context context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java index 005c57397805..9d02cb5fbe26 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MetricsClient.java @@ -22,19 +22,22 @@ public interface MetricsClient { * @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. + * @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 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 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 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. @@ -63,19 +66,22 @@ Mono> listWithResponseAsync( * @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. + * @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 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 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 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. @@ -128,19 +134,22 @@ Mono listAsync( * @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. + * @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 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 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 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. diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MonitorClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MonitorClient.java index bae4e76e865f..1b66bcc3a033 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MonitorClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/MonitorClient.java @@ -10,7 +10,7 @@ /** The interface for MonitorClient class. */ public interface MonitorClient { /** - * Gets The Azure subscription Id. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -93,13 +93,6 @@ public interface MonitorClient { */ ActionGroupsClient getActionGroups(); - /** - * Gets the ActivityLogAlertsClient object to access its operations. - * - * @return the ActivityLogAlertsClient object. - */ - ActivityLogAlertsClient getActivityLogAlerts(); - /** * Gets the ActivityLogsClient object to access its operations. * @@ -135,13 +128,6 @@ public interface MonitorClient { */ MetricsClient getMetrics(); - /** - * Gets the MetricBaselinesClient object to access its operations. - * - * @return the MetricBaselinesClient object. - */ - MetricBaselinesClient getMetricBaselines(); - /** * Gets the BaselinesClient object to access its operations. * @@ -183,4 +169,67 @@ public interface MonitorClient { * @return the VMInsightsClient object. */ VMInsightsClient getVMInsights(); + + /** + * Gets the PrivateLinkScopesClient object to access its operations. + * + * @return the PrivateLinkScopesClient object. + */ + PrivateLinkScopesClient getPrivateLinkScopes(); + + /** + * Gets the PrivateLinkScopeOperationStatusClient object to access its operations. + * + * @return the PrivateLinkScopeOperationStatusClient object. + */ + PrivateLinkScopeOperationStatusClient getPrivateLinkScopeOperationStatus(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkScopedResourcesClient object to access its operations. + * + * @return the PrivateLinkScopedResourcesClient object. + */ + PrivateLinkScopedResourcesClient getPrivateLinkScopedResources(); + + /** + * Gets the ActivityLogAlertsClient object to access its operations. + * + * @return the ActivityLogAlertsClient object. + */ + ActivityLogAlertsClient getActivityLogAlerts(); + + /** + * Gets the DataCollectionEndpointsClient object to access its operations. + * + * @return the DataCollectionEndpointsClient object. + */ + DataCollectionEndpointsClient getDataCollectionEndpoints(); + + /** + * Gets the DataCollectionRuleAssociationsClient object to access its operations. + * + * @return the DataCollectionRuleAssociationsClient object. + */ + DataCollectionRuleAssociationsClient getDataCollectionRuleAssociations(); + + /** + * Gets the DataCollectionRulesClient object to access its operations. + * + * @return the DataCollectionRulesClient object. + */ + DataCollectionRulesClient getDataCollectionRules(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateEndpointConnectionsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..d48aacb703de --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,363 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.monitor.fluent.models.PrivateEndpointConnectionInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PollerFlux, PrivateEndpointConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkResourcesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..9e4743502c5a --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,117 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.monitor.fluent.models.PrivateLinkResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String groupName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String scopeName, String groupName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String scopeName, String groupName, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopeOperationStatusClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopeOperationStatusClient.java new file mode 100644 index 000000000000..cc325e423124 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopeOperationStatusClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.monitor.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkScopeOperationStatusClient. */ +public interface PrivateLinkScopeOperationStatusClient extends InnerSupportsGet { + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * + * @param resourceGroupName The name of the resource group. + * @param asyncOperationId The operation Id. + * @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 status of an azure asynchronous operation associated with a private link scope operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String asyncOperationId); + + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * + * @param resourceGroupName The name of the resource group. + * @param asyncOperationId The operation Id. + * @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 status of an azure asynchronous operation associated with a private link scope operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String asyncOperationId); + + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * + * @param resourceGroupName The name of the resource group. + * @param asyncOperationId The operation Id. + * @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 status of an azure asynchronous operation associated with a private link scope operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner getByResourceGroup(String resourceGroupName, String asyncOperationId); + + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * + * @param resourceGroupName The name of the resource group. + * @param asyncOperationId The operation Id. + * @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 status of an azure asynchronous operation associated with a private link scope operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String asyncOperationId, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopedResourcesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopedResourcesClient.java new file mode 100644 index 000000000000..94132afe74f9 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopedResourcesClient.java @@ -0,0 +1,362 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.monitor.fluent.models.ScopedResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkScopedResourcesClient. */ +public interface PrivateLinkScopedResourcesClient { + /** + * Gets a scoped resource in a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 scoped resource in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String scopeName, String name); + + /** + * Gets a scoped resource in a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 scoped resource in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String scopeName, String name); + + /** + * Gets a scoped resource in a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 scoped resource in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopedResourceInner get(String resourceGroupName, String scopeName, String name); + + /** + * Gets a scoped resource in a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 a scoped resource in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String scopeName, String name, Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String scopeName, String name, String linkedResourceId); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PollerFlux, ScopedResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String scopeName, String name, String linkedResourceId); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ScopedResourceInner> beginCreateOrUpdate( + String resourceGroupName, String scopeName, String name, String linkedResourceId); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 a private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ScopedResourceInner> beginCreateOrUpdate( + String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync( + String resourceGroupName, String scopeName, String name, String linkedResourceId); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String scopeName, String name); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopedResourceInner createOrUpdate( + String resourceGroupName, String scopeName, String name, String linkedResourceId); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopedResourceInner createOrUpdate(String resourceGroupName, String scopeName, String name); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 a private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopedResourceInner createOrUpdate( + String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String scopeName, String name); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String scopeName, String name); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, String name); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String name, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String scopeName, String name); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName, String name); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName, String name, Context context); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopesClient.java new file mode 100644 index 000000000000..56c6f528f2c2 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopesClient.java @@ -0,0 +1,394 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.nio.ByteBuffer; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkScopesClient. */ +public interface PrivateLinkScopesClient + extends InnerSupportsGet, + InnerSupportsListing, + InnerSupportsDelete { + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * + * @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 list of all Azure Monitor PrivateLinkScopes within a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * + * @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 list of all Azure Monitor PrivateLinkScopes within a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * + * @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 a list of all Azure Monitor PrivateLinkScopes within a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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 list of Azure Monitor PrivateLinkScopes within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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 list of Azure Monitor PrivateLinkScopes within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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 a list of Azure Monitor PrivateLinkScopes within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String scopeName); + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String scopeName); + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName); + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, Context context); + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String scopeName); + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName); + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName, Context context); + + /** + * Returns a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String scopeName); + + /** + * Returns a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String scopeName); + + /** + * Returns a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureMonitorPrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName); + + /** + * Returns a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String scopeName, Context context); + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure + * Monitor PrivateLinkScope. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String scopeName, + AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload); + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure + * Monitor PrivateLinkScope. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync( + String resourceGroupName, + String scopeName, + AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload); + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure + * Monitor PrivateLinkScope. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureMonitorPrivateLinkScopeInner createOrUpdate( + String resourceGroupName, + String scopeName, + AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload); + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure + * Monitor PrivateLinkScope. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String scopeName, + AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload, + Context context); + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param tags Resource tags. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateTagsWithResponseAsync( + String resourceGroupName, String scopeName, Map tags); + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param tags Resource tags. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateTagsAsync( + String resourceGroupName, String scopeName, Map tags); + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateTagsAsync(String resourceGroupName, String scopeName); + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureMonitorPrivateLinkScopeInner updateTags(String resourceGroupName, String scopeName); + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param tags Resource tags. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String scopeName, Map tags, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ScheduledQueryRulesClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ScheduledQueryRulesClient.java index d0143c3e50cc..7e4181fbab15 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ScheduledQueryRulesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/ScheduledQueryRulesClient.java @@ -27,7 +27,7 @@ public interface ScheduledQueryRulesClient * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The Log Search Rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -42,7 +42,7 @@ Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The Log Search Rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -57,7 +57,7 @@ Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The Log Search Rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -72,7 +72,7 @@ LogSearchRuleResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The Log Search Rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -143,7 +143,7 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The log search rule resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -158,7 +158,7 @@ Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The log search rule resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -173,7 +173,7 @@ Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The log search rule resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -187,7 +187,7 @@ Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The log search rule resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -276,26 +276,26 @@ Response updateWithResponse( /** * List the Log Search rules within a subscription group. * - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @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 a collection of Log Search rule resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); + PagedIterable list(); /** * List the Log Search rules within a subscription group. * + * @param filter The filter to apply on the operation. For more information please see + * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. + * @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 a collection of Log Search rule resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(String filter, Context context); /** * List the Log Search rules within a resource group. @@ -327,27 +327,27 @@ Response updateWithResponse( * List the Log Search rules within a resource group. * * @param resourceGroupName The name of the resource group. - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @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 a collection of Log Search rule resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** * List the Log Search rules within a resource group. * * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see + * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. + * @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 a collection of Log Search rule resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Context context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/TenantActivityLogsClient.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/TenantActivityLogsClient.java index 9be10fe8d861..43ee0f5b3315 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/TenantActivityLogsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/TenantActivityLogsClient.java @@ -58,6 +58,19 @@ public interface TenantActivityLogsClient { @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); + /** + * Gets 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. + * + * @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 Activity Logs for the Tenant. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + /** * Gets 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 @@ -90,17 +103,4 @@ public interface TenantActivityLogsClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String filter, String select, Context context); - - /** - * Gets 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. - * - * @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 Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java index bb2945fd0b28..09af08c960e9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActionGroupResourceInner.java @@ -6,12 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.monitor.models.ArmRoleReceiver; import com.azure.resourcemanager.monitor.models.AutomationRunbookReceiver; import com.azure.resourcemanager.monitor.models.AzureAppPushReceiver; import com.azure.resourcemanager.monitor.models.AzureFunctionReceiver; +import com.azure.resourcemanager.monitor.models.AzureResource; import com.azure.resourcemanager.monitor.models.EmailReceiver; import com.azure.resourcemanager.monitor.models.ItsmReceiver; import com.azure.resourcemanager.monitor.models.LogicAppReceiver; @@ -21,11 +21,12 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; /** An action group resource. */ @JsonFlatten @Fluent -public class ActionGroupResourceInner extends Resource { +public class ActionGroupResourceInner extends AzureResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ActionGroupResourceInner.class); /* @@ -350,12 +351,28 @@ public ActionGroupResourceInner withArmRoleReceivers(List armRo return this; } + /** {@inheritDoc} */ + @Override + public ActionGroupResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ActionGroupResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (emailReceivers() != null) { emailReceivers().forEach(e -> e.validate()); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java index 2f844c517839..43f6049a45a9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ActivityLogAlertResourceInner.java @@ -6,18 +6,19 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.monitor.models.ActivityLogAlertActionList; import com.azure.resourcemanager.monitor.models.ActivityLogAlertAllOfCondition; +import com.azure.resourcemanager.monitor.models.ResourceAutoGenerated2; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; /** An activity log alert resource. */ @JsonFlatten @Fluent -public class ActivityLogAlertResourceInner extends Resource { +public class ActivityLogAlertResourceInner extends ResourceAutoGenerated2 { @JsonIgnore private final ClientLogger logger = new ClientLogger(ActivityLogAlertResourceInner.class); /* @@ -157,12 +158,28 @@ public ActivityLogAlertResourceInner withDescription(String description) { return this; } + /** {@inheritDoc} */ + @Override + public ActivityLogAlertResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ActivityLogAlertResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (condition() != null) { condition().validate(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java index de932079a368..88269c36dc39 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AlertRuleResourceInner.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; +import java.util.Map; /** The alert rule resource. */ @JsonFlatten @@ -34,6 +35,12 @@ public class AlertRuleResourceInner extends Resource { @JsonProperty(value = "properties.description") private String description; + /* + * the provisioning state. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + /* * the flag that indicates whether the alert rule is enabled. */ @@ -46,6 +53,13 @@ public class AlertRuleResourceInner extends Resource { @JsonProperty(value = "properties.condition", required = true) private RuleCondition condition; + /* + * action that is performed when the alert rule becomes active, and when an + * alert condition is resolved. + */ + @JsonProperty(value = "properties.action") + private RuleAction action; + /* * the array of actions that are performed when the alert rule becomes * active, and when an alert condition is resolved. @@ -99,6 +113,26 @@ public AlertRuleResourceInner withDescription(String description) { return this; } + /** + * Get the provisioningState property: the provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: the provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the AlertRuleResourceInner object itself. + */ + public AlertRuleResourceInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + /** * Get the isEnabled property: the flag that indicates whether the alert rule is enabled. * @@ -139,6 +173,28 @@ public AlertRuleResourceInner withCondition(RuleCondition condition) { return this; } + /** + * Get the action property: action that is performed when the alert rule becomes active, and when an alert condition + * is resolved. + * + * @return the action value. + */ + public RuleAction action() { + return this.action; + } + + /** + * Set the action property: action that is performed when the alert rule becomes active, and when an alert condition + * is resolved. + * + * @param action the action value to set. + * @return the AlertRuleResourceInner object itself. + */ + public AlertRuleResourceInner withAction(RuleAction action) { + this.action = action; + 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. @@ -170,6 +226,20 @@ public OffsetDateTime lastUpdatedTime() { return this.lastUpdatedTime; } + /** {@inheritDoc} */ + @Override + public AlertRuleResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AlertRuleResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Validates the instance. * @@ -190,6 +260,9 @@ public void validate() { } else { condition().validate(); } + if (action() != null) { + action().validate(); + } if (actions() != null) { actions().forEach(e -> e.validate()); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java index 18d0927c968e..020cc93666d7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AutoscaleSettingResourceInner.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; /** The autoscale setting resource. */ @JsonFlatten @@ -53,6 +54,13 @@ public class AutoscaleSettingResourceInner extends Resource { @JsonProperty(value = "properties.targetResourceUri") private String targetResourceUri; + /* + * the location of the resource that the autoscale setting should be added + * to. + */ + @JsonProperty(value = "properties.targetResourceLocation") + private String targetResourceLocation; + /** * Get the profiles property: the collection of automatic scaling profiles that specify different scaling parameters * for different time periods. A maximum of 20 profiles can be specified. @@ -159,6 +167,42 @@ public AutoscaleSettingResourceInner withTargetResourceUri(String targetResource return this; } + /** + * Get the targetResourceLocation property: the location of the resource that the autoscale setting should be added + * to. + * + * @return the targetResourceLocation value. + */ + public String targetResourceLocation() { + return this.targetResourceLocation; + } + + /** + * Set the targetResourceLocation property: the location of the resource that the autoscale setting should be added + * to. + * + * @param targetResourceLocation the targetResourceLocation value to set. + * @return the AutoscaleSettingResourceInner object itself. + */ + public AutoscaleSettingResourceInner withTargetResourceLocation(String targetResourceLocation) { + this.targetResourceLocation = targetResourceLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public AutoscaleSettingResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AutoscaleSettingResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.java new file mode 100644 index 000000000000..ef34d5344520 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/AzureMonitorPrivateLinkScopeInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.models.PrivateLinkScopesResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** An Azure Monitor PrivateLinkScope definition. */ +@JsonFlatten +@Fluent +public class AzureMonitorPrivateLinkScopeInner extends PrivateLinkScopesResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureMonitorPrivateLinkScopeInner.class); + + /* + * Current state of this PrivateLinkScope: whether or not is has been + * provisioned within the resource group it is defined. Users cannot change + * this value but are able to read from it. Values will include + * Provisioning ,Succeeded, Canceled and Failed. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * List of private endpoint connections. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the provisioningState property: Current state of this PrivateLinkScope: whether or not is has been + * provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. + * Values will include Provisioning ,Succeeded, Canceled and Failed. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** {@inheritDoc} */ + @Override + public AzureMonitorPrivateLinkScopeInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureMonitorPrivateLinkScopeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/BaselineMetadataValueInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/BaselineMetadataValueInner.java deleted file mode 100644 index b878a3d374b6..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/BaselineMetadataValueInner.java +++ /dev/null @@ -1,79 +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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a baseline metadata value. */ -@Fluent -public final class BaselineMetadataValueInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BaselineMetadataValueInner.class); - - /* - * the name of the metadata. - */ - @JsonProperty(value = "name") - private LocalizableStringInner name; - - /* - * the value of the metadata. - */ - @JsonProperty(value = "value") - private String value; - - /** - * Get the name property: the name of the metadata. - * - * @return the name value. - */ - public LocalizableStringInner name() { - return this.name; - } - - /** - * Set the name property: the name of the metadata. - * - * @param name the name value to set. - * @return the BaselineMetadataValueInner object itself. - */ - public BaselineMetadataValueInner withName(LocalizableStringInner name) { - this.name = name; - return this; - } - - /** - * Get the value property: the value of the metadata. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: the value of the metadata. - * - * @param value the value value to set. - * @return the BaselineMetadataValueInner object itself. - */ - public BaselineMetadataValueInner withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/BaselineResponseInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/BaselineResponseInner.java deleted file mode 100644 index da23c2601e51..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/BaselineResponseInner.java +++ /dev/null @@ -1,254 +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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.Baseline; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.List; - -/** The response to a baseline query. */ -@JsonFlatten -@Fluent -public class BaselineResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BaselineResponseInner.class); - - /* - * the metric baseline Id. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * the resource type of the baseline resource. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * the name and the display name of the metric, i.e. it is localizable - * string. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private LocalizableStringInner name; - - /* - * 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. - */ - @JsonProperty(value = "properties.timespan") - 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. - */ - @JsonProperty(value = "properties.interval") - private Duration interval; - - /* - * The aggregation type of the metric. - */ - @JsonProperty(value = "properties.aggregation") - private String aggregation; - - /* - * the array of timestamps of the baselines. - */ - @JsonProperty(value = "properties.timestamps") - private List timestamps; - - /* - * the baseline values for each sensitivity. - */ - @JsonProperty(value = "properties.baseline") - private List baseline; - - /* - * the baseline metadata values. - */ - @JsonProperty(value = "properties.metadata") - private List metadata; - - /** - * Get the id property: the metric baseline Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the type property: the resource type of the baseline resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * 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; - } - - /** - * 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 BaselineResponseInner object itself. - */ - public BaselineResponseInner 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 BaselineResponseInner object itself. - */ - public BaselineResponseInner withInterval(Duration interval) { - this.interval = interval; - return this; - } - - /** - * Get the aggregation property: The aggregation type of the metric. - * - * @return the aggregation value. - */ - public String aggregation() { - return this.aggregation; - } - - /** - * Set the aggregation property: The aggregation type of the metric. - * - * @param aggregation the aggregation value to set. - * @return the BaselineResponseInner object itself. - */ - public BaselineResponseInner withAggregation(String aggregation) { - this.aggregation = aggregation; - return this; - } - - /** - * Get the timestamps property: the array of timestamps of the baselines. - * - * @return the timestamps value. - */ - public List timestamps() { - return this.timestamps; - } - - /** - * Set the timestamps property: the array of timestamps of the baselines. - * - * @param timestamps the timestamps value to set. - * @return the BaselineResponseInner object itself. - */ - public BaselineResponseInner withTimestamps(List timestamps) { - this.timestamps = timestamps; - return this; - } - - /** - * Get the baseline property: the baseline values for each sensitivity. - * - * @return the baseline value. - */ - public List baseline() { - return this.baseline; - } - - /** - * Set the baseline property: the baseline values for each sensitivity. - * - * @param baseline the baseline value to set. - * @return the BaselineResponseInner object itself. - */ - public BaselineResponseInner withBaseline(List baseline) { - this.baseline = baseline; - return this; - } - - /** - * Get the metadata property: the baseline metadata values. - * - * @return the metadata value. - */ - public List metadata() { - return this.metadata; - } - - /** - * Set the metadata property: the baseline metadata values. - * - * @param metadata the metadata value to set. - * @return the BaselineResponseInner object itself. - */ - public BaselineResponseInner withMetadata(List metadata) { - this.metadata = metadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - if (baseline() != null) { - baseline().forEach(e -> e.validate()); - } - if (metadata() != null) { - metadata().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/CalculateBaselineResponseInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/CalculateBaselineResponseInner.java deleted file mode 100644 index caa2f8b1a80f..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/CalculateBaselineResponseInner.java +++ /dev/null @@ -1,119 +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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.Baseline; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The response to a calculate baseline call. */ -@Fluent -public final class CalculateBaselineResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CalculateBaselineResponseInner.class); - - /* - * the resource type of the baseline resource. - */ - @JsonProperty(value = "type", required = true) - private String type; - - /* - * the array of timestamps of the baselines. - */ - @JsonProperty(value = "timestamps") - private List timestamps; - - /* - * the baseline values for each sensitivity. - */ - @JsonProperty(value = "baseline", required = true) - private List baseline; - - /** - * Get the type property: the resource type of the baseline resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: the resource type of the baseline resource. - * - * @param type the type value to set. - * @return the CalculateBaselineResponseInner object itself. - */ - public CalculateBaselineResponseInner withType(String type) { - this.type = type; - return this; - } - - /** - * Get the timestamps property: the array of timestamps of the baselines. - * - * @return the timestamps value. - */ - public List timestamps() { - return this.timestamps; - } - - /** - * Set the timestamps property: the array of timestamps of the baselines. - * - * @param timestamps the timestamps value to set. - * @return the CalculateBaselineResponseInner object itself. - */ - public CalculateBaselineResponseInner withTimestamps(List timestamps) { - this.timestamps = timestamps; - return this; - } - - /** - * Get the baseline property: the baseline values for each sensitivity. - * - * @return the baseline value. - */ - public List baseline() { - return this.baseline; - } - - /** - * Set the baseline property: the baseline values for each sensitivity. - * - * @param baseline the baseline value to set. - * @return the CalculateBaselineResponseInner object itself. - */ - public CalculateBaselineResponseInner withBaseline(List baseline) { - this.baseline = baseline; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property type in model CalculateBaselineResponseInner")); - } - if (baseline() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property baseline in model CalculateBaselineResponseInner")); - } else { - baseline().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java new file mode 100644 index 000000000000..620e2a0a126d --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionEndpointResourceInner.java @@ -0,0 +1,262 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointConfigurationAccess; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointLogsIngestion; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointNetworkAcls; +import com.azure.resourcemanager.monitor.models.KnownDataCollectionEndpointProvisioningState; +import com.azure.resourcemanager.monitor.models.KnownDataCollectionEndpointResourceKind; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Definition of ARM tracked top level resource. */ +@JsonFlatten +@Fluent +public class DataCollectionEndpointResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointResourceInner.class); + + /* + * The kind of the resource. + */ + @JsonProperty(value = "kind") + private KnownDataCollectionEndpointResourceKind kind; + + /* + * Resource entity tag (ETag). + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Description of the data collection endpoint. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The immutable ID of this data collection endpoint resource. This + * property is READ-ONLY. + */ + @JsonProperty(value = "properties.immutableId") + private String immutableId; + + /* + * The endpoint used by agents to access their configuration. + */ + @JsonProperty(value = "properties.configurationAccess") + private DataCollectionEndpointConfigurationAccess configurationAccess; + + /* + * The endpoint used by clients to ingest logs. + */ + @JsonProperty(value = "properties.logsIngestion") + private DataCollectionEndpointLogsIngestion logsIngestion; + + /* + * Network access control rules for the endpoints. + */ + @JsonProperty(value = "properties.networkAcls") + private DataCollectionEndpointNetworkAcls networkAcls; + + /* + * The resource provisioning state. This property is READ-ONLY. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private KnownDataCollectionEndpointProvisioningState provisioningState; + + /** + * Get the kind property: The kind of the resource. + * + * @return the kind value. + */ + public KnownDataCollectionEndpointResourceKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the resource. + * + * @param kind the kind value to set. + * @return the DataCollectionEndpointResourceInner object itself. + */ + public DataCollectionEndpointResourceInner withKind(KnownDataCollectionEndpointResourceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the etag property: Resource entity tag (ETag). + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the description property: Description of the data collection endpoint. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the data collection endpoint. + * + * @param description the description value to set. + * @return the DataCollectionEndpointResourceInner object itself. + */ + public DataCollectionEndpointResourceInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the immutableId property: The immutable ID of this data collection endpoint resource. This property is + * READ-ONLY. + * + * @return the immutableId value. + */ + public String immutableId() { + return this.immutableId; + } + + /** + * Set the immutableId property: The immutable ID of this data collection endpoint resource. This property is + * READ-ONLY. + * + * @param immutableId the immutableId value to set. + * @return the DataCollectionEndpointResourceInner object itself. + */ + public DataCollectionEndpointResourceInner withImmutableId(String immutableId) { + this.immutableId = immutableId; + return this; + } + + /** + * Get the configurationAccess property: The endpoint used by agents to access their configuration. + * + * @return the configurationAccess value. + */ + public DataCollectionEndpointConfigurationAccess configurationAccess() { + return this.configurationAccess; + } + + /** + * Set the configurationAccess property: The endpoint used by agents to access their configuration. + * + * @param configurationAccess the configurationAccess value to set. + * @return the DataCollectionEndpointResourceInner object itself. + */ + public DataCollectionEndpointResourceInner withConfigurationAccess( + DataCollectionEndpointConfigurationAccess configurationAccess) { + this.configurationAccess = configurationAccess; + return this; + } + + /** + * Get the logsIngestion property: The endpoint used by clients to ingest logs. + * + * @return the logsIngestion value. + */ + public DataCollectionEndpointLogsIngestion logsIngestion() { + return this.logsIngestion; + } + + /** + * Set the logsIngestion property: The endpoint used by clients to ingest logs. + * + * @param logsIngestion the logsIngestion value to set. + * @return the DataCollectionEndpointResourceInner object itself. + */ + public DataCollectionEndpointResourceInner withLogsIngestion(DataCollectionEndpointLogsIngestion logsIngestion) { + this.logsIngestion = logsIngestion; + return this; + } + + /** + * Get the networkAcls property: Network access control rules for the endpoints. + * + * @return the networkAcls value. + */ + public DataCollectionEndpointNetworkAcls networkAcls() { + return this.networkAcls; + } + + /** + * Set the networkAcls property: Network access control rules for the endpoints. + * + * @param networkAcls the networkAcls value to set. + * @return the DataCollectionEndpointResourceInner object itself. + */ + public DataCollectionEndpointResourceInner withNetworkAcls(DataCollectionEndpointNetworkAcls networkAcls) { + this.networkAcls = networkAcls; + return this; + } + + /** + * Get the provisioningState property: The resource provisioning state. This property is READ-ONLY. + * + * @return the provisioningState value. + */ + public KnownDataCollectionEndpointProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionEndpointResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionEndpointResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configurationAccess() != null) { + configurationAccess().validate(); + } + if (logsIngestion() != null) { + logsIngestion().validate(); + } + if (networkAcls() != null) { + networkAcls().validate(); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java new file mode 100644 index 000000000000..8f78862e6dd7 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleAssociationProxyOnlyResourceInner.java @@ -0,0 +1,157 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.models.KnownDataCollectionRuleAssociationProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Definition of generic ARM proxy resource. */ +@JsonFlatten +@Fluent +public class DataCollectionRuleAssociationProxyOnlyResourceInner extends ProxyResource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(DataCollectionRuleAssociationProxyOnlyResourceInner.class); + + /* + * Resource entity tag (ETag). + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Description of the association. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The resource ID of the data collection rule that is to be associated. + */ + @JsonProperty(value = "properties.dataCollectionRuleId") + private String dataCollectionRuleId; + + /* + * The resource ID of the data collection endpoint that is to be + * associated. + */ + @JsonProperty(value = "properties.dataCollectionEndpointId") + private String dataCollectionEndpointId; + + /* + * The resource provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private KnownDataCollectionRuleAssociationProvisioningState provisioningState; + + /** + * Get the etag property: Resource entity tag (ETag). + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the description property: Description of the association. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the association. + * + * @param description the description value to set. + * @return the DataCollectionRuleAssociationProxyOnlyResourceInner object itself. + */ + public DataCollectionRuleAssociationProxyOnlyResourceInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the dataCollectionRuleId property: The resource ID of the data collection rule that is to be associated. + * + * @return the dataCollectionRuleId value. + */ + public String dataCollectionRuleId() { + return this.dataCollectionRuleId; + } + + /** + * Set the dataCollectionRuleId property: The resource ID of the data collection rule that is to be associated. + * + * @param dataCollectionRuleId the dataCollectionRuleId value to set. + * @return the DataCollectionRuleAssociationProxyOnlyResourceInner object itself. + */ + public DataCollectionRuleAssociationProxyOnlyResourceInner withDataCollectionRuleId(String dataCollectionRuleId) { + this.dataCollectionRuleId = dataCollectionRuleId; + return this; + } + + /** + * Get the dataCollectionEndpointId property: The resource ID of the data collection endpoint that is to be + * associated. + * + * @return the dataCollectionEndpointId value. + */ + public String dataCollectionEndpointId() { + return this.dataCollectionEndpointId; + } + + /** + * Set the dataCollectionEndpointId property: The resource ID of the data collection endpoint that is to be + * associated. + * + * @param dataCollectionEndpointId the dataCollectionEndpointId value to set. + * @return the DataCollectionRuleAssociationProxyOnlyResourceInner object itself. + */ + public DataCollectionRuleAssociationProxyOnlyResourceInner withDataCollectionEndpointId( + String dataCollectionEndpointId) { + this.dataCollectionEndpointId = dataCollectionEndpointId; + return this; + } + + /** + * Get the provisioningState property: The resource provisioning state. + * + * @return the provisioningState value. + */ + public KnownDataCollectionRuleAssociationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java new file mode 100644 index 000000000000..8dc38767cbf8 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/DataCollectionRuleResourceInner.java @@ -0,0 +1,253 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleDataSources; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleDestinations; +import com.azure.resourcemanager.monitor.models.DataFlow; +import com.azure.resourcemanager.monitor.models.KnownDataCollectionRuleProvisioningState; +import com.azure.resourcemanager.monitor.models.KnownDataCollectionRuleResourceKind; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Definition of ARM tracked top level resource. */ +@JsonFlatten +@Fluent +public class DataCollectionRuleResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleResourceInner.class); + + /* + * The kind of the resource. + */ + @JsonProperty(value = "kind") + private KnownDataCollectionRuleResourceKind kind; + + /* + * Resource entity tag (ETag). + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Description of the data collection rule. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The immutable ID of this data collection rule. This property is + * READ-ONLY. + */ + @JsonProperty(value = "properties.immutableId", access = JsonProperty.Access.WRITE_ONLY) + private String immutableId; + + /* + * The specification of data sources. + * This property is optional and can be omitted if the rule is meant to be + * used via direct calls to the provisioned endpoint. + */ + @JsonProperty(value = "properties.dataSources") + private DataCollectionRuleDataSources dataSources; + + /* + * The specification of destinations. + */ + @JsonProperty(value = "properties.destinations") + private DataCollectionRuleDestinations destinations; + + /* + * The specification of data flows. + */ + @JsonProperty(value = "properties.dataFlows") + private List dataFlows; + + /* + * The resource provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private KnownDataCollectionRuleProvisioningState provisioningState; + + /** + * Get the kind property: The kind of the resource. + * + * @return the kind value. + */ + public KnownDataCollectionRuleResourceKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the resource. + * + * @param kind the kind value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner withKind(KnownDataCollectionRuleResourceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the etag property: Resource entity tag (ETag). + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the description property: Description of the data collection rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the data collection rule. + * + * @param description the description value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the immutableId property: The immutable ID of this data collection rule. This property is READ-ONLY. + * + * @return the immutableId value. + */ + public String immutableId() { + return this.immutableId; + } + + /** + * Get the dataSources property: The specification of data sources. This property is optional and can be omitted if + * the rule is meant to be used via direct calls to the provisioned endpoint. + * + * @return the dataSources value. + */ + public DataCollectionRuleDataSources dataSources() { + return this.dataSources; + } + + /** + * Set the dataSources property: The specification of data sources. This property is optional and can be omitted if + * the rule is meant to be used via direct calls to the provisioned endpoint. + * + * @param dataSources the dataSources value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner withDataSources(DataCollectionRuleDataSources dataSources) { + this.dataSources = dataSources; + return this; + } + + /** + * Get the destinations property: The specification of destinations. + * + * @return the destinations value. + */ + public DataCollectionRuleDestinations destinations() { + return this.destinations; + } + + /** + * Set the destinations property: The specification of destinations. + * + * @param destinations the destinations value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner withDestinations(DataCollectionRuleDestinations destinations) { + this.destinations = destinations; + return this; + } + + /** + * Get the dataFlows property: The specification of data flows. + * + * @return the dataFlows value. + */ + public List dataFlows() { + return this.dataFlows; + } + + /** + * Set the dataFlows property: The specification of data flows. + * + * @param dataFlows the dataFlows value to set. + * @return the DataCollectionRuleResourceInner object itself. + */ + public DataCollectionRuleResourceInner withDataFlows(List dataFlows) { + this.dataFlows = dataFlows; + return this; + } + + /** + * Get the provisioningState property: The resource provisioning state. + * + * @return the provisioningState value. + */ + public KnownDataCollectionRuleProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataSources() != null) { + dataSources().validate(); + } + if (destinations() != null) { + destinations().validate(); + } + if (dataFlows() != null) { + dataFlows().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java index 76c94e18aa81..e7c595733606 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogProfileResourceInner.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; /** The log profile resource. */ @JsonFlatten @@ -167,6 +168,20 @@ public LogProfileResourceInner withRetentionPolicy(RetentionPolicy retentionPoli return this; } + /** {@inheritDoc} */ + @Override + public LogProfileResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LogProfileResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogSearchRuleResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogSearchRuleResourceInner.java index a33f3af23b62..2c0926ef4a15 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogSearchRuleResourceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/LogSearchRuleResourceInner.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.Map; /** The Log Search Rule resource. */ @JsonFlatten @@ -23,12 +24,37 @@ public class LogSearchRuleResourceInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSearchRuleResourceInner.class); + /* + * The api-version used when creating this alert rule + */ + @JsonProperty(value = "properties.createdWithApiVersion", access = JsonProperty.Access.WRITE_ONLY) + private String createdWithApiVersion; + + /* + * True if alert rule is legacy Log Analytic rule + */ + @JsonProperty(value = "properties.isLegacyLogAnalyticsRule", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isLegacyLogAnalyticsRule; + /* * The description of the Log Search rule. */ @JsonProperty(value = "properties.description") private String description; + /* + * The display name of the alert rule + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * The flag that indicates whether the alert should be automatically + * resolved or not. The default is false. + */ + @JsonProperty(value = "properties.autoMitigate") + private Boolean autoMitigate; + /* * The flag which indicates whether the Log Search rule is enabled. Value * should be true or false @@ -67,6 +93,44 @@ public class LogSearchRuleResourceInner extends Resource { @JsonProperty(value = "properties.action", required = true) private Action action; + /* + * Metadata used by portal/tooling/etc to render different UX experiences + * for resources of the same type; e.g. ApiApps are a kind of + * Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * The etag field is *not* required. If it is provided in the response + * body, it must also be provided as a header per the normal etag + * convention. Entity tags are used for comparing two or more entities + * from the same requested resource. HTTP/1.1 uses entity tags in the etag + * (section 14.19), If-Match (section 14.24), If-None-Match (section + * 14.26), and If-Range (section 14.27) header fields. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the createdWithApiVersion property: The api-version used when creating this alert rule. + * + * @return the createdWithApiVersion value. + */ + public String createdWithApiVersion() { + return this.createdWithApiVersion; + } + + /** + * Get the isLegacyLogAnalyticsRule property: True if alert rule is legacy Log Analytic rule. + * + * @return the isLegacyLogAnalyticsRule value. + */ + public Boolean isLegacyLogAnalyticsRule() { + return this.isLegacyLogAnalyticsRule; + } + /** * Get the description property: The description of the Log Search rule. * @@ -87,6 +151,48 @@ public LogSearchRuleResourceInner withDescription(String description) { return this; } + /** + * Get the displayName property: The display name of the alert rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the alert rule. + * + * @param displayName the displayName value to set. + * @return the LogSearchRuleResourceInner object itself. + */ + public LogSearchRuleResourceInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not. + * The default is false. + * + * @return the autoMitigate value. + */ + public Boolean autoMitigate() { + return this.autoMitigate; + } + + /** + * Set the autoMitigate property: The flag that indicates whether the alert should be automatically resolved or not. + * The default is false. + * + * @param autoMitigate the autoMitigate value to set. + * @return the LogSearchRuleResourceInner object itself. + */ + public LogSearchRuleResourceInner withAutoMitigate(Boolean autoMitigate) { + this.autoMitigate = autoMitigate; + return this; + } + /** * Get the enabled property: The flag which indicates whether the Log Search rule is enabled. Value should be true * or false. @@ -187,6 +293,43 @@ public LogSearchRuleResourceInner withAction(Action action) { return this; } + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be + * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from + * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), + * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** {@inheritDoc} */ + @Override + public LogSearchRuleResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LogSearchRuleResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java index 76aaa7380455..a1a560378756 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricAlertResourceInner.java @@ -15,6 +15,7 @@ import java.time.Duration; import java.time.OffsetDateTime; import java.util.List; +import java.util.Map; /** The metric alert resource. */ @JsonFlatten @@ -26,7 +27,7 @@ public class MetricAlertResourceInner extends Resource { * the description of the metric alert that will be included in the alert * email. */ - @JsonProperty(value = "properties.description", required = true) + @JsonProperty(value = "properties.description") private String description; /* @@ -44,7 +45,7 @@ public class MetricAlertResourceInner extends Resource { /* * the list of resource id's that this metric alert is scoped to. */ - @JsonProperty(value = "properties.scopes") + @JsonProperty(value = "properties.scopes", required = true) private List scopes; /* @@ -63,14 +64,16 @@ public class MetricAlertResourceInner extends Resource { /* * the resource type of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + * created/updated. Mandatory if the scope contains a subscription, + * resource group, or more than one resource. */ @JsonProperty(value = "properties.targetResourceType") private String targetResourceType; /* * the region of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + * created/updated. Mandatory if the scope contains a subscription, + * resource group, or more than one resource. */ @JsonProperty(value = "properties.targetResourceRegion") private String targetResourceRegion; @@ -101,6 +104,12 @@ public class MetricAlertResourceInner extends Resource { @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastUpdatedTime; + /* + * the value indicating whether this alert rule is migrated. + */ + @JsonProperty(value = "properties.isMigrated", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isMigrated; + /** * Get the description property: the description of the metric alert that will be included in the alert email. * @@ -227,7 +236,7 @@ public MetricAlertResourceInner withWindowSize(Duration windowSize) { /** * Get the targetResourceType property: the resource type of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @return the targetResourceType value. */ @@ -237,7 +246,7 @@ public String targetResourceType() { /** * Set the targetResourceType property: the resource type of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @param targetResourceType the targetResourceType value to set. * @return the MetricAlertResourceInner object itself. @@ -249,7 +258,7 @@ public MetricAlertResourceInner withTargetResourceType(String targetResourceType /** * Get the targetResourceRegion property: the region of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @return the targetResourceRegion value. */ @@ -259,7 +268,7 @@ public String targetResourceRegion() { /** * Set the targetResourceRegion property: the region of the target resource(s) on which the alert is - * created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + * created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. * * @param targetResourceRegion the targetResourceRegion value to set. * @return the MetricAlertResourceInner object itself. @@ -342,17 +351,39 @@ public OffsetDateTime lastUpdatedTime() { return this.lastUpdatedTime; } + /** + * Get the isMigrated property: the value indicating whether this alert rule is migrated. + * + * @return the isMigrated value. + */ + public Boolean isMigrated() { + return this.isMigrated; + } + + /** {@inheritDoc} */ + @Override + public MetricAlertResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MetricAlertResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (description() == null) { + if (scopes() == null) { throw logger .logExceptionAsError( - new IllegalArgumentException( - "Missing required property description in model MetricAlertResourceInner")); + new IllegalArgumentException("Missing required property scopes in model MetricAlertResourceInner")); } if (evaluationFrequency() == null) { throw logger diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java index f37ed9faa0d1..0596eeaf38a0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricDefinitionInner.java @@ -8,6 +8,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.monitor.models.AggregationType; import com.azure.resourcemanager.monitor.models.MetricAvailability; +import com.azure.resourcemanager.monitor.models.MetricClass; import com.azure.resourcemanager.monitor.models.Unit; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -44,7 +45,25 @@ public final class MetricDefinitionInner { private LocalizableStringInner name; /* - * the unit of the metric. + * Detailed description of this metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Custom category name for this metric. + */ + @JsonProperty(value = "category") + private String category; + + /* + * The class of the metric. + */ + @JsonProperty(value = "metricClass") + private MetricClass metricClass; + + /* + * The unit of the metric. */ @JsonProperty(value = "unit") private Unit unit; @@ -163,7 +182,67 @@ public MetricDefinitionInner withName(LocalizableStringInner name) { } /** - * Get the unit property: the unit of the metric. + * 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 MetricDefinitionInner object itself. + */ + public MetricDefinitionInner 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 MetricDefinitionInner object itself. + */ + public MetricDefinitionInner 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 MetricDefinitionInner object itself. + */ + public MetricDefinitionInner withMetricClass(MetricClass metricClass) { + this.metricClass = metricClass; + return this; + } + + /** + * Get the unit property: The unit of the metric. * * @return the unit value. */ @@ -172,7 +251,7 @@ public Unit unit() { } /** - * Set the unit property: the unit of the metric. + * Set the unit property: The unit of the metric. * * @param unit the unit value to set. * @return the MetricDefinitionInner object itself. diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricInner.java index d61727884b51..f8ff04917707 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricInner.java @@ -37,7 +37,25 @@ public final class MetricInner { private LocalizableStringInner name; /* - * the unit of the metric. + * Detailed description of this metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * 'Success' or the error details on query failures for this metric. + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Error message encountered querying this specific metric. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * The unit of the metric. */ @JsonProperty(value = "unit", required = true) private Unit unit; @@ -109,7 +127,67 @@ public MetricInner withName(LocalizableStringInner name) { } /** - * Get the unit property: the unit of the metric. + * 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 MetricInner object itself. + */ + public MetricInner 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 MetricInner object itself. + */ + public MetricInner 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 MetricInner object itself. + */ + public MetricInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the unit property: The unit of the metric. * * @return the unit value. */ @@ -118,7 +196,7 @@ public Unit unit() { } /** - * Set the unit property: the unit of the metric. + * Set the unit property: The unit of the metric. * * @param unit the unit value to set. * @return the MetricInner object itself. diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricNamespaceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricNamespaceInner.java index f9234766118a..735d834692bc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricNamespaceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/MetricNamespaceInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.monitor.models.MetricNamespaceName; +import com.azure.resourcemanager.monitor.models.NamespaceClassification; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,7 +17,7 @@ public final class MetricNamespaceInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricNamespaceInner.class); /* - * The ID of the metricNamespace. + * The ID of the metric namespace. */ @JsonProperty(value = "id") private String id; @@ -28,11 +29,17 @@ public final class MetricNamespaceInner { private String type; /* - * The name of the namespace. + * The escaped name of the namespace. */ @JsonProperty(value = "name") private String name; + /* + * Kind of namespace + */ + @JsonProperty(value = "classification") + private NamespaceClassification classification; + /* * Properties which include the fully qualified namespace name. */ @@ -40,7 +47,7 @@ public final class MetricNamespaceInner { private MetricNamespaceName properties; /** - * Get the id property: The ID of the metricNamespace. + * Get the id property: The ID of the metric namespace. * * @return the id value. */ @@ -49,7 +56,7 @@ public String id() { } /** - * Set the id property: The ID of the metricNamespace. + * Set the id property: The ID of the metric namespace. * * @param id the id value to set. * @return the MetricNamespaceInner object itself. @@ -80,7 +87,7 @@ public MetricNamespaceInner withType(String type) { } /** - * Get the name property: The name of the namespace. + * Get the name property: The escaped name of the namespace. * * @return the name value. */ @@ -89,7 +96,7 @@ public String name() { } /** - * Set the name property: The name of the namespace. + * Set the name property: The escaped name of the namespace. * * @param name the name value to set. * @return the MetricNamespaceInner object itself. @@ -99,6 +106,26 @@ public MetricNamespaceInner withName(String name) { return this; } + /** + * Get the classification property: Kind of namespace. + * + * @return the classification value. + */ + public NamespaceClassification classification() { + return this.classification; + } + + /** + * Set the classification property: Kind of namespace. + * + * @param classification the classification value to set. + * @return the MetricNamespaceInner object itself. + */ + public MetricNamespaceInner withClassification(NamespaceClassification classification) { + this.classification = classification; + return this; + } + /** * Get the properties property: Properties which include the fully qualified namespace name. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/OperationStatusInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/OperationStatusInner.java new file mode 100644 index 000000000000..eac05cd876ad --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/OperationStatusInner.java @@ -0,0 +1,185 @@ +// 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.resourcemanager.monitor.models.ErrorResponseCommon; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The status of operation. */ +@Fluent +public final class OperationStatusInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusInner.class); + + /* + * The operation Id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The operation name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Start time of the job in standard ISO8601 format. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * End time of the job in standard ISO8601 format. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The status of the operation. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The error detail of the operation if any. + */ + @JsonProperty(value = "error") + private ErrorResponseCommon error; + + /** + * Get the id property: The operation Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The operation Id. + * + * @param id the id value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The operation name. + * + * @param name the name value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the startTime property: Start time of the job in standard ISO8601 format. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of the job in standard ISO8601 format. + * + * @param startTime the startTime value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: End time of the job in standard ISO8601 format. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: End time of the job in standard ISO8601 format. + * + * @param endTime the endTime value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the status property: The status of the operation. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status of the operation. + * + * @param status the status value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the error property: The error detail of the operation if any. + * + * @return the error value. + */ + public ErrorResponseCommon error() { + return this.error; + } + + /** + * Set the error property: The error detail of the operation if any. + * + * @param error the error value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withError(ErrorResponseCommon error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateEndpointConnectionInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..94aafa027f44 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,103 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.models.PrivateEndpointProperty; +import com.azure.resourcemanager.monitor.models.PrivateLinkServiceConnectionStateProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private endpoint connection. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * Private endpoint which the connection belongs to. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpointProperty privateEndpoint; + + /* + * Connection state of the private endpoint connection. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState; + + /* + * State of the private endpoint connection. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the privateEndpoint property: Private endpoint which the connection belongs to. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointProperty privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: Private endpoint which the connection belongs to. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpointProperty privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: State of the private endpoint connection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateLinkResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..7a03e40e64ed --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/PrivateLinkResourceInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@JsonFlatten +@Immutable +public class PrivateLinkResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ResponseInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ResponseInner.java index 5c46acba613a..1bc3b7149555 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ResponseInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ResponseInner.java @@ -17,7 +17,7 @@ public final class ResponseInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseInner.class); /* - * The integer value representing the cost of the query, for data case. + * The integer value representing the relative cost of the query. */ @JsonProperty(value = "cost") private Integer cost; @@ -40,13 +40,13 @@ public final class ResponseInner { private Duration interval; /* - * The namespace of the metrics been queried + * The namespace of the metrics being queried */ @JsonProperty(value = "namespace") private String namespace; /* - * The region of the resource been queried for metrics. + * The region of the resource being queried for metrics. */ @JsonProperty(value = "resourceregion") private String resourceRegion; @@ -58,7 +58,7 @@ public final class ResponseInner { private List value; /** - * Get the cost property: The integer value representing the cost of the query, for data case. + * Get the cost property: The integer value representing the relative cost of the query. * * @return the cost value. */ @@ -67,7 +67,7 @@ public Integer cost() { } /** - * Set the cost property: The integer value representing the cost of the query, for data case. + * Set the cost property: The integer value representing the relative cost of the query. * * @param cost the cost value to set. * @return the ResponseInner object itself. @@ -126,7 +126,7 @@ public ResponseInner withInterval(Duration interval) { } /** - * Get the namespace property: The namespace of the metrics been queried. + * Get the namespace property: The namespace of the metrics being queried. * * @return the namespace value. */ @@ -135,7 +135,7 @@ public String namespace() { } /** - * Set the namespace property: The namespace of the metrics been queried. + * Set the namespace property: The namespace of the metrics being queried. * * @param namespace the namespace value to set. * @return the ResponseInner object itself. @@ -146,7 +146,7 @@ public ResponseInner withNamespace(String namespace) { } /** - * Get the resourceRegion property: The region of the resource been queried for metrics. + * Get the resourceRegion property: The region of the resource being queried for metrics. * * @return the resourceRegion value. */ @@ -155,7 +155,7 @@ public String resourceRegion() { } /** - * Set the resourceRegion property: The region of the resource been queried for metrics. + * Set the resourceRegion property: The region of the resource being queried for metrics. * * @param resourceRegion the resourceRegion value to set. * @return the ResponseInner object itself. diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java new file mode 100644 index 000000000000..f161336eed45 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/models/ScopedResourceInner.java @@ -0,0 +1,68 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private link scoped resource. */ +@JsonFlatten +@Fluent +public class ScopedResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopedResourceInner.class); + + /* + * The resource id of the scoped Azure monitor resource. + */ + @JsonProperty(value = "properties.linkedResourceId") + private String linkedResourceId; + + /* + * State of the private endpoint connection. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the linkedResourceId property: The resource id of the scoped Azure monitor resource. + * + * @return the linkedResourceId value. + */ + public String linkedResourceId() { + return this.linkedResourceId; + } + + /** + * Set the linkedResourceId property: The resource id of the scoped Azure monitor resource. + * + * @param linkedResourceId the linkedResourceId value to set. + * @return the ScopedResourceInner object itself. + */ + public ScopedResourceInner withLinkedResourceId(String linkedResourceId) { + this.linkedResourceId = linkedResourceId; + return this; + } + + /** + * Get the provisioningState property: State of the private endpoint connection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java index f68881bdd898..781c7b9bf292 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -72,7 +73,7 @@ public final class ActionGroupsClientImpl @Host("{$host}") @ServiceInterface(name = "MonitorClientActionG") private interface ActionGroupsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/actionGroups/{actionGroupName}") @@ -85,9 +86,10 @@ Mono> createOrUpdate( @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ActionGroupResourceInner actionGroup, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/actionGroups/{actionGroupName}") @@ -99,9 +101,10 @@ Mono> getByResourceGroup( @PathParam("actionGroupName") String actionGroupName, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/actionGroups/{actionGroupName}") @@ -113,9 +116,10 @@ Mono> delete( @PathParam("actionGroupName") String actionGroupName, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/actionGroups/{actionGroupName}") @@ -128,9 +132,10 @@ Mono> update( @PathParam("actionGroupName") String actionGroupName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ActionGroupPatchBody actionGroupPatch, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/actionGroups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -138,9 +143,10 @@ Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/actionGroups") @@ -151,9 +157,10 @@ Mono> listByResourceGroup( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/actionGroups/{actionGroupName}/subscribe") @@ -166,6 +173,7 @@ Mono> enableReceiver( @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") EnableRequest enableRequest, + @HeaderParam("Accept") String accept, Context context); } @@ -174,7 +182,7 @@ Mono> enableReceiver( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroup An action group resource. + * @param actionGroup The action group to create or use for the update. * @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. @@ -209,6 +217,7 @@ public Mono> createOrUpdateWithResponseAsync( actionGroup.validate(); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -220,8 +229,9 @@ public Mono> createOrUpdateWithResponseAsync( this.client.getSubscriptionId(), apiVersion, actionGroup, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -229,7 +239,7 @@ public Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroup An action group resource. + * @param actionGroup The action group to create or use for the update. * @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. @@ -265,6 +275,7 @@ private Mono> createOrUpdateWithResponseAsync actionGroup.validate(); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( @@ -274,6 +285,7 @@ private Mono> createOrUpdateWithResponseAsync this.client.getSubscriptionId(), apiVersion, actionGroup, + accept, context); } @@ -282,7 +294,7 @@ private Mono> createOrUpdateWithResponseAsync * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroup An action group resource. + * @param actionGroup The action group to create or use for the update. * @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. @@ -307,7 +319,7 @@ public Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroup An action group resource. + * @param actionGroup The action group to create or use for the update. * @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. @@ -324,7 +336,7 @@ public ActionGroupResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroup An action group resource. + * @param actionGroup The action group to create or use for the update. * @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. @@ -371,6 +383,7 @@ public Mono> getByResourceGroupWithResponseAs "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -381,8 +394,9 @@ public Mono> getByResourceGroupWithResponseAs actionGroupName, this.client.getSubscriptionId(), apiVersion, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -420,6 +434,7 @@ private Mono> getByResourceGroupWithResponseA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( @@ -428,6 +443,7 @@ private Mono> getByResourceGroupWithResponseA actionGroupName, this.client.getSubscriptionId(), apiVersion, + accept, context); } @@ -519,6 +535,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -529,8 +546,9 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St actionGroupName, this.client.getSubscriptionId(), apiVersion, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -568,6 +586,7 @@ private Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( @@ -576,6 +595,7 @@ private Mono> deleteWithResponseAsync( actionGroupName, this.client.getSubscriptionId(), apiVersion, + accept, context); } @@ -630,7 +650,7 @@ public Response deleteWithResponse(String resourceGroupName, String action * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroupPatch An action group object for the body of patch operations. + * @param actionGroupPatch Parameters supplied to the 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. @@ -666,6 +686,7 @@ public Mono> updateWithResponseAsync( actionGroupPatch.validate(); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -677,8 +698,9 @@ public Mono> updateWithResponseAsync( actionGroupName, apiVersion, actionGroupPatch, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -686,7 +708,7 @@ public Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroupPatch An action group object for the body of patch operations. + * @param actionGroupPatch Parameters supplied to the operation. * @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. @@ -723,6 +745,7 @@ private Mono> updateWithResponseAsync( actionGroupPatch.validate(); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( @@ -732,6 +755,7 @@ private Mono> updateWithResponseAsync( actionGroupName, apiVersion, actionGroupPatch, + accept, context); } @@ -740,7 +764,7 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroupPatch An action group object for the body of patch operations. + * @param actionGroupPatch Parameters supplied to the 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. @@ -765,7 +789,7 @@ public Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroupPatch An action group object for the body of patch operations. + * @param actionGroupPatch Parameters supplied to the 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. @@ -782,7 +806,7 @@ public ActionGroupResourceInner update( * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. - * @param actionGroupPatch An action group object for the body of patch operations. + * @param actionGroupPatch Parameters supplied to the operation. * @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. @@ -817,15 +841,17 @@ private Mono> listSinglePageAsync() { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> - service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context)) + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -852,9 +878,10 @@ private Mono> listSinglePageAsync(Contex "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( @@ -941,6 +968,7 @@ private Mono> listByResourceGroupSingleP "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -950,12 +978,13 @@ private Mono> listByResourceGroupSingleP resourceGroupName, this.client.getSubscriptionId(), apiVersion, + accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -988,10 +1017,16 @@ private Mono> listByResourceGroupSingleP "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( - this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), apiVersion, context) + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -1095,6 +1130,7 @@ public Mono> enableReceiverWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter receiverName is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; EnableRequest enableRequest = new EnableRequest(); enableRequest.withReceiverName(receiverName); return FluxUtil @@ -1108,8 +1144,9 @@ public Mono> enableReceiverWithResponseAsync( this.client.getSubscriptionId(), apiVersion, enableRequest, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1152,6 +1189,7 @@ private Mono> enableReceiverWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter receiverName is required and cannot be null.")); } final String apiVersion = "2019-06-01"; + final String accept = "application/json"; EnableRequest enableRequest = new EnableRequest(); enableRequest.withReceiverName(receiverName); context = this.client.mergeContext(context); @@ -1163,6 +1201,7 @@ private Mono> enableReceiverWithResponseAsync( this.client.getSubscriptionId(), apiVersion, enableRequest, + accept, context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsClientImpl.java index bf2bebecf3bf..7503c1e42d20 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogAlertsClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -70,7 +71,7 @@ public final class ActivityLogAlertsClientImpl @Host("{$host}") @ServiceInterface(name = "MonitorClientActivit") private interface ActivityLogAlertsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/activityLogAlerts/{activityLogAlertName}") @@ -83,9 +84,10 @@ Mono> createOrUpdate( @PathParam("activityLogAlertName") String activityLogAlertName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ActivityLogAlertResourceInner activityLogAlert, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/activityLogAlerts/{activityLogAlertName}") @@ -97,9 +99,10 @@ Mono> getByResourceGroup( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("activityLogAlertName") String activityLogAlertName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/activityLogAlerts/{activityLogAlertName}") @@ -111,9 +114,10 @@ Mono> delete( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("activityLogAlertName") String activityLogAlertName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/activityLogAlerts/{activityLogAlertName}") @@ -126,9 +130,10 @@ Mono> update( @PathParam("activityLogAlertName") String activityLogAlertName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ActivityLogAlertPatchBody activityLogAlertPatch, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -136,9 +141,10 @@ Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + "/activityLogAlerts") @@ -149,6 +155,7 @@ Mono> listByResourceGroup( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } @@ -157,7 +164,7 @@ Mono> listByResourceGroup( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert An activity log alert resource. + * @param activityLogAlert The activity log alert to create or use for the update. * @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. @@ -193,6 +200,7 @@ public Mono> createOrUpdateWithResponseA activityLogAlert.validate(); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -204,8 +212,9 @@ public Mono> createOrUpdateWithResponseA activityLogAlertName, apiVersion, activityLogAlert, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -213,7 +222,7 @@ public Mono> createOrUpdateWithResponseA * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert An activity log alert resource. + * @param activityLogAlert The activity log alert to create or use for the update. * @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. @@ -253,6 +262,7 @@ private Mono> createOrUpdateWithResponse activityLogAlert.validate(); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( @@ -262,6 +272,7 @@ private Mono> createOrUpdateWithResponse activityLogAlertName, apiVersion, activityLogAlert, + accept, context); } @@ -270,7 +281,7 @@ private Mono> createOrUpdateWithResponse * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert An activity log alert resource. + * @param activityLogAlert The activity log alert to create or use for the update. * @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. @@ -295,7 +306,7 @@ public Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert An activity log alert resource. + * @param activityLogAlert The activity log alert to create or use for the update. * @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. @@ -312,7 +323,7 @@ public ActivityLogAlertResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlert An activity log alert resource. + * @param activityLogAlert The activity log alert to create or use for the update. * @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. @@ -363,6 +374,7 @@ public Mono> getByResourceGroupWithRespo .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -373,8 +385,9 @@ public Mono> getByResourceGroupWithRespo resourceGroupName, activityLogAlertName, apiVersion, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -412,6 +425,7 @@ private Mono> getByResourceGroupWithResp .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( @@ -420,6 +434,7 @@ private Mono> getByResourceGroupWithResp resourceGroupName, activityLogAlertName, apiVersion, + accept, context); } @@ -512,6 +527,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -522,8 +538,9 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St resourceGroupName, activityLogAlertName, apiVersion, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -561,6 +578,7 @@ private Mono> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter activityLogAlertName is required and cannot be null.")); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( @@ -569,6 +587,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, activityLogAlertName, apiVersion, + accept, context); } @@ -623,7 +642,7 @@ public Response deleteWithResponse(String resourceGroupName, String activi * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch An activity log alert object for the body of patch operations. + * @param activityLogAlertPatch Parameters supplied to the 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. @@ -659,6 +678,7 @@ public Mono> updateWithResponseAsync( activityLogAlertPatch.validate(); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -670,8 +690,9 @@ public Mono> updateWithResponseAsync( activityLogAlertName, apiVersion, activityLogAlertPatch, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -679,7 +700,7 @@ public Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch An activity log alert object for the body of patch operations. + * @param activityLogAlertPatch Parameters supplied to the operation. * @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. @@ -719,6 +740,7 @@ private Mono> updateWithResponseAsync( activityLogAlertPatch.validate(); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( @@ -728,6 +750,7 @@ private Mono> updateWithResponseAsync( activityLogAlertName, apiVersion, activityLogAlertPatch, + accept, context); } @@ -736,7 +759,7 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch An activity log alert object for the body of patch operations. + * @param activityLogAlertPatch Parameters supplied to the 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. @@ -761,7 +784,7 @@ public Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch An activity log alert object for the body of patch operations. + * @param activityLogAlertPatch Parameters supplied to the 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. @@ -778,7 +801,7 @@ public ActivityLogAlertResourceInner update( * * @param resourceGroupName The name of the resource group. * @param activityLogAlertName The name of the activity log alert. - * @param activityLogAlertPatch An activity log alert object for the body of patch operations. + * @param activityLogAlertPatch Parameters supplied to the operation. * @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. @@ -816,15 +839,17 @@ private Mono> listSinglePageAsync() "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> - service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context)) + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -851,9 +876,10 @@ private Mono> listSinglePageAsync(C "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( @@ -941,6 +967,7 @@ private Mono> listByResourceGroupSi .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -950,12 +977,13 @@ private Mono> listByResourceGroupSi this.client.getSubscriptionId(), resourceGroupName, apiVersion, + accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -988,10 +1016,16 @@ private Mono> listByResourceGroupSi .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2017-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( - this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java index 87500cfc6239..03f6c5d49f49 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActivityLogsClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -58,8 +59,8 @@ public final class ActivityLogsClientImpl implements ActivityLogsClient { @Host("{$host}") @ServiceInterface(name = "MonitorClientActivit") private interface ActivityLogsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/eventtypes/management/values") + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/eventtypes/management/values") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -68,14 +69,18 @@ Mono> list( @QueryParam("$filter") String filter, @QueryParam("$select") String select, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -122,6 +127,7 @@ private Mono> listSinglePageAsync(String filter, S "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -132,6 +138,7 @@ private Mono> listSinglePageAsync(String filter, S filter, select, this.client.getSubscriptionId(), + accept, context)) .>map( res -> @@ -142,7 +149,7 @@ private Mono> listSinglePageAsync(String filter, S res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -190,9 +197,11 @@ private Mono> listSinglePageAsync(String filter, S "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, filter, select, this.client.getSubscriptionId(), context) + .list( + this.client.getEndpoint(), apiVersion, filter, select, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( @@ -313,20 +322,15 @@ private PagedFlux listAsync(String filter, String select, Contex * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other * syntax is allowed. - * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma - * separated list of property names to be returned. Possible values are: *authorization*, *claims*, - * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, - * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, - * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. - * @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 events. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String select, Context context) { - return new PagedIterable<>(listAsync(filter, select, context)); + public PagedIterable list(String filter) { + final String select = null; + return new PagedIterable<>(listAsync(filter, select)); } /** @@ -345,15 +349,20 @@ public PagedIterable list(String filter, String select, Context * correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le * '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other * syntax is allowed. + * @param select Used to fetch events with only the given properties.<br>The **$select** argument is a comma + * separated list of property names to be returned. Possible values are: *authorization*, *claims*, + * *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, + * *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, + * *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. + * @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 events. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter) { - final String select = null; - return new PagedIterable<>(listAsync(filter, select)); + public PagedIterable list(String filter, String select, Context context) { + return new PagedIterable<>(listAsync(filter, select, context)); } /** @@ -370,8 +379,15 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, context)) + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -381,7 +397,7 @@ private Mono> listNextSinglePageAsync(String nextL res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -399,9 +415,16 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, context) + .listNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java index 2fa0fe22b7da..1389f7a1242a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRuleIncidentsClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -58,7 +59,7 @@ public final class AlertRuleIncidentsClientImpl implements AlertRuleIncidentsCli @Host("{$host}") @ServiceInterface(name = "MonitorClientAlertRu") private interface AlertRuleIncidentsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules" + "/{ruleName}/incidents/{incidentName}") @@ -71,9 +72,10 @@ Mono> get( @PathParam("incidentName") String incidentName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules" + "/{ruleName}/incidents") @@ -85,6 +87,7 @@ Mono> listByAlertRule( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } @@ -125,6 +128,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -136,8 +140,9 @@ public Mono> getWithResponseAsync( incidentName, apiVersion, this.client.getSubscriptionId(), + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -178,6 +183,7 @@ private Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( @@ -187,6 +193,7 @@ private Mono> getWithResponseAsync( incidentName, apiVersion, this.client.getSubscriptionId(), + accept, context); } @@ -281,6 +288,7 @@ private Mono> listByAlertRuleSinglePageAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -291,12 +299,13 @@ private Mono> listByAlertRuleSinglePageAsync( ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -333,6 +342,7 @@ private Mono> listByAlertRuleSinglePageAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByAlertRule( @@ -341,6 +351,7 @@ private Mono> listByAlertRuleSinglePageAsync( ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context) .map( res -> diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java index 8c8952d7ef61..c2c3c20b9040 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AlertRulesClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -70,9 +71,9 @@ public final class AlertRulesClientImpl @Host("{$host}") @ServiceInterface(name = "MonitorClientAlertRu") private interface AlertRulesService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules" + "/{ruleName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -83,11 +84,12 @@ Mono> createOrUpdate( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") AlertRuleResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules" + "/{ruleName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -97,11 +99,12 @@ Mono> delete( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules" + "/{ruleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -111,11 +114,12 @@ Mono> getByResourceGroup( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules" + "/{ruleName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -126,11 +130,12 @@ Mono> update( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AlertRuleResourcePatch alertRulesResource, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/alertrules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -139,16 +144,18 @@ Mono> listByResourceGroup( @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules") + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } @@ -157,7 +164,7 @@ Mono> list( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The alert rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -191,6 +198,7 @@ public Mono> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -202,8 +210,9 @@ public Mono> createOrUpdateWithResponseAsync( apiVersion, this.client.getSubscriptionId(), parameters, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -211,7 +220,7 @@ public Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The alert rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -246,6 +255,7 @@ private Mono> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( @@ -255,6 +265,7 @@ private Mono> createOrUpdateWithResponseAsync( apiVersion, this.client.getSubscriptionId(), parameters, + accept, context); } @@ -263,7 +274,7 @@ private Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The alert rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -288,7 +299,7 @@ public Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The alert rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -305,7 +316,7 @@ public AlertRuleResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The alert rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -350,6 +361,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -360,8 +372,9 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -397,6 +410,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( @@ -405,6 +419,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context); } @@ -486,6 +501,7 @@ public Mono> getByResourceGroupWithResponseAsyn "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -496,8 +512,9 @@ public Mono> getByResourceGroupWithResponseAsyn ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -534,6 +551,7 @@ private Mono> getByResourceGroupWithResponseAsy "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( @@ -542,6 +560,7 @@ private Mono> getByResourceGroupWithResponseAsy ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context); } @@ -605,7 +624,7 @@ public Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param alertRulesResource The alert rule object for patch operations. + * @param alertRulesResource Parameters supplied to the 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. @@ -640,6 +659,7 @@ public Mono> updateWithResponseAsync( alertRulesResource.validate(); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -651,8 +671,9 @@ public Mono> updateWithResponseAsync( ruleName, apiVersion, alertRulesResource, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -660,7 +681,7 @@ public Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param alertRulesResource The alert rule object for patch operations. + * @param alertRulesResource Parameters supplied to the operation. * @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. @@ -696,6 +717,7 @@ private Mono> updateWithResponseAsync( alertRulesResource.validate(); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( @@ -705,6 +727,7 @@ private Mono> updateWithResponseAsync( ruleName, apiVersion, alertRulesResource, + accept, context); } @@ -713,7 +736,7 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param alertRulesResource The alert rule object for patch operations. + * @param alertRulesResource Parameters supplied to the 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. @@ -738,7 +761,7 @@ public Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param alertRulesResource The alert rule object for patch operations. + * @param alertRulesResource Parameters supplied to the 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. @@ -755,7 +778,7 @@ public AlertRuleResourceInner update( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param alertRulesResource The alert rule object for patch operations. + * @param alertRulesResource Parameters supplied to the operation. * @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. @@ -796,6 +819,7 @@ private Mono> listByResourceGroupSinglePag "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -805,12 +829,13 @@ private Mono> listByResourceGroupSinglePag resourceGroupName, apiVersion, this.client.getSubscriptionId(), + accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -843,10 +868,16 @@ private Mono> listByResourceGroupSinglePag "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( - this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) .map( res -> new PagedResponseBase<>( @@ -933,15 +964,17 @@ private Mono> listSinglePageAsync() { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> - service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context)) + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -968,9 +1001,10 @@ private Mono> listSinglePageAsync(Context "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsClientImpl.java index 801ba9184a41..f4ebf1e5f37e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/AutoscaleSettingsClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -70,9 +71,9 @@ public final class AutoscaleSettingsClientImpl @Host("{$host}") @ServiceInterface(name = "MonitorClientAutosca") private interface AutoscaleSettingsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/autoscalesettings") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -81,11 +82,12 @@ Mono> listByResourceGroup( @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/autoscalesettings/{autoscaleSettingName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -96,11 +98,12 @@ Mono> createOrUpdate( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") AutoscaleSettingResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/autoscalesettings/{autoscaleSettingName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -110,11 +113,12 @@ Mono> delete( @PathParam("autoscaleSettingName") String autoscaleSettingName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/autoscalesettings/{autoscaleSettingName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -124,11 +128,12 @@ Mono> getByResourceGroup( @PathParam("autoscaleSettingName") String autoscaleSettingName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/autoscalesettings/{autoscaleSettingName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -139,31 +144,39 @@ Mono> update( @PathParam("autoscaleSettingName") String autoscaleSettingName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AutoscaleSettingResourcePatch autoscaleSettingResource, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/autoscalesettings") + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -195,6 +208,7 @@ private Mono> listByResourceGroupSi "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -204,6 +218,7 @@ private Mono> listByResourceGroupSi resourceGroupName, apiVersion, this.client.getSubscriptionId(), + accept, context)) .>map( res -> @@ -214,7 +229,7 @@ private Mono> listByResourceGroupSi res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -247,10 +262,16 @@ private Mono> listByResourceGroupSi "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( - this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) .map( res -> new PagedResponseBase<>( @@ -330,7 +351,7 @@ public PagedIterable listByResourceGroup(String r * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param parameters The autoscale setting resource. + * @param parameters Parameters supplied to the 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. @@ -365,6 +386,7 @@ public Mono> createOrUpdateWithResponseA parameters.validate(); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -376,8 +398,9 @@ public Mono> createOrUpdateWithResponseA apiVersion, this.client.getSubscriptionId(), parameters, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -385,7 +408,7 @@ public Mono> createOrUpdateWithResponseA * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param parameters The autoscale setting resource. + * @param parameters Parameters supplied to the operation. * @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. @@ -424,6 +447,7 @@ private Mono> createOrUpdateWithResponse parameters.validate(); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( @@ -433,6 +457,7 @@ private Mono> createOrUpdateWithResponse apiVersion, this.client.getSubscriptionId(), parameters, + accept, context); } @@ -441,7 +466,7 @@ private Mono> createOrUpdateWithResponse * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param parameters The autoscale setting resource. + * @param parameters Parameters supplied to the 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. @@ -466,7 +491,7 @@ public Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param parameters The autoscale setting resource. + * @param parameters Parameters supplied to the 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. @@ -483,7 +508,7 @@ public AutoscaleSettingResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param parameters The autoscale setting resource. + * @param parameters Parameters supplied to the operation. * @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. @@ -532,6 +557,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -542,8 +568,9 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St autoscaleSettingName, apiVersion, this.client.getSubscriptionId(), + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -581,6 +608,7 @@ private Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( @@ -589,6 +617,7 @@ private Mono> deleteWithResponseAsync( autoscaleSettingName, apiVersion, this.client.getSubscriptionId(), + accept, context); } @@ -672,6 +701,7 @@ public Mono> getByResourceGroupWithRespo "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -682,8 +712,9 @@ public Mono> getByResourceGroupWithRespo autoscaleSettingName, apiVersion, this.client.getSubscriptionId(), + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -721,6 +752,7 @@ private Mono> getByResourceGroupWithResp "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( @@ -729,6 +761,7 @@ private Mono> getByResourceGroupWithResp autoscaleSettingName, apiVersion, this.client.getSubscriptionId(), + accept, context); } @@ -793,7 +826,7 @@ public Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource The autoscale setting object for patch operations. + * @param autoscaleSettingResource Parameters supplied to the 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. @@ -830,6 +863,7 @@ public Mono> updateWithResponseAsync( autoscaleSettingResource.validate(); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -841,8 +875,9 @@ public Mono> updateWithResponseAsync( autoscaleSettingName, apiVersion, autoscaleSettingResource, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -850,7 +885,7 @@ public Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource The autoscale setting object for patch operations. + * @param autoscaleSettingResource Parameters supplied to the operation. * @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. @@ -891,6 +926,7 @@ private Mono> updateWithResponseAsync( autoscaleSettingResource.validate(); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( @@ -900,6 +936,7 @@ private Mono> updateWithResponseAsync( autoscaleSettingName, apiVersion, autoscaleSettingResource, + accept, context); } @@ -908,7 +945,7 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource The autoscale setting object for patch operations. + * @param autoscaleSettingResource Parameters supplied to the 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. @@ -933,7 +970,7 @@ public Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource The autoscale setting object for patch operations. + * @param autoscaleSettingResource Parameters supplied to the 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. @@ -950,7 +987,7 @@ public AutoscaleSettingResourceInner update( * * @param resourceGroupName The name of the resource group. * @param autoscaleSettingName The autoscale setting name. - * @param autoscaleSettingResource The autoscale setting object for patch operations. + * @param autoscaleSettingResource Parameters supplied to the operation. * @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. @@ -989,10 +1026,12 @@ private Mono> listSinglePageAsync() "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> - service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context)) + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1002,7 +1041,7 @@ private Mono> listSinglePageAsync() res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1029,9 +1068,10 @@ private Mono> listSinglePageAsync(C "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1111,8 +1151,16 @@ private Mono> listByResourceGroupNe if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroupNext(nextLink, context)) + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1122,7 +1170,7 @@ private Mono> listByResourceGroupNe res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1141,9 +1189,16 @@ private Mono> listByResourceGroupNe if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroupNext(nextLink, context) + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1169,8 +1224,16 @@ private Mono> listBySubscriptionNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listBySubscriptionNext(nextLink, context)) + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1180,7 +1243,7 @@ private Mono> listBySubscriptionNex res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1199,9 +1262,16 @@ private Mono> listBySubscriptionNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySubscriptionNext(nextLink, context) + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/BaselinesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/BaselinesClientImpl.java index 910e097aa0dc..802993dae4ee 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/BaselinesClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/BaselinesClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -60,8 +61,8 @@ public final class BaselinesClientImpl implements BaselinesClient { @Host("{$host}") @ServiceInterface(name = "MonitorClientBaselin") private interface BaselinesService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/{resourceUri}/providers/microsoft.insights/metricBaselines") + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.Insights/metricBaselines") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -76,6 +77,7 @@ Mono> list( @QueryParam("$filter") String filter, @QueryParam("resultType") ResultType resultType, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } @@ -83,21 +85,24 @@ Mono> list( * **Lists the metric baseline values for a resource**. * * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. + * @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 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 aggregation The list of aggregation types (comma separated) to retrieve. * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @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 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 resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -125,6 +130,7 @@ private Mono> listSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -141,33 +147,37 @@ private Mono> listSinglePageAsync( filter, resultType, apiVersion, + accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * **Lists the metric baseline values for a resource**. * * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. + * @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 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 aggregation The list of aggregation types (comma separated) to retrieve. * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @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 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 resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -197,6 +207,7 @@ private Mono> listSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( @@ -211,6 +222,7 @@ private Mono> listSinglePageAsync( filter, resultType, apiVersion, + accept, context) .map( res -> @@ -222,21 +234,24 @@ private Mono> listSinglePageAsync( * **Lists the metric baseline values for a resource**. * * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. + * @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 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 aggregation The list of aggregation types (comma separated) to retrieve. * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @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 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 resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -305,21 +320,24 @@ public PagedFlux listAsync(String resourceUri) { * **Lists the metric baseline values for a resource**. * * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. + * @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 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 aggregation The list of aggregation types (comma separated) to retrieve. * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @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 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 resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -358,40 +376,21 @@ private PagedFlux listAsync( * **Lists the metric baseline values for a resource**. * * @param resourceUri The identifier of the resource. - * @param metricnames The names of the metrics (comma separated) to retrieve. - * @param metricnamespace Metric namespace to query metric definitions for. - * @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 aggregation The list of aggregation types (comma separated) to retrieve. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @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 Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @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 a list of metric baselines. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceUri, - String metricnames, - String metricnamespace, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - String filter, - ResultType resultType, - Context context) { + public PagedIterable list(String resourceUri) { + final String metricnames = null; + final String metricnamespace = null; + final String timespan = null; + final Duration interval = null; + final String aggregation = null; + final String sensitivities = null; + final String filter = null; + final ResultType resultType = null; return new PagedIterable<>( listAsync( resourceUri, @@ -402,29 +401,50 @@ public PagedIterable list( aggregation, sensitivities, filter, - resultType, - context)); + resultType)); } /** * **Lists the metric baseline values for a resource**. * * @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 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 aggregation The list of aggregation types (comma separated) to retrieve. + * @param sensitivities The list of sensitivities (comma separated) to retrieve. + * @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 resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. + * @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 a list of metric baselines. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { - final String metricnames = null; - final String metricnamespace = null; - final String timespan = null; - final Duration interval = null; - final String aggregation = null; - final String sensitivities = null; - final String filter = null; - final ResultType resultType = null; + public PagedIterable list( + String resourceUri, + String metricnames, + String metricnamespace, + String timespan, + Duration interval, + String aggregation, + String sensitivities, + String filter, + ResultType resultType, + Context context) { return new PagedIterable<>( listAsync( resourceUri, @@ -435,6 +455,7 @@ public PagedIterable list(String resourceUri) { aggregation, sensitivities, filter, - resultType)); + resultType, + context)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java new file mode 100644 index 000000000000..daf55bfbea94 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionEndpointsClientImpl.java @@ -0,0 +1,1343 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.fluent.DataCollectionEndpointsClient; +import com.azure.resourcemanager.monitor.fluent.models.DataCollectionEndpointResourceInner; +import com.azure.resourcemanager.monitor.models.DataCollectionEndpointResourceListResult; +import com.azure.resourcemanager.monitor.models.ResourceForUpdate; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataCollectionEndpointsClient. */ +public final class DataCollectionEndpointsClientImpl + implements InnerSupportsGet, + InnerSupportsListing, + InnerSupportsDelete, + DataCollectionEndpointsClient { + private final ClientLogger logger = new ClientLogger(DataCollectionEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataCollectionEndpointsService service; + + /** The service client containing this operation class. */ + private final MonitorClientImpl client; + + /** + * Initializes an instance of DataCollectionEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataCollectionEndpointsClientImpl(MonitorClientImpl client) { + this.service = + RestProxy + .create(DataCollectionEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MonitorClientDataCollectionEndpoints to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MonitorClientDataCol") + private interface DataCollectionEndpointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionEndpoints/{dataCollectionEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataCollectionEndpointName") String dataCollectionEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionEndpoints/{dataCollectionEndpointName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataCollectionEndpointName") String dataCollectionEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataCollectionEndpointResourceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionEndpoints/{dataCollectionEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataCollectionEndpointName") String dataCollectionEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceForUpdate body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionEndpoints/{dataCollectionEndpointName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataCollectionEndpointName") String dataCollectionEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all data collection endpoints in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all data collection endpoints in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all data collection endpoints in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all data collection endpoints in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all data collection endpoints in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all data collection endpoints in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all data collection endpoints in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all data collection endpoints in the specified subscription. + * + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all data collection endpoints in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all data collection endpoints in the specified subscription. + * + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all data collection endpoints in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all data collection endpoints in the specified subscription. + * + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Returns the specified data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dataCollectionEndpointName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataCollectionEndpointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionEndpointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the specified data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dataCollectionEndpointName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataCollectionEndpointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionEndpointName, + apiVersion, + accept, + context); + } + + /** + * Returns the specified data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String dataCollectionEndpointName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataCollectionEndpointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the specified data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataCollectionEndpointResourceInner getByResourceGroup( + String resourceGroupName, String dataCollectionEndpointName) { + return getByResourceGroupAsync(resourceGroupName, dataCollectionEndpointName).block(); + } + + /** + * Returns the specified data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String dataCollectionEndpointName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataCollectionEndpointName, context).block(); + } + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync( + String resourceGroupName, String dataCollectionEndpointName, DataCollectionEndpointResourceInner 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataCollectionEndpointName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionEndpointName, + apiVersion, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String dataCollectionEndpointName, + DataCollectionEndpointResourceInner 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataCollectionEndpointName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionEndpointName, + apiVersion, + body, + accept, + context); + } + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync( + String resourceGroupName, String dataCollectionEndpointName, DataCollectionEndpointResourceInner body) { + return createWithResponseAsync(resourceGroupName, dataCollectionEndpointName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync( + String resourceGroupName, String dataCollectionEndpointName) { + final DataCollectionEndpointResourceInner body = null; + return createWithResponseAsync(resourceGroupName, dataCollectionEndpointName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataCollectionEndpointResourceInner create(String resourceGroupName, String dataCollectionEndpointName) { + final DataCollectionEndpointResourceInner body = null; + return createAsync(resourceGroupName, dataCollectionEndpointName, body).block(); + } + + /** + * Creates or updates a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String dataCollectionEndpointName, + DataCollectionEndpointResourceInner body, + Context context) { + return createWithResponseAsync(resourceGroupName, dataCollectionEndpointName, body, context).block(); + } + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync( + String resourceGroupName, String dataCollectionEndpointName, Map tags) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataCollectionEndpointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + ResourceForUpdate bodyInternal = null; + if (tags != null) { + bodyInternal = new ResourceForUpdate(); + bodyInternal.withTags(tags); + } + ResourceForUpdate body = bodyInternal; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionEndpointName, + apiVersion, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String dataCollectionEndpointName, Map tags, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataCollectionEndpointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + ResourceForUpdate bodyInternal = null; + if (tags != null) { + bodyInternal = new ResourceForUpdate(); + bodyInternal.withTags(tags); + } + ResourceForUpdate body = bodyInternal; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionEndpointName, + apiVersion, + body, + accept, + context); + } + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String dataCollectionEndpointName, Map tags) { + return updateWithResponseAsync(resourceGroupName, dataCollectionEndpointName, tags) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String dataCollectionEndpointName) { + final Map tags = null; + return updateWithResponseAsync(resourceGroupName, dataCollectionEndpointName, tags) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataCollectionEndpointResourceInner update(String resourceGroupName, String dataCollectionEndpointName) { + final Map tags = null; + return updateAsync(resourceGroupName, dataCollectionEndpointName, tags).block(); + } + + /** + * Updates part of a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @param tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String dataCollectionEndpointName, Map tags, Context context) { + return updateWithResponseAsync(resourceGroupName, dataCollectionEndpointName, tags, context).block(); + } + + /** + * Deletes a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionEndpointName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataCollectionEndpointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionEndpointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String dataCollectionEndpointName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataCollectionEndpointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionEndpointName, + apiVersion, + accept, + context); + } + + /** + * Deletes a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String dataCollectionEndpointName) { + return deleteWithResponseAsync(resourceGroupName, dataCollectionEndpointName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataCollectionEndpointName) { + deleteAsync(resourceGroupName, dataCollectionEndpointName).block(); + } + + /** + * Deletes a data collection endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataCollectionEndpointName The name of the data collection endpoint. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String dataCollectionEndpointName, Context context) { + return deleteWithResponseAsync(resourceGroupName, dataCollectionEndpointName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java new file mode 100644 index 000000000000..6da439a95883 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRuleAssociationsClientImpl.java @@ -0,0 +1,1032 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.fluent.DataCollectionRuleAssociationsClient; +import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleAssociationProxyOnlyResourceInner; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleAssociationProxyOnlyResourceListResult; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataCollectionRuleAssociationsClient. */ +public final class DataCollectionRuleAssociationsClientImpl + implements InnerSupportsDelete, DataCollectionRuleAssociationsClient { + private final ClientLogger logger = new ClientLogger(DataCollectionRuleAssociationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataCollectionRuleAssociationsService service; + + /** The service client containing this operation class. */ + private final MonitorClientImpl client; + + /** + * Initializes an instance of DataCollectionRuleAssociationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataCollectionRuleAssociationsClientImpl(MonitorClientImpl client) { + this.service = + RestProxy + .create( + DataCollectionRuleAssociationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MonitorClientDataCollectionRuleAssociations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MonitorClientDataCol") + private interface DataCollectionRuleAssociationsService { + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResource( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionRules/{dataCollectionRuleName}/associations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRule( + @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); + + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("associationName") String associationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("associationName") String associationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataCollectionRuleAssociationProxyOnlyResourceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("associationName") String associationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRuleNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists associations for the specified resource. + * + * @param resourceUri The identifier of the 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 pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResource(this.client.getEndpoint(), resourceUri, apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists associations for the specified resource. + * + * @param resourceUri The identifier of the resource. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResource(this.client.getEndpoint(), resourceUri, 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 resource. + * + * @param resourceUri The identifier of the 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 pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceAsync(String resourceUri) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceUri), nextLink -> listByResourceNextSinglePageAsync(nextLink)); + } + + /** + * Lists associations for the specified resource. + * + * @param resourceUri The identifier of the resource. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceAsync( + String resourceUri, Context context) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceUri, context), + nextLink -> listByResourceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists associations for the specified resource. + * + * @param resourceUri The identifier of the 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 pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource(String resourceUri) { + return new PagedIterable<>(listByResourceAsync(resourceUri)); + } + + /** + * Lists associations for the specified resource. + * + * @param resourceUri The identifier of the resource. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource( + String resourceUri, Context context) { + return new PagedIterable<>(listByResourceAsync(resourceUri, 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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSinglePageAsync( + String resourceGroupName, String dataCollectionRuleName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByRule( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleSinglePageAsync( + String resourceGroupName, String dataCollectionRuleName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByRule( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + 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. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByRuleAsync( + String resourceGroupName, String dataCollectionRuleName) { + return new PagedFlux<>( + () -> listByRuleSinglePageAsync(resourceGroupName, dataCollectionRuleName), + nextLink -> listByRuleNextSinglePageAsync(nextLink)); + } + + /** + * 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 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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRuleAsync( + String resourceGroupName, String dataCollectionRuleName, Context context) { + return new PagedFlux<>( + () -> listByRuleSinglePageAsync(resourceGroupName, dataCollectionRuleName, context), + nextLink -> listByRuleNextSinglePageAsync(nextLink, 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. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRule( + String resourceGroupName, String dataCollectionRuleName) { + return new PagedIterable<>(listByRuleAsync(resourceGroupName, dataCollectionRuleName)); + } + + /** + * 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 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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRule( + String resourceGroupName, String dataCollectionRuleName, Context context) { + return new PagedIterable<>(listByRuleAsync(resourceGroupName, dataCollectionRuleName, context)); + } + + /** + * Returns the specified association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceUri, String associationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (associationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.get(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the specified association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceUri, String associationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (associationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context); + } + + /** + * Returns the specified association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceUri, String associationName) { + return getWithResponseAsync(resourceUri, associationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the specified association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataCollectionRuleAssociationProxyOnlyResourceInner get(String resourceUri, String associationName) { + return getAsync(resourceUri, associationName).block(); + } + + /** + * Returns the specified association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceUri, String associationName, Context context) { + return getWithResponseAsync(resourceUri, associationName, context).block(); + } + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param body The payload. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync( + String resourceUri, String associationName, DataCollectionRuleAssociationProxyOnlyResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (associationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), resourceUri, associationName, apiVersion, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param body The payload. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceUri, + String associationName, + DataCollectionRuleAssociationProxyOnlyResourceInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (associationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create(this.client.getEndpoint(), resourceUri, associationName, apiVersion, body, accept, context); + } + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param body The payload. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync( + String resourceUri, String associationName, DataCollectionRuleAssociationProxyOnlyResourceInner body) { + return createWithResponseAsync(resourceUri, associationName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync( + String resourceUri, String associationName) { + final DataCollectionRuleAssociationProxyOnlyResourceInner body = null; + return createWithResponseAsync(resourceUri, associationName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataCollectionRuleAssociationProxyOnlyResourceInner create(String resourceUri, String associationName) { + final DataCollectionRuleAssociationProxyOnlyResourceInner body = null; + return createAsync(resourceUri, associationName, body).block(); + } + + /** + * Creates or updates an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @param body The payload. + * @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 definition of generic ARM proxy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceUri, + String associationName, + DataCollectionRuleAssociationProxyOnlyResourceInner body, + Context context) { + return createWithResponseAsync(resourceUri, associationName, body, context).block(); + } + + /** + * Deletes an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String resourceUri, String associationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (associationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceUri, String associationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (associationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associationName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceUri, associationName, apiVersion, accept, context); + } + + /** + * Deletes an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceUri, String associationName) { + return deleteWithResponseAsync(resourceUri, associationName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri, String associationName) { + deleteAsync(resourceUri, associationName).block(); + } + + /** + * Deletes an association. + * + * @param resourceUri The identifier of the resource. + * @param associationName The name of the association. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceUri, String associationName, Context context) { + return deleteWithResponseAsync(resourceUri, associationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByRuleNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRuleNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByRuleNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java new file mode 100644 index 000000000000..4f889e7ad803 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DataCollectionRulesClientImpl.java @@ -0,0 +1,1330 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.fluent.DataCollectionRulesClient; +import com.azure.resourcemanager.monitor.fluent.models.DataCollectionRuleResourceInner; +import com.azure.resourcemanager.monitor.models.DataCollectionRuleResourceListResult; +import com.azure.resourcemanager.monitor.models.ResourceForUpdate; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataCollectionRulesClient. */ +public final class DataCollectionRulesClientImpl + implements InnerSupportsGet, + InnerSupportsListing, + InnerSupportsDelete, + DataCollectionRulesClient { + private final ClientLogger logger = new ClientLogger(DataCollectionRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataCollectionRulesService service; + + /** The service client containing this operation class. */ + private final MonitorClientImpl client; + + /** + * Initializes an instance of DataCollectionRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataCollectionRulesClientImpl(MonitorClientImpl client) { + this.service = + RestProxy.create(DataCollectionRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MonitorClientDataCollectionRules to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MonitorClientDataCol") + private interface DataCollectionRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionRules/{dataCollectionRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @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); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionRules/{dataCollectionRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataCollectionRuleName") String dataCollectionRuleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataCollectionRuleResourceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionRules/{dataCollectionRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataCollectionRuleName") String dataCollectionRuleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceForUpdate body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/dataCollectionRules/{dataCollectionRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> 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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all data collection rules in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all data collection rules in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all data collection rules in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all data collection rules in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all data collection rules in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all data collection rules in the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all data collection rules in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all data collection rules in the specified subscription. + * + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all data collection rules in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all data collection rules in the specified subscription. + * + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all data collection rules in the specified subscription. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all data collection rules in the specified subscription. + * + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Returns 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dataCollectionRuleName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns 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 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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String dataCollectionRuleName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + apiVersion, + accept, + context); + } + + /** + * Returns 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String dataCollectionRuleName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataCollectionRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataCollectionRuleResourceInner getByResourceGroup(String resourceGroupName, String dataCollectionRuleName) { + return getByResourceGroupAsync(resourceGroupName, dataCollectionRuleName).block(); + } + + /** + * Returns 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 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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String dataCollectionRuleName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataCollectionRuleName, context).block(); + } + + /** + * Creates or updates a 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 body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync( + String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + apiVersion, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a 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 body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String dataCollectionRuleName, + DataCollectionRuleResourceInner 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + apiVersion, + body, + accept, + context); + } + + /** + * Creates or updates a 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 body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync( + String resourceGroupName, String dataCollectionRuleName, DataCollectionRuleResourceInner body) { + return createWithResponseAsync(resourceGroupName, dataCollectionRuleName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String dataCollectionRuleName) { + final DataCollectionRuleResourceInner body = null; + return createWithResponseAsync(resourceGroupName, dataCollectionRuleName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataCollectionRuleResourceInner create(String resourceGroupName, String dataCollectionRuleName) { + final DataCollectionRuleResourceInner body = null; + return createAsync(resourceGroupName, dataCollectionRuleName, body).block(); + } + + /** + * Creates or updates a 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 body The payload. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String dataCollectionRuleName, + DataCollectionRuleResourceInner body, + Context context) { + return createWithResponseAsync(resourceGroupName, dataCollectionRuleName, body, context).block(); + } + + /** + * Updates part of a 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 tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync( + String resourceGroupName, String dataCollectionRuleName, Map tags) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + ResourceForUpdate bodyInternal = null; + if (tags != null) { + bodyInternal = new ResourceForUpdate(); + bodyInternal.withTags(tags); + } + ResourceForUpdate body = bodyInternal; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + apiVersion, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates part of a 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 tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String dataCollectionRuleName, Map tags, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + ResourceForUpdate bodyInternal = null; + if (tags != null) { + bodyInternal = new ResourceForUpdate(); + bodyInternal.withTags(tags); + } + ResourceForUpdate body = bodyInternal; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + apiVersion, + body, + accept, + context); + } + + /** + * Updates part of a 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 tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String dataCollectionRuleName, Map tags) { + return updateWithResponseAsync(resourceGroupName, dataCollectionRuleName, tags) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates part of a 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String dataCollectionRuleName) { + final Map tags = null; + return updateWithResponseAsync(resourceGroupName, dataCollectionRuleName, tags) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates part of a 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. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataCollectionRuleResourceInner update(String resourceGroupName, String dataCollectionRuleName) { + final Map tags = null; + return updateAsync(resourceGroupName, dataCollectionRuleName, tags).block(); + } + + /** + * Updates part of a 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 tags Resource tags. + * @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 definition of ARM tracked top level resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String dataCollectionRuleName, Map tags, Context context) { + return updateWithResponseAsync(resourceGroupName, dataCollectionRuleName, tags, context).block(); + } + + /** + * Deletes a 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. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String resourceGroupName, String dataCollectionRuleName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a 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 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String dataCollectionRuleName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataCollectionRuleName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataCollectionRuleName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataCollectionRuleName, + apiVersion, + accept, + context); + } + + /** + * Deletes a 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. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String dataCollectionRuleName) { + return deleteWithResponseAsync(resourceGroupName, dataCollectionRuleName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a 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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataCollectionRuleName) { + deleteAsync(resourceGroupName, dataCollectionRuleName).block(); + } + + /** + * Deletes a 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String dataCollectionRuleName, Context context) { + return deleteWithResponseAsync(resourceGroupName, dataCollectionRuleName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 a pageable list of resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java index 29cd669900db..34afeaba8b3e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsCategoriesClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -56,8 +57,8 @@ public final class DiagnosticSettingsCategoriesClientImpl implements DiagnosticS @Host("{$host}") @ServiceInterface(name = "MonitorClientDiagnos") private interface DiagnosticSettingsCategoriesService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories/{name}") + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -65,16 +66,18 @@ Mono> get( @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories") + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } @@ -104,9 +107,11 @@ public Mono> getWithResponseAs return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .withContext( + context -> service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -136,8 +141,9 @@ private Mono> getWithResponseA return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, context); + return service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context); } /** @@ -216,9 +222,10 @@ public Mono> listWit return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -244,8 +251,9 @@ private Mono> listWi return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), resourceUri, apiVersion, context); + return service.list(this.client.getEndpoint(), resourceUri, apiVersion, accept, context); } /** diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsClientImpl.java index 5d3f22e4673c..922615411f4f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/DiagnosticSettingsClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -58,8 +59,8 @@ public final class DiagnosticSettingsClientImpl implements InnerSupportsDelete> get( @@ -67,10 +68,11 @@ Mono> get( @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put("/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}") + @Headers({"Content-Type: application/json"}) + @Put("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -79,10 +81,11 @@ Mono> createOrUpdate( @QueryParam("api-version") String apiVersion, @PathParam("name") String name, @BodyParam("application/json") DiagnosticSettingsResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete("/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}") + @Headers({"Content-Type: application/json"}) + @Delete("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -90,16 +93,18 @@ Mono> delete( @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/{resourceUri}/providers/microsoft.insights/diagnosticSettings") + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } @@ -128,9 +133,11 @@ public Mono> getWithResponseAsync(Stri return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .withContext( + context -> service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -160,8 +167,9 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, context); + return service.get(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context); } /** @@ -223,7 +231,7 @@ public Response getWithResponse(String resource * * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. - * @param parameters The diagnostic setting resource. + * @param parameters Parameters supplied to the 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. @@ -250,12 +258,14 @@ public Mono> createOrUpdateWithRespons parameters.validate(); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createOrUpdate(this.client.getEndpoint(), resourceUri, apiVersion, name, parameters, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .createOrUpdate( + this.client.getEndpoint(), resourceUri, apiVersion, name, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -263,7 +273,7 @@ public Mono> createOrUpdateWithRespons * * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. - * @param parameters The diagnostic setting resource. + * @param parameters Parameters supplied to the operation. * @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. @@ -291,8 +301,10 @@ private Mono> createOrUpdateWithRespon parameters.validate(); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceUri, apiVersion, name, parameters, context); + return service + .createOrUpdate(this.client.getEndpoint(), resourceUri, apiVersion, name, parameters, accept, context); } /** @@ -300,7 +312,7 @@ private Mono> createOrUpdateWithRespon * * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. - * @param parameters The diagnostic setting resource. + * @param parameters Parameters supplied to the 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. @@ -325,7 +337,7 @@ public Mono createOrUpdateAsync( * * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. - * @param parameters The diagnostic setting resource. + * @param parameters Parameters supplied to the 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. @@ -342,7 +354,7 @@ public DiagnosticSettingsResourceInner createOrUpdate( * * @param resourceUri The identifier of the resource. * @param name The name of the diagnostic setting. - * @param parameters The diagnostic setting resource. + * @param parameters Parameters supplied to the operation. * @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. @@ -380,9 +392,11 @@ public Mono> deleteWithResponseAsync(String resourceUri, String n return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceUri, apiVersion, name, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .withContext( + context -> service.delete(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -411,8 +425,9 @@ private Mono> deleteWithResponseAsync(String resourceUri, String return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceUri, apiVersion, name, context); + return service.delete(this.client.getEndpoint(), resourceUri, apiVersion, name, accept, context); } /** @@ -481,9 +496,10 @@ public Mono> listWithRespons return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .withContext(context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -509,8 +525,9 @@ private Mono> listWithRespon return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2017-05-01-preview"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), resourceUri, apiVersion, context); + return service.list(this.client.getEndpoint(), resourceUri, apiVersion, accept, context); } /** diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java index 7a3b6e72793b..16b0d5022696 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/EventCategoriesClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -57,12 +58,15 @@ public final class EventCategoriesClientImpl implements EventCategoriesClient { @Host("{$host}") @ServiceInterface(name = "MonitorClientEventCa") private interface EventCategoriesService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/providers/microsoft.insights/eventcategories") + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Insights/eventcategories") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, Context context); + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -82,13 +86,14 @@ private Mono> listSinglePageAsync() { "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, context)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -110,9 +115,10 @@ private Mono> listSinglePageAsync(Context "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, context) + .list(this.client.getEndpoint(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java index a097cf4a1d45..c2bd961a69cc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/LogProfilesClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -64,7 +65,7 @@ public final class LogProfilesClientImpl implements LogProfilesClient { @ServiceInterface(name = "MonitorClientLogProf") private interface LogProfilesService { @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}") + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( @@ -74,8 +75,8 @@ Mono> delete( @PathParam("subscriptionId") String subscriptionId, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}") + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -83,10 +84,11 @@ Mono> get( @PathParam("logProfileName") String logProfileName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}") + @Headers({"Content-Type: application/json"}) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -95,10 +97,11 @@ Mono> createOrUpdate( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") LogProfileResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch("/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}") + @Headers({"Content-Type: application/json"}) + @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -107,16 +110,18 @@ Mono> update( @PathParam("logProfileName") String logProfileName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") LogProfileResourcePatch logProfilesResource, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles") + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } @@ -157,7 +162,7 @@ public Mono> deleteWithResponseAsync(String logProfileName) { apiVersion, this.client.getSubscriptionId(), context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -262,6 +267,7 @@ public Mono> getWithResponseAsync(String logPr "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -271,8 +277,9 @@ public Mono> getWithResponseAsync(String logPr logProfileName, apiVersion, this.client.getSubscriptionId(), + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -303,9 +310,16 @@ private Mono> getWithResponseAsync(String logP "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get(this.client.getEndpoint(), logProfileName, apiVersion, this.client.getSubscriptionId(), context); + .get( + this.client.getEndpoint(), + logProfileName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); } /** @@ -363,7 +377,7 @@ public Response getWithResponse(String logProfileName, * Create or update a log profile in Azure Monitoring REST API. * * @param logProfileName The name of the log profile. - * @param parameters The log profile resource. + * @param parameters Parameters supplied to the 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. @@ -393,6 +407,7 @@ public Mono> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -403,15 +418,16 @@ public Mono> createOrUpdateWithResponseAsync( apiVersion, this.client.getSubscriptionId(), parameters, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a log profile in Azure Monitoring REST API. * * @param logProfileName The name of the log profile. - * @param parameters The log profile resource. + * @param parameters Parameters supplied to the operation. * @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. @@ -442,6 +458,7 @@ private Mono> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( @@ -450,6 +467,7 @@ private Mono> createOrUpdateWithResponseAsync( apiVersion, this.client.getSubscriptionId(), parameters, + accept, context); } @@ -457,7 +475,7 @@ private Mono> createOrUpdateWithResponseAsync( * Create or update a log profile in Azure Monitoring REST API. * * @param logProfileName The name of the log profile. - * @param parameters The log profile resource. + * @param parameters Parameters supplied to the 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. @@ -481,7 +499,7 @@ public Mono createOrUpdateAsync( * Create or update a log profile in Azure Monitoring REST API. * * @param logProfileName The name of the log profile. - * @param parameters The log profile resource. + * @param parameters Parameters supplied to the 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. @@ -496,7 +514,7 @@ public LogProfileResourceInner createOrUpdate(String logProfileName, LogProfileR * Create or update a log profile in Azure Monitoring REST API. * * @param logProfileName The name of the log profile. - * @param parameters The log profile resource. + * @param parameters Parameters supplied to the operation. * @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. @@ -513,7 +531,7 @@ public Response createOrUpdateWithResponse( * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * * @param logProfileName The name of the log profile. - * @param logProfilesResource The log profile resource for patch operations. + * @param logProfilesResource Parameters supplied to the 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. @@ -544,6 +562,7 @@ public Mono> updateWithResponseAsync( logProfilesResource.validate(); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -554,15 +573,16 @@ public Mono> updateWithResponseAsync( logProfileName, apiVersion, logProfilesResource, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * * @param logProfileName The name of the log profile. - * @param logProfilesResource The log profile resource for patch operations. + * @param logProfilesResource Parameters supplied to the operation. * @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. @@ -594,6 +614,7 @@ private Mono> updateWithResponseAsync( logProfilesResource.validate(); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( @@ -602,6 +623,7 @@ private Mono> updateWithResponseAsync( logProfileName, apiVersion, logProfilesResource, + accept, context); } @@ -609,7 +631,7 @@ private Mono> updateWithResponseAsync( * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * * @param logProfileName The name of the log profile. - * @param logProfilesResource The log profile resource for patch operations. + * @param logProfilesResource Parameters supplied to the 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. @@ -633,7 +655,7 @@ public Mono updateAsync( * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * * @param logProfileName The name of the log profile. - * @param logProfilesResource The log profile resource for patch operations. + * @param logProfilesResource Parameters supplied to the 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. @@ -648,7 +670,7 @@ public LogProfileResourceInner update(String logProfileName, LogProfileResourceP * Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. * * @param logProfileName The name of the log profile. - * @param logProfilesResource The log profile resource for patch operations. + * @param logProfilesResource Parameters supplied to the operation. * @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. @@ -683,15 +705,17 @@ private Mono> listSinglePageAsync() { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> - service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context)) + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -718,9 +742,10 @@ private Mono> listSinglePageAsync(Context "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2016-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionImpl.java index 989f07dc7c20..6c5f2552a671 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertConditionImpl.java @@ -3,7 +3,7 @@ package com.azure.resourcemanager.monitor.implementation; -import com.azure.resourcemanager.monitor.models.AggregationType; +import com.azure.resourcemanager.monitor.models.AggregationTypeEnum; import com.azure.resourcemanager.monitor.models.MetricAlert; import com.azure.resourcemanager.monitor.models.MetricAlertCondition; import com.azure.resourcemanager.monitor.models.MetricAlertRuleCondition; @@ -33,7 +33,7 @@ class MetricAlertConditionImpl extends MetricAlertConditionBaseImpl> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/metricAlerts") @@ -91,9 +93,10 @@ Mono> listByResourceGroup( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/metricAlerts/{ruleName}") @@ -105,9 +108,10 @@ Mono> getByResourceGroup( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/metricAlerts/{ruleName}") @@ -120,9 +124,10 @@ Mono> createOrUpdate( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") MetricAlertResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/metricAlerts/{ruleName}") @@ -135,9 +140,10 @@ Mono> update( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") MetricAlertResourcePatch parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/metricAlerts/{ruleName}") @@ -149,6 +155,7 @@ Mono> delete( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } @@ -174,15 +181,17 @@ private Mono> listSinglePageAsync() { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> - service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context)) + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -209,9 +218,10 @@ private Mono> listSinglePageAsync(Contex "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( @@ -298,6 +308,7 @@ private Mono> listByResourceGroupSingleP .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -307,12 +318,13 @@ private Mono> listByResourceGroupSingleP this.client.getSubscriptionId(), resourceGroupName, apiVersion, + accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -345,10 +357,16 @@ private Mono> listByResourceGroupSingleP .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( - this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -446,6 +464,7 @@ public Mono> getByResourceGroupWithResponseAs return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -456,8 +475,9 @@ public Mono> getByResourceGroupWithResponseAs resourceGroupName, ruleName, apiVersion, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -494,6 +514,7 @@ private Mono> getByResourceGroupWithResponseA return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( @@ -502,6 +523,7 @@ private Mono> getByResourceGroupWithResponseA resourceGroupName, ruleName, apiVersion, + accept, context); } @@ -565,7 +587,7 @@ public Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -599,6 +621,7 @@ public Mono> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -610,8 +633,9 @@ public Mono> createOrUpdateWithResponseAsync( ruleName, apiVersion, parameters, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -619,7 +643,7 @@ public Mono> createOrUpdateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -654,6 +678,7 @@ private Mono> createOrUpdateWithResponseAsync parameters.validate(); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( @@ -663,6 +688,7 @@ private Mono> createOrUpdateWithResponseAsync ruleName, apiVersion, parameters, + accept, context); } @@ -671,7 +697,7 @@ private Mono> createOrUpdateWithResponseAsync * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -696,7 +722,7 @@ public Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -713,7 +739,7 @@ public MetricAlertResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -731,7 +757,7 @@ public Response createOrUpdateWithResponse( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -765,6 +791,7 @@ public Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -776,8 +803,9 @@ public Mono> updateWithResponseAsync( ruleName, apiVersion, parameters, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -785,7 +813,7 @@ public Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -820,6 +848,7 @@ private Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( @@ -829,6 +858,7 @@ private Mono> updateWithResponseAsync( ruleName, apiVersion, parameters, + accept, context); } @@ -837,7 +867,7 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -862,7 +892,7 @@ public Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -879,7 +909,7 @@ public MetricAlertResourceInner update( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The metric alert resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -924,6 +954,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -934,8 +965,9 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St resourceGroupName, ruleName, apiVersion, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -971,6 +1003,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( @@ -979,6 +1012,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S resourceGroupName, ruleName, apiVersion, + accept, context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java index e9eab162ab51..2ae5c3a71a4f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsStatusClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -53,7 +54,7 @@ public final class MetricAlertsStatusClientImpl implements MetricAlertsStatusCli @Host("{$host}") @ServiceInterface(name = "MonitorClientMetricA") private interface MetricAlertsStatusService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/metricAlerts/{ruleName}/status") @@ -65,9 +66,10 @@ Mono> list( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + "/metricAlerts/{ruleName}/status/{statusName}") @@ -80,6 +82,7 @@ Mono> listByName( @PathParam("ruleName") String ruleName, @PathParam("statusName") String statusName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } @@ -116,6 +119,7 @@ public Mono> listWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -126,8 +130,9 @@ public Mono> listWithResponseAsync( resourceGroupName, ruleName, apiVersion, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -164,6 +169,7 @@ private Mono> listWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( @@ -172,6 +178,7 @@ private Mono> listWithResponseAsync( resourceGroupName, ruleName, apiVersion, + accept, context); } @@ -267,6 +274,7 @@ public Mono> listByNameWithResponseAs return Mono.error(new IllegalArgumentException("Parameter statusName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -278,8 +286,9 @@ public Mono> listByNameWithResponseAs ruleName, statusName, apiVersion, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -320,6 +329,7 @@ private Mono> listByNameWithResponseA return Mono.error(new IllegalArgumentException("Parameter statusName is required and cannot be null.")); } final String apiVersion = "2018-03-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByName( @@ -329,6 +339,7 @@ private Mono> listByNameWithResponseA ruleName, statusName, apiVersion, + accept, context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricBaselinesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricBaselinesClientImpl.java deleted file mode 100644 index 76a40aba9b8b..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricBaselinesClientImpl.java +++ /dev/null @@ -1,479 +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.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.Headers; -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; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.fluent.MetricBaselinesClient; -import com.azure.resourcemanager.monitor.fluent.models.BaselineResponseInner; -import com.azure.resourcemanager.monitor.fluent.models.CalculateBaselineResponseInner; -import com.azure.resourcemanager.monitor.models.ResultType; -import com.azure.resourcemanager.monitor.models.TimeSeriesInformation; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MetricBaselinesClient. */ -public final class MetricBaselinesClientImpl implements MetricBaselinesClient { - private final ClientLogger logger = new ClientLogger(MetricBaselinesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final MetricBaselinesService service; - - /** The service client containing this operation class. */ - private final MonitorClientImpl client; - - /** - * Initializes an instance of MetricBaselinesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MetricBaselinesClientImpl(MonitorClientImpl client) { - this.service = - RestProxy.create(MetricBaselinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MonitorClientMetricBaselines to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MonitorClientMetricB") - private interface MetricBaselinesService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/{resourceUri}/providers/microsoft.insights/baseline/{metricName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @PathParam("metricName") String metricName, - @QueryParam("timespan") String timespan, - @QueryParam("interval") Duration interval, - @QueryParam("aggregation") String aggregation, - @QueryParam("sensitivities") String sensitivities, - @QueryParam("resultType") ResultType resultType, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post("/{resourceUri}/providers/microsoft.insights/calculatebaseline") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> calculateBaseline( - @HostParam("$host") String endpoint, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TimeSeriesInformation timeSeriesInformation, - Context context); - } - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 aggregation The aggregation type of the metric to retrieve the baseline for. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceUri, - String metricName, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - ResultType resultType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (metricName == null) { - return Mono.error(new IllegalArgumentException("Parameter metricName is required and cannot be null.")); - } - final String apiVersion = "2017-11-01-preview"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceUri, - metricName, - timespan, - interval, - aggregation, - sensitivities, - resultType, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 aggregation The aggregation type of the metric to retrieve the baseline for. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceUri, - String metricName, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - ResultType resultType, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (metricName == null) { - return Mono.error(new IllegalArgumentException("Parameter metricName is required and cannot be null.")); - } - final String apiVersion = "2017-11-01-preview"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceUri, - metricName, - timespan, - interval, - aggregation, - sensitivities, - resultType, - apiVersion, - context); - } - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 aggregation The aggregation type of the metric to retrieve the baseline for. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceUri, - String metricName, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - ResultType resultType) { - return getWithResponseAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceUri, String metricName) { - final String timespan = null; - final Duration interval = null; - final String aggregation = null; - final String sensitivities = null; - final ResultType resultType = null; - return getWithResponseAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BaselineResponseInner get(String resourceUri, String metricName) { - final String timespan = null; - final Duration interval = null; - final String aggregation = null; - final String sensitivities = null; - final ResultType resultType = null; - return getAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType).block(); - } - - /** - * **Gets the baseline values for a specific metric**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param metricName The name of the metric to retrieve the baseline for. - * @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 aggregation The aggregation type of the metric to retrieve the baseline for. - * @param sensitivities The list of sensitivities (comma separated) to retrieve. - * @param resultType Allows retrieving only metadata of the baseline. On data request all information is retrieved. - * @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 baseline query. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceUri, - String metricName, - String timespan, - Duration interval, - String aggregation, - String sensitivities, - ResultType resultType, - Context context) { - return getWithResponseAsync( - resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType, context) - .block(); - } - - /** - * **Lists the baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param timeSeriesInformation The time series info needed for calculating the baseline. - * @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 calculate baseline call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> calculateBaselineWithResponseAsync( - String resourceUri, TimeSeriesInformation timeSeriesInformation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (timeSeriesInformation == null) { - return Mono - .error(new IllegalArgumentException("Parameter timeSeriesInformation is required and cannot be null.")); - } else { - timeSeriesInformation.validate(); - } - final String apiVersion = "2017-11-01-preview"; - return FluxUtil - .withContext( - context -> - service - .calculateBaseline( - this.client.getEndpoint(), resourceUri, apiVersion, timeSeriesInformation, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * **Lists the baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param timeSeriesInformation The time series info needed for calculating the baseline. - * @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 calculate baseline call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> calculateBaselineWithResponseAsync( - String resourceUri, TimeSeriesInformation timeSeriesInformation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (timeSeriesInformation == null) { - return Mono - .error(new IllegalArgumentException("Parameter timeSeriesInformation is required and cannot be null.")); - } else { - timeSeriesInformation.validate(); - } - final String apiVersion = "2017-11-01-preview"; - context = this.client.mergeContext(context); - return service - .calculateBaseline(this.client.getEndpoint(), resourceUri, apiVersion, timeSeriesInformation, context); - } - - /** - * **Lists the baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param timeSeriesInformation The time series info needed for calculating the baseline. - * @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 calculate baseline call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono calculateBaselineAsync( - String resourceUri, TimeSeriesInformation timeSeriesInformation) { - return calculateBaselineWithResponseAsync(resourceUri, timeSeriesInformation) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * **Lists the baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param timeSeriesInformation The time series info needed for calculating the baseline. - * @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 calculate baseline call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CalculateBaselineResponseInner calculateBaseline( - String resourceUri, TimeSeriesInformation timeSeriesInformation) { - return calculateBaselineAsync(resourceUri, timeSeriesInformation).block(); - } - - /** - * **Lists the baseline values for a resource**. - * - * @param resourceUri The identifier of the resource. It has the following structure: - * subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. - * For example: - * subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1. - * @param timeSeriesInformation The time series info needed for calculating the baseline. - * @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 calculate baseline call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response calculateBaselineWithResponse( - String resourceUri, TimeSeriesInformation timeSeriesInformation, Context context) { - return calculateBaselineWithResponseAsync(resourceUri, timeSeriesInformation, context).block(); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java index 4fb75fd760c5..64b4b6e1575a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionImpl.java @@ -10,9 +10,9 @@ import com.azure.resourcemanager.monitor.models.MetricCollection; import com.azure.resourcemanager.monitor.models.MetricDefinition; import com.azure.resourcemanager.monitor.models.ResultType; -import com.azure.resourcemanager.monitor.models.Unit; import com.azure.resourcemanager.monitor.fluent.models.LocalizableStringInner; import com.azure.resourcemanager.monitor.fluent.models.MetricDefinitionInner; +import com.azure.resourcemanager.monitor.models.Unit; import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; import java.time.Duration; import java.time.OffsetDateTime; @@ -88,7 +88,7 @@ public List supportedAggregationTypes() { } public Unit unit() { - return this.inner.unit(); + return this.innerModel().unit(); } public AggregationType primaryAggregationType() { diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java index 995c30d28e5f..3a8ddd54b405 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDefinitionsClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -58,8 +59,8 @@ public final class MetricDefinitionsClientImpl implements MetricDefinitionsClien @Host("{$host}") @ServiceInterface(name = "MonitorClientMetricD") private interface MetricDefinitionsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/{resourceUri}/providers/microsoft.insights/metricDefinitions") + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.Insights/metricDefinitions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -67,6 +68,7 @@ Mono> list( @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @QueryParam("metricnamespace") String metricnamespace, + @HeaderParam("Accept") String accept, Context context); } @@ -92,14 +94,16 @@ private Mono> listSinglePageAsync(String re return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2018-01-01"; + final String accept = "application/json"; return FluxUtil .withContext( - context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, metricnamespace, context)) + context -> + service.list(this.client.getEndpoint(), resourceUri, apiVersion, metricnamespace, accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -126,9 +130,10 @@ private Mono> listSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2018-01-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), resourceUri, apiVersion, metricnamespace, context) + .list(this.client.getEndpoint(), resourceUri, apiVersion, metricnamespace, accept, context) .map( res -> new PagedResponseBase<>( @@ -185,30 +190,30 @@ private PagedFlux listAsync(String resourceUri, String me * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. - * @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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri, String metricnamespace, Context context) { - return new PagedIterable<>(listAsync(resourceUri, metricnamespace, context)); + public PagedIterable list(String resourceUri) { + final String metricnamespace = null; + return new PagedIterable<>(listAsync(resourceUri, metricnamespace)); } /** * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. + * @param metricnamespace Metric namespace to query metric definitions for. + * @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. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { - final String metricnamespace = null; - return new PagedIterable<>(listAsync(resourceUri, metricnamespace)); + public PagedIterable list(String resourceUri, String metricnamespace, Context context) { + return new PagedIterable<>(listAsync(resourceUri, metricnamespace, context)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDynamicAlertConditionImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDynamicAlertConditionImpl.java index d10979d4c64a..0d2e4c1b0c5e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDynamicAlertConditionImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricDynamicAlertConditionImpl.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.monitor.implementation; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.monitor.models.AggregationType; +import com.azure.resourcemanager.monitor.models.AggregationTypeEnum; import com.azure.resourcemanager.monitor.models.DynamicMetricCriteria; import com.azure.resourcemanager.monitor.models.DynamicThresholdFailingPeriods; import com.azure.resourcemanager.monitor.models.DynamicThresholdOperator; @@ -68,7 +68,7 @@ public MetricDynamicAlertConditionImpl withCondition( DynamicThresholdOperator condition, DynamicThresholdSensitivity alertSensitivity) { this.innerModel().withOperator(condition); - this.innerModel().withTimeAggregation(AggregationType.fromString(timeAggregation.toString())); + this.innerModel().withTimeAggregation(AggregationTypeEnum.fromString(timeAggregation.toString())); this.innerModel().withAlertSensitivity(alertSensitivity); return this; } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricImpl.java index f3693c2db594..c9607ed814c4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricImpl.java @@ -5,8 +5,8 @@ import com.azure.resourcemanager.monitor.models.LocalizableString; import com.azure.resourcemanager.monitor.models.Metric; -import com.azure.resourcemanager.monitor.models.TimeSeriesElement; import com.azure.resourcemanager.monitor.models.Unit; +import com.azure.resourcemanager.monitor.models.TimeSeriesElement; import com.azure.resourcemanager.monitor.fluent.models.MetricInner; import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; import java.util.List; diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java index 9bf2317dd2f5..b876969fc9d3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricNamespacesClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -58,7 +59,7 @@ public final class MetricNamespacesClientImpl implements MetricNamespacesClient @Host("{$host}") @ServiceInterface(name = "MonitorClientMetricN") private interface MetricNamespacesService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get("/{resourceUri}/providers/microsoft.insights/metricNamespaces") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -67,6 +68,7 @@ Mono> list( @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("api-version") String apiVersion, @QueryParam("startTime") String startTime, + @HeaderParam("Accept") String accept, Context context); } @@ -92,14 +94,15 @@ private Mono> listSinglePageAsync(String res return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2017-12-01-preview"; + final String accept = "application/json"; return FluxUtil .withContext( - context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, startTime, context)) + context -> service.list(this.client.getEndpoint(), resourceUri, apiVersion, startTime, accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -126,9 +129,10 @@ private Mono> listSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2017-12-01-preview"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), resourceUri, apiVersion, startTime, context) + .list(this.client.getEndpoint(), resourceUri, apiVersion, startTime, accept, context) .map( res -> new PagedResponseBase<>( @@ -185,30 +189,30 @@ private PagedFlux listAsync(String resourceUri, String sta * Lists the metric namespaces for the resource. * * @param resourceUri The identifier of the resource. - * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. - * @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 namespaces. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri, String startTime, Context context) { - return new PagedIterable<>(listAsync(resourceUri, startTime, context)); + public PagedIterable list(String resourceUri) { + final String startTime = null; + return new PagedIterable<>(listAsync(resourceUri, startTime)); } /** * Lists the metric namespaces for the resource. * * @param resourceUri The identifier of the resource. + * @param startTime The ISO 8601 conform Date start time from which to query for metric namespaces. + * @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 namespaces. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { - final String startTime = null; - return new PagedIterable<>(listAsync(resourceUri, startTime)); + public PagedIterable list(String resourceUri, String startTime, Context context) { + return new PagedIterable<>(listAsync(resourceUri, startTime, context)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java index e3c2ff75eb86..2650511fa7b8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricsClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -54,8 +55,8 @@ public final class MetricsClientImpl implements MetricsClient { @Host("{$host}") @ServiceInterface(name = "MonitorClientMetrics") private interface MetricsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/{resourceUri}/providers/microsoft.insights/metrics") + @Headers({"Content-Type: application/json"}) + @Get("/{resourceUri}/providers/Microsoft.Insights/metrics") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -71,6 +72,7 @@ Mono> list( @QueryParam("resultType") ResultType resultType, @QueryParam("api-version") String apiVersion, @QueryParam("metricnamespace") String metricnamespace, + @HeaderParam("Accept") String accept, Context context); } @@ -81,19 +83,22 @@ Mono> list( * @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. + * @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 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 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 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. @@ -124,6 +129,7 @@ public Mono> listWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2018-01-01"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -141,8 +147,9 @@ public Mono> listWithResponseAsync( resultType, apiVersion, metricnamespace, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -152,19 +159,22 @@ public Mono> listWithResponseAsync( * @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. + * @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 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 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 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. @@ -197,6 +207,7 @@ private Mono> listWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2018-01-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( @@ -212,6 +223,7 @@ private Mono> listWithResponseAsync( resultType, apiVersion, metricnamespace, + accept, context); } @@ -222,19 +234,22 @@ private Mono> listWithResponseAsync( * @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. + * @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 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 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 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. @@ -358,19 +373,22 @@ public ResponseInner list(String resourceUri) { * @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. + * @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 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 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 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. diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientBuilder.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientBuilder.java index f10eba7276b3..fc95b3561da6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientBuilder.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientBuilder.java @@ -19,12 +19,12 @@ @ServiceClientBuilder(serviceClients = {MonitorClientImpl.class}) public final class MonitorClientBuilder { /* - * The Azure subscription Id. + * The ID of the target subscription. */ private String subscriptionId; /** - * Sets The Azure subscription Id. + * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. * @return the MonitorClientBuilder. diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java index 69b198e75861..77a4bd85c284 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MonitorClientImpl.java @@ -16,18 +16,25 @@ import com.azure.resourcemanager.monitor.fluent.AlertRulesClient; import com.azure.resourcemanager.monitor.fluent.AutoscaleSettingsClient; import com.azure.resourcemanager.monitor.fluent.BaselinesClient; +import com.azure.resourcemanager.monitor.fluent.DataCollectionEndpointsClient; +import com.azure.resourcemanager.monitor.fluent.DataCollectionRuleAssociationsClient; +import com.azure.resourcemanager.monitor.fluent.DataCollectionRulesClient; import com.azure.resourcemanager.monitor.fluent.DiagnosticSettingsCategoriesClient; import com.azure.resourcemanager.monitor.fluent.DiagnosticSettingsClient; import com.azure.resourcemanager.monitor.fluent.EventCategoriesClient; import com.azure.resourcemanager.monitor.fluent.LogProfilesClient; import com.azure.resourcemanager.monitor.fluent.MetricAlertsClient; import com.azure.resourcemanager.monitor.fluent.MetricAlertsStatusClient; -import com.azure.resourcemanager.monitor.fluent.MetricBaselinesClient; import com.azure.resourcemanager.monitor.fluent.MetricDefinitionsClient; import com.azure.resourcemanager.monitor.fluent.MetricNamespacesClient; import com.azure.resourcemanager.monitor.fluent.MetricsClient; import com.azure.resourcemanager.monitor.fluent.MonitorClient; import com.azure.resourcemanager.monitor.fluent.OperationsClient; +import com.azure.resourcemanager.monitor.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.monitor.fluent.PrivateLinkResourcesClient; +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; import com.azure.resourcemanager.monitor.fluent.VMInsightsClient; @@ -39,11 +46,11 @@ public final class MonitorClientImpl extends AzureServiceClient implements MonitorClient { private final ClientLogger logger = new ClientLogger(MonitorClientImpl.class); - /** The Azure subscription Id. */ + /** The ID of the target subscription. */ private final String subscriptionId; /** - * Gets The Azure subscription Id. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -195,18 +202,6 @@ public ActionGroupsClient getActionGroups() { return this.actionGroups; } - /** The ActivityLogAlertsClient object to access its operations. */ - private final ActivityLogAlertsClient activityLogAlerts; - - /** - * Gets the ActivityLogAlertsClient object to access its operations. - * - * @return the ActivityLogAlertsClient object. - */ - public ActivityLogAlertsClient getActivityLogAlerts() { - return this.activityLogAlerts; - } - /** The ActivityLogsClient object to access its operations. */ private final ActivityLogsClient activityLogs; @@ -267,18 +262,6 @@ public MetricsClient getMetrics() { return this.metrics; } - /** The MetricBaselinesClient object to access its operations. */ - private final MetricBaselinesClient metricBaselines; - - /** - * Gets the MetricBaselinesClient object to access its operations. - * - * @return the MetricBaselinesClient object. - */ - public MetricBaselinesClient getMetricBaselines() { - return this.metricBaselines; - } - /** The BaselinesClient object to access its operations. */ private final BaselinesClient baselines; @@ -351,6 +334,114 @@ public VMInsightsClient getVMInsights() { return this.vMInsights; } + /** The PrivateLinkScopesClient object to access its operations. */ + private final PrivateLinkScopesClient privateLinkScopes; + + /** + * Gets the PrivateLinkScopesClient object to access its operations. + * + * @return the PrivateLinkScopesClient object. + */ + public PrivateLinkScopesClient getPrivateLinkScopes() { + return this.privateLinkScopes; + } + + /** The PrivateLinkScopeOperationStatusClient object to access its operations. */ + private final PrivateLinkScopeOperationStatusClient privateLinkScopeOperationStatus; + + /** + * Gets the PrivateLinkScopeOperationStatusClient object to access its operations. + * + * @return the PrivateLinkScopeOperationStatusClient object. + */ + public PrivateLinkScopeOperationStatusClient getPrivateLinkScopeOperationStatus() { + return this.privateLinkScopeOperationStatus; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkScopedResourcesClient object to access its operations. */ + private final PrivateLinkScopedResourcesClient privateLinkScopedResources; + + /** + * Gets the PrivateLinkScopedResourcesClient object to access its operations. + * + * @return the PrivateLinkScopedResourcesClient object. + */ + public PrivateLinkScopedResourcesClient getPrivateLinkScopedResources() { + return this.privateLinkScopedResources; + } + + /** The ActivityLogAlertsClient object to access its operations. */ + private final ActivityLogAlertsClient activityLogAlerts; + + /** + * Gets the ActivityLogAlertsClient object to access its operations. + * + * @return the ActivityLogAlertsClient object. + */ + public ActivityLogAlertsClient getActivityLogAlerts() { + return this.activityLogAlerts; + } + + /** The DataCollectionEndpointsClient object to access its operations. */ + private final DataCollectionEndpointsClient dataCollectionEndpoints; + + /** + * Gets the DataCollectionEndpointsClient object to access its operations. + * + * @return the DataCollectionEndpointsClient object. + */ + public DataCollectionEndpointsClient getDataCollectionEndpoints() { + return this.dataCollectionEndpoints; + } + + /** The DataCollectionRuleAssociationsClient object to access its operations. */ + private final DataCollectionRuleAssociationsClient dataCollectionRuleAssociations; + + /** + * Gets the DataCollectionRuleAssociationsClient object to access its operations. + * + * @return the DataCollectionRuleAssociationsClient object. + */ + public DataCollectionRuleAssociationsClient getDataCollectionRuleAssociations() { + return this.dataCollectionRuleAssociations; + } + + /** The DataCollectionRulesClient object to access its operations. */ + private final DataCollectionRulesClient dataCollectionRules; + + /** + * Gets the DataCollectionRulesClient object to access its operations. + * + * @return the DataCollectionRulesClient object. + */ + public DataCollectionRulesClient getDataCollectionRules() { + return this.dataCollectionRules; + } + /** * Initializes an instance of MonitorClient client. * @@ -358,7 +449,7 @@ public VMInsightsClient getVMInsights() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The Azure subscription Id. + * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ MonitorClientImpl( @@ -382,18 +473,25 @@ public VMInsightsClient getVMInsights() { this.diagnosticSettings = new DiagnosticSettingsClientImpl(this); this.diagnosticSettingsCategories = new DiagnosticSettingsCategoriesClientImpl(this); this.actionGroups = new ActionGroupsClientImpl(this); - this.activityLogAlerts = new ActivityLogAlertsClientImpl(this); this.activityLogs = new ActivityLogsClientImpl(this); this.eventCategories = new EventCategoriesClientImpl(this); this.tenantActivityLogs = new TenantActivityLogsClientImpl(this); this.metricDefinitions = new MetricDefinitionsClientImpl(this); this.metrics = new MetricsClientImpl(this); - this.metricBaselines = new MetricBaselinesClientImpl(this); this.baselines = new BaselinesClientImpl(this); this.metricAlerts = new MetricAlertsClientImpl(this); this.metricAlertsStatus = new MetricAlertsStatusClientImpl(this); this.scheduledQueryRules = new ScheduledQueryRulesClientImpl(this); this.metricNamespaces = new MetricNamespacesClientImpl(this); this.vMInsights = new VMInsightsClientImpl(this); + this.privateLinkScopes = new PrivateLinkScopesClientImpl(this); + this.privateLinkScopeOperationStatus = new PrivateLinkScopeOperationStatusClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkScopedResources = new PrivateLinkScopedResourcesClientImpl(this); + this.activityLogAlerts = new ActivityLogAlertsClientImpl(this); + this.dataCollectionEndpoints = new DataCollectionEndpointsClientImpl(this); + this.dataCollectionRuleAssociations = new DataCollectionRuleAssociationsClientImpl(this); + this.dataCollectionRules = new DataCollectionRulesClientImpl(this); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java index 876952c54d16..1935171d38ca 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/OperationsClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -52,12 +53,15 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "MonitorClientOperati") private interface OperationsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/providers/microsoft.insights/operations") + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Insights/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, Context context); + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -76,9 +80,10 @@ public Mono> listWithResponseAsync() { "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -99,8 +104,9 @@ private Mono> listWithResponseAsync(Context c "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, context); + return service.list(this.client.getEndpoint(), apiVersion, accept, context); } /** diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..f128510da74b --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1172 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.monitor.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.monitor.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.monitor.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final MonitorClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(MonitorClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MonitorClientPrivateEndpointConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MonitorClientPrivate") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScope( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, scopeName, privateEndpointConnectionName).block(); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + parameters, + accept, + context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters).block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @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 a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String scopeName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, parameters, context) + .block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + privateEndpointConnectionName, + context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName).block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, scopeName, privateEndpointConnectionName, context).block(); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByPrivateLinkScopeAsync( + String resourceGroupName, String scopeName) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPrivateLinkScopeAsync( + String resourceGroupName, String scopeName, Context context) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName, context), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..ec2932b0d4ce --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,523 @@ +// 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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.monitor.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.monitor.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final MonitorClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(MonitorClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MonitorClientPrivateLinkResources to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MonitorClientPrivate") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScope( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("groupName") String groupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPrivateLinkScopeAsync( + String resourceGroupName, String scopeName, Context context) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName, context), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName, context)); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link 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 the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String groupName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + groupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String groupName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + groupName, + accept, + context); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link 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 the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String scopeName, String groupName) { + return getWithResponseAsync(resourceGroupName, scopeName, groupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link 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 the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName) { + return getAsync(resourceGroupName, scopeName, groupName).block(); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @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 private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String scopeName, String groupName, Context context) { + return getWithResponseAsync(resourceGroupName, scopeName, groupName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.java new file mode 100644 index 000000000000..dff0cabab360 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopeOperationStatusClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopeOperationStatusClient; +import com.azure.resourcemanager.monitor.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkScopeOperationStatusClient. */ +public final class PrivateLinkScopeOperationStatusClientImpl + implements InnerSupportsGet, PrivateLinkScopeOperationStatusClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkScopeOperationStatusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkScopeOperationStatusService service; + + /** The service client containing this operation class. */ + private final MonitorClientImpl client; + + /** + * Initializes an instance of PrivateLinkScopeOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkScopeOperationStatusClientImpl(MonitorClientImpl client) { + this.service = + RestProxy + .create( + PrivateLinkScopeOperationStatusService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MonitorClientPrivateLinkScopeOperationStatus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MonitorClientPrivate") + private interface PrivateLinkScopeOperationStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + + "/privateLinkScopeOperationStatuses/{asyncOperationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("asyncOperationId") String asyncOperationId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * + * @param resourceGroupName The name of the resource group. + * @param asyncOperationId The operation Id. + * @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 status of an azure asynchronous operation associated with a private link scope operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String asyncOperationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (asyncOperationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter asyncOperationId 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.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + asyncOperationId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * + * @param resourceGroupName The name of the resource group. + * @param asyncOperationId The operation Id. + * @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 status of an azure asynchronous operation associated with a private link scope operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String asyncOperationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (asyncOperationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter asyncOperationId 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.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + asyncOperationId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * + * @param resourceGroupName The name of the resource group. + * @param asyncOperationId The operation Id. + * @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 status of an azure asynchronous operation associated with a private link scope operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String asyncOperationId) { + return getByResourceGroupWithResponseAsync(resourceGroupName, asyncOperationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * + * @param resourceGroupName The name of the resource group. + * @param asyncOperationId The operation Id. + * @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 status of an azure asynchronous operation associated with a private link scope operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner getByResourceGroup(String resourceGroupName, String asyncOperationId) { + return getByResourceGroupAsync(resourceGroupName, asyncOperationId).block(); + } + + /** + * Get the status of an azure asynchronous operation associated with a private link scope operation. + * + * @param resourceGroupName The name of the resource group. + * @param asyncOperationId The operation Id. + * @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 status of an azure asynchronous operation associated with a private link scope operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String asyncOperationId, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, asyncOperationId, context).block(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java new file mode 100644 index 000000000000..f0ef89e21042 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopedResourcesClientImpl.java @@ -0,0 +1,1127 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopedResourcesClient; +import com.azure.resourcemanager.monitor.fluent.models.ScopedResourceInner; +import com.azure.resourcemanager.monitor.models.ScopedResourceListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkScopedResourcesClient. */ +public final class PrivateLinkScopedResourcesClientImpl implements PrivateLinkScopedResourcesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkScopedResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkScopedResourcesService service; + + /** The service client containing this operation class. */ + private final MonitorClientImpl client; + + /** + * Initializes an instance of PrivateLinkScopedResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkScopedResourcesClientImpl(MonitorClientImpl client) { + this.service = + RestProxy + .create( + PrivateLinkScopedResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MonitorClientPrivateLinkScopedResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MonitorClientPrivate") + private interface PrivateLinkScopedResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/scopedResources/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("name") String name, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/scopedResources/{name}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("name") String name, + @BodyParam("application/json") ScopedResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/scopedResources/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("name") String name, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights" + + "/privateLinkScopes/{scopeName}/scopedResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScope( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a scoped resource in a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 scoped resource in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String name) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + name, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a scoped resource in a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 a scoped resource in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String scopeName, String name, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + name, + accept, + context); + } + + /** + * Gets a scoped resource in a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 scoped resource in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String scopeName, String name) { + return getWithResponseAsync(resourceGroupName, scopeName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a scoped resource in a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 scoped resource in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopedResourceInner get(String resourceGroupName, String scopeName, String name) { + return getAsync(resourceGroupName, scopeName, name).block(); + } + + /** + * Gets a scoped resource in a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 a scoped resource in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String scopeName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, scopeName, name, context).block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor 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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String scopeName, String name, String linkedResourceId) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + ScopedResourceInner parameters = new ScopedResourceInner(); + parameters.withLinkedResourceId(linkedResourceId); + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + name, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 a private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String scopeName, String name, String linkedResourceId, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + ScopedResourceInner parameters = new ScopedResourceInner(); + parameters.withLinkedResourceId(linkedResourceId); + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + name, + parameters, + accept, + context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor 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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ScopedResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String scopeName, String name, String linkedResourceId) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, scopeName, name, linkedResourceId); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ScopedResourceInner.class, + ScopedResourceInner.class, + Context.NONE); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 a private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ScopedResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, scopeName, name, linkedResourceId, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ScopedResourceInner.class, ScopedResourceInner.class, context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor 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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ScopedResourceInner> beginCreateOrUpdate( + String resourceGroupName, String scopeName, String name, String linkedResourceId) { + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId).getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 a private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ScopedResourceInner> beginCreateOrUpdate( + String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId, context).getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor 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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String scopeName, String name, String linkedResourceId) { + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String scopeName, String name) { + final String linkedResourceId = null; + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 a private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor 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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopedResourceInner createOrUpdate( + String resourceGroupName, String scopeName, String name, String linkedResourceId) { + return createOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId).block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopedResourceInner createOrUpdate(String resourceGroupName, String scopeName, String name) { + final String linkedResourceId = null; + return createOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId).block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @param linkedResourceId The resource id of the scoped Azure monitor resource. + * @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 a private link scoped resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopedResourceInner createOrUpdate( + String resourceGroupName, String scopeName, String name, String linkedResourceId, Context context) { + return createOrUpdateAsync(resourceGroupName, scopeName, name, linkedResourceId, context).block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String scopeName, String name) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + name, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String scopeName, String name, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + name, + context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String scopeName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName, name); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String scopeName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, String name) { + return beginDeleteAsync(resourceGroupName, scopeName, name).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String scopeName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, name, context).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String scopeName, String name) { + return beginDeleteAsync(resourceGroupName, scopeName, name) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String scopeName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName, String name) { + deleteAsync(resourceGroupName, scopeName, name).block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param name The name of the scoped resource object. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName, String name, Context context) { + deleteAsync(resourceGroupName, scopeName, name, context).block(); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeSinglePageAsync( + String resourceGroupName, String scopeName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScope( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + scopeName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByPrivateLinkScopeAsync(String resourceGroupName, String scopeName) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPrivateLinkScopeAsync( + String resourceGroupName, String scopeName, Context context) { + return new PagedFlux<>( + () -> listByPrivateLinkScopeSinglePageAsync(resourceGroupName, scopeName, context), + nextLink -> listByPrivateLinkScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope(String resourceGroupName, String scopeName) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName)); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPrivateLinkScope( + String resourceGroupName, String scopeName, Context context) { + return new PagedIterable<>(listByPrivateLinkScopeAsync(resourceGroupName, scopeName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 a list of scoped resources in a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPrivateLinkScopeNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPrivateLinkScopeNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java new file mode 100644 index 000000000000..a5fc6d66c98a --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/PrivateLinkScopesClientImpl.java @@ -0,0 +1,1393 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.monitor.fluent.PrivateLinkScopesClient; +import com.azure.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner; +import com.azure.resourcemanager.monitor.models.AzureMonitorPrivateLinkScopeListResult; +import com.azure.resourcemanager.monitor.models.TagsResource; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.nio.ByteBuffer; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkScopesClient. */ +public final class PrivateLinkScopesClientImpl + implements InnerSupportsGet, + InnerSupportsListing, + InnerSupportsDelete, + PrivateLinkScopesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkScopesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkScopesService service; + + /** The service client containing this operation class. */ + private final MonitorClientImpl client; + + /** + * Initializes an instance of PrivateLinkScopesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkScopesClientImpl(MonitorClientImpl client) { + this.service = + RestProxy.create(PrivateLinkScopesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MonitorClientPrivateLinkScopes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MonitorClientPrivate") + private interface PrivateLinkScopesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/privateLinkScopes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + + "/privateLinkScopes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + + "/privateLinkScopes/{scopeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + + "/privateLinkScopes/{scopeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + + "/privateLinkScopes/{scopeName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, + @BodyParam("application/json") AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights" + + "/privateLinkScopes/{scopeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, + @BodyParam("application/json") TagsResource privateLinkScopeTags, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * + * @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 all Azure Monitor PrivateLinkScopes within a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * + * @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 a list of all Azure Monitor PrivateLinkScopes within a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * + * @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 all Azure Monitor PrivateLinkScopes within a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * + * @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 a list of all Azure Monitor PrivateLinkScopes within a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * + * @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 all Azure Monitor PrivateLinkScopes within a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. + * + * @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 a list of all Azure Monitor PrivateLinkScopes within a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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 Azure Monitor PrivateLinkScopes within a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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 a list of Azure Monitor PrivateLinkScopes within a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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 Azure Monitor PrivateLinkScopes within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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 a list of Azure Monitor PrivateLinkScopes within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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 Azure Monitor PrivateLinkScopes within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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 a list of Azure Monitor PrivateLinkScopes within a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + context); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String scopeName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String scopeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, scopeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName) { + return beginDeleteAsync(resourceGroupName, scopeName).getSyncPoller(); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String scopeName, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, context).getSyncPoller(); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String scopeName) { + return beginDeleteAsync(resourceGroupName, scopeName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String scopeName, Context context) { + return beginDeleteAsync(resourceGroupName, scopeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName) { + deleteAsync(resourceGroupName, scopeName).block(); + } + + /** + * Deletes a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName, Context context) { + deleteAsync(resourceGroupName, scopeName, context).block(); + } + + /** + * Returns a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + accept, + context); + } + + /** + * Returns a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String scopeName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureMonitorPrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName) { + return getByResourceGroupAsync(resourceGroupName, scopeName).block(); + } + + /** + * Returns a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String scopeName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName, context).block(); + } + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure + * Monitor PrivateLinkScope. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String scopeName, + AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (azureMonitorPrivateLinkScopePayload == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureMonitorPrivateLinkScopePayload is required and cannot be null.")); + } else { + azureMonitorPrivateLinkScopePayload.validate(); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + azureMonitorPrivateLinkScopePayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure + * Monitor PrivateLinkScope. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String scopeName, + AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (azureMonitorPrivateLinkScopePayload == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureMonitorPrivateLinkScopePayload is required and cannot be null.")); + } else { + azureMonitorPrivateLinkScopePayload.validate(); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + azureMonitorPrivateLinkScopePayload, + accept, + context); + } + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure + * Monitor PrivateLinkScope. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String scopeName, + AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload) { + return createOrUpdateWithResponseAsync(resourceGroupName, scopeName, azureMonitorPrivateLinkScopePayload) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure + * Monitor PrivateLinkScope. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureMonitorPrivateLinkScopeInner createOrUpdate( + String resourceGroupName, + String scopeName, + AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload) { + return createOrUpdateAsync(resourceGroupName, scopeName, azureMonitorPrivateLinkScopePayload).block(); + } + + /** + * Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param azureMonitorPrivateLinkScopePayload Properties that need to be specified to create or update a Azure + * Monitor PrivateLinkScope. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String scopeName, + AzureMonitorPrivateLinkScopeInner azureMonitorPrivateLinkScopePayload, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, scopeName, azureMonitorPrivateLinkScopePayload, context) + .block(); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param tags Resource tags. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateTagsWithResponseAsync( + String resourceGroupName, String scopeName, Map tags) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + TagsResource privateLinkScopeTags = new TagsResource(); + privateLinkScopeTags.withTags(tags); + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + privateLinkScopeTags, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param tags Resource tags. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String scopeName, Map tags, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String apiVersion = "2019-10-17-preview"; + final String accept = "application/json"; + TagsResource privateLinkScopeTags = new TagsResource(); + privateLinkScopeTags.withTags(tags); + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + scopeName, + privateLinkScopeTags, + accept, + context); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param tags Resource tags. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateTagsAsync( + String resourceGroupName, String scopeName, Map tags) { + return updateTagsWithResponseAsync(resourceGroupName, scopeName, tags) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateTagsAsync(String resourceGroupName, String scopeName) { + final Map tags = null; + return updateTagsWithResponseAsync(resourceGroupName, scopeName, tags) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope 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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureMonitorPrivateLinkScopeInner updateTags(String resourceGroupName, String scopeName) { + final Map tags = null; + return updateTagsAsync(resourceGroupName, scopeName, tags).block(); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. + * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. + * @param tags Resource tags. + * @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 an Azure Monitor PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String scopeName, Map tags, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, scopeName, tags, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 describes the list of Azure Monitor PrivateLinkScope resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 describes the list of Azure Monitor PrivateLinkScope resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java index 9949351e415e..c38035d5aff1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ScheduledQueryRulesClientImpl.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -70,9 +71,9 @@ public final class ScheduledQueryRulesClientImpl @Host("{$host}") @ServiceInterface(name = "MonitorClientSchedul") private interface ScheduledQueryRulesService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/scheduledQueryRules/{ruleName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -83,11 +84,12 @@ Mono> createOrUpdate( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") LogSearchRuleResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/scheduledQueryRules/{ruleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -97,11 +99,12 @@ Mono> getByResourceGroup( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/scheduledQueryRules/{ruleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -112,11 +115,12 @@ Mono> update( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") LogSearchRuleResourcePatch parameters, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/scheduledQueryRules/{ruleName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -126,10 +130,11 @@ Mono> delete( @PathParam("ruleName") String ruleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/microsoft.insights/scheduledQueryRules") + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -137,11 +142,12 @@ Mono> list( @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights" + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights" + "/scheduledQueryRules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -151,6 +157,7 @@ Mono> listByResourceGroup( @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } @@ -159,7 +166,7 @@ Mono> listByResourceGroup( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The Log Search Rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -193,6 +200,7 @@ public Mono> createOrUpdateWithResponseAsyn parameters.validate(); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -204,8 +212,9 @@ public Mono> createOrUpdateWithResponseAsyn ruleName, apiVersion, parameters, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -213,7 +222,7 @@ public Mono> createOrUpdateWithResponseAsyn * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The Log Search Rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -248,6 +257,7 @@ private Mono> createOrUpdateWithResponseAsy parameters.validate(); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( @@ -257,6 +267,7 @@ private Mono> createOrUpdateWithResponseAsy ruleName, apiVersion, parameters, + accept, context); } @@ -265,7 +276,7 @@ private Mono> createOrUpdateWithResponseAsy * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The Log Search Rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -290,7 +301,7 @@ public Mono createOrUpdateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The Log Search Rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -307,7 +318,7 @@ public LogSearchRuleResourceInner createOrUpdate( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The Log Search Rule resource. + * @param parameters The parameters of the rule to create or update. * @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. @@ -353,6 +364,7 @@ public Mono> getByResourceGroupWithResponse "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -363,8 +375,9 @@ public Mono> getByResourceGroupWithResponse ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -401,6 +414,7 @@ private Mono> getByResourceGroupWithRespons "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( @@ -409,6 +423,7 @@ private Mono> getByResourceGroupWithRespons ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context); } @@ -472,7 +487,7 @@ public Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The log search rule resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -506,6 +521,7 @@ public Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -517,8 +533,9 @@ public Mono> updateWithResponseAsync( ruleName, apiVersion, parameters, + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -526,7 +543,7 @@ public Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The log search rule resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -561,6 +578,7 @@ private Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( @@ -570,6 +588,7 @@ private Mono> updateWithResponseAsync( ruleName, apiVersion, parameters, + accept, context); } @@ -578,7 +597,7 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The log search rule resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -603,7 +622,7 @@ public Mono updateAsync( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The log search rule resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -620,7 +639,7 @@ public LogSearchRuleResourceInner update( * * @param resourceGroupName The name of the resource group. * @param ruleName The name of the rule. - * @param parameters The log search rule resource for patch operations. + * @param parameters The parameters of the rule to update. * @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. @@ -665,6 +684,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -675,8 +695,9 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -712,6 +733,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( @@ -720,6 +742,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S ruleName, apiVersion, this.client.getSubscriptionId(), + accept, context); } @@ -793,16 +816,23 @@ private Mono> listSinglePageAsync(Stri "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list(this.client.getEndpoint(), apiVersion, filter, this.client.getSubscriptionId(), context)) + .list( + this.client.getEndpoint(), + apiVersion, + filter, + this.client.getSubscriptionId(), + accept, + context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -831,9 +861,10 @@ private Mono> listSinglePageAsync(Stri "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, filter, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), apiVersion, filter, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( @@ -887,30 +918,30 @@ private PagedFlux listAsync(String filter, Context c /** * List the Log Search rules within a subscription group. * - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @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 a collection of Log Search rule resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); } /** * List the Log Search rules within a subscription group. * + * @param filter The filter to apply on the operation. For more information please see + * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. + * @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 a collection of Log Search rule resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); } /** @@ -944,6 +975,7 @@ private Mono> listByResourceGroupSingl "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; return FluxUtil .withContext( context -> @@ -954,12 +986,13 @@ private Mono> listByResourceGroupSingl apiVersion, filter, this.client.getSubscriptionId(), + accept, context)) .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -994,6 +1027,7 @@ private Mono> listByResourceGroupSingl "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-04-16"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( @@ -1002,6 +1036,7 @@ private Mono> listByResourceGroupSingl apiVersion, filter, this.client.getSubscriptionId(), + accept, context) .map( res -> @@ -1062,32 +1097,32 @@ private PagedFlux listByResourceGroupAsync( * List the Log Search rules within a resource group. * * @param resourceGroupName The name of the resource group. - * @param filter The filter to apply on the operation. For more information please see - * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. - * @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 a collection of Log Search rule resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); } /** * List the Log Search rules within a resource group. * * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For more information please see + * https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. + * @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 a collection of Log Search rule resources. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java index b31dfbde0c35..df98bc640f91 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/TenantActivityLogsClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -58,8 +59,8 @@ public final class TenantActivityLogsClientImpl implements TenantActivityLogsCli @Host("{$host}") @ServiceInterface(name = "MonitorClientTenantA") private interface TenantActivityLogsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Get("/providers/microsoft.insights/eventtypes/management/values") + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Insights/eventtypes/management/values") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -67,14 +68,18 @@ Mono> list( @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("$select") String select, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -115,8 +120,10 @@ private Mono> listSinglePageAsync(String filter, S "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, filter, select, context)) + .withContext( + context -> service.list(this.client.getEndpoint(), apiVersion, filter, select, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -126,7 +133,7 @@ private Mono> listSinglePageAsync(String filter, S res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -168,9 +175,10 @@ private Mono> listSinglePageAsync(String filter, S "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2015-04-01"; + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, filter, select, context) + .list(this.client.getEndpoint(), apiVersion, filter, select, accept, context) .map( res -> new PagedResponseBase<>( @@ -271,6 +279,23 @@ private PagedFlux listAsync(String filter, String select, Contex () -> listSinglePageAsync(filter, select, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } + /** + * Gets 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. + * + * @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 Activity Logs for the Tenant. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final String select = null; + return new PagedIterable<>(listAsync(filter, select)); + } + /** * Gets 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 @@ -306,23 +331,6 @@ public PagedIterable list(String filter, String select, Context return new PagedIterable<>(listAsync(filter, select, context)); } - /** - * Gets 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. - * - * @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 Activity Logs for the Tenant. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final String select = null; - return new PagedIterable<>(listAsync(filter, select)); - } - /** * Get the next page of items. * @@ -337,8 +345,15 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, context)) + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -348,7 +363,7 @@ private Mono> listNextSinglePageAsync(String nextL res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -366,9 +381,16 @@ private Mono> listNextSinglePageAsync(String nextL if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, context) + .listNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java index 544d8023c98a..4cb9b2fd4a4c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/VMInsightsClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -53,7 +54,7 @@ public final class VMInsightsClientImpl implements VMInsightsClient { @Host("{$host}") @ServiceInterface(name = "MonitorClientVMInsig") private interface VMInsightsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Headers({"Content-Type: application/json"}) @Get("/{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) @@ -61,6 +62,7 @@ Mono> getOnboardingStatus( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @HeaderParam("Accept") String accept, Context context); } @@ -86,10 +88,12 @@ public Mono> getOnboardingStatusWithRe return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2018-11-27-preview"; + final String accept = "application/json"; return FluxUtil .withContext( - context -> service.getOnboardingStatus(this.client.getEndpoint(), apiVersion, resourceUri, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + context -> + service.getOnboardingStatus(this.client.getEndpoint(), apiVersion, resourceUri, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -116,8 +120,9 @@ private Mono> getOnboardingStatusWithR return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); } final String apiVersion = "2018-11-27-preview"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getOnboardingStatus(this.client.getEndpoint(), apiVersion, resourceUri, context); + return service.getOnboardingStatus(this.client.getEndpoint(), apiVersion, resourceUri, accept, context); } /** diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java new file mode 100644 index 000000000000..9979d0ec5d87 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AggregationTypeEnum.java @@ -0,0 +1,43 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AggregationTypeEnum. */ +public final class AggregationTypeEnum extends ExpandableStringEnum { + /** Static value Average for AggregationTypeEnum. */ + public static final AggregationTypeEnum AVERAGE = fromString("Average"); + + /** Static value Count for AggregationTypeEnum. */ + public static final AggregationTypeEnum COUNT = fromString("Count"); + + /** Static value Minimum for AggregationTypeEnum. */ + public static final AggregationTypeEnum MINIMUM = fromString("Minimum"); + + /** Static value Maximum for AggregationTypeEnum. */ + public static final AggregationTypeEnum MAXIMUM = fromString("Maximum"); + + /** Static value Total for AggregationTypeEnum. */ + public static final AggregationTypeEnum TOTAL = fromString("Total"); + + /** + * Creates or finds a AggregationTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding AggregationTypeEnum. + */ + @JsonCreator + public static AggregationTypeEnum fromString(String name) { + return fromString(name, AggregationTypeEnum.class); + } + + /** @return known AggregationTypeEnum values. */ + public static Collection values() { + return values(AggregationTypeEnum.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourcePatch.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourcePatch.java index 77da26385ad8..25d9d549c8c2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourcePatch.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AlertRuleResourcePatch.java @@ -38,6 +38,12 @@ public class AlertRuleResourcePatch { @JsonProperty(value = "properties.description") private String description; + /* + * the provisioning state. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + /* * the flag that indicates whether the alert rule is enabled. */ @@ -50,6 +56,13 @@ public class AlertRuleResourcePatch { @JsonProperty(value = "properties.condition") private RuleCondition condition; + /* + * action that is performed when the alert rule becomes active, and when an + * alert condition is resolved. + */ + @JsonProperty(value = "properties.action") + private RuleAction action; + /* * the array of actions that are performed when the alert rule becomes * active, and when an alert condition is resolved. @@ -123,6 +136,26 @@ public AlertRuleResourcePatch withDescription(String description) { return this; } + /** + * Get the provisioningState property: the provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: the provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the AlertRuleResourcePatch object itself. + */ + public AlertRuleResourcePatch withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + /** * Get the isEnabled property: the flag that indicates whether the alert rule is enabled. * @@ -163,6 +196,28 @@ public AlertRuleResourcePatch withCondition(RuleCondition condition) { return this; } + /** + * Get the action property: action that is performed when the alert rule becomes active, and when an alert condition + * is resolved. + * + * @return the action value. + */ + public RuleAction action() { + return this.action; + } + + /** + * Set the action property: action that is performed when the alert rule becomes active, and when an alert condition + * is resolved. + * + * @param action the action value to set. + * @return the AlertRuleResourcePatch object itself. + */ + public AlertRuleResourcePatch withAction(RuleAction action) { + this.action = action; + 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. @@ -203,6 +258,9 @@ public void validate() { if (condition() != null) { condition().validate(); } + if (action() != null) { + action().validate(); + } if (actions() != null) { actions().forEach(e -> e.validate()); } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ArmRoleReceiver.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ArmRoleReceiver.java index 1a5a0d813b50..4f14a010733a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ArmRoleReceiver.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ArmRoleReceiver.java @@ -30,8 +30,8 @@ public final class ArmRoleReceiver { /* * Indicates whether to use common alert schema. */ - @JsonProperty(value = "useCommonAlertSchema", required = true) - private boolean useCommonAlertSchema; + @JsonProperty(value = "useCommonAlertSchema") + private Boolean useCommonAlertSchema; /** * Get the name property: The name of the arm role receiver. Names must be unique across all receivers within an @@ -80,7 +80,7 @@ public ArmRoleReceiver withRoleId(String roleId) { * * @return the useCommonAlertSchema value. */ - public boolean useCommonAlertSchema() { + public Boolean useCommonAlertSchema() { return this.useCommonAlertSchema; } @@ -90,7 +90,7 @@ public boolean useCommonAlertSchema() { * @param useCommonAlertSchema the useCommonAlertSchema value to set. * @return the ArmRoleReceiver object itself. */ - public ArmRoleReceiver withUseCommonAlertSchema(boolean useCommonAlertSchema) { + public ArmRoleReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { this.useCommonAlertSchema = useCommonAlertSchema; return this; } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutomationRunbookReceiver.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutomationRunbookReceiver.java index 5a662ee01960..03152080c3ee 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutomationRunbookReceiver.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutomationRunbookReceiver.java @@ -54,8 +54,8 @@ public final class AutomationRunbookReceiver { /* * Indicates whether to use common alert schema. */ - @JsonProperty(value = "useCommonAlertSchema", required = true) - private boolean useCommonAlertSchema; + @JsonProperty(value = "useCommonAlertSchema") + private Boolean useCommonAlertSchema; /** * Get the automationAccountId property: The Azure automation account Id which holds this runbook and authenticate @@ -184,7 +184,7 @@ public AutomationRunbookReceiver withServiceUri(String serviceUri) { * * @return the useCommonAlertSchema value. */ - public boolean useCommonAlertSchema() { + public Boolean useCommonAlertSchema() { return this.useCommonAlertSchema; } @@ -194,7 +194,7 @@ public boolean useCommonAlertSchema() { * @param useCommonAlertSchema the useCommonAlertSchema value to set. * @return the AutomationRunbookReceiver object itself. */ - public AutomationRunbookReceiver withUseCommonAlertSchema(boolean useCommonAlertSchema) { + public AutomationRunbookReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { this.useCommonAlertSchema = useCommonAlertSchema; return this; } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourcePatch.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourcePatch.java index 1e2cdd15e9ab..9a154b433d77 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourcePatch.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AutoscaleSettingResourcePatch.java @@ -59,6 +59,13 @@ public class AutoscaleSettingResourcePatch { @JsonProperty(value = "properties.targetResourceUri") private String targetResourceUri; + /* + * the location of the resource that the autoscale setting should be added + * to. + */ + @JsonProperty(value = "properties.targetResourceLocation") + private String targetResourceLocation; + /** * Get the tags property: Resource tags. * @@ -185,6 +192,28 @@ public AutoscaleSettingResourcePatch withTargetResourceUri(String targetResource return this; } + /** + * Get the targetResourceLocation property: the location of the resource that the autoscale setting should be added + * to. + * + * @return the targetResourceLocation value. + */ + public String targetResourceLocation() { + return this.targetResourceLocation; + } + + /** + * Set the targetResourceLocation property: the location of the resource that the autoscale setting should be added + * to. + * + * @param targetResourceLocation the targetResourceLocation value to set. + * @return the AutoscaleSettingResourcePatch object itself. + */ + public AutoscaleSettingResourcePatch withTargetResourceLocation(String targetResourceLocation) { + this.targetResourceLocation = targetResourceLocation; + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureFunctionReceiver.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureFunctionReceiver.java index caead5edf130..eb0bbf8fc04b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureFunctionReceiver.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureFunctionReceiver.java @@ -42,8 +42,8 @@ public final class AzureFunctionReceiver { /* * Indicates whether to use common alert schema. */ - @JsonProperty(value = "useCommonAlertSchema", required = true) - private boolean useCommonAlertSchema; + @JsonProperty(value = "useCommonAlertSchema") + private Boolean useCommonAlertSchema; /** * Get the name property: The name of the azure function receiver. Names must be unique across all receivers within @@ -132,7 +132,7 @@ public AzureFunctionReceiver withHttpTriggerUrl(String httpTriggerUrl) { * * @return the useCommonAlertSchema value. */ - public boolean useCommonAlertSchema() { + public Boolean useCommonAlertSchema() { return this.useCommonAlertSchema; } @@ -142,7 +142,7 @@ public boolean useCommonAlertSchema() { * @param useCommonAlertSchema the useCommonAlertSchema value to set. * @return the AzureFunctionReceiver object itself. */ - public AzureFunctionReceiver withUseCommonAlertSchema(boolean useCommonAlertSchema) { + public AzureFunctionReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { this.useCommonAlertSchema = useCommonAlertSchema; return this; } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorMetricsDestination.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorMetricsDestination.java new file mode 100644 index 000000000000..20bc11cfe9b3 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorMetricsDestination.java @@ -0,0 +1,54 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Monitor Metrics destination. */ +@Fluent +public class AzureMonitorMetricsDestination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureMonitorMetricsDestination.class); + + /* + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) + * within the data collection rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * 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 AzureMonitorMetricsDestination object itself. + */ + public AzureMonitorMetricsDestination withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorPrivateLinkScopeListResult.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorPrivateLinkScopeListResult.java new file mode 100644 index 000000000000..59b75f5fbf98 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureMonitorPrivateLinkScopeListResult.java @@ -0,0 +1,90 @@ +// 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.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the list of Azure Monitor PrivateLinkScope resources. */ +@Fluent +public final class AzureMonitorPrivateLinkScopeListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureMonitorPrivateLinkScopeListResult.class); + + /* + * List of Azure Monitor PrivateLinkScope definitions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to get the next set of Azure Monitor PrivateLinkScope + * definitions if too many PrivateLinkScopes where returned in the result + * set. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Azure Monitor PrivateLinkScope definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Azure Monitor PrivateLinkScope definitions. + * + * @param value the value value to set. + * @return the AzureMonitorPrivateLinkScopeListResult object itself. + */ + public AzureMonitorPrivateLinkScopeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many + * PrivateLinkScopes where returned in the result set. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many + * PrivateLinkScopes where returned in the result set. + * + * @param nextLink the nextLink value to set. + * @return the AzureMonitorPrivateLinkScopeListResult object itself. + */ + public AzureMonitorPrivateLinkScopeListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model AzureMonitorPrivateLinkScopeListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureResource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureResource.java new file mode 100644 index 000000000000..de780c13f1f2 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/AzureResource.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.monitor.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An azure resource object. */ +@Fluent +public class AzureResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureResource.class); + + /* + * Azure resource kind + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Azure resource identity + */ + @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) + private String identity; + + /** + * Get the kind property: Azure resource kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the identity property: Azure resource identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** {@inheritDoc} */ + @Override + public AzureResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Baseline.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Baseline.java deleted file mode 100644 index 0fcfc1493b03..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Baseline.java +++ /dev/null @@ -1,118 +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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The baseline values for a single sensitivity value. */ -@Fluent -public final class Baseline { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Baseline.class); - - /* - * the sensitivity of the baseline. - */ - @JsonProperty(value = "sensitivity", required = true) - private Sensitivity sensitivity; - - /* - * The low thresholds of the baseline. - */ - @JsonProperty(value = "lowThresholds", required = true) - private List lowThresholds; - - /* - * The high thresholds of the baseline. - */ - @JsonProperty(value = "highThresholds", required = true) - private List highThresholds; - - /** - * Get the sensitivity property: the sensitivity of the baseline. - * - * @return the sensitivity value. - */ - public Sensitivity sensitivity() { - return this.sensitivity; - } - - /** - * Set the sensitivity property: the sensitivity of the baseline. - * - * @param sensitivity the sensitivity value to set. - * @return the Baseline object itself. - */ - public Baseline withSensitivity(Sensitivity sensitivity) { - this.sensitivity = sensitivity; - return this; - } - - /** - * Get the lowThresholds property: The low thresholds of the baseline. - * - * @return the lowThresholds value. - */ - public List lowThresholds() { - return this.lowThresholds; - } - - /** - * Set the lowThresholds property: The low thresholds of the baseline. - * - * @param lowThresholds the lowThresholds value to set. - * @return the Baseline object itself. - */ - public Baseline withLowThresholds(List lowThresholds) { - this.lowThresholds = lowThresholds; - return this; - } - - /** - * Get the highThresholds property: The high thresholds of the baseline. - * - * @return the highThresholds value. - */ - public List highThresholds() { - return this.highThresholds; - } - - /** - * Set the highThresholds property: The high thresholds of the baseline. - * - * @param highThresholds the highThresholds value to set. - * @return the Baseline object itself. - */ - public Baseline withHighThresholds(List highThresholds) { - this.highThresholds = highThresholds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sensitivity() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property sensitivity in model Baseline")); - } - if (lowThresholds() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property lowThresholds in model Baseline")); - } - if (highThresholds() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property highThresholds in model Baseline")); - } - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionalOperator.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionalOperator.java index 9f6c515bd4b4..5b034708fabb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionalOperator.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConditionalOperator.java @@ -10,6 +10,12 @@ /** Defines values for ConditionalOperator. */ public final class ConditionalOperator extends ExpandableStringEnum { + /** Static value GreaterThanOrEqual for ConditionalOperator. */ + public static final ConditionalOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value LessThanOrEqual for ConditionalOperator. */ + public static final ConditionalOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + /** Static value GreaterThan for ConditionalOperator. */ public static final ConditionalOperator GREATER_THAN = fromString("GreaterThan"); diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConfigurationAccessEndpointSpec.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConfigurationAccessEndpointSpec.java new file mode 100644 index 000000000000..5b1d3b77bbaf --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ConfigurationAccessEndpointSpec.java @@ -0,0 +1,39 @@ +// 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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Definition of the endpoint used for accessing configuration. */ +@Immutable +public class ConfigurationAccessEndpointSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationAccessEndpointSpec.class); + + /* + * The endpoint. This property is READ-ONLY. + */ + @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * Get the endpoint property: The endpoint. This property is READ-ONLY. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java new file mode 100644 index 000000000000..db44f6fc9ed4 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpoint.java @@ -0,0 +1,182 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Definition of data collection endpoint. */ +@Fluent +public class DataCollectionEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpoint.class); + + /* + * Description of the data collection endpoint. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The immutable ID of this data collection endpoint resource. This + * property is READ-ONLY. + */ + @JsonProperty(value = "immutableId") + private String immutableId; + + /* + * The endpoint used by agents to access their configuration. + */ + @JsonProperty(value = "configurationAccess") + private DataCollectionEndpointConfigurationAccess configurationAccess; + + /* + * The endpoint used by clients to ingest logs. + */ + @JsonProperty(value = "logsIngestion") + private DataCollectionEndpointLogsIngestion logsIngestion; + + /* + * Network access control rules for the endpoints. + */ + @JsonProperty(value = "networkAcls") + private DataCollectionEndpointNetworkAcls networkAcls; + + /* + * The resource provisioning state. This property is READ-ONLY. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private KnownDataCollectionEndpointProvisioningState provisioningState; + + /** + * Get the description property: Description of the data collection endpoint. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the data collection endpoint. + * + * @param description the description value to set. + * @return the DataCollectionEndpoint object itself. + */ + public DataCollectionEndpoint withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the immutableId property: The immutable ID of this data collection endpoint resource. This property is + * READ-ONLY. + * + * @return the immutableId value. + */ + public String immutableId() { + return this.immutableId; + } + + /** + * Set the immutableId property: The immutable ID of this data collection endpoint resource. This property is + * READ-ONLY. + * + * @param immutableId the immutableId value to set. + * @return the DataCollectionEndpoint object itself. + */ + public DataCollectionEndpoint withImmutableId(String immutableId) { + this.immutableId = immutableId; + return this; + } + + /** + * Get the configurationAccess property: The endpoint used by agents to access their configuration. + * + * @return the configurationAccess value. + */ + public DataCollectionEndpointConfigurationAccess configurationAccess() { + return this.configurationAccess; + } + + /** + * Set the configurationAccess property: The endpoint used by agents to access their configuration. + * + * @param configurationAccess the configurationAccess value to set. + * @return the DataCollectionEndpoint object itself. + */ + public DataCollectionEndpoint withConfigurationAccess( + DataCollectionEndpointConfigurationAccess configurationAccess) { + this.configurationAccess = configurationAccess; + return this; + } + + /** + * Get the logsIngestion property: The endpoint used by clients to ingest logs. + * + * @return the logsIngestion value. + */ + public DataCollectionEndpointLogsIngestion logsIngestion() { + return this.logsIngestion; + } + + /** + * Set the logsIngestion property: The endpoint used by clients to ingest logs. + * + * @param logsIngestion the logsIngestion value to set. + * @return the DataCollectionEndpoint object itself. + */ + public DataCollectionEndpoint withLogsIngestion(DataCollectionEndpointLogsIngestion logsIngestion) { + this.logsIngestion = logsIngestion; + return this; + } + + /** + * Get the networkAcls property: Network access control rules for the endpoints. + * + * @return the networkAcls value. + */ + public DataCollectionEndpointNetworkAcls networkAcls() { + return this.networkAcls; + } + + /** + * Set the networkAcls property: Network access control rules for the endpoints. + * + * @param networkAcls the networkAcls value to set. + * @return the DataCollectionEndpoint object itself. + */ + public DataCollectionEndpoint withNetworkAcls(DataCollectionEndpointNetworkAcls networkAcls) { + this.networkAcls = networkAcls; + return this; + } + + /** + * Get the provisioningState property: The resource provisioning state. This property is READ-ONLY. + * + * @return the provisioningState value. + */ + public KnownDataCollectionEndpointProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configurationAccess() != null) { + configurationAccess().validate(); + } + if (logsIngestion() != null) { + logsIngestion().validate(); + } + if (networkAcls() != null) { + networkAcls().validate(); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java new file mode 100644 index 000000000000..b0d52a912b1d --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointConfigurationAccess.java @@ -0,0 +1,25 @@ +// 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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The endpoint used by agents to access their configuration. */ +@Immutable +public final class DataCollectionEndpointConfigurationAccess extends ConfigurationAccessEndpointSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointConfigurationAccess.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java new file mode 100644 index 000000000000..bdd6e2ebc8f7 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointLogsIngestion.java @@ -0,0 +1,25 @@ +// 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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The endpoint used by clients to ingest logs. */ +@Immutable +public final class DataCollectionEndpointLogsIngestion extends LogsIngestionEndpointSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointLogsIngestion.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java new file mode 100644 index 000000000000..f21821ab1ff3 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointNetworkAcls.java @@ -0,0 +1,33 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; + +/** Network access control rules for the endpoints. */ +@Fluent +public final class DataCollectionEndpointNetworkAcls extends NetworkRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointNetworkAcls.class); + + /** {@inheritDoc} */ + @Override + public DataCollectionEndpointNetworkAcls withPublicNetworkAccess( + KnownPublicNetworkAccessOptions publicNetworkAccess) { + super.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceListResult.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceListResult.java new file mode 100644 index 000000000000..4ca831d79c43 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceListResult.java @@ -0,0 +1,86 @@ +// 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.resourcemanager.monitor.fluent.models.DataCollectionEndpointResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of resources. */ +@Fluent +public final class DataCollectionEndpointResourceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointResourceListResult.class); + + /* + * A list of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of resources. + * + * @param value the value value to set. + * @return the DataCollectionEndpointResourceListResult object itself. + */ + public DataCollectionEndpointResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the DataCollectionEndpointResourceListResult object itself. + */ + public DataCollectionEndpointResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model DataCollectionEndpointResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceProperties.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceProperties.java new file mode 100644 index 000000000000..55973242b1ab --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionEndpointResourceProperties.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Resource properties. */ +@Fluent +public final class DataCollectionEndpointResourceProperties extends DataCollectionEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionEndpointResourceProperties.class); + + /** {@inheritDoc} */ + @Override + public DataCollectionEndpointResourceProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionEndpointResourceProperties withImmutableId(String immutableId) { + super.withImmutableId(immutableId); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionEndpointResourceProperties withConfigurationAccess( + DataCollectionEndpointConfigurationAccess configurationAccess) { + super.withConfigurationAccess(configurationAccess); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionEndpointResourceProperties withLogsIngestion( + DataCollectionEndpointLogsIngestion logsIngestion) { + super.withLogsIngestion(logsIngestion); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionEndpointResourceProperties withNetworkAcls(DataCollectionEndpointNetworkAcls networkAcls) { + super.withNetworkAcls(networkAcls); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java new file mode 100644 index 000000000000..24275d0ec743 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRule.java @@ -0,0 +1,173 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Definition of what monitoring data to collect and where that data should be sent. */ +@Fluent +public class DataCollectionRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRule.class); + + /* + * Description of the data collection rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The immutable ID of this data collection rule. This property is + * READ-ONLY. + */ + @JsonProperty(value = "immutableId", access = JsonProperty.Access.WRITE_ONLY) + private String immutableId; + + /* + * The specification of data sources. + * This property is optional and can be omitted if the rule is meant to be + * used via direct calls to the provisioned endpoint. + */ + @JsonProperty(value = "dataSources") + private DataCollectionRuleDataSources dataSources; + + /* + * The specification of destinations. + */ + @JsonProperty(value = "destinations") + private DataCollectionRuleDestinations destinations; + + /* + * The specification of data flows. + */ + @JsonProperty(value = "dataFlows") + private List dataFlows; + + /* + * The resource provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private KnownDataCollectionRuleProvisioningState provisioningState; + + /** + * Get the description property: Description of the data collection rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the data collection rule. + * + * @param description the description value to set. + * @return the DataCollectionRule object itself. + */ + public DataCollectionRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the immutableId property: The immutable ID of this data collection rule. This property is READ-ONLY. + * + * @return the immutableId value. + */ + public String immutableId() { + return this.immutableId; + } + + /** + * Get the dataSources property: The specification of data sources. This property is optional and can be omitted if + * the rule is meant to be used via direct calls to the provisioned endpoint. + * + * @return the dataSources value. + */ + public DataCollectionRuleDataSources dataSources() { + return this.dataSources; + } + + /** + * Set the dataSources property: The specification of data sources. This property is optional and can be omitted if + * the rule is meant to be used via direct calls to the provisioned endpoint. + * + * @param dataSources the dataSources value to set. + * @return the DataCollectionRule object itself. + */ + public DataCollectionRule withDataSources(DataCollectionRuleDataSources dataSources) { + this.dataSources = dataSources; + return this; + } + + /** + * Get the destinations property: The specification of destinations. + * + * @return the destinations value. + */ + public DataCollectionRuleDestinations destinations() { + return this.destinations; + } + + /** + * Set the destinations property: The specification of destinations. + * + * @param destinations the destinations value to set. + * @return the DataCollectionRule object itself. + */ + public DataCollectionRule withDestinations(DataCollectionRuleDestinations destinations) { + this.destinations = destinations; + return this; + } + + /** + * Get the dataFlows property: The specification of data flows. + * + * @return the dataFlows value. + */ + public List dataFlows() { + return this.dataFlows; + } + + /** + * Set the dataFlows property: The specification of data flows. + * + * @param dataFlows the dataFlows value to set. + * @return the DataCollectionRule object itself. + */ + public DataCollectionRule withDataFlows(List dataFlows) { + this.dataFlows = dataFlows; + return this; + } + + /** + * Get the provisioningState property: The resource provisioning state. + * + * @return the provisioningState value. + */ + public KnownDataCollectionRuleProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataSources() != null) { + dataSources().validate(); + } + if (destinations() != null) { + destinations().validate(); + } + if (dataFlows() != null) { + dataFlows().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociation.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociation.java new file mode 100644 index 000000000000..1de7c91d0f4c --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociation.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Definition of association of a data collection rule with a monitored Azure resource. */ +@Fluent +public class DataCollectionRuleAssociation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleAssociation.class); + + /* + * Description of the association. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The resource ID of the data collection rule that is to be associated. + */ + @JsonProperty(value = "dataCollectionRuleId") + private String dataCollectionRuleId; + + /* + * The resource ID of the data collection endpoint that is to be + * associated. + */ + @JsonProperty(value = "dataCollectionEndpointId") + private String dataCollectionEndpointId; + + /* + * The resource provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private KnownDataCollectionRuleAssociationProvisioningState provisioningState; + + /** + * Get the description property: Description of the association. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the association. + * + * @param description the description value to set. + * @return the DataCollectionRuleAssociation object itself. + */ + public DataCollectionRuleAssociation withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the dataCollectionRuleId property: The resource ID of the data collection rule that is to be associated. + * + * @return the dataCollectionRuleId value. + */ + public String dataCollectionRuleId() { + return this.dataCollectionRuleId; + } + + /** + * Set the dataCollectionRuleId property: The resource ID of the data collection rule that is to be associated. + * + * @param dataCollectionRuleId the dataCollectionRuleId value to set. + * @return the DataCollectionRuleAssociation object itself. + */ + public DataCollectionRuleAssociation withDataCollectionRuleId(String dataCollectionRuleId) { + this.dataCollectionRuleId = dataCollectionRuleId; + return this; + } + + /** + * Get the dataCollectionEndpointId property: The resource ID of the data collection endpoint that is to be + * associated. + * + * @return the dataCollectionEndpointId value. + */ + public String dataCollectionEndpointId() { + return this.dataCollectionEndpointId; + } + + /** + * Set the dataCollectionEndpointId property: The resource ID of the data collection endpoint that is to be + * associated. + * + * @param dataCollectionEndpointId the dataCollectionEndpointId value to set. + * @return the DataCollectionRuleAssociation object itself. + */ + public DataCollectionRuleAssociation withDataCollectionEndpointId(String dataCollectionEndpointId) { + this.dataCollectionEndpointId = dataCollectionEndpointId; + return this; + } + + /** + * Get the provisioningState property: The resource provisioning state. + * + * @return the provisioningState value. + */ + public KnownDataCollectionRuleAssociationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceListResult.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceListResult.java new file mode 100644 index 000000000000..4938510fa311 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceListResult.java @@ -0,0 +1,90 @@ +// 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.resourcemanager.monitor.fluent.models.DataCollectionRuleAssociationProxyOnlyResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of resources. */ +@Fluent +public final class DataCollectionRuleAssociationProxyOnlyResourceListResult { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(DataCollectionRuleAssociationProxyOnlyResourceListResult.class); + + /* + * A list of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of resources. + * + * @param value the value value to set. + * @return the DataCollectionRuleAssociationProxyOnlyResourceListResult object itself. + */ + public DataCollectionRuleAssociationProxyOnlyResourceListResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the DataCollectionRuleAssociationProxyOnlyResourceListResult object itself. + */ + public DataCollectionRuleAssociationProxyOnlyResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model" + + " DataCollectionRuleAssociationProxyOnlyResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java new file mode 100644 index 000000000000..d7d9f58c9548 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleAssociationProxyOnlyResourceProperties.java @@ -0,0 +1,50 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; + +/** Resource properties. */ +@Fluent +public final class DataCollectionRuleAssociationProxyOnlyResourceProperties extends DataCollectionRuleAssociation { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(DataCollectionRuleAssociationProxyOnlyResourceProperties.class); + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleAssociationProxyOnlyResourceProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleAssociationProxyOnlyResourceProperties withDataCollectionRuleId( + String dataCollectionRuleId) { + super.withDataCollectionRuleId(dataCollectionRuleId); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleAssociationProxyOnlyResourceProperties withDataCollectionEndpointId( + String dataCollectionEndpointId) { + super.withDataCollectionEndpointId(dataCollectionEndpointId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.java new file mode 100644 index 000000000000..ee0a612e4139 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDataSources.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** + * The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via + * direct calls to the provisioned endpoint. + */ +@Fluent +public final class DataCollectionRuleDataSources extends DataSourcesSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleDataSources.class); + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleDataSources withPerformanceCounters(List performanceCounters) { + super.withPerformanceCounters(performanceCounters); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleDataSources withWindowsEventLogs(List windowsEventLogs) { + super.withWindowsEventLogs(windowsEventLogs); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleDataSources withSyslog(List syslog) { + super.withSyslog(syslog); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleDataSources withExtensions(List extensions) { + super.withExtensions(extensions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java new file mode 100644 index 000000000000..1fd2830c7bf7 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleDestinations.java @@ -0,0 +1,41 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The specification of destinations. */ +@Fluent +public final class DataCollectionRuleDestinations extends DestinationsSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleDestinations.class); + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleDestinations withLogAnalytics(List logAnalytics) { + super.withLogAnalytics(logAnalytics); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleDestinations withAzureMonitorMetrics( + DestinationsSpecAzureMonitorMetrics azureMonitorMetrics) { + super.withAzureMonitorMetrics(azureMonitorMetrics); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceListResult.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceListResult.java new file mode 100644 index 000000000000..9bf874261f75 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceListResult.java @@ -0,0 +1,86 @@ +// 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.resourcemanager.monitor.fluent.models.DataCollectionRuleResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of resources. */ +@Fluent +public final class DataCollectionRuleResourceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleResourceListResult.class); + + /* + * A list of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of resources. + * + * @param value the value value to set. + * @return the DataCollectionRuleResourceListResult object itself. + */ + public DataCollectionRuleResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the DataCollectionRuleResourceListResult object itself. + */ + public DataCollectionRuleResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model DataCollectionRuleResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceProperties.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceProperties.java new file mode 100644 index 000000000000..7666fda3b6a7 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataCollectionRuleResourceProperties.java @@ -0,0 +1,54 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** Resource properties. */ +@Fluent +public final class DataCollectionRuleResourceProperties extends DataCollectionRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataCollectionRuleResourceProperties.class); + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleResourceProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleResourceProperties withDataSources(DataCollectionRuleDataSources dataSources) { + super.withDataSources(dataSources); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleResourceProperties withDestinations(DataCollectionRuleDestinations destinations) { + super.withDestinations(destinations); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataCollectionRuleResourceProperties withDataFlows(List dataFlows) { + super.withDataFlows(dataFlows); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java new file mode 100644 index 000000000000..050d18e7205a --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataFlow.java @@ -0,0 +1,77 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Definition of which streams are sent to which destinations. */ +@Fluent +public final class DataFlow { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataFlow.class); + + /* + * List of streams for this data flow. + */ + @JsonProperty(value = "streams") + private List streams; + + /* + * List of destinations for this data flow. + */ + @JsonProperty(value = "destinations") + private List destinations; + + /** + * Get the streams property: List of streams for this data flow. + * + * @return the streams value. + */ + public List streams() { + return this.streams; + } + + /** + * Set the streams property: List of streams for this data flow. + * + * @param streams the streams value to set. + * @return the DataFlow object itself. + */ + public DataFlow withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the destinations property: List of destinations for this data flow. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: List of destinations for this data flow. + * + * @param destinations the destinations value to set. + * @return the DataFlow object itself. + */ + public DataFlow withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java new file mode 100644 index 000000000000..154632db5551 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DataSourcesSpec.java @@ -0,0 +1,141 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specification of data sources that will be collected. */ +@Fluent +public class DataSourcesSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataSourcesSpec.class); + + /* + * The list of performance counter data source configurations. + */ + @JsonProperty(value = "performanceCounters") + private List performanceCounters; + + /* + * The list of Windows Event Log data source configurations. + */ + @JsonProperty(value = "windowsEventLogs") + private List windowsEventLogs; + + /* + * The list of Syslog data source configurations. + */ + @JsonProperty(value = "syslog") + private List syslog; + + /* + * The list of Azure VM extension data source configurations. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /** + * Get the performanceCounters property: The list of performance counter data source configurations. + * + * @return the performanceCounters value. + */ + public List performanceCounters() { + return this.performanceCounters; + } + + /** + * Set the performanceCounters property: The list of performance counter data source configurations. + * + * @param performanceCounters the performanceCounters value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withPerformanceCounters(List performanceCounters) { + this.performanceCounters = performanceCounters; + return this; + } + + /** + * Get the windowsEventLogs property: The list of Windows Event Log data source configurations. + * + * @return the windowsEventLogs value. + */ + public List windowsEventLogs() { + return this.windowsEventLogs; + } + + /** + * Set the windowsEventLogs property: The list of Windows Event Log data source configurations. + * + * @param windowsEventLogs the windowsEventLogs value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withWindowsEventLogs(List windowsEventLogs) { + this.windowsEventLogs = windowsEventLogs; + return this; + } + + /** + * Get the syslog property: The list of Syslog data source configurations. + * + * @return the syslog value. + */ + public List syslog() { + return this.syslog; + } + + /** + * Set the syslog property: The list of Syslog data source configurations. + * + * @param syslog the syslog value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withSyslog(List syslog) { + this.syslog = syslog; + return this; + } + + /** + * Get the extensions property: The list of Azure VM extension data source configurations. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: The list of Azure VM extension data source configurations. + * + * @param extensions the extensions value to set. + * @return the DataSourcesSpec object itself. + */ + public DataSourcesSpec withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (performanceCounters() != null) { + performanceCounters().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()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.java new file mode 100644 index 000000000000..19eed45684f3 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpec.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specification of destinations that can be used in data flows. */ +@Fluent +public class DestinationsSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DestinationsSpec.class); + + /* + * List of Log Analytics destinations. + */ + @JsonProperty(value = "logAnalytics") + private List logAnalytics; + + /* + * Azure Monitor Metrics destination. + */ + @JsonProperty(value = "azureMonitorMetrics") + private DestinationsSpecAzureMonitorMetrics azureMonitorMetrics; + + /** + * Get the logAnalytics property: List of Log Analytics destinations. + * + * @return the logAnalytics value. + */ + public List logAnalytics() { + return this.logAnalytics; + } + + /** + * Set the logAnalytics property: List of Log Analytics destinations. + * + * @param logAnalytics the logAnalytics value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withLogAnalytics(List logAnalytics) { + this.logAnalytics = logAnalytics; + return this; + } + + /** + * Get the azureMonitorMetrics property: Azure Monitor Metrics destination. + * + * @return the azureMonitorMetrics value. + */ + public DestinationsSpecAzureMonitorMetrics azureMonitorMetrics() { + return this.azureMonitorMetrics; + } + + /** + * Set the azureMonitorMetrics property: Azure Monitor Metrics destination. + * + * @param azureMonitorMetrics the azureMonitorMetrics value to set. + * @return the DestinationsSpec object itself. + */ + public DestinationsSpec withAzureMonitorMetrics(DestinationsSpecAzureMonitorMetrics azureMonitorMetrics) { + this.azureMonitorMetrics = azureMonitorMetrics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logAnalytics() != null) { + logAnalytics().forEach(e -> e.validate()); + } + if (azureMonitorMetrics() != null) { + azureMonitorMetrics().validate(); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java new file mode 100644 index 000000000000..bb7aac403baf --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DestinationsSpecAzureMonitorMetrics.java @@ -0,0 +1,32 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; + +/** Azure Monitor Metrics destination. */ +@Fluent +public final class DestinationsSpecAzureMonitorMetrics extends AzureMonitorMetricsDestination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DestinationsSpecAzureMonitorMetrics.class); + + /** {@inheritDoc} */ + @Override + public DestinationsSpecAzureMonitorMetrics withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java index f9d54be605b2..db3a6646113a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/DynamicMetricCriteria.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; /** Criterion for dynamic threshold. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "criterionType") @@ -132,6 +133,48 @@ public DynamicMetricCriteria withIgnoreDataBefore(OffsetDateTime ignoreDataBefor return this; } + /** {@inheritDoc} */ + @Override + public DynamicMetricCriteria withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public DynamicMetricCriteria withMetricName(String metricName) { + super.withMetricName(metricName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DynamicMetricCriteria withMetricNamespace(String metricNamespace) { + super.withMetricNamespace(metricNamespace); + return this; + } + + /** {@inheritDoc} */ + @Override + public DynamicMetricCriteria withTimeAggregation(AggregationTypeEnum timeAggregation) { + super.withTimeAggregation(timeAggregation); + return this; + } + + /** {@inheritDoc} */ + @Override + public DynamicMetricCriteria withDimensions(List dimensions) { + super.withDimensions(dimensions); + return this; + } + + /** {@inheritDoc} */ + @Override + public DynamicMetricCriteria withSkipMetricValidation(Boolean skipMetricValidation) { + super.withSkipMetricValidation(skipMetricValidation); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailReceiver.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailReceiver.java index 832666acc14b..c691b77fdaf0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailReceiver.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/EmailReceiver.java @@ -30,8 +30,8 @@ public final class EmailReceiver { /* * Indicates whether to use common alert schema. */ - @JsonProperty(value = "useCommonAlertSchema", required = true) - private boolean useCommonAlertSchema; + @JsonProperty(value = "useCommonAlertSchema") + private Boolean useCommonAlertSchema; /* * The receiver status of the e-mail. @@ -86,7 +86,7 @@ public EmailReceiver withEmailAddress(String emailAddress) { * * @return the useCommonAlertSchema value. */ - public boolean useCommonAlertSchema() { + public Boolean useCommonAlertSchema() { return this.useCommonAlertSchema; } @@ -96,7 +96,7 @@ public boolean useCommonAlertSchema() { * @param useCommonAlertSchema the useCommonAlertSchema value to set. * @return the EmailReceiver object itself. */ - public EmailReceiver withUseCommonAlertSchema(boolean useCommonAlertSchema) { + public EmailReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { this.useCommonAlertSchema = useCommonAlertSchema; return this; } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ErrorResponseCommon.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ErrorResponseCommon.java new file mode 100644 index 000000000000..e75ad7b28924 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ErrorResponseCommon.java @@ -0,0 +1,44 @@ +// 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.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The resource management error response. */ +@Immutable +public final class ErrorResponseCommon extends ManagementError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorResponseCommon.class); + + /* + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Get the details property: The error details. + * + * @return the details value. + */ + public List getDetails() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (getDetails() != null) { + getDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java new file mode 100644 index 000000000000..caee0d87cc40 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ExtensionDataSource.java @@ -0,0 +1,172 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Definition of which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. + * Collected from either Windows and Linux machines, depending on which extension is defined. + */ +@Fluent +public final class ExtensionDataSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionDataSource.class); + + /* + * 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. + */ + @JsonProperty(value = "streams") + private List streams; + + /* + * The name of the VM extension. + */ + @JsonProperty(value = "extensionName", required = true) + private String extensionName; + + /* + * The extension settings. The format is specific for particular extension. + */ + @JsonProperty(value = "extensionSettings") + private Object extensionSettings; + + /* + * The list of data sources this extension needs data from. + */ + @JsonProperty(value = "inputDataSources") + private List inputDataSources; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) + * within the data collection rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * 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 ExtensionDataSource object itself. + */ + public ExtensionDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the extensionName property: The name of the VM extension. + * + * @return the extensionName value. + */ + public String extensionName() { + return this.extensionName; + } + + /** + * Set the extensionName property: The name of the VM extension. + * + * @param extensionName the extensionName value to set. + * @return the ExtensionDataSource object itself. + */ + public ExtensionDataSource withExtensionName(String extensionName) { + this.extensionName = extensionName; + return this; + } + + /** + * Get the extensionSettings property: The extension settings. The format is specific for particular extension. + * + * @return the extensionSettings value. + */ + public Object extensionSettings() { + return this.extensionSettings; + } + + /** + * Set the extensionSettings property: The extension settings. The format is specific for particular extension. + * + * @param extensionSettings the extensionSettings value to set. + * @return the ExtensionDataSource object itself. + */ + public ExtensionDataSource withExtensionSettings(Object extensionSettings) { + this.extensionSettings = extensionSettings; + return this; + } + + /** + * Get the inputDataSources property: The list of data sources this extension needs data from. + * + * @return the inputDataSources value. + */ + public List inputDataSources() { + return this.inputDataSources; + } + + /** + * Set the inputDataSources property: The list of data sources this extension needs data from. + * + * @param inputDataSources the inputDataSources value to set. + * @return the ExtensionDataSource object itself. + */ + public ExtensionDataSource withInputDataSources(List inputDataSources) { + this.inputDataSources = inputDataSources; + 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 ExtensionDataSource object itself. + */ + public ExtensionDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extensionName in model ExtensionDataSource")); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java new file mode 100644 index 000000000000..0e11d941b265 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointProvisioningState.java @@ -0,0 +1,44 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownDataCollectionEndpointProvisioningState. */ +public final class KnownDataCollectionEndpointProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for KnownDataCollectionEndpointProvisioningState. */ + public static final KnownDataCollectionEndpointProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for KnownDataCollectionEndpointProvisioningState. */ + public static final KnownDataCollectionEndpointProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for KnownDataCollectionEndpointProvisioningState. */ + public static final KnownDataCollectionEndpointProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for KnownDataCollectionEndpointProvisioningState. */ + public static final KnownDataCollectionEndpointProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for KnownDataCollectionEndpointProvisioningState. */ + public static final KnownDataCollectionEndpointProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a KnownDataCollectionEndpointProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownDataCollectionEndpointProvisioningState. + */ + @JsonCreator + public static KnownDataCollectionEndpointProvisioningState fromString(String name) { + return fromString(name, KnownDataCollectionEndpointProvisioningState.class); + } + + /** @return known KnownDataCollectionEndpointProvisioningState values. */ + public static Collection values() { + return values(KnownDataCollectionEndpointProvisioningState.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointResourceKind.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointResourceKind.java new file mode 100644 index 000000000000..ed7fc419c182 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionEndpointResourceKind.java @@ -0,0 +1,35 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownDataCollectionEndpointResourceKind. */ +public final class KnownDataCollectionEndpointResourceKind + extends ExpandableStringEnum { + /** Static value Linux for KnownDataCollectionEndpointResourceKind. */ + public static final KnownDataCollectionEndpointResourceKind LINUX = fromString("Linux"); + + /** Static value Windows for KnownDataCollectionEndpointResourceKind. */ + public static final KnownDataCollectionEndpointResourceKind WINDOWS = fromString("Windows"); + + /** + * Creates or finds a KnownDataCollectionEndpointResourceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownDataCollectionEndpointResourceKind. + */ + @JsonCreator + public static KnownDataCollectionEndpointResourceKind fromString(String name) { + return fromString(name, KnownDataCollectionEndpointResourceKind.class); + } + + /** @return known KnownDataCollectionEndpointResourceKind values. */ + public static Collection values() { + return values(KnownDataCollectionEndpointResourceKind.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java new file mode 100644 index 000000000000..d1469e7f611a --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleAssociationProvisioningState.java @@ -0,0 +1,44 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownDataCollectionRuleAssociationProvisioningState. */ +public final class KnownDataCollectionRuleAssociationProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for KnownDataCollectionRuleAssociationProvisioningState. */ + public static final KnownDataCollectionRuleAssociationProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for KnownDataCollectionRuleAssociationProvisioningState. */ + public static final KnownDataCollectionRuleAssociationProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for KnownDataCollectionRuleAssociationProvisioningState. */ + public static final KnownDataCollectionRuleAssociationProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for KnownDataCollectionRuleAssociationProvisioningState. */ + public static final KnownDataCollectionRuleAssociationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for KnownDataCollectionRuleAssociationProvisioningState. */ + public static final KnownDataCollectionRuleAssociationProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a KnownDataCollectionRuleAssociationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownDataCollectionRuleAssociationProvisioningState. + */ + @JsonCreator + public static KnownDataCollectionRuleAssociationProvisioningState fromString(String name) { + return fromString(name, KnownDataCollectionRuleAssociationProvisioningState.class); + } + + /** @return known KnownDataCollectionRuleAssociationProvisioningState values. */ + public static Collection values() { + return values(KnownDataCollectionRuleAssociationProvisioningState.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java new file mode 100644 index 000000000000..21be2d6ee3d6 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleProvisioningState.java @@ -0,0 +1,44 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownDataCollectionRuleProvisioningState. */ +public final class KnownDataCollectionRuleProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for KnownDataCollectionRuleProvisioningState. */ + public static final KnownDataCollectionRuleProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for KnownDataCollectionRuleProvisioningState. */ + public static final KnownDataCollectionRuleProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for KnownDataCollectionRuleProvisioningState. */ + public static final KnownDataCollectionRuleProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for KnownDataCollectionRuleProvisioningState. */ + public static final KnownDataCollectionRuleProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for KnownDataCollectionRuleProvisioningState. */ + public static final KnownDataCollectionRuleProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a KnownDataCollectionRuleProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownDataCollectionRuleProvisioningState. + */ + @JsonCreator + public static KnownDataCollectionRuleProvisioningState fromString(String name) { + return fromString(name, KnownDataCollectionRuleProvisioningState.class); + } + + /** @return known KnownDataCollectionRuleProvisioningState values. */ + public static Collection values() { + return values(KnownDataCollectionRuleProvisioningState.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleResourceKind.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleResourceKind.java new file mode 100644 index 000000000000..6705536553d7 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataCollectionRuleResourceKind.java @@ -0,0 +1,35 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownDataCollectionRuleResourceKind. */ +public final class KnownDataCollectionRuleResourceKind + extends ExpandableStringEnum { + /** Static value Linux for KnownDataCollectionRuleResourceKind. */ + public static final KnownDataCollectionRuleResourceKind LINUX = fromString("Linux"); + + /** Static value Windows for KnownDataCollectionRuleResourceKind. */ + public static final KnownDataCollectionRuleResourceKind WINDOWS = fromString("Windows"); + + /** + * Creates or finds a KnownDataCollectionRuleResourceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownDataCollectionRuleResourceKind. + */ + @JsonCreator + public static KnownDataCollectionRuleResourceKind fromString(String name) { + return fromString(name, KnownDataCollectionRuleResourceKind.class); + } + + /** @return known KnownDataCollectionRuleResourceKind values. */ + public static Collection values() { + return values(KnownDataCollectionRuleResourceKind.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataFlowStreams.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataFlowStreams.java new file mode 100644 index 000000000000..7fa554d102b0 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownDataFlowStreams.java @@ -0,0 +1,43 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownDataFlowStreams. */ +public final class KnownDataFlowStreams extends ExpandableStringEnum { + /** Static value Microsoft-Event for KnownDataFlowStreams. */ + public static final KnownDataFlowStreams MICROSOFT_EVENT = fromString("Microsoft-Event"); + + /** Static value Microsoft-InsightsMetrics for KnownDataFlowStreams. */ + public static final KnownDataFlowStreams MICROSOFT_INSIGHTS_METRICS = fromString("Microsoft-InsightsMetrics"); + + /** Static value Microsoft-Perf for KnownDataFlowStreams. */ + public static final KnownDataFlowStreams MICROSOFT_PERF = fromString("Microsoft-Perf"); + + /** Static value Microsoft-Syslog for KnownDataFlowStreams. */ + public static final KnownDataFlowStreams MICROSOFT_SYSLOG = fromString("Microsoft-Syslog"); + + /** Static value Microsoft-WindowsEvent for KnownDataFlowStreams. */ + public static final KnownDataFlowStreams MICROSOFT_WINDOWS_EVENT = fromString("Microsoft-WindowsEvent"); + + /** + * Creates or finds a KnownDataFlowStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownDataFlowStreams. + */ + @JsonCreator + public static KnownDataFlowStreams fromString(String name) { + return fromString(name, KnownDataFlowStreams.class); + } + + /** @return known KnownDataFlowStreams values. */ + public static Collection values() { + return values(KnownDataFlowStreams.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownExtensionDataSourceStreams.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownExtensionDataSourceStreams.java new file mode 100644 index 000000000000..e87b1058021c --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownExtensionDataSourceStreams.java @@ -0,0 +1,44 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownExtensionDataSourceStreams. */ +public final class KnownExtensionDataSourceStreams extends ExpandableStringEnum { + /** Static value Microsoft-Event for KnownExtensionDataSourceStreams. */ + public static final KnownExtensionDataSourceStreams MICROSOFT_EVENT = fromString("Microsoft-Event"); + + /** Static value Microsoft-InsightsMetrics for KnownExtensionDataSourceStreams. */ + public static final KnownExtensionDataSourceStreams MICROSOFT_INSIGHTS_METRICS = + fromString("Microsoft-InsightsMetrics"); + + /** Static value Microsoft-Perf for KnownExtensionDataSourceStreams. */ + public static final KnownExtensionDataSourceStreams MICROSOFT_PERF = fromString("Microsoft-Perf"); + + /** Static value Microsoft-Syslog for KnownExtensionDataSourceStreams. */ + public static final KnownExtensionDataSourceStreams MICROSOFT_SYSLOG = fromString("Microsoft-Syslog"); + + /** Static value Microsoft-WindowsEvent for KnownExtensionDataSourceStreams. */ + public static final KnownExtensionDataSourceStreams MICROSOFT_WINDOWS_EVENT = fromString("Microsoft-WindowsEvent"); + + /** + * Creates or finds a KnownExtensionDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownExtensionDataSourceStreams. + */ + @JsonCreator + public static KnownExtensionDataSourceStreams fromString(String name) { + return fromString(name, KnownExtensionDataSourceStreams.class); + } + + /** @return known KnownExtensionDataSourceStreams values. */ + public static Collection values() { + return values(KnownExtensionDataSourceStreams.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPerfCounterDataSourceStreams.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPerfCounterDataSourceStreams.java new file mode 100644 index 000000000000..4b6037156d63 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPerfCounterDataSourceStreams.java @@ -0,0 +1,35 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownPerfCounterDataSourceStreams. */ +public final class KnownPerfCounterDataSourceStreams extends ExpandableStringEnum { + /** Static value Microsoft-Perf for KnownPerfCounterDataSourceStreams. */ + public static final KnownPerfCounterDataSourceStreams MICROSOFT_PERF = fromString("Microsoft-Perf"); + + /** Static value Microsoft-InsightsMetrics for KnownPerfCounterDataSourceStreams. */ + public static final KnownPerfCounterDataSourceStreams MICROSOFT_INSIGHTS_METRICS = + fromString("Microsoft-InsightsMetrics"); + + /** + * Creates or finds a KnownPerfCounterDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownPerfCounterDataSourceStreams. + */ + @JsonCreator + public static KnownPerfCounterDataSourceStreams fromString(String name) { + return fromString(name, KnownPerfCounterDataSourceStreams.class); + } + + /** @return known KnownPerfCounterDataSourceStreams values. */ + public static Collection values() { + return values(KnownPerfCounterDataSourceStreams.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java new file mode 100644 index 000000000000..40f19718e471 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownPublicNetworkAccessOptions.java @@ -0,0 +1,34 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownPublicNetworkAccessOptions. */ +public final class KnownPublicNetworkAccessOptions extends ExpandableStringEnum { + /** Static value Enabled for KnownPublicNetworkAccessOptions. */ + public static final KnownPublicNetworkAccessOptions ENABLED = fromString("Enabled"); + + /** Static value Disabled for KnownPublicNetworkAccessOptions. */ + public static final KnownPublicNetworkAccessOptions DISABLED = fromString("Disabled"); + + /** + * Creates or finds a KnownPublicNetworkAccessOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownPublicNetworkAccessOptions. + */ + @JsonCreator + public static KnownPublicNetworkAccessOptions fromString(String name) { + return fromString(name, KnownPublicNetworkAccessOptions.class); + } + + /** @return known KnownPublicNetworkAccessOptions values. */ + public static Collection values() { + return values(KnownPublicNetworkAccessOptions.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.java new file mode 100644 index 000000000000..a5dbb3617a1f --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceFacilityNames.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownSyslogDataSourceFacilityNames. */ +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. */ + public static final KnownSyslogDataSourceFacilityNames CRON = fromString("cron"); + + /** Static value daemon for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames DAEMON = fromString("daemon"); + + /** Static value kern for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames KERN = fromString("kern"); + + /** Static value lpr for KnownSyslogDataSourceFacilityNames. */ + 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 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"); + + /** Static value local0 for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames LOCAL0 = fromString("local0"); + + /** Static value local1 for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames LOCAL1 = fromString("local1"); + + /** Static value local2 for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames LOCAL2 = fromString("local2"); + + /** Static value local3 for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames LOCAL3 = fromString("local3"); + + /** Static value local4 for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames LOCAL4 = fromString("local4"); + + /** Static value local5 for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames LOCAL5 = fromString("local5"); + + /** Static value local6 for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames LOCAL6 = fromString("local6"); + + /** Static value local7 for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames LOCAL7 = fromString("local7"); + + /** Static value * for KnownSyslogDataSourceFacilityNames. */ + public static final KnownSyslogDataSourceFacilityNames ASTERISK = fromString("*"); + + /** + * Creates or finds a KnownSyslogDataSourceFacilityNames from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownSyslogDataSourceFacilityNames. + */ + @JsonCreator + public static KnownSyslogDataSourceFacilityNames fromString(String name) { + return fromString(name, KnownSyslogDataSourceFacilityNames.class); + } + + /** @return known KnownSyslogDataSourceFacilityNames values. */ + public static Collection values() { + return values(KnownSyslogDataSourceFacilityNames.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceLogLevels.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceLogLevels.java new file mode 100644 index 000000000000..3bd3950850fa --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceLogLevels.java @@ -0,0 +1,55 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownSyslogDataSourceLogLevels. */ +public final class KnownSyslogDataSourceLogLevels extends ExpandableStringEnum { + /** Static value Debug for KnownSyslogDataSourceLogLevels. */ + public static final KnownSyslogDataSourceLogLevels DEBUG = fromString("Debug"); + + /** Static value Info for KnownSyslogDataSourceLogLevels. */ + public static final KnownSyslogDataSourceLogLevels INFO = fromString("Info"); + + /** Static value Notice for KnownSyslogDataSourceLogLevels. */ + public static final KnownSyslogDataSourceLogLevels NOTICE = fromString("Notice"); + + /** Static value Warning for KnownSyslogDataSourceLogLevels. */ + public static final KnownSyslogDataSourceLogLevels WARNING = fromString("Warning"); + + /** Static value Error for KnownSyslogDataSourceLogLevels. */ + public static final KnownSyslogDataSourceLogLevels ERROR = fromString("Error"); + + /** Static value Critical for KnownSyslogDataSourceLogLevels. */ + public static final KnownSyslogDataSourceLogLevels CRITICAL = fromString("Critical"); + + /** Static value Alert for KnownSyslogDataSourceLogLevels. */ + public static final KnownSyslogDataSourceLogLevels ALERT = fromString("Alert"); + + /** Static value Emergency for KnownSyslogDataSourceLogLevels. */ + public static final KnownSyslogDataSourceLogLevels EMERGENCY = fromString("Emergency"); + + /** Static value * for KnownSyslogDataSourceLogLevels. */ + public static final KnownSyslogDataSourceLogLevels ASTERISK = fromString("*"); + + /** + * Creates or finds a KnownSyslogDataSourceLogLevels from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownSyslogDataSourceLogLevels. + */ + @JsonCreator + public static KnownSyslogDataSourceLogLevels fromString(String name) { + return fromString(name, KnownSyslogDataSourceLogLevels.class); + } + + /** @return known KnownSyslogDataSourceLogLevels values. */ + public static Collection values() { + return values(KnownSyslogDataSourceLogLevels.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceStreams.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceStreams.java new file mode 100644 index 000000000000..8b71ec284aaa --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownSyslogDataSourceStreams.java @@ -0,0 +1,31 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownSyslogDataSourceStreams. */ +public final class KnownSyslogDataSourceStreams extends ExpandableStringEnum { + /** Static value Microsoft-Syslog for KnownSyslogDataSourceStreams. */ + public static final KnownSyslogDataSourceStreams MICROSOFT_SYSLOG = fromString("Microsoft-Syslog"); + + /** + * Creates or finds a KnownSyslogDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownSyslogDataSourceStreams. + */ + @JsonCreator + public static KnownSyslogDataSourceStreams fromString(String name) { + return fromString(name, KnownSyslogDataSourceStreams.class); + } + + /** @return known KnownSyslogDataSourceStreams values. */ + public static Collection values() { + return values(KnownSyslogDataSourceStreams.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownWindowsEventLogDataSourceStreams.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownWindowsEventLogDataSourceStreams.java new file mode 100644 index 000000000000..6b6bd146a411 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/KnownWindowsEventLogDataSourceStreams.java @@ -0,0 +1,36 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KnownWindowsEventLogDataSourceStreams. */ +public final class KnownWindowsEventLogDataSourceStreams + extends ExpandableStringEnum { + /** Static value Microsoft-WindowsEvent for KnownWindowsEventLogDataSourceStreams. */ + public static final KnownWindowsEventLogDataSourceStreams MICROSOFT_WINDOWS_EVENT = + fromString("Microsoft-WindowsEvent"); + + /** Static value Microsoft-Event for KnownWindowsEventLogDataSourceStreams. */ + public static final KnownWindowsEventLogDataSourceStreams MICROSOFT_EVENT = fromString("Microsoft-Event"); + + /** + * Creates or finds a KnownWindowsEventLogDataSourceStreams from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnownWindowsEventLogDataSourceStreams. + */ + @JsonCreator + public static KnownWindowsEventLogDataSourceStreams fromString(String name) { + return fromString(name, KnownWindowsEventLogDataSourceStreams.class); + } + + /** @return known KnownWindowsEventLogDataSourceStreams values. */ + public static Collection values() { + return values(KnownWindowsEventLogDataSourceStreams.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java index 0cf062049d51..e25a8b84457e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LocationThresholdRuleCondition.java @@ -77,6 +77,13 @@ public LocationThresholdRuleCondition withFailedLocationCount(int failedLocation return this; } + /** {@inheritDoc} */ + @Override + public LocationThresholdRuleCondition withDataSource(RuleDataSource dataSource) { + super.withDataSource(dataSource); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogAnalyticsDestination.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogAnalyticsDestination.java new file mode 100644 index 000000000000..39efe95bb74a --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogAnalyticsDestination.java @@ -0,0 +1,95 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log Analytics destination. */ +@Fluent +public final class LogAnalyticsDestination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsDestination.class); + + /* + * The resource ID of the Log Analytics workspace. + */ + @JsonProperty(value = "workspaceResourceId") + private String workspaceResourceId; + + /* + * The Customer ID of the Log Analytics workspace. + */ + @JsonProperty(value = "workspaceId", access = JsonProperty.Access.WRITE_ONLY) + private String workspaceId; + + /* + * A friendly name for the destination. + * This name should be unique across all destinations (regardless of type) + * within the data collection rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the workspaceResourceId property: The resource ID of the Log Analytics workspace. + * + * @return the workspaceResourceId value. + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set the workspaceResourceId property: The resource ID of the Log Analytics workspace. + * + * @param workspaceResourceId the workspaceResourceId value to set. + * @return the LogAnalyticsDestination object itself. + */ + public LogAnalyticsDestination withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + + /** + * Get the workspaceId property: The Customer ID of the Log Analytics workspace. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * 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 LogAnalyticsDestination object itself. + */ + public LogAnalyticsDestination withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogicAppReceiver.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogicAppReceiver.java index 5e251e8ceb7f..1734e6c40f91 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogicAppReceiver.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogicAppReceiver.java @@ -36,8 +36,8 @@ public final class LogicAppReceiver { /* * Indicates whether to use common alert schema. */ - @JsonProperty(value = "useCommonAlertSchema", required = true) - private boolean useCommonAlertSchema; + @JsonProperty(value = "useCommonAlertSchema") + private Boolean useCommonAlertSchema; /** * Get the name property: The name of the logic app receiver. Names must be unique across all receivers within an @@ -106,7 +106,7 @@ public LogicAppReceiver withCallbackUrl(String callbackUrl) { * * @return the useCommonAlertSchema value. */ - public boolean useCommonAlertSchema() { + public Boolean useCommonAlertSchema() { return this.useCommonAlertSchema; } @@ -116,7 +116,7 @@ public boolean useCommonAlertSchema() { * @param useCommonAlertSchema the useCommonAlertSchema value to set. * @return the LogicAppReceiver object itself. */ - public LogicAppReceiver withUseCommonAlertSchema(boolean useCommonAlertSchema) { + public LogicAppReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { this.useCommonAlertSchema = useCommonAlertSchema; return this; } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogsIngestionEndpointSpec.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogsIngestionEndpointSpec.java new file mode 100644 index 000000000000..d074164aa259 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/LogsIngestionEndpointSpec.java @@ -0,0 +1,39 @@ +// 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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Definition of the endpoint used for ingesting logs. */ +@Immutable +public class LogsIngestionEndpointSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogsIngestionEndpointSpec.class); + + /* + * The endpoint. This property is READ-ONLY. + */ + @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * Get the endpoint property: The endpoint. This property is READ-ONLY. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java index 709d2dc424d7..959f0cd00336 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ManagementEventRuleCondition.java @@ -53,6 +53,13 @@ public ManagementEventRuleCondition withAggregation(ManagementEventAggregationCo return this; } + /** {@inheritDoc} */ + @Override + public ManagementEventRuleCondition withDataSource(RuleDataSource dataSource) { + super.withDataSource(dataSource); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metric.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metric.java index ace61561a6b0..5a20a03aefd2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metric.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Metric.java @@ -31,8 +31,7 @@ public interface Metric extends HasInnerModel { LocalizableString name(); /** - * Get the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'CountPerSecond', - * 'BytesPerSecond', 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified'. + * Get the unit of the metric. * * @return the unit value */ diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java index 76e4af20f4df..14e5d3d03ba8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertAction.java @@ -22,7 +22,8 @@ public final class MetricAlertAction { private String actionGroupId; /* - * The properties of a webhook object. + * This field allows specifying custom properties, which would be appended + * to the alert payload sent as input to the webhook. */ @JsonProperty(value = "webHookProperties") private Map webhookProperties; @@ -48,7 +49,8 @@ public MetricAlertAction withActionGroupId(String actionGroupId) { } /** - * Get the webhookProperties property: The properties of a webhook object. + * Get the webhookProperties property: This field allows specifying custom properties, which would be appended to + * the alert payload sent as input to the webhook. * * @return the webhookProperties value. */ @@ -57,7 +59,8 @@ public Map webhookProperties() { } /** - * Set the webhookProperties property: The properties of a webhook object. + * Set the webhookProperties property: This field allows specifying custom properties, which would be appended to + * the alert payload sent as input to the webhook. * * @param webhookProperties the webhookProperties value to set. * @return the MetricAlertAction object itself. diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java index 769695eccf8a..59f2e0b192ea 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricAlertResourcePatch.java @@ -105,6 +105,12 @@ public class MetricAlertResourcePatch { @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastUpdatedTime; + /* + * the value indicating whether this alert rule is migrated. + */ + @JsonProperty(value = "properties.isMigrated", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isMigrated; + /** * Get the tags property: Resource tags. * @@ -366,6 +372,15 @@ public OffsetDateTime lastUpdatedTime() { return this.lastUpdatedTime; } + /** + * Get the isMigrated property: the value indicating whether this alert rule is migrated. + * + * @return the isMigrated value. + */ + public Boolean isMigrated() { + return this.isMigrated; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricClass.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricClass.java new file mode 100644 index 000000000000..4a8cf45ca345 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricClass.java @@ -0,0 +1,43 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricClass. */ +public final class MetricClass extends ExpandableStringEnum { + /** Static value Availability for MetricClass. */ + public static final MetricClass AVAILABILITY = fromString("Availability"); + + /** Static value Transactions for MetricClass. */ + public static final MetricClass TRANSACTIONS = fromString("Transactions"); + + /** Static value Errors for MetricClass. */ + public static final MetricClass ERRORS = fromString("Errors"); + + /** Static value Latency for MetricClass. */ + public static final MetricClass LATENCY = fromString("Latency"); + + /** Static value Saturation for MetricClass. */ + public static final MetricClass SATURATION = fromString("Saturation"); + + /** + * Creates or finds a MetricClass from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricClass. + */ + @JsonCreator + public static MetricClass fromString(String name) { + return fromString(name, MetricClass.class); + } + + /** @return known MetricClass values. */ + public static Collection values() { + return values(MetricClass.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java index be10cd21230c..d6f30f2d66dc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricCriteria.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Criterion to filter metrics. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "criterionType") @@ -70,6 +71,48 @@ public MetricCriteria withThreshold(double threshold) { return this; } + /** {@inheritDoc} */ + @Override + public MetricCriteria withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MetricCriteria withMetricName(String metricName) { + super.withMetricName(metricName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MetricCriteria withMetricNamespace(String metricNamespace) { + super.withMetricNamespace(metricNamespace); + return this; + } + + /** {@inheritDoc} */ + @Override + public MetricCriteria withTimeAggregation(AggregationTypeEnum timeAggregation) { + super.withTimeAggregation(timeAggregation); + return this; + } + + /** {@inheritDoc} */ + @Override + public MetricCriteria withDimensions(List dimensions) { + super.withDimensions(dimensions); + return this; + } + + /** {@inheritDoc} */ + @Override + public MetricCriteria withSkipMetricValidation(Boolean skipMetricValidation) { + super.withSkipMetricValidation(skipMetricValidation); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricStatisticType.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricStatisticType.java index 4c9237cc6512..44142a2cfc1c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricStatisticType.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricStatisticType.java @@ -19,7 +19,10 @@ public enum MetricStatisticType { MAX("Max"), /** Enum value Sum. */ - SUM("Sum"); + SUM("Sum"), + + /** Enum value Count. */ + COUNT("Count"); /** The actual serialized value for a MetricStatisticType instance. */ private final String value; diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTrigger.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTrigger.java index c81d6b4679bf..2e82c2fc7952 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTrigger.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MetricTrigger.java @@ -34,6 +34,12 @@ public final class MetricTrigger { @JsonProperty(value = "metricResourceUri", required = true) private String metricResourceUri; + /* + * the location of the resource the rule monitors. + */ + @JsonProperty(value = "metricResourceLocation") + private String metricResourceLocation; + /* * the granularity of metrics the rule monitors. Must be one of the * predefined values returned from metric definitions for the metric. Must @@ -84,6 +90,12 @@ public final class MetricTrigger { @JsonProperty(value = "dimensions") private List dimensions; + /* + * a value indicating whether metric should divide per instance. + */ + @JsonProperty(value = "dividePerInstance") + private Boolean dividePerInstance; + /** * Get the metricName property: the name of the metric that defines what the rule monitors. * @@ -144,6 +156,26 @@ public MetricTrigger withMetricResourceUri(String metricResourceUri) { return this; } + /** + * Get the metricResourceLocation property: the location of the resource the rule monitors. + * + * @return the metricResourceLocation value. + */ + public String metricResourceLocation() { + return this.metricResourceLocation; + } + + /** + * Set the metricResourceLocation property: the location of the resource the rule monitors. + * + * @param metricResourceLocation the metricResourceLocation value to set. + * @return the MetricTrigger object itself. + */ + public MetricTrigger withMetricResourceLocation(String metricResourceLocation) { + this.metricResourceLocation = metricResourceLocation; + return this; + } + /** * Get the timeGrain property: the granularity of metrics the rule monitors. Must be one of the predefined values * returned from metric definitions for the metric. Must be between 12 hours and 1 minute. @@ -296,6 +328,26 @@ public MetricTrigger withDimensions(List dimensions) { return this; } + /** + * Get the dividePerInstance property: a value indicating whether metric should divide per instance. + * + * @return the dividePerInstance value. + */ + public Boolean dividePerInstance() { + return this.dividePerInstance; + } + + /** + * Set the dividePerInstance property: a value indicating whether metric should divide per instance. + * + * @param dividePerInstance the dividePerInstance value to set. + * @return the MetricTrigger object itself. + */ + public MetricTrigger withDividePerInstance(Boolean dividePerInstance) { + this.dividePerInstance = dividePerInstance; + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java index c6e0f49a7aa8..c9e25d006a59 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/MultiMetricCriteria.java @@ -54,7 +54,7 @@ public class MultiMetricCriteria { * the criteria time aggregation types. */ @JsonProperty(value = "timeAggregation", required = true) - private AggregationType timeAggregation; + private AggregationTypeEnum timeAggregation; /* * List of dimension conditions. @@ -139,7 +139,7 @@ public MultiMetricCriteria withMetricNamespace(String metricNamespace) { * * @return the timeAggregation value. */ - public AggregationType timeAggregation() { + public AggregationTypeEnum timeAggregation() { return this.timeAggregation; } @@ -149,7 +149,7 @@ public AggregationType timeAggregation() { * @param timeAggregation the timeAggregation value to set. * @return the MultiMetricCriteria object itself. */ - public MultiMetricCriteria withTimeAggregation(AggregationType timeAggregation) { + public MultiMetricCriteria withTimeAggregation(AggregationTypeEnum timeAggregation) { this.timeAggregation = timeAggregation; return this; } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NamespaceClassification.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NamespaceClassification.java new file mode 100644 index 000000000000..565aa30271ed --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NamespaceClassification.java @@ -0,0 +1,37 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NamespaceClassification. */ +public final class NamespaceClassification extends ExpandableStringEnum { + /** Static value Platform for NamespaceClassification. */ + public static final NamespaceClassification PLATFORM = fromString("Platform"); + + /** Static value Custom for NamespaceClassification. */ + public static final NamespaceClassification CUSTOM = fromString("Custom"); + + /** Static value Qos for NamespaceClassification. */ + public static final NamespaceClassification QOS = fromString("Qos"); + + /** + * Creates or finds a NamespaceClassification from its string representation. + * + * @param name a name to look for. + * @return the corresponding NamespaceClassification. + */ + @JsonCreator + public static NamespaceClassification fromString(String name) { + return fromString(name, NamespaceClassification.class); + } + + /** @return known NamespaceClassification values. */ + public static Collection values() { + return values(NamespaceClassification.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NetworkRuleSet.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NetworkRuleSet.java new file mode 100644 index 000000000000..6f153af85005 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/NetworkRuleSet.java @@ -0,0 +1,53 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Definition of the network rules. */ +@Fluent +public class NetworkRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSet.class); + + /* + * The configuration to set whether network access from public internet to + * the endpoints are allowed. + */ + @JsonProperty(value = "publicNetworkAccess") + private KnownPublicNetworkAccessOptions publicNetworkAccess; + + /** + * Get the publicNetworkAccess property: The configuration to set whether network access from public internet to the + * endpoints are allowed. + * + * @return the publicNetworkAccess value. + */ + public KnownPublicNetworkAccessOptions publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: The configuration to set whether network access from public internet to the + * endpoints are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withPublicNetworkAccess(KnownPublicNetworkAccessOptions publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.java new file mode 100644 index 000000000000..1d8e43aa7a7b --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PerfCounterDataSource.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Definition of which 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 PerfCounterDataSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PerfCounterDataSource.class); + + /* + * 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. + */ + @JsonProperty(value = "streams") + private List streams; + + /* + * The number of seconds between consecutive counter measurements + * (samples). + */ + @JsonProperty(value = "samplingFrequencyInSeconds") + private Integer samplingFrequencyInSeconds; + + /* + * A list of specifier names of the performance counters you want to + * collect. + * Use a wildcard (*) to collect a counter for all instances. + * To get a list of performance counters on Windows, run the command + * 'typeperf'. + */ + @JsonProperty(value = "counterSpecifiers") + 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. + */ + @JsonProperty(value = "name") + private String name; + + /** + * 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 PerfCounterDataSource object itself. + */ + public PerfCounterDataSource 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 PerfCounterDataSource object itself. + */ + public PerfCounterDataSource 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. + * Use a wildcard (*) to collect a counter for all instances. To get a list of performance counters on Windows, run + * the command 'typeperf'. + * + * @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. + * Use a wildcard (*) to collect a counter for all instances. To get a list of performance counters on Windows, run + * the command 'typeperf'. + * + * @param counterSpecifiers the counterSpecifiers value to set. + * @return the PerfCounterDataSource object itself. + */ + public PerfCounterDataSource 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 PerfCounterDataSource object itself. + */ + public PerfCounterDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointConnectionListResult.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..93c6c1f210b4 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointConnectionListResult.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private endpoint connections. */ +@Immutable +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointProperty.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointProperty.java new file mode 100644 index 000000000000..c455648b2357 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateEndpointProperty.java @@ -0,0 +1,50 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint which the connection belongs to. */ +@Fluent +public final class PrivateEndpointProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointProperty.class); + + /* + * Resource id of the private endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource id of the private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource id of the private endpoint. + * + * @param id the id value to set. + * @return the PrivateEndpointProperty object itself. + */ + public PrivateEndpointProperty withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkResourceListResult.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..efefcac98563 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkResourceListResult.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Immutable +public final class PrivateLinkResourceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkScopesResource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkScopesResource.java new file mode 100644 index 000000000000..7cbd03dc6ad1 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkScopesResource.java @@ -0,0 +1,39 @@ +// 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.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** An azure resource object. */ +@Fluent +public class PrivateLinkScopesResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkScopesResource.class); + + /** {@inheritDoc} */ + @Override + public PrivateLinkScopesResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkScopesResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkServiceConnectionStateProperty.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkServiceConnectionStateProperty.java new file mode 100644 index 000000000000..93467c78a2d4 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/PrivateLinkServiceConnectionStateProperty.java @@ -0,0 +1,103 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** State of the private endpoint connection. */ +@Fluent +public final class PrivateLinkServiceConnectionStateProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionStateProperty.class); + + /* + * The private link service connection status. + */ + @JsonProperty(value = "status", required = true) + private String status; + + /* + * The private link service connection description. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * The actions required for private link service connection. + */ + @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) + private String actionsRequired; + + /** + * Get the status property: The private link service connection status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The private link service connection status. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionStateProperty object itself. + */ + public PrivateLinkServiceConnectionStateProperty withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the description property: The private link service connection description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The private link service connection description. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionStateProperty object itself. + */ + public PrivateLinkServiceConnectionStateProperty withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: The actions required for private link service connection. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model PrivateLinkServiceConnectionStateProperty")); + } + if (description() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property description in model PrivateLinkServiceConnectionStateProperty")); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceAutoGenerated2.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceAutoGenerated2.java new file mode 100644 index 000000000000..3a6b96b02481 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceAutoGenerated2.java @@ -0,0 +1,39 @@ +// 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.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** An azure resource object. */ +@Fluent +public class ResourceAutoGenerated2 extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceAutoGenerated2.class); + + /** {@inheritDoc} */ + @Override + public ResourceAutoGenerated2 withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceAutoGenerated2 withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.java new file mode 100644 index 000000000000..755b4791c8c5 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ResourceForUpdate.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Definition of ARM tracked top level resource properties for update operation. */ +@Fluent +public final class ResourceForUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceForUpdate.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ResourceForUpdate object itself. + */ + public ResourceForUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleDataSource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleDataSource.java index 2aaa3caf7cda..88a0dce3b65a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleDataSource.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleDataSource.java @@ -40,6 +40,25 @@ public class RuleDataSource { @JsonProperty(value = "resourceUri") private String resourceUri; + /* + * the legacy resource identifier of the resource the rule monitors. + * **NOTE**: this property cannot be updated for an existing rule. + */ + @JsonProperty(value = "legacyResourceId") + private String legacyResourceId; + + /* + * the location of the resource. + */ + @JsonProperty(value = "resourceLocation") + private String resourceLocation; + + /* + * the namespace of the metric. + */ + @JsonProperty(value = "metricNamespace") + private String metricNamespace; + /** * Get the resourceUri property: the resource identifier of the resource the rule monitors. **NOTE**: this property * cannot be updated for an existing rule. @@ -62,6 +81,68 @@ public RuleDataSource withResourceUri(String resourceUri) { return this; } + /** + * Get the legacyResourceId property: the legacy resource identifier of the resource the rule monitors. **NOTE**: + * this property cannot be updated for an existing rule. + * + * @return the legacyResourceId value. + */ + public String legacyResourceId() { + return this.legacyResourceId; + } + + /** + * Set the legacyResourceId property: the legacy resource identifier of the resource the rule monitors. **NOTE**: + * this property cannot be updated for an existing rule. + * + * @param legacyResourceId the legacyResourceId value to set. + * @return the RuleDataSource object itself. + */ + public RuleDataSource withLegacyResourceId(String legacyResourceId) { + this.legacyResourceId = legacyResourceId; + return this; + } + + /** + * Get the resourceLocation property: the location of the resource. + * + * @return the resourceLocation value. + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * Set the resourceLocation property: the location of the resource. + * + * @param resourceLocation the resourceLocation value to set. + * @return the RuleDataSource object itself. + */ + public RuleDataSource withResourceLocation(String resourceLocation) { + this.resourceLocation = resourceLocation; + return this; + } + + /** + * Get the metricNamespace property: the namespace of the metric. + * + * @return the metricNamespace value. + */ + public String metricNamespace() { + return this.metricNamespace; + } + + /** + * Set the metricNamespace property: the namespace of the metric. + * + * @param metricNamespace the metricNamespace value to set. + * @return the RuleDataSource object itself. + */ + public RuleDataSource withMetricNamespace(String metricNamespace) { + this.metricNamespace = metricNamespace; + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java index 664f1007f94c..85c2c6bbeeb0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleManagementEventDataSource.java @@ -262,6 +262,34 @@ public RuleManagementEventDataSource withClaims(RuleManagementEventClaimsDataSou return this; } + /** {@inheritDoc} */ + @Override + public RuleManagementEventDataSource withResourceUri(String resourceUri) { + super.withResourceUri(resourceUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuleManagementEventDataSource withLegacyResourceId(String legacyResourceId) { + super.withLegacyResourceId(legacyResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuleManagementEventDataSource withResourceLocation(String resourceLocation) { + super.withResourceLocation(resourceLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuleManagementEventDataSource withMetricNamespace(String metricNamespace) { + super.withMetricNamespace(metricNamespace); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java index 88824b0a6000..cc0d63994692 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/RuleMetricDataSource.java @@ -46,6 +46,34 @@ public RuleMetricDataSource withMetricName(String metricName) { return this; } + /** {@inheritDoc} */ + @Override + public RuleMetricDataSource withResourceUri(String resourceUri) { + super.withResourceUri(resourceUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuleMetricDataSource withLegacyResourceId(String legacyResourceId) { + super.withLegacyResourceId(legacyResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuleMetricDataSource withResourceLocation(String resourceLocation) { + super.withResourceLocation(resourceLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuleMetricDataSource withMetricNamespace(String metricNamespace) { + super.withMetricNamespace(metricNamespace); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleType.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleType.java index a27eed0805f4..a311dc688912 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleType.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScaleType.java @@ -16,7 +16,10 @@ public enum ScaleType { PERCENT_CHANGE_COUNT("PercentChangeCount"), /** Enum value ExactCount. */ - EXACT_COUNT("ExactCount"); + EXACT_COUNT("ExactCount"), + + /** Enum value ServiceAllowedNextValue. */ + SERVICE_ALLOWED_NEXT_VALUE("ServiceAllowedNextValue"); /** The actual serialized value for a ScaleType instance. */ private final String value; diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScopedResourceListResult.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScopedResourceListResult.java new file mode 100644 index 000000000000..aff95a2a90d5 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ScopedResourceListResult.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.monitor.fluent.models.ScopedResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of scoped resources in a private link scope. */ +@Immutable +public final class ScopedResourceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScopedResourceListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Sensitivity.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Sensitivity.java deleted file mode 100644 index 45f0ce6d6dcd..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Sensitivity.java +++ /dev/null @@ -1,50 +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.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for Sensitivity. */ -public enum Sensitivity { - /** Enum value Low. */ - LOW("Low"), - - /** Enum value Medium. */ - MEDIUM("Medium"), - - /** Enum value High. */ - HIGH("High"); - - /** The actual serialized value for a Sensitivity instance. */ - private final String value; - - Sensitivity(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a Sensitivity instance. - * - * @param value the serialized value to parse. - * @return the parsed Sensitivity object, or null if unable to parse. - */ - @JsonCreator - public static Sensitivity fromString(String value) { - Sensitivity[] items = Sensitivity.values(); - for (Sensitivity item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java new file mode 100644 index 000000000000..5d32e10a4769 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/SyslogDataSource.java @@ -0,0 +1,139 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Definition of which syslog data will be collected and how it will be collected. Only collected from Linux machines. + */ +@Fluent +public final class SyslogDataSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyslogDataSource.class); + + /* + * 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. + */ + @JsonProperty(value = "streams") + private List streams; + + /* + * The list of facility names. + */ + @JsonProperty(value = "facilityNames") + private List facilityNames; + + /* + * The log levels to collect. + */ + @JsonProperty(value = "logLevels") + private List logLevels; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) + * within the data collection rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * 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 SyslogDataSource object itself. + */ + public SyslogDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the facilityNames property: The list of facility names. + * + * @return the facilityNames value. + */ + public List facilityNames() { + return this.facilityNames; + } + + /** + * Set the facilityNames property: The list of facility names. + * + * @param facilityNames the facilityNames value to set. + * @return the SyslogDataSource object itself. + */ + public SyslogDataSource withFacilityNames(List facilityNames) { + this.facilityNames = facilityNames; + return this; + } + + /** + * Get the logLevels property: The log levels to collect. + * + * @return the logLevels value. + */ + public List logLevels() { + return this.logLevels; + } + + /** + * Set the logLevels property: The log levels to collect. + * + * @param logLevels the logLevels value to set. + * @return the SyslogDataSource object itself. + */ + public SyslogDataSource withLogLevels(List logLevels) { + this.logLevels = logLevels; + 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 SyslogDataSource object itself. + */ + public SyslogDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TagsResource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TagsResource.java new file mode 100644 index 000000000000..e2566e24e7c6 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TagsResource.java @@ -0,0 +1,54 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope + * instance. + */ +@Fluent +public final class TagsResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsResource.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TagsResource object itself. + */ + public TagsResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java index dbd7c896284f..2da784a06200 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/ThresholdRuleCondition.java @@ -133,6 +133,13 @@ public ThresholdRuleCondition withTimeAggregation(TimeAggregationOperator timeAg return this; } + /** {@inheritDoc} */ + @Override + public ThresholdRuleCondition withDataSource(RuleDataSource dataSource) { + super.withDataSource(dataSource); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesBaseline.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesBaseline.java index 13a2c7455b5c..27295753c6fc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesBaseline.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesBaseline.java @@ -43,8 +43,8 @@ public final class TimeSeriesBaseline { /* * The baseline metadata values. */ - @JsonProperty(value = "metadata") - private List metadata; + @JsonProperty(value = "metadataValues") + private List metadataValues; /** * Get the aggregation property: The aggregation type of the metric. @@ -127,22 +127,22 @@ public TimeSeriesBaseline withData(List data) { } /** - * Get the metadata property: The baseline metadata values. + * Get the metadataValues property: The baseline metadata values. * - * @return the metadata value. + * @return the metadataValues value. */ - public List metadata() { - return this.metadata; + public List metadataValues() { + return this.metadataValues; } /** - * Set the metadata property: The baseline metadata values. + * Set the metadataValues property: The baseline metadata values. * - * @param metadata the metadata value to set. + * @param metadataValues the metadataValues value to set. * @return the TimeSeriesBaseline object itself. */ - public TimeSeriesBaseline withMetadata(List metadata) { - this.metadata = metadata; + public TimeSeriesBaseline withMetadataValues(List metadataValues) { + this.metadataValues = metadataValues; return this; } @@ -172,8 +172,8 @@ public void validate() { } else { data().forEach(e -> e.validate()); } - if (metadata() != null) { - metadata().forEach(e -> e.validate()); + if (metadataValues() != null) { + metadataValues().forEach(e -> e.validate()); } } } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesInformation.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesInformation.java deleted file mode 100644 index 352d8c6797a6..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/TimeSeriesInformation.java +++ /dev/null @@ -1,115 +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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The time series info needed for calculating the baseline. */ -@Fluent -public final class TimeSeriesInformation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeSeriesInformation.class); - - /* - * the list of sensitivities for calculating the baseline. - */ - @JsonProperty(value = "sensitivities", required = true) - private List sensitivities; - - /* - * The metric values to calculate the baseline. - */ - @JsonProperty(value = "values", required = true) - private List values; - - /* - * the array of timestamps of the baselines. - */ - @JsonProperty(value = "timestamps") - private List timestamps; - - /** - * Get the sensitivities property: the list of sensitivities for calculating the baseline. - * - * @return the sensitivities value. - */ - public List sensitivities() { - return this.sensitivities; - } - - /** - * Set the sensitivities property: the list of sensitivities for calculating the baseline. - * - * @param sensitivities the sensitivities value to set. - * @return the TimeSeriesInformation object itself. - */ - public TimeSeriesInformation withSensitivities(List sensitivities) { - this.sensitivities = sensitivities; - return this; - } - - /** - * Get the values property: The metric values to calculate the baseline. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Set the values property: The metric values to calculate the baseline. - * - * @param values the values value to set. - * @return the TimeSeriesInformation object itself. - */ - public TimeSeriesInformation withValues(List values) { - this.values = values; - return this; - } - - /** - * Get the timestamps property: the array of timestamps of the baselines. - * - * @return the timestamps value. - */ - public List timestamps() { - return this.timestamps; - } - - /** - * Set the timestamps property: the array of timestamps of the baselines. - * - * @param timestamps the timestamps value to set. - * @return the TimeSeriesInformation object itself. - */ - public TimeSeriesInformation withTimestamps(List timestamps) { - this.timestamps = timestamps; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sensitivities() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sensitivities in model TimeSeriesInformation")); - } - if (values() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property values in model TimeSeriesInformation")); - } - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Unit.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Unit.java index b35b8b1af86a..2ee3697c0029 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Unit.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/Unit.java @@ -4,77 +4,64 @@ package com.azure.resourcemanager.monitor.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for Unit. */ -public enum Unit { - /** Enum value Count. */ - COUNT("Count"), +public final class Unit extends ExpandableStringEnum { + /** Static value Count for Unit. */ + public static final Unit COUNT = fromString("Count"); - /** Enum value Bytes. */ - BYTES("Bytes"), + /** Static value Bytes for Unit. */ + public static final Unit BYTES = fromString("Bytes"); - /** Enum value Seconds. */ - SECONDS("Seconds"), + /** Static value Seconds for Unit. */ + public static final Unit SECONDS = fromString("Seconds"); - /** Enum value CountPerSecond. */ - COUNT_PER_SECOND("CountPerSecond"), + /** Static value CountPerSecond for Unit. */ + public static final Unit COUNT_PER_SECOND = fromString("CountPerSecond"); - /** Enum value BytesPerSecond. */ - BYTES_PER_SECOND("BytesPerSecond"), + /** Static value BytesPerSecond for Unit. */ + public static final Unit BYTES_PER_SECOND = fromString("BytesPerSecond"); - /** Enum value Percent. */ - PERCENT("Percent"), + /** Static value Percent for Unit. */ + public static final Unit PERCENT = fromString("Percent"); - /** Enum value MilliSeconds. */ - MILLI_SECONDS("MilliSeconds"), + /** Static value MilliSeconds for Unit. */ + public static final Unit MILLI_SECONDS = fromString("MilliSeconds"); - /** Enum value ByteSeconds. */ - BYTE_SECONDS("ByteSeconds"), + /** Static value ByteSeconds for Unit. */ + public static final Unit BYTE_SECONDS = fromString("ByteSeconds"); - /** Enum value Unspecified. */ - UNSPECIFIED("Unspecified"), + /** Static value Unspecified for Unit. */ + public static final Unit UNSPECIFIED = fromString("Unspecified"); - /** Enum value Cores. */ - CORES("Cores"), + /** Static value Cores for Unit. */ + public static final Unit CORES = fromString("Cores"); - /** Enum value MilliCores. */ - MILLI_CORES("MilliCores"), + /** Static value MilliCores for Unit. */ + public static final Unit MILLI_CORES = fromString("MilliCores"); - /** Enum value NanoCores. */ - NANO_CORES("NanoCores"), + /** Static value NanoCores for Unit. */ + public static final Unit NANO_CORES = fromString("NanoCores"); - /** Enum value BitsPerSecond. */ - BITS_PER_SECOND("BitsPerSecond"); - - /** The actual serialized value for a Unit instance. */ - private final String value; - - Unit(String value) { - this.value = value; - } + /** Static value BitsPerSecond for Unit. */ + public static final Unit BITS_PER_SECOND = fromString("BitsPerSecond"); /** - * Parses a serialized value to a Unit instance. + * Creates or finds a Unit from its string representation. * - * @param value the serialized value to parse. - * @return the parsed Unit object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding Unit. */ @JsonCreator - public static Unit fromString(String value) { - Unit[] items = Unit.values(); - for (Unit item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static Unit fromString(String name) { + return fromString(name, Unit.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known Unit values. */ + public static Collection values() { + return values(Unit.class); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookReceiver.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookReceiver.java index 3aeffcb29452..ee204cbe14dc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookReceiver.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WebhookReceiver.java @@ -30,8 +30,8 @@ public final class WebhookReceiver { /* * Indicates whether to use common alert schema. */ - @JsonProperty(value = "useCommonAlertSchema", required = true) - private boolean useCommonAlertSchema; + @JsonProperty(value = "useCommonAlertSchema") + private Boolean useCommonAlertSchema; /* * Indicates whether or not use AAD authentication. @@ -104,7 +104,7 @@ public WebhookReceiver withServiceUri(String serviceUri) { * * @return the useCommonAlertSchema value. */ - public boolean useCommonAlertSchema() { + public Boolean useCommonAlertSchema() { return this.useCommonAlertSchema; } @@ -114,7 +114,7 @@ public boolean useCommonAlertSchema() { * @param useCommonAlertSchema the useCommonAlertSchema value to set. * @return the WebhookReceiver object itself. */ - public WebhookReceiver withUseCommonAlertSchema(boolean useCommonAlertSchema) { + public WebhookReceiver withUseCommonAlertSchema(Boolean useCommonAlertSchema) { this.useCommonAlertSchema = useCommonAlertSchema; return this; } diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java new file mode 100644 index 000000000000..6e0aa7a225d0 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/models/WindowsEventLogDataSource.java @@ -0,0 +1,114 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Definition of which Windows Event Log events will be collected and how they will be collected. Only collected from + * Windows machines. + */ +@Fluent +public final class WindowsEventLogDataSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WindowsEventLogDataSource.class); + + /* + * 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. + */ + @JsonProperty(value = "streams") + private List streams; + + /* + * A list of Windows Event Log queries in XPATH format. + */ + @JsonProperty(value = "xPathQueries") + private List xPathQueries; + + /* + * A friendly name for the data source. + * This name should be unique across all data sources (regardless of type) + * within the data collection rule. + */ + @JsonProperty(value = "name") + private String name; + + /** + * 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 WindowsEventLogDataSource object itself. + */ + public WindowsEventLogDataSource withStreams(List streams) { + this.streams = streams; + return this; + } + + /** + * Get the xPathQueries property: A list of Windows Event Log queries in XPATH format. + * + * @return the xPathQueries value. + */ + public List xPathQueries() { + return this.xPathQueries; + } + + /** + * Set the xPathQueries property: A list of Windows Event Log queries in XPATH format. + * + * @param xPathQueries the xPathQueries value to set. + * @return the WindowsEventLogDataSource object itself. + */ + public WindowsEventLogDataSource withXPathQueries(List xPathQueries) { + this.xPathQueries = xPathQueries; + 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 WindowsEventLogDataSource object itself. + */ + public WindowsEventLogDataSource withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AlertsTests.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AlertsTests.java index bde54e8b5e9e..63cc35f8c572 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AlertsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/AlertsTests.java @@ -350,7 +350,7 @@ public void canCRUDMultipleResourceMetricAlerts() throws Exception { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername(userName) - .withRootPassword(password) + .withSsh(sshPublicKey()) .create(); VirtualMachine vm2 = @@ -364,7 +364,7 @@ public void canCRUDMultipleResourceMetricAlerts() throws Exception { .withoutPrimaryPublicIPAddress() .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) .withRootUsername(userName) - .withRootPassword(password) + .withSsh(sshPublicKey()) .create(); MetricAlert ma = @@ -435,6 +435,8 @@ public void canCRUDMultipleResourceMetricAlerts() throws Exception { @Test public void canCRUDActivityLogAlerts() throws Exception { + // make sure there exists a VM + try { ActionGroup ag = monitorManager diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java index 9fc980a5b3cd..869ec3255e5c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java @@ -20,7 +20,15 @@ public class MonitorActivityAndMetricsTests extends MonitorManagementTest { @Test public void canListEventsAndMetrics() throws Exception { - OffsetDateTime recordDateTime = OffsetDateTime.parse("2020-12-28T21:44:57.424+08:00").minusDays(40); + // make sure there exists a VM + + OffsetDateTime now = OffsetDateTime.parse("2020-12-28T21:44:57.424+08:00"); + if (!this.isPlaybackMode()) { + now = OffsetDateTime.now(); + System.out.println("record timestamp: " + now); + } + + OffsetDateTime recordDateTime = now.minusDays(40); VirtualMachine vm = computeManager.virtualMachines().list().iterator().next(); // Metric Definition diff --git a/sdk/resourcemanager/azure-resourcemanager/pom.xml b/sdk/resourcemanager/azure-resourcemanager/pom.xml index 7db5653f4a5d..d4cba1d1ceff 100644 --- a/sdk/resourcemanager/azure-resourcemanager/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager/pom.xml @@ -286,6 +286,8 @@ revapi-maven-plugin 0.11.2 + true + diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java index 48f2831bfe9c..9641a18f6247 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java @@ -1329,10 +1329,12 @@ public void generateMissingRegion() { StringBuilder sb = new StringBuilder(); - PagedIterable locations = + List locations = azureResourceManager .getCurrentSubscription() - .listLocations(); // note the region is not complete since it depends on current subscription + .listLocations() + .stream().collect(Collectors.toList()); + // note the region is not complete since it depends on current subscription List locationGroupByGeography = new ArrayList<>(); List geographies = Arrays.asList(