diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyStates.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyStates.java index 91c835ae3b6f..e39fec0068aa 100644 --- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyStates.java +++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyStates.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.policyinsights.v2019_10_01; +import rx.Completable; import rx.Observable; /** @@ -92,6 +93,25 @@ public interface PolicyStates { */ Observable summarizeForResourceAsync(String resourceId); + /** + * Triggers a policy evaluation scan for all the resources under the subscription. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable triggerSubscriptionEvaluationAsync(String subscriptionId); + + /** + * Triggers a policy evaluation scan for all the resources under the resource group. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable triggerResourceGroupEvaluationAsync(String subscriptionId, String resourceGroupName); + /** * Queries policy states for the subscription level policy set definition. * diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/Remediation.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/Remediation.java index 2cb39df9700f..11e7d513d28f 100644 --- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/Remediation.java +++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/Remediation.java @@ -80,7 +80,7 @@ public interface Remediation extends HasInner, Indexable, Upda /** * The entirety of the Remediation definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithManagementGroupId, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMicrosoft.PolicyInsight, DefinitionStages.WithCreate { } /** @@ -90,19 +90,19 @@ interface DefinitionStages { /** * The first stage of a Remediation definition. */ - interface Blank extends WithManagementGroupId { + interface Blank extends WithMicrosoft.PolicyInsight { } /** - * The stage of the remediation definition allowing to specify ManagementGroupId. + * The stage of the remediation definition allowing to specify Microsoft.PolicyInsight. */ - interface WithManagementGroupId { + interface WithMicrosoft.PolicyInsight { /** * Specifies managementGroupId. * @param managementGroupId Management group ID * @return the next definition stage */ - WithCreate withExistingManagementGroupId(String managementGroupId); + WithCreate withExistingMicrosoft.PolicyInsight(String managementGroupId); } /** diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyInsightsClientImpl.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyInsightsClientImpl.java index 074ac33762e2..749b66cd0428 100644 --- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyInsightsClientImpl.java +++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyInsightsClientImpl.java @@ -10,6 +10,8 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStateInner.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStateInner.java index ccb6f3383dcd..6135ff3594ca 100644 --- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStateInner.java +++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStateInner.java @@ -214,6 +214,24 @@ public class PolicyStateInner { @JsonProperty(value = "policyDefinitionGroupNames") private List policyDefinitionGroupNames; + /** + * Evaluated policy definition version. + */ + @JsonProperty(value = "policyDefinitionVersion", access = JsonProperty.Access.WRITE_ONLY) + private String policyDefinitionVersion; + + /** + * Evaluated policy set definition version. + */ + @JsonProperty(value = "policySetDefinitionVersion", access = JsonProperty.Access.WRITE_ONLY) + private String policySetDefinitionVersion; + + /** + * Evaluated policy assignment version. + */ + @JsonProperty(value = "policyAssignmentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String policyAssignmentVersion; + /** * Get unmatched properties from the message are deserialized this collection. * @@ -834,4 +852,31 @@ public PolicyStateInner withPolicyDefinitionGroupNames(List policyDefini return this; } + /** + * Get evaluated policy definition version. + * + * @return the policyDefinitionVersion value + */ + public String policyDefinitionVersion() { + return this.policyDefinitionVersion; + } + + /** + * Get evaluated policy set definition version. + * + * @return the policySetDefinitionVersion value + */ + public String policySetDefinitionVersion() { + return this.policySetDefinitionVersion; + } + + /** + * Get evaluated policy assignment version. + * + * @return the policyAssignmentVersion value + */ + public String policyAssignmentVersion() { + return this.policyAssignmentVersion; + } + } diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStatesImpl.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStatesImpl.java index bf7a59f3ddb8..52e588973c0d 100644 --- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStatesImpl.java +++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStatesImpl.java @@ -11,6 +11,7 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyStates; +import rx.Completable; import rx.functions.Func1; import rx.Observable; import com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyStatesQueryResults; @@ -125,6 +126,18 @@ public SummarizeResults call(SummarizeResultsInner inner) { }); } + @Override + public Completable triggerSubscriptionEvaluationAsync(String subscriptionId) { + PolicyStatesInner client = this.inner(); + return client.triggerSubscriptionEvaluationAsync(subscriptionId).toCompletable(); + } + + @Override + public Completable triggerResourceGroupEvaluationAsync(String subscriptionId, String resourceGroupName) { + PolicyStatesInner client = this.inner(); + return client.triggerResourceGroupEvaluationAsync(subscriptionId, resourceGroupName).toCompletable(); + } + @Override public Observable listQueryResultsForPolicySetDefinitionAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String policySetDefinitionName) { PolicyStatesInner client = this.inner(); diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStatesInner.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStatesInner.java index bc4c4cca0791..bf760533e622 100644 --- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStatesInner.java +++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyStatesInner.java @@ -28,6 +28,8 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -87,6 +89,22 @@ interface PolicyStatesService { @POST("{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize") Observable> summarizeForResource(@Path("policyStatesSummaryResource") String policyStatesSummaryResource, @Path(value = "resourceId", encoded = true) String resourceId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyStates triggerSubscriptionEvaluation" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation") + Observable> triggerSubscriptionEvaluation(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyStates beginTriggerSubscriptionEvaluation" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation") + Observable> beginTriggerSubscriptionEvaluation(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyStates triggerResourceGroupEvaluation" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation") + Observable> triggerResourceGroupEvaluation(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyStates beginTriggerResourceGroupEvaluation" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation") + Observable> beginTriggerResourceGroupEvaluation(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyStates listQueryResultsForPolicySetDefinition" }) @POST("subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults") Observable> listQueryResultsForPolicySetDefinition(@Path("policyStatesResource") PolicyStatesResource policyStatesResource1, @Path("subscriptionId") String subscriptionId, @Path("authorizationNamespace") String authorizationNamespace, @Path("policySetDefinitionName") String policySetDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Header("User-Agent") String userAgent); @@ -1618,6 +1636,280 @@ private ServiceResponse summarizeForResourceDelegate(Resp .build(response); } + /** + * Triggers a policy evaluation scan for all the resources under the subscription. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws QueryFailureException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void triggerSubscriptionEvaluation(String subscriptionId) { + triggerSubscriptionEvaluationWithServiceResponseAsync(subscriptionId).toBlocking().last().body(); + } + + /** + * Triggers a policy evaluation scan for all the resources under the subscription. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture triggerSubscriptionEvaluationAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(triggerSubscriptionEvaluationWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * Triggers a policy evaluation scan for all the resources under the subscription. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable triggerSubscriptionEvaluationAsync(String subscriptionId) { + return triggerSubscriptionEvaluationWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers a policy evaluation scan for all the resources under the subscription. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> triggerSubscriptionEvaluationWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + final String apiVersion = "2019-10-01"; + Observable> observable = service.triggerSubscriptionEvaluation(subscriptionId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Triggers a policy evaluation scan for all the resources under the subscription. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws QueryFailureException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginTriggerSubscriptionEvaluation(String subscriptionId) { + beginTriggerSubscriptionEvaluationWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + } + + /** + * Triggers a policy evaluation scan for all the resources under the subscription. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginTriggerSubscriptionEvaluationAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginTriggerSubscriptionEvaluationWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * Triggers a policy evaluation scan for all the resources under the subscription. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginTriggerSubscriptionEvaluationAsync(String subscriptionId) { + return beginTriggerSubscriptionEvaluationWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers a policy evaluation scan for all the resources under the subscription. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginTriggerSubscriptionEvaluationWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + final String apiVersion = "2019-10-01"; + return service.beginTriggerSubscriptionEvaluation(subscriptionId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginTriggerSubscriptionEvaluationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginTriggerSubscriptionEvaluationDelegate(Response response) throws QueryFailureException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(QueryFailureException.class) + .build(response); + } + + /** + * Triggers a policy evaluation scan for all the resources under the resource group. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws QueryFailureException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void triggerResourceGroupEvaluation(String subscriptionId, String resourceGroupName) { + triggerResourceGroupEvaluationWithServiceResponseAsync(subscriptionId, resourceGroupName).toBlocking().last().body(); + } + + /** + * Triggers a policy evaluation scan for all the resources under the resource group. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture triggerResourceGroupEvaluationAsync(String subscriptionId, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(triggerResourceGroupEvaluationWithServiceResponseAsync(subscriptionId, resourceGroupName), serviceCallback); + } + + /** + * Triggers a policy evaluation scan for all the resources under the resource group. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable triggerResourceGroupEvaluationAsync(String subscriptionId, String resourceGroupName) { + return triggerResourceGroupEvaluationWithServiceResponseAsync(subscriptionId, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers a policy evaluation scan for all the resources under the resource group. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> triggerResourceGroupEvaluationWithServiceResponseAsync(String subscriptionId, String resourceGroupName) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2019-10-01"; + Observable> observable = service.triggerResourceGroupEvaluation(subscriptionId, resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Triggers a policy evaluation scan for all the resources under the resource group. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws QueryFailureException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginTriggerResourceGroupEvaluation(String subscriptionId, String resourceGroupName) { + beginTriggerResourceGroupEvaluationWithServiceResponseAsync(subscriptionId, resourceGroupName).toBlocking().single().body(); + } + + /** + * Triggers a policy evaluation scan for all the resources under the resource group. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginTriggerResourceGroupEvaluationAsync(String subscriptionId, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginTriggerResourceGroupEvaluationWithServiceResponseAsync(subscriptionId, resourceGroupName), serviceCallback); + } + + /** + * Triggers a policy evaluation scan for all the resources under the resource group. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginTriggerResourceGroupEvaluationAsync(String subscriptionId, String resourceGroupName) { + return beginTriggerResourceGroupEvaluationWithServiceResponseAsync(subscriptionId, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers a policy evaluation scan for all the resources under the resource group. + * + * @param subscriptionId Microsoft Azure subscription ID. + * @param resourceGroupName Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginTriggerResourceGroupEvaluationWithServiceResponseAsync(String subscriptionId, String resourceGroupName) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2019-10-01"; + return service.beginTriggerResourceGroupEvaluation(subscriptionId, resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginTriggerResourceGroupEvaluationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginTriggerResourceGroupEvaluationDelegate(Response response) throws QueryFailureException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(QueryFailureException.class) + .build(response); + } + /** * Queries policy states for the subscription level policy set definition. * diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/RemediationImpl.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/RemediationImpl.java index 396ef9972bc6..344735d7ea61 100644 --- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/RemediationImpl.java +++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/RemediationImpl.java @@ -127,7 +127,7 @@ public String type() { } @Override - public RemediationImpl withExistingManagementGroupId(String managementGroupId) { + public RemediationImpl withExistingMicrosoft.PolicyInsight(String managementGroupId) { this.managementGroupId = managementGroupId; return this; }